summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2013-03-16 01:59:29 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2013-03-16 01:59:29 +0000
commitbb131f52daf0792c3f1566df992024d5d7640f25 (patch)
treede73eea594a7d08aa73916e31df3c1775165fa87
parent2e6ce4f737dcdeb748f467836dd12490c0cdfd22 (diff)
parent282add7bc3e80825c73244f527857aefa74093a9 (diff)
Merge "Fix issue #8401553: It's possible to startForeground()..." into jb-mr2-dev
-rw-r--r--services/java/com/android/server/am/ServiceRecord.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ServiceRecord.java b/services/java/com/android/server/am/ServiceRecord.java
index b06c60ae760c..1ac6bdfb850f 100644
--- a/services/java/com/android/server/am/ServiceRecord.java
+++ b/services/java/com/android/server/am/ServiceRecord.java
@@ -368,6 +368,13 @@ class ServiceRecord extends Binder {
return;
}
try {
+ if (foregroundNoti.icon == 0) {
+ // Notifications whose icon is 0 are defined to not show
+ // a notification, silently ignoring it. We don't want to
+ // just ignore it, we want to prevent the service from
+ // being foreground.
+ throw new RuntimeException("icon must be non-zero");
+ }
int[] outId = new int[1];
nm.enqueueNotificationInternal(localPackageName, localPackageName,
appUid, appPid, null, localForegroundId, localForegroundNoti,