diff options
| author | MÃ¥rten Kongstad <marten.kongstad@sony.com> | 2018-04-10 17:44:42 +0200 |
|---|---|---|
| committer | Todd Kennedy <toddke@google.com> | 2018-05-09 09:10:28 -0700 |
| commit | 2f1944bf0e225b0fd96d57cfbca40fb717e4f475 (patch) | |
| tree | 7216c3f497155dae20538691db778a902735e9aa /core/java/android | |
| parent | 35424828755937b9457f5f8c0972793b4b6945ff (diff) | |
OMS: rebase settings when overlays update
When an overlay package has been upgraded, OMS needs to reconcile any
previous settings about the overlay with the new state of affairs.
Sometimes it is possible to rebase the OMS settings on the new
information [e.g. the overlay has changed categories]; sometimes the OMS
settings have to be scrapped [e.g. the overlay has changed target
package]. Update OMS to do The Right Thing.
Bug: 78809704
Test: manual (adb shell stop, adb push specially prepared overlays, adb shell start, adb exec-out cmd overlay dump)
Change-Id: Icd1ae633dbee5b5ca957fa6b652af6209b4b1260
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/content/om/OverlayInfo.java | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/core/java/android/content/om/OverlayInfo.java b/core/java/android/content/om/OverlayInfo.java index 6e63342698b3..579cd6a24849 100644 --- a/core/java/android/content/om/OverlayInfo.java +++ b/core/java/android/content/om/OverlayInfo.java @@ -18,7 +18,6 @@ package android.content.om; import android.annotation.IntDef; import android.annotation.NonNull; -import android.annotation.Nullable; import android.os.Parcel; import android.os.Parcelable; @@ -126,6 +125,23 @@ public final class OverlayInfo implements Parcelable { public final int userId; /** + * Priority as read from the manifest. Used if isStatic is true. Not + * intended to be exposed to 3rd party. + * + * @hide + */ + public final int priority; + + /** + * isStatic as read from the manifest. If true, the overlay is + * unconditionally loaded and cannot be unloaded. Not intended to be + * exposed to 3rd party. + * + * @hide + */ + public final boolean isStatic; + + /** * Create a new OverlayInfo based on source with an updated state. * * @param source the source OverlayInfo to base the new instance on @@ -133,17 +149,20 @@ public final class OverlayInfo implements Parcelable { */ public OverlayInfo(@NonNull OverlayInfo source, @State int state) { this(source.packageName, source.targetPackageName, source.category, source.baseCodePath, - state, source.userId); + state, source.userId, source.priority, source.isStatic); } public OverlayInfo(@NonNull String packageName, @NonNull String targetPackageName, - @Nullable String category, @NonNull String baseCodePath, int state, int userId) { + @NonNull String category, @NonNull String baseCodePath, int state, int userId, + int priority, boolean isStatic) { this.packageName = packageName; this.targetPackageName = targetPackageName; this.category = category; this.baseCodePath = baseCodePath; this.state = state; this.userId = userId; + this.priority = priority; + this.isStatic = isStatic; ensureValidState(); } @@ -154,6 +173,8 @@ public final class OverlayInfo implements Parcelable { baseCodePath = source.readString(); state = source.readInt(); userId = source.readInt(); + priority = source.readInt(); + isStatic = source.readBoolean(); ensureValidState(); } @@ -194,6 +215,8 @@ public final class OverlayInfo implements Parcelable { dest.writeString(baseCodePath); dest.writeInt(state); dest.writeInt(userId); + dest.writeInt(priority); + dest.writeBoolean(isStatic); } public static final Parcelable.Creator<OverlayInfo> CREATOR = |
