diff options
author | Yo Chiang <yochiang@google.com> | 2021-03-03 13:28:41 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-03-03 13:28:41 +0000 |
commit | 47b02fee455ff468f321e9b92be8de2e86e858ac (patch) | |
tree | ba9913e71fe3139ad5c21af86aad6281577a1897 /packages/DynamicSystemInstallationService | |
parent | 921b1b0055ea63e3d6317736b6ed6c8eb26d77c9 (diff) | |
parent | 7ec7d60f455a33f85b5881a5c7e687612f00938b (diff) |
Merge "DSUService: stopSelf() only if no ongoing installation" am: 0fb5c3f306 am: 3121af69d3 am: 7ec7d60f45
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1609094
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I07d45bb2ce07850d05d3bfaa798075a2ebbaa19e
Diffstat (limited to 'packages/DynamicSystemInstallationService')
-rw-r--r-- | packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java index 7f19662c6961..c1dca5df1b2f 100644 --- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java +++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java @@ -394,16 +394,20 @@ public class DynamicSystemInstallationService extends Service } private void executeNotifyIfInUseCommand() { - int status = getStatus(); - - if (status == STATUS_IN_USE) { - startForeground(NOTIFICATION_ID, - buildNotification(STATUS_IN_USE, CAUSE_NOT_SPECIFIED)); - } else if (status == STATUS_READY) { - startForeground(NOTIFICATION_ID, - buildNotification(STATUS_READY, CAUSE_NOT_SPECIFIED)); - } else { - stopSelf(); + switch (getStatus()) { + case STATUS_IN_USE: + startForeground(NOTIFICATION_ID, + buildNotification(STATUS_IN_USE, CAUSE_NOT_SPECIFIED)); + break; + case STATUS_READY: + startForeground(NOTIFICATION_ID, + buildNotification(STATUS_READY, CAUSE_NOT_SPECIFIED)); + break; + case STATUS_IN_PROGRESS: + break; + case STATUS_NOT_STARTED: + default: + stopSelf(); } } |