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
This commit is contained in:
Yo Chiang
2020-10-05 16:41:18 +08:00
parent 0989373740
commit 569c31cef6

View File

@@ -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;
}