diff options
author | zachh <zachh@google.com> | 2018-06-08 17:03:55 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-08 17:07:04 -0700 |
commit | e332b103cacab1430bde7130dbfea1eebca30038 (patch) | |
tree | d8114d34c5a4305460897f1587ddc303e80801d2 | |
parent | 72fdb6c67fac0ef31e8422a6ebae8c7cdb3fe025 (diff) |
Removed cast to DialtactsActivity.
DialtactsActivity should be dead code at this point so this code should be unreachable.
Bug: 109931227
Test: none
PiperOrigin-RevId: 199872804
Change-Id: I4f4f66f5c803662de238c42dc746423c8ab1f150
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogAdapter.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index a4479da9e..d3fd36520 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -54,7 +54,6 @@ import android.view.View; import android.view.ViewGroup; import com.android.contacts.common.ContactsUtils; import com.android.contacts.common.preference.ContactsPreferences; -import com.android.dialer.app.DialtactsActivity; import com.android.dialer.app.R; import com.android.dialer.app.calllog.CallLogFragment.CallLogFragmentListener; import com.android.dialer.app.calllog.CallLogGroupBuilder.GroupCreator; @@ -395,16 +394,15 @@ public class CallLogAdapter extends GroupingListAdapter if (viewHolder.callType == CallLog.Calls.MISSED_TYPE) { CallLogAsyncTaskUtil.markCallAsRead(activity, viewHolder.callIds); if (activityType == ACTIVITY_TYPE_DIALTACTS) { - if (v.getContext() instanceof MainActivityPeer.PeerSupplier) { - // This is really bad, but we must do this to prevent a dependency cycle, enforce - // best practices in new code, and avoid refactoring DialtactsActivity. - ((FragmentUtilListener) - ((MainActivityPeer.PeerSupplier) v.getContext()).getPeer()) - .getImpl(CallLogFragmentListener.class) - .updateTabUnreadCounts(); - } else { - ((DialtactsActivity) v.getContext()).updateTabUnreadCounts(); - } + Assert.checkState( + v.getContext() instanceof MainActivityPeer.PeerSupplier, + "%s is not a PeerSupplier", + v.getContext().getClass()); + // This is really bad, but we must do this to prevent a dependency cycle, enforce + // best practices in new code, and avoid refactoring DialtactsActivity. + ((FragmentUtilListener) ((MainActivityPeer.PeerSupplier) v.getContext()).getPeer()) + .getImpl(CallLogFragmentListener.class) + .updateTabUnreadCounts(); } } expandViewHolderActions(viewHolder); |