diff options
author | Christine Chen <christinech@google.com> | 2013-10-14 17:46:58 -0700 |
---|---|---|
committer | Christine Chen <christinech@google.com> | 2013-10-15 10:02:27 -0700 |
commit | ff40f157168bc54fec724350387670876ae382b1 (patch) | |
tree | 5839070acd3997b348489f1ca178e7555b11a51b /src/com/android/incallui/InCallPresenter.java | |
parent | 845b3fb72cd3dc3b4d042767d18dedb983ff4b47 (diff) | |
download | packages_apps_InCallUI-ff40f157168bc54fec724350387670876ae382b1.tar.gz packages_apps_InCallUI-ff40f157168bc54fec724350387670876ae382b1.tar.bz2 packages_apps_InCallUI-ff40f157168bc54fec724350387670876ae382b1.zip |
Clears notification when there is no call.
Bug: 11083320
Change-Id: I05efd985114a78d87098a46b1c4c33ad5bcc5b94
Diffstat (limited to 'src/com/android/incallui/InCallPresenter.java')
-rw-r--r-- | src/com/android/incallui/InCallPresenter.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/incallui/InCallPresenter.java b/src/com/android/incallui/InCallPresenter.java index 2fbbf34b..5830e726 100644 --- a/src/com/android/incallui/InCallPresenter.java +++ b/src/com/android/incallui/InCallPresenter.java @@ -16,6 +16,7 @@ package com.android.incallui; +import com.android.incallui.service.PhoneNumberService; import com.google.android.collect.Sets; import com.google.common.base.Preconditions; @@ -211,6 +212,9 @@ public class InCallPresenter implements CallList.Listener { */ @Override public void onCallListChange(CallList callList) { + if (callList == null) { + return; + } InCallState newState = getPotentialStateFromCallList(callList); newState = startOrFinishUi(newState); @@ -270,8 +274,12 @@ public class InCallPresenter implements CallList.Listener { * Given the call list, return the state in which the in-call screen should be. */ public static InCallState getPotentialStateFromCallList(CallList callList) { + InCallState newState = InCallState.NO_CALLS; + if (callList == null) { + return newState; + } if (callList.getIncomingCall() != null) { newState = InCallState.INCOMING; } else if (callList.getOutgoingCall() != null) { @@ -321,10 +329,15 @@ public class InCallPresenter implements CallList.Listener { /** * Hangs up any active or outgoing calls. */ - public void hangUpOngoingCall() { + public void hangUpOngoingCall(Context context) { // By the time we receive this intent, we could be shut down and call list // could be null. Bail in those cases. if (mCallList == null) { + if (mStatusBarNotifier == null) { + // The In Call UI has crashed but the notification still stayed up. We should not + // come to this stage. + StatusBarNotifier.clearInCallNotification(context); + } return; } |