From 569c31cef61f05e9b83e1afac8eab4ddb246255a Mon Sep 17 00:00:00 2001 From: Yo Chiang Date: Mon, 5 Oct 2020 16:41:18 +0800 Subject: [PATCH] Dismiss DSU notification in executeDiscardCommand() Dismiss notification even if there is no active DSU installation. Bug: 170072953 Test: Install a DSU system. Reboot into guest system and reboot back to host system. `adb shell gsi_tool wipe` Press "Discard" in the DSU notification, the notifiction is dismissed. Change-Id: I6f217c4ba287e4789d61182a12485db60f9605c9 --- .../android/dynsystem/DynamicSystemInstallationService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java index 9ff8684675316..f7f3cbb7d332e 100644 --- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java +++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java @@ -321,6 +321,9 @@ public class DynamicSystemInstallationService extends Service if (!isDynamicSystemInstalled() && (getStatus() != STATUS_READY)) { Log.e(TAG, "Trying to discard AOT while there is no complete installation"); + // Stop foreground state and dismiss stale notification. + stopForeground(STOP_FOREGROUND_REMOVE); + resetTaskAndStop(); return; }