summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chun-Wei Wang <wangchun@google.com> 2023-07-13 05:45:07 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-07-13 05:45:07 +0000
commitc1e9269f5330a811e175be205b850cdee88d60a9 (patch)
treea6f869e69f5e0c17e53d2ee372e70b2b11ad2b94
parentb8a1502c5c54c9431c91fe5c67c895dedfa90ba1 (diff)
parent20bd9b07e4a740c1041e03198b581d5c52d12820 (diff)
Merge "Don't show notifications for locked slots" into main am: c2e0258630 am: 7ff75ffea0 am: e400e294d4 am: b50c07ccca am: 20bd9b07e4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2655023 Change-Id: If7f27dfe13562bc34e0e03a2893f87899d6c4db7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
index e1eb36ac276c..25ac3c9d9074 100644
--- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
+++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java
@@ -419,12 +419,20 @@ public class DynamicSystemInstallationService extends Service
mDynSystem.remove();
}
+ private boolean isDsuSlotLocked() {
+ // Slot names ending with ".lock" are a customized installation.
+ // We expect the client app to provide custom UI to enter/exit DSU mode.
+ // We will ignore the ACTION_REBOOT_TO_NORMAL command and will not show
+ // notifications in this case.
+ return mDynSystem.getActiveDsuSlot().endsWith(".lock");
+ }
+
private void executeRebootToNormalCommand() {
if (!isInDynamicSystem()) {
Log.e(TAG, "It's already running in normal system.");
return;
}
- if (mDynSystem.getActiveDsuSlot().endsWith(".lock")) {
+ if (isDsuSlotLocked()) {
Log.e(TAG, "Ignore the reboot intent for a locked DSU slot");
return;
}
@@ -449,13 +457,13 @@ public class DynamicSystemInstallationService extends Service
private void executeNotifyIfInUseCommand() {
switch (getStatus()) {
case STATUS_IN_USE:
- if (!mHideNotification) {
+ if (!mHideNotification && !isDsuSlotLocked()) {
startForeground(NOTIFICATION_ID,
buildNotification(STATUS_IN_USE, CAUSE_NOT_SPECIFIED));
}
break;
case STATUS_READY:
- if (!mHideNotification) {
+ if (!mHideNotification && !isDsuSlotLocked()) {
startForeground(NOTIFICATION_ID,
buildNotification(STATUS_READY, CAUSE_NOT_SPECIFIED));
}