summaryrefslogtreecommitdiff
path: root/packages/DynamicSystemInstallationService
diff options
context:
space:
mode:
authorYo Chiang <yochiang@google.com>2021-03-03 08:21:05 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-03-03 08:21:05 +0000
commit3121af69d37ece00f0f1779eaafc13eb67ccf13e (patch)
treeb1e51773b155a2197899d501ae8985caf3a2e8f5 /packages/DynamicSystemInstallationService
parent00a8690dc93c17249cb8c3e19cd6e476c6102973 (diff)
parent0fb5c3f306dfeebd77d9963f970b83f18928e580 (diff)
Merge "DSUService: stopSelf() only if no ongoing installation" am: 0fb5c3f306
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1609094 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I9ec7b60e0a5d964db91e84bb1ebb4c751eda5cf5
Diffstat (limited to 'packages/DynamicSystemInstallationService')
-rw-r--r--packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java24
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();
}
}