Merge "Don't show notifications for locked slots" into main am: c2e0258630 am: 7ff75ffea0 am: e400e294d4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2655023 Change-Id: I11da0cb9c5d8aa0ef8cfb7e8a86f252613353813 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -419,12 +419,20 @@ public class DynamicSystemInstallationService extends Service
|
|||||||
mDynSystem.remove();
|
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() {
|
private void executeRebootToNormalCommand() {
|
||||||
if (!isInDynamicSystem()) {
|
if (!isInDynamicSystem()) {
|
||||||
Log.e(TAG, "It's already running in normal system.");
|
Log.e(TAG, "It's already running in normal system.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mDynSystem.getActiveDsuSlot().endsWith(".lock")) {
|
if (isDsuSlotLocked()) {
|
||||||
Log.e(TAG, "Ignore the reboot intent for a locked DSU slot");
|
Log.e(TAG, "Ignore the reboot intent for a locked DSU slot");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -449,13 +457,13 @@ public class DynamicSystemInstallationService extends Service
|
|||||||
private void executeNotifyIfInUseCommand() {
|
private void executeNotifyIfInUseCommand() {
|
||||||
switch (getStatus()) {
|
switch (getStatus()) {
|
||||||
case STATUS_IN_USE:
|
case STATUS_IN_USE:
|
||||||
if (!mHideNotification) {
|
if (!mHideNotification && !isDsuSlotLocked()) {
|
||||||
startForeground(NOTIFICATION_ID,
|
startForeground(NOTIFICATION_ID,
|
||||||
buildNotification(STATUS_IN_USE, CAUSE_NOT_SPECIFIED));
|
buildNotification(STATUS_IN_USE, CAUSE_NOT_SPECIFIED));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STATUS_READY:
|
case STATUS_READY:
|
||||||
if (!mHideNotification) {
|
if (!mHideNotification && !isDsuSlotLocked()) {
|
||||||
startForeground(NOTIFICATION_ID,
|
startForeground(NOTIFICATION_ID,
|
||||||
buildNotification(STATUS_READY, CAUSE_NOT_SPECIFIED));
|
buildNotification(STATUS_READY, CAUSE_NOT_SPECIFIED));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user