From 0f2daaf2f7f0f9a35512e452231fd34e743ddc51 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Tue, 8 Mar 2016 12:44:22 -0800 Subject: [PATCH] Call stopSelfWhenDone() *after* canceling the notification. When a bugreport is shared it's necessary to remove its system notification and stop the service if there is no more pending bugreports. Since the service will might be killed as a result, to call to cancel the notification must be done prior to calling stopSelf(). BUG: 27524556 Change-Id: Iae9a263b6cee0e4a0a7df3e52621e56b50983fec --- .../Shell/src/com/android/shell/BugreportProgressService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index 0fad11357bd9b..e99c6939fa763 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -505,9 +505,9 @@ public class BugreportProgressService extends Service { Log.d(TAG, "Removing ID " + id); mProcesses.remove(id); } - stopSelfWhenDone(); Log.v(TAG, "stopProgress(" + id + "): cancel notification"); NotificationManager.from(mContext).cancel(TAG, id); + stopSelfWhenDone(); } /**