Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0665cbce authored by Ivan Chiang's avatar Ivan Chiang
Browse files

[PM] Update conditions for updates without user action

- For Android B, updates without user action are permitted for apps
  targeting API 34+
- Updated the conditions for SDK version check in
  PackageInstallerSession and associated documentation in
  PackageInstaller.SesionParams

Flag: EXEMPT JAVA DOC
Bug: 420996962
Test: atest CtsSilentUpdateHostTestCases
Change-Id: I6c56897f84e8637f75edb2d3569f2b7b6d2bd2a6
parent 75c82c24
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3894,6 +3894,9 @@ public class PackageInstaller {
         *              <li>{@link android.os.Build.VERSION_CODES#TIRAMISU API 33} or higher on
         *              Android V ({@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM API 35})
         *              </li>
         *              <li>{@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE API 34} or
         *              higher on Android B ({@link android.os.Build.VERSION_CODES#BAKLAVA API 36})
         *              </li>
         *          </ul>
         *     </li>
         *     <li>The installer is:
+4 −4
Original line number Diff line number Diff line
@@ -355,14 +355,14 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
    private static final int INCREMENTAL_STORAGE_UNHEALTHY_MONITORING_MS = 60000;

    /**
     * If an app being installed targets {@link Build.VERSION_CODES#TIRAMISU API 33} and above,
     * the app can be installed without user action.
     * If an app being installed targets {@link Build.VERSION_CODES#UPSIDE_DOWN_CAKE API 34} and
     * above, the app can be installed without user action.
     * See {@link PackageInstaller.SessionParams#setRequireUserAction} for other conditions required
     * to be satisfied for a silent install.
     */
    @ChangeId
    @EnabledSince(targetSdkVersion = Build.VERSION_CODES.TIRAMISU)
    private static final long SILENT_INSTALL_ALLOWED = 325888262L;
    @EnabledSince(targetSdkVersion = VERSION_CODES.UPSIDE_DOWN_CAKE)
    private static final long SILENT_INSTALL_ALLOWED = 420996962L;

    /**
     * The system supports pre-approval and update ownership features from