From c08484b1fc4c4001f59ae963ce6082209ac00172 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 15 Dec 2014 10:42:06 -0800 Subject: Use mInCallActivity if mContext is null. It seems that attemptFinishActivity can occasionally be invoked when mContext hasn't been set, via setActivity -> updateActivity -> attemptFinishActivity, if there are NO_CALLS. In this case, fall back on mInCallActivity as the context for clearing the display. Bug: 18728214 Change-Id: I504af612f79e14787741b14b03170805f57c5699 --- InCallUI/src/com/android/incallui/InCallPresenter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index 0004d4618..5ad31b17a 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -258,7 +258,12 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener { private void attemptFinishActivity() { mWaitForRevealAnimationStart = false; - CircularRevealActivity.sendClearDisplayBroadcast(mContext); + + Context context = mContext != null ? mContext : mInCallActivity; + if (context != null) { + CircularRevealActivity.sendClearDisplayBroadcast(context); + } + final boolean doFinish = (mInCallActivity != null && isActivityStarted()); Log.i(this, "Hide in call UI: " + doFinish); if (doFinish) { -- cgit v1.2.3