diff options
author | Chiao Cheng <chiaocheng@google.com> | 2013-09-13 13:50:07 -0700 |
---|---|---|
committer | Chiao Cheng <chiaocheng@google.com> | 2013-09-13 13:50:07 -0700 |
commit | 7dac444afe26abaec15dfbe55a1548f785ad2521 (patch) | |
tree | ed0b42ea289a027d598d480113cc323c173c0d5c | |
parent | 5ab76a4f685e94beb77ab4a613fed49079513f73 (diff) |
Fix NullPointerException.
The existing null check was being overridden by check for
incoming call. Prioritize the null check first.
Bug: 10727364
Change-Id: Id0127a6f3634876126c1f13c810f1d1e54e8d203
-rw-r--r-- | InCallUI/src/com/android/incallui/StatusBarNotifier.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index ad1a67e77..bdbb1253d 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -461,6 +461,14 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, * Returns true if notification should not be shown in the current state. */ private boolean shouldSuppressNotification(InCallState state, Call call) { + + // We can still be in the INCALL state when a call is disconnected (in order to show + // the "Call ended" screen. So check that we have an active connection too. + if (call == null) { + Log.v(this, "suppressing: no call"); + return true; + } + // Suppress the in-call notification if the InCallScreen is the // foreground activity, since it's already obvious that you're on a // call. (The status bar icon is needed only if you navigate *away* @@ -473,13 +481,6 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener, shouldSuppress = true; } - // We can still be in the INCALL state when a call is disconnected (in order to show - // the "Call ended" screen. So check that we have an active connection too. - if (call == null) { - Log.v(this, "suppressing: no call"); - shouldSuppress = true; - } - // If there's an incoming ringing call: always show the // notification, since the in-call notification is what actually // launches the incoming call UI in the first place (see |