Merge changes from topic "b_78809704" into pi-dev

am: 92b64bb1bb

Change-Id: I08a9b59d00c9e7aa075c21c44b582d571fe79fd7
This commit is contained in:
Todd Kennedy
2018-05-11 11:15:10 -07:00
committed by android-build-merger
4 changed files with 22 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ public final class OverlayInfo implements Parcelable {
STATE_NO_IDMAP,
STATE_DISABLED,
STATE_ENABLED,
STATE_ENABLED_STATIC,
STATE_TARGET_UPGRADING,
STATE_OVERLAY_UPGRADING,
})
@@ -90,7 +91,16 @@ public final class OverlayInfo implements Parcelable {
public static final int STATE_OVERLAY_UPGRADING = 5;
/**
* Category for theme overlays.
* The overlay package is currently enabled because it is marked as
* 'static'. It cannot be disabled but will change state if for instance
* its target is uninstalled.
*/
public static final int STATE_ENABLED_STATIC = 6;
/**
* Overlay category: theme.
* <p>
* Change how Android (including the status bar, dialogs, ...) looks.
*/
public static final String CATEGORY_THEME = "android.theme";
@@ -194,6 +204,7 @@ public final class OverlayInfo implements Parcelable {
case STATE_NO_IDMAP:
case STATE_DISABLED:
case STATE_ENABLED:
case STATE_ENABLED_STATIC:
case STATE_TARGET_UPGRADING:
case STATE_OVERLAY_UPGRADING:
break;
@@ -243,6 +254,7 @@ public final class OverlayInfo implements Parcelable {
public boolean isEnabled() {
switch (state) {
case STATE_ENABLED:
case STATE_ENABLED_STATIC:
return true;
default:
return false;
@@ -267,6 +279,8 @@ public final class OverlayInfo implements Parcelable {
return "STATE_DISABLED";
case STATE_ENABLED:
return "STATE_ENABLED";
case STATE_ENABLED_STATIC:
return "STATE_ENABLED_STATIC";
case STATE_TARGET_UPGRADING:
return "STATE_TARGET_UPGRADING";
case STATE_OVERLAY_UPGRADING:

View File

@@ -18,6 +18,7 @@ package com.android.server.om;
import static android.content.om.OverlayInfo.STATE_DISABLED;
import static android.content.om.OverlayInfo.STATE_ENABLED;
import static android.content.om.OverlayInfo.STATE_ENABLED_STATIC;
import static android.content.om.OverlayInfo.STATE_MISSING_TARGET;
import static android.content.om.OverlayInfo.STATE_NO_IDMAP;
import static android.content.om.OverlayInfo.STATE_OVERLAY_UPGRADING;
@@ -685,6 +686,10 @@ final class OverlayManagerServiceImpl {
return STATE_NO_IDMAP;
}
if (overlayPackage.isStaticOverlayPackage()) {
return STATE_ENABLED_STATIC;
}
final boolean enabled = mSettings.getEnabled(overlayPackage.packageName, userId);
return enabled ? STATE_ENABLED : STATE_DISABLED;
}

View File

@@ -309,6 +309,7 @@ final class OverlayManagerSettings {
pw.print("mState.............: "); pw.println(OverlayInfo.stateToString(item.getState()));
pw.print("mIsEnabled.........: "); pw.println(item.isEnabled());
pw.print("mIsStatic..........: "); pw.println(item.isStatic());
pw.print("mPriority..........: "); pw.println(item.mPriority);
pw.print("mCategory..........: "); pw.println(item.mCategory);
pw.decreaseIndent();

View File

@@ -126,6 +126,7 @@ final class OverlayManagerShellCommand extends ShellCommand {
final OverlayInfo oi = overlaysForTarget.get(i);
String status;
switch (oi.state) {
case OverlayInfo.STATE_ENABLED_STATIC:
case OverlayInfo.STATE_ENABLED:
status = "[x]";
break;