am bb131f52: Merge "Fix issue #8401553: It\'s possible to startForeground()..." into jb-mr2-dev

* commit 'bb131f52daf0792c3f1566df992024d5d7640f25':
  Fix issue #8401553: It's possible to startForeground()...
This commit is contained in:
Dianne Hackborn
2013-03-17 16:24:03 +00:00
committed by Android Git Automerger

View File

@@ -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,