diff options
| author | 2023-07-13 03:32:21 +0000 | |
|---|---|---|
| committer | 2023-07-13 03:32:21 +0000 | |
| commit | e400e294d4777838c8a41796a489b048da7bf3cf (patch) | |
| tree | cdccd720726fa6e26b92f120eeca7cb989ea7cc7 | |
| parent | fe2e57cfbb10657ba21797d3ae5ccb109d144a81 (diff) | |
| parent | 7ff75ffea0b1809001152d7c3b29d512d1be15ea (diff) | |
Merge "Don't show notifications for locked slots" into main am: c2e0258630 am: 7ff75ffea0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2655023
Change-Id: I97c9d8dc80c35b761970512eac57313412287af9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | packages/DynamicSystemInstallationService/src/com/android/dynsystem/DynamicSystemInstallationService.java | 14 |
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 3b56016f4718..c390f3198f14 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)); } |