From 345b0e1ec3a435e49b36bfc6d415024a5361157f Mon Sep 17 00:00:00 2001 From: yueg Date: Fri, 22 Sep 2017 17:01:43 -0700 Subject: Fix crash on ending call. We moved onUiShowing() call from InCallActivityCommon.onPause to onStop in cl/169615685, which causes the crash since InCallPresenter is cleared up before calling onUiShowing() and mContext is null at that time. This CL fix the crash by also moving the clearup(InCallPresenter.unsetActivity()) from onPause to onStop. It also makes sense because InCallPresenter.onActivityStarted() is called in onStart instead of onPause. Test: manual PiperOrigin-RevId: 169756942 Change-Id: I222009be1b672f8a6dcb8bfdcea2d633c5810575 --- java/com/android/incallui/InCallActivityCommon.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'java/com/android') diff --git a/java/com/android/incallui/InCallActivityCommon.java b/java/com/android/incallui/InCallActivityCommon.java index fec9700ab..9e6271f3e 100644 --- a/java/com/android/incallui/InCallActivityCommon.java +++ b/java/com/android/incallui/InCallActivityCommon.java @@ -317,10 +317,6 @@ public class InCallActivityCommon { if (dialpadFragment != null) { dialpadFragment.onDialerKeyUp(null); } - - if (inCallActivity.isFinishing()) { - InCallPresenter.getInstance().unsetActivity(inCallActivity); - } } public void onStop() { @@ -342,6 +338,9 @@ public class InCallActivityCommon { if (!isRecreating) { InCallPresenter.getInstance().onUiShowing(false); } + if (inCallActivity.isFinishing()) { + InCallPresenter.getInstance().unsetActivity(inCallActivity); + } } public void onDestroy() { -- cgit v1.2.3 From 8db7caad865c38b629c1cb0f3383972cb86f2ed5 Mon Sep 17 00:00:00 2001 From: yueg Date: Fri, 22 Sep 2017 18:15:15 -0700 Subject: Don't show Lightbringer disclosure dialog after 1 day since viewed. We think it's viewed by user if it's showing and user scrolls on call log tab, since action in the same tab that moves the dialog is a strong proof. Test: GoogleCallLogAdapterTest PiperOrigin-RevId: 169763132 Change-Id: Ie520c65627b1e5d364860507321fb268c89e0cf7 --- java/com/android/dialer/app/calllog/CallLogAdapter.java | 5 +++++ java/com/android/dialer/app/calllog/CallLogFragment.java | 3 +++ 2 files changed, 8 insertions(+) (limited to 'java/com/android') diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index 6540b6f95..e79c89c57 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -407,6 +407,11 @@ public class CallLogAdapter extends GroupingListAdapter } }; + @Nullable + public RecyclerView.OnScrollListener getOnScrollListener() { + return null; + } + private void checkMarkCallLogEntry(CallLogListItemViewHolder viewHolder) { announceforAccessibility( mActivity.getCurrentFocus(), diff --git a/java/com/android/dialer/app/calllog/CallLogFragment.java b/java/com/android/dialer/app/calllog/CallLogFragment.java index 441cb4a5c..8ed924d76 100644 --- a/java/com/android/dialer/app/calllog/CallLogFragment.java +++ b/java/com/android/dialer/app/calllog/CallLogFragment.java @@ -352,6 +352,9 @@ public class CallLogFragment extends Fragment new FilteredNumberAsyncQueryHandler(getActivity()), activityType); mRecyclerView.setAdapter(mAdapter); + if (mAdapter.getOnScrollListener() != null) { + mRecyclerView.addOnScrollListener(mAdapter.getOnScrollListener()); + } fetchCalls(); } -- cgit v1.2.3