From ede56ae7ea4574b6942e748f31f9ef862a7ec0bb Mon Sep 17 00:00:00 2001 From: Po-Chien Hsueh Date: Thu, 2 Jan 2020 15:44:26 +0800 Subject: [PATCH] Remove notification right after clicking on cancel After aosp/1188881, DynamicSystemManager.remove() is blocked for about 30 seconds. To give users feedbacks faster when they click on the [Cancel] button, This CL removes the progress notification earlier. Bug: 145891864 Test: Clicking on the [Cancel] button Change-Id: I4e43775b2de6eaa50d4a1cc073a5057f22f6d8d5 --- .../android/dynsystem/DynamicSystemInstallationService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java index 9e49826f70c3d..c2ce840238690 100644 --- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java +++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java @@ -262,10 +262,11 @@ public class DynamicSystemInstallationService extends Service return; } + stopForeground(true); mJustCancelledByUser = true; if (mInstallTask.cancel(false)) { - // Will cleanup and post status in onResult() + // Will stopSelf() in onResult() Log.d(TAG, "Cancel request filed successfully"); } else { Log.e(TAG, "Trying to cancel installation while it's already completed.");