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

Commit 417059b1 authored by Matt Pape's avatar Matt Pape Committed by Android (Google) Code Review
Browse files

Merge "Remove interface for Rollback and Rollback Boot."

parents b6ac3c7d 12187ae6
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -5871,6 +5871,8 @@ package android.provider {
    field public static final String NAMESPACE_INTELLIGENCE_ATTENTION = "intelligence_attention";
    field public static final String NAMESPACE_MEDIA_NATIVE = "media_native";
    field public static final String NAMESPACE_NETD_NATIVE = "netd_native";
    field public static final String NAMESPACE_ROLLBACK = "rollback";
    field public static final String NAMESPACE_ROLLBACK_BOOT = "rollback_boot";
    field public static final String NAMESPACE_RUNTIME = "runtime";
    field public static final String NAMESPACE_RUNTIME_NATIVE = "runtime_native";
    field public static final String NAMESPACE_RUNTIME_NATIVE_BOOT = "runtime_native_boot";
@@ -5902,13 +5904,6 @@ package android.provider {
    method @Nullable public String getString(@NonNull String, @Nullable String);
  }
  public static interface DeviceConfig.Rollback {
    field public static final String BOOT_NAMESPACE = "rollback_boot";
    field public static final String ENABLE_ROLLBACK_TIMEOUT = "enable_rollback_timeout";
    field public static final String NAMESPACE = "rollback";
    field public static final String ROLLBACK_LIFETIME_IN_MILLIS = "rollback_lifetime_in_millis";
  }
  public static interface DeviceConfig.Scheduler {
    field public static final String ENABLE_FAST_METRICS_COLLECTION = "enable_fast_metrics_collection";
    field public static final String NAMESPACE = "scheduler";
+3 −7
Original line number Diff line number Diff line
@@ -727,6 +727,7 @@ package android.content.rollback {
    method @RequiresPermission(android.Manifest.permission.MANAGE_ROLLBACKS) public void reloadPersistedData();
    field public static final String EXTRA_STATUS = "android.content.rollback.extra.STATUS";
    field public static final String EXTRA_STATUS_MESSAGE = "android.content.rollback.extra.STATUS_MESSAGE";
    field public static final String PROPERTY_ROLLBACK_LIFETIME_MILLIS = "rollback_lifetime_in_millis";
    field public static final int STATUS_FAILURE = 1; // 0x1
    field public static final int STATUS_FAILURE_INSTALL = 3; // 0x3
    field public static final int STATUS_FAILURE_ROLLBACK_UNAVAILABLE = 2; // 0x2
@@ -2067,6 +2068,8 @@ package android.provider {
    method @RequiresPermission(android.Manifest.permission.WRITE_DEVICE_CONFIG) public static boolean setProperty(@NonNull String, @NonNull String, @Nullable String, boolean);
    field public static final String NAMESPACE_AUTOFILL = "autofill";
    field public static final String NAMESPACE_CONTENT_CAPTURE = "content_capture";
    field public static final String NAMESPACE_ROLLBACK = "rollback";
    field public static final String NAMESPACE_ROLLBACK_BOOT = "rollback_boot";
  }

  public static interface DeviceConfig.OnPropertiesChangedListener {
@@ -2092,13 +2095,6 @@ package android.provider {
    method @Nullable public String getString(@NonNull String, @Nullable String);
  }

  public static interface DeviceConfig.Rollback {
    field public static final String BOOT_NAMESPACE = "rollback_boot";
    field public static final String ENABLE_ROLLBACK_TIMEOUT = "enable_rollback_timeout";
    field public static final String NAMESPACE = "rollback";
    field public static final String ROLLBACK_LIFETIME_IN_MILLIS = "rollback_lifetime_in_millis";
  }

  public final class MediaStore {
    method @RequiresPermission(android.Manifest.permission.CLEAR_APP_USER_DATA) public static void deleteContributedMedia(android.content.Context, String, android.os.UserHandle) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.CLEAR_APP_USER_DATA) public static long getContributedMediaSize(android.content.Context, String, android.os.UserHandle) throws java.io.IOException;
+19 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.annotation.SystemService;
import android.annotation.TestApi;
import android.content.Context;
import android.content.IntentSender;
import android.content.pm.PackageInstaller;
import android.content.pm.ParceledListSlice;
import android.content.pm.VersionedPackage;
import android.os.RemoteException;
@@ -48,6 +49,24 @@ public final class RollbackManager {
    private final String mCallerPackageName;
    private final IRollbackManager mBinder;

    /**
     * Lifetime duration of rollback packages in millis. A rollback will be available for
     * at most that duration of time after a package is installed with
     * {@link PackageInstaller.SessionParams#setEnableRollback()}.
     *
     * <p>If flag value is negative, the default value will be assigned.
     *
     * @see RollbackManager
     *
     * Flag type: {@code long}
     * Namespace: NAMESPACE_ROLLBACK_BOOT
     *
     * @hide
     */
    @TestApi
    public static final String PROPERTY_ROLLBACK_LIFETIME_MILLIS =
            "rollback_lifetime_in_millis";

    /** {@hide} */
    public RollbackManager(Context context, IRollbackManager binder) {
        mCallerPackageName = context.getPackageName();
+16 −44
Original line number Diff line number Diff line
@@ -171,6 +171,22 @@ public final class DeviceConfig {
    @SystemApi
    public static final String NAMESPACE_NETD_NATIVE = "netd_native";

    /**
     * Namespace for Rollback flags that are applied immediately.
     *
     * @hide
     */
    @SystemApi @TestApi
    public static final String NAMESPACE_ROLLBACK = "rollback";

    /**
     * Namespace for Rollback flags that are applied after a reboot.
     *
     * @hide
     */
    @SystemApi @TestApi
    public static final String NAMESPACE_ROLLBACK_BOOT = "rollback_boot";

    /**
     * Namespace for all runtime related features that don't require a reboot to become active.
     * There are no feature flags using NAMESPACE_RUNTIME.
@@ -269,50 +285,6 @@ public final class DeviceConfig {
        String RAMPING_RINGER_VIBRATION_DURATION = "ramping_ringer_vibration_duration";
    }

    /**
     * Namespace for Rollback.
     *
     * @hide
     */
    @SystemApi @TestApi
    public interface Rollback {

        /**
         * Namespace for flags that can be changed immediately after becoming available on device.
         */
        String NAMESPACE = "rollback";

        /**
         * Namespace for flags that can be changed only after reboot.
         */
        String BOOT_NAMESPACE = "rollback_boot";

        /**
         * Timeout duration in milliseconds for enabling package rollback. If we fail to enable
         * rollback within that period, the install will proceed without rollback enabled.
         *
         * <p>If flag value is negative, the default value will be assigned.
         *
         * Flag type: {@code long}
         * Namespace: Rollback.NAMESPACE
         */
        String ENABLE_ROLLBACK_TIMEOUT = "enable_rollback_timeout";

        /**
         * Lifetime duration of rollback packages in millis. A rollback will be available for
         * at most that duration of time after a package is installed with
         * {@link PackageInstaller.SessionParams#setEnableRollback()}.
         *
         * <p>If flag value is negative, the default value will be assigned.
         *
         * @see RollbackManager
         *
         * Flag type: {@code long}
         * Namespace: Rollback.BOOT_NAMESPACE
         */
        String ROLLBACK_LIFETIME_IN_MILLIS = "rollback_lifetime_in_millis";
    }

    /**
     * Namespace for storage-related features.
     *
+16 −5
Original line number Diff line number Diff line
@@ -551,11 +551,22 @@ public class PackageManagerService extends IPackageManager.Stub
     */
    private static final long DEFAULT_VERIFICATION_TIMEOUT = 10 * 1000;
    /**
     * Timeout duration in milliseconds for enabling package rollback. If we fail to enable
     * rollback within that period, the install will proceed without rollback enabled.
     *
     * <p>If flag value is negative, the default value will be assigned.
     *
     * Flag type: {@code long}
     * Namespace: NAMESPACE_ROLLBACK
     */
    private static final String PROPERTY_ENABLE_ROLLBACK_TIMEOUT_MILLIS = "enable_rollback_timeout";
    /**
     * The default duration to wait for rollback to be enabled in
     * milliseconds.
     */
    private static final long DEFAULT_ENABLE_ROLLBACK_TIMEOUT = 10 * 1000;
    private static final long DEFAULT_ENABLE_ROLLBACK_TIMEOUT_MILLIS = 10 * 1000;
    /**
     * The default response for package verification timeout.
@@ -14754,11 +14765,11 @@ public class PackageManagerService extends IPackageManager.Stub
                                public void onReceive(Context context, Intent intent) {
                                    // the duration to wait for rollback to be enabled, in millis
                                    long rollbackTimeout = DeviceConfig.getLong(
                                            DeviceConfig.Rollback.NAMESPACE,
                                            DeviceConfig.Rollback.ENABLE_ROLLBACK_TIMEOUT,
                                            DEFAULT_ENABLE_ROLLBACK_TIMEOUT);
                                            DeviceConfig.NAMESPACE_ROLLBACK,
                                            PROPERTY_ENABLE_ROLLBACK_TIMEOUT_MILLIS,
                                            DEFAULT_ENABLE_ROLLBACK_TIMEOUT_MILLIS);
                                    if (rollbackTimeout < 0) {
                                        rollbackTimeout = DEFAULT_ENABLE_ROLLBACK_TIMEOUT;
                                        rollbackTimeout = DEFAULT_ENABLE_ROLLBACK_TIMEOUT_MILLIS;
                                    }
                                    final Message msg = mHandler.obtainMessage(
                                            ENABLE_ROLLBACK_TIMEOUT);
Loading