summaryrefslogtreecommitdiff
path: root/packages/DynamicSystemInstallationService
diff options
context:
space:
mode:
authorYo Chiang <yochiang@google.com>2021-03-03 05:11:10 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-03-03 05:11:10 +0000
commit0fb5c3f306dfeebd77d9963f970b83f18928e580 (patch)
treedeb7e2b85ce8977f1cb300a1647cd51a95eec765 /packages/DynamicSystemInstallationService
parentc8677e4d052239a5215fbf26f9877f77ccdde842 (diff)
parent59914320433bf74fb4ae0d4199270c89529032a7 (diff)
Merge "DSUService: stopSelf() only if no ongoing installation"
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();
}
}