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
This commit is contained in:
Po-Chien Hsueh
2020-01-02 15:44:26 +08:00
parent 5a049f5cf2
commit ede56ae7ea

View File

@@ -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.");