From 569a45871c71d4fa7e685cb8931fba8b17dd00f0 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 4 Aug 2016 14:00:22 -0700 Subject: [PATCH] Fix issue #30647973: stopForeground() doesn't remove notification Ignore the service that is actually trying to remove its notification. Change-Id: I1293300cf2a4bea7c512df7b2242a18dcc25d1c6 --- services/core/java/com/android/server/am/ActiveServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index a3d2ebbba9c32..1bcff1a7b2e6c 100755 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -748,7 +748,7 @@ public final class ActiveServices { if (sm != null) { for (int i = sm.mServicesByName.size()-1; i >= 0; i--) { ServiceRecord other = sm.mServicesByName.valueAt(i); - if (other.foregroundId == r.foregroundId + if (other != r && other.foregroundId == r.foregroundId && other.packageName.equals(r.packageName)) { // Found one! Abort the cancel. return;