diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2021-02-17 18:17:09 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-02-17 18:17:09 +0000 |
commit | 29ec0b24c781a50a01c0545f0cecfd440dfef250 (patch) | |
tree | ebba9dd1b597e6a4bada08fd8249fd80eb759dfc | |
parent | f1d78f17c243a7e90597cfb9e8b48d08cb4e34fd (diff) | |
parent | 8c2a70689536169d32f8ecde6524c7b9406181f5 (diff) |
Merge "Expose a setter for install scenarios"
-rw-r--r-- | core/api/current.txt | 5 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageInstaller.java | 7 | ||||
-rw-r--r-- | core/java/android/content/pm/PackageManager.java | 8 |
3 files changed, 12 insertions, 8 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index e2aead5af467..f3ea44a8e543 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -11922,6 +11922,7 @@ package android.content.pm { method public void setAutoRevokePermissionsMode(boolean); method public void setInstallLocation(int); method public void setInstallReason(int); + method public void setInstallScenario(int); method public void setMultiPackage(); method public void setOriginatingUid(int); method public void setOriginatingUri(@Nullable android.net.Uri); @@ -12236,6 +12237,10 @@ package android.content.pm { field public static final int INSTALL_REASON_POLICY = 1; // 0x1 field public static final int INSTALL_REASON_UNKNOWN = 0; // 0x0 field public static final int INSTALL_REASON_USER = 4; // 0x4 + field public static final int INSTALL_SCENARIO_BULK = 2; // 0x2 + field public static final int INSTALL_SCENARIO_BULK_SECONDARY = 3; // 0x3 + field public static final int INSTALL_SCENARIO_DEFAULT = 0; // 0x0 + field public static final int INSTALL_SCENARIO_FAST = 1; // 0x1 field public static final int MATCH_ALL = 131072; // 0x20000 field public static final int MATCH_APEX = 1073741824; // 0x40000000 field public static final int MATCH_DEFAULT_ONLY = 65536; // 0x10000 diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java index 005c7ce9d949..08d8da389110 100644 --- a/core/java/android/content/pm/PackageInstaller.java +++ b/core/java/android/content/pm/PackageInstaller.java @@ -1990,6 +1990,13 @@ public class PackageInstaller { this.forceQueryableOverride = true; } + /** + * Sets the install scenario for this session, which describes the expected user journey. + */ + public void setInstallScenario(@InstallScenario int installScenario) { + this.installScenario = installScenario; + } + /** {@hide} */ public void dump(IndentingPrintWriter pw) { pw.printPair("mode", mode); diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 04e0468fde90..2a28ea7a5c51 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -1059,15 +1059,11 @@ public abstract class PackageManager { /** * A value to indicate the lack of CUJ information, disabling all installation scenario logic. - * - * @hide */ public static final int INSTALL_SCENARIO_DEFAULT = 0; /** * Installation scenario providing the fastest “install button to launch" experience possible. - * - * @hide */ public static final int INSTALL_SCENARIO_FAST = 1; @@ -1084,8 +1080,6 @@ public abstract class PackageManager { * less optimized applications. The device state (e.g. memory usage or battery status) should * not be considered when making this decision as those factors are taken into account by the * Package Manager when acting on the installation scenario. - * - * @hide */ public static final int INSTALL_SCENARIO_BULK = 2; @@ -1096,8 +1090,6 @@ public abstract class PackageManager { * operation that are marked BULK_SECONDARY, the faster the entire bulk operation will be. * * See the comments for INSTALL_SCENARIO_BULK for more information. - * - * @hide */ public static final int INSTALL_SCENARIO_BULK_SECONDARY = 3; |