summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/call
diff options
context:
space:
mode:
authoryueg <yueg@google.com>2017-10-18 14:45:05 -0700
committerEric Erfanian <erfanian@google.com>2017-10-19 08:37:25 -0700
commitc18ad7a8c917c6388668784461456cc779031e0b (patch)
treeaa6c70e1f0c287f013b068e95b10ca400f2a659f /java/com/android/incallui/call
parent6b864300238962f896ab78eaedea3b04814e3bff (diff)
Fix NPE in TelecomAdapter.stopForegroundNotification().
In InCallServiceImpl.tearDown(), we should only clear inCallService after InCallPresenter.tearDown() where we remove all notification. Also remove null assertion in stopForegroundNotification() since other crash should only happens when there is no notification. Test: StatusBarNotifierTest PiperOrigin-RevId: 172657924 Change-Id: I86e720b80f885aa93f12215fda899ee62eeaba5b
Diffstat (limited to 'java/com/android/incallui/call')
-rw-r--r--java/com/android/incallui/call/TelecomAdapter.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/java/com/android/incallui/call/TelecomAdapter.java b/java/com/android/incallui/call/TelecomAdapter.java
index 0c0bbd473..d48ab68c2 100644
--- a/java/com/android/incallui/call/TelecomAdapter.java
+++ b/java/com/android/incallui/call/TelecomAdapter.java
@@ -185,8 +185,12 @@ public class TelecomAdapter implements InCallServiceListener {
* Stop a started foreground notification. This does not stop {@code mInCallService} from running.
*/
public void stopForegroundNotification() {
- Assert.isNotNull(
- mInCallService, "No inCallService available for stopping foreground notification");
- mInCallService.stopForeground(true /*removeNotification*/);
+ if (mInCallService != null) {
+ mInCallService.stopForeground(true /*removeNotification*/);
+ } else {
+ LogUtil.e(
+ "TelecomAdapter.stopForegroundNotification",
+ "no inCallService available for stopping foreground notification");
+ }
}
}