From b2d5e7caf51de7805b98295e97c37a91792cbddf Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Mon, 12 Feb 2018 11:07:47 -0800 Subject: Clicking on a missed call in the call log no longer crashes the app. Bug: 72956783 Test: DialtactsActivityIntegrationTest PiperOrigin-RevId: 185404033 Change-Id: I486f7b1a6739bf49c6f19bba82227dd4d9794e1f --- java/com/android/dialer/app/calllog/CallLogAdapter.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'java') diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index 51df70219..baca590b5 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -54,6 +54,7 @@ import android.view.ViewGroup; import com.android.contacts.common.ContactsUtils; import com.android.contacts.common.compat.PhoneNumberUtilsCompat; 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; @@ -381,9 +382,7 @@ 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 CallLogFragmentListener) { - ((CallLogFragmentListener) v.getContext()).updateTabUnreadCounts(); - } else if (v.getContext() instanceof MainActivityPeer.PeerSupplier) { + 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) @@ -391,8 +390,7 @@ public class CallLogAdapter extends GroupingListAdapter .getImpl(CallLogFragmentListener.class) .updateTabUnreadCounts(); } else { - throw Assert.createIllegalStateFailException( - "View parent does not implement CallLogFragmentListener"); + ((DialtactsActivity) v.getContext()).updateTabUnreadCounts(); } } } -- cgit v1.2.3