diff options
| author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-12-04 12:29:06 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-12-04 12:29:06 +0000 |
| commit | f64909587beada220cc5697badbd56be72909d13 (patch) | |
| tree | 8988b9115e50c2132afe781bd2e65bad6c41cd3f /core/java | |
| parent | ec62f08f8c0a5a947cd2042854e2b5055a291fa5 (diff) | |
| parent | e8129a31bbe63c88ad4d817485718f42cf486244 (diff) | |
Merge changes from topic "apex_adb"
* changes:
Add MATCH_APEX flag to getInstalledPackages.
Rename APEX installPackage method to stagePackage.
Initial support for installing APEX via adb.
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/content/pm/PackageInfo.java | 18 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageManager.java | 20 |
2 files changed, 37 insertions, 1 deletions
diff --git a/core/java/android/content/pm/PackageInfo.java b/core/java/android/content/pm/PackageInfo.java index d9d177760243..89e8608eec08 100644 --- a/core/java/android/content/pm/PackageInfo.java +++ b/core/java/android/content/pm/PackageInfo.java @@ -18,6 +18,7 @@ package android.content.pm; import android.annotation.Nullable; import android.annotation.UnsupportedAppUsage; +import android.apex.ApexInfo; import android.os.Parcel; import android.os.Parcelable; @@ -390,6 +391,11 @@ public class PackageInfo implements Parcelable { @Nullable public String compileSdkVersionCodename; + /** + * Whether the package is an APEX package. + */ + public boolean isApex; + public PackageInfo() { } @@ -472,6 +478,7 @@ public class PackageInfo implements Parcelable { } else { dest.writeInt(0); } + dest.writeBoolean(isApex); } public static final Parcelable.Creator<PackageInfo> CREATOR @@ -533,7 +540,7 @@ public class PackageInfo implements Parcelable { if (hasSigningInfo != 0) { signingInfo = SigningInfo.CREATOR.createFromParcel(source); } - + isApex = source.readBoolean(); // The component lists were flattened with the redundant ApplicationInfo // instances omitted. Distribute the canonical one here as appropriate. if (applicationInfo != null) { @@ -544,6 +551,15 @@ public class PackageInfo implements Parcelable { } } + /** + * @hide + */ + public PackageInfo(ApexInfo apexInfo) { + packageName = apexInfo.packageName; + setLongVersionCode(apexInfo.versionCode); + isApex = true; + } + private void propagateApplicationInfo(ApplicationInfo appInfo, ComponentInfo[] components) { if (components != null) { for (ComponentInfo ci : components) { diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 2597f1d53937..1394c358868c 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -145,6 +145,7 @@ public abstract class PackageManager { MATCH_FACTORY_ONLY, MATCH_DEBUG_TRIAGED_MISSING, MATCH_INSTANT, + MATCH_APEX, GET_DISABLED_COMPONENTS, GET_DISABLED_UNTIL_USED_COMPONENTS, GET_UNINSTALLED_PACKAGES, @@ -531,6 +532,17 @@ public abstract class PackageManager { public static final int MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS = 0x20000000; /** + * {@link PackageInfo} flag: include APEX packages that are currently + * installed. In APEX terminology, this corresponds to packages that are + * currently active, i.e. mounted and available to other processes of the OS. + * In particular, this flag alone will not match APEX files that are staged + * for activation at next reboot. + * TODO(b/119767311): include uninstalled/inactive APEX if + * MATCH_UNINSTALLED_PACKAGES is set. + */ + public static final int MATCH_APEX = 0x40000000; + + /** * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when * resolving an intent that matches the {@code CrossProfileIntentFilter}, * the current profile will be skipped. Only activities in the target user @@ -846,6 +858,14 @@ public abstract class PackageManager { */ public static final int INSTALL_VIRTUAL_PRELOAD = 0x00010000; + /** + * Flag parameter for {@link #installPackage} to indicate that this package + * is an APEX package + * + * @hide + */ + public static final int INSTALL_APEX = 0x00020000; + /** @hide */ @IntDef(flag = true, prefix = { "DONT_KILL_APP" }, value = { DONT_KILL_APP |
