Merge "DSUService: stopSelf() only if no ongoing installation"

This commit is contained in:
Yo Chiang
2021-03-03 05:11:10 +00:00
committed by Gerrit Code Review

View File

@@ -394,16 +394,20 @@ public class DynamicSystemInstallationService extends Service
} }
private void executeNotifyIfInUseCommand() { private void executeNotifyIfInUseCommand() {
int status = getStatus(); switch (getStatus()) {
case STATUS_IN_USE:
if (status == STATUS_IN_USE) { startForeground(NOTIFICATION_ID,
startForeground(NOTIFICATION_ID, buildNotification(STATUS_IN_USE, CAUSE_NOT_SPECIFIED));
buildNotification(STATUS_IN_USE, CAUSE_NOT_SPECIFIED)); break;
} else if (status == STATUS_READY) { case STATUS_READY:
startForeground(NOTIFICATION_ID, startForeground(NOTIFICATION_ID,
buildNotification(STATUS_READY, CAUSE_NOT_SPECIFIED)); buildNotification(STATUS_READY, CAUSE_NOT_SPECIFIED));
} else { break;
stopSelf(); case STATUS_IN_PROGRESS:
break;
case STATUS_NOT_STARTED:
default:
stopSelf();
} }
} }