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

Commit 1e55861e authored by Kweku Adams's avatar Kweku Adams
Browse files

Migrate Doze flags to DeviceConfig.

This migrates flags inside DeviceIdleController to DeviceConfig.
DeviceConfig is the recommended way and using it means
that we only operate/parse the set of flags that changed instead of
every single flag whenever one of them changes.

Bug: 124466289
Test: atest CtsHostsideNetworkTests
Test: atest FrameworksMockingServicesTests:DeviceIdleControllerTest
Test: atest SettingsProviderTest:SettingsBackupTest
Change-Id: I7fff451b641eee43a13e77df7b40db5b3af16d58
parent e14fbaad
Loading
Loading
Loading
Loading
+263 −161

File changed.

Preview size limit exceeded, changes collapsed.

+8 −0
Original line number Diff line number Diff line
@@ -129,6 +129,14 @@ package android.os {

}

package android.provider {

  public final class DeviceConfig {
    field public static final String NAMESPACE_DEVICE_IDLE = "device_idle";
  }

}

package android.util {

  public class AtomicFile {
+1 −0
Original line number Diff line number Diff line
@@ -3294,6 +3294,7 @@ package android.provider {
    field public static final String NAMESPACE_AUTOFILL = "autofill";
    field public static final String NAMESPACE_BIOMETRICS = "biometrics";
    field public static final String NAMESPACE_CONTENT_CAPTURE = "content_capture";
    field public static final String NAMESPACE_DEVICE_IDLE = "device_idle";
    field public static final String NAMESPACE_JOB_SCHEDULER = "jobscheduler";
    field public static final String NAMESPACE_PERMISSIONS = "permissions";
    field public static final String NAMESPACE_PRIVACY = "privacy";
+9 −0
Original line number Diff line number Diff line
@@ -144,6 +144,15 @@ public final class DeviceConfig {
    @TestApi
    public static final String NAMESPACE_CONTENT_CAPTURE = "content_capture";

    /**
     * Namespace for device idle configurations.
     *
     * @hide
     */
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    @TestApi
    public static final String NAMESPACE_DEVICE_IDLE = "device_idle";

    /**
     * Namespace for how dex runs. The feature requires a reboot to reach a clean state.
     *
+0 −32
Original line number Diff line number Diff line
@@ -11533,38 +11533,6 @@ public final class Settings {
        @TestApi
        public static final String APP_OPS_CONSTANTS = "app_ops_constants";
        /**
         * Device Idle (Doze) specific settings.
         * This is encoded as a key=value list, separated by commas. Ex:
         *
         * "inactive_to=60000,sensing_to=400000"
         *
         * The following keys are supported:
         *
         * <pre>
         * inactive_to                      (long)
         * sensing_to                       (long)
         * motion_inactive_to               (long)
         * idle_after_inactive_to           (long)
         * idle_pending_to                  (long)
         * max_idle_pending_to              (long)
         * idle_pending_factor              (float)
         * quick_doze_delay_to              (long)
         * idle_to                          (long)
         * max_idle_to                      (long)
         * idle_factor                      (float)
         * min_time_to_alarm                (long)
         * max_temp_app_whitelist_duration  (long)
         * notification_whitelist_duration  (long)
         * </pre>
         *
         * <p>
         * Type: string
         * @hide
         * @see com.android.server.DeviceIdleController.Constants
         */
        public static final String DEVICE_IDLE_CONSTANTS = "device_idle_constants";
        /**
         * Battery Saver specific settings
         * This is encoded as a key=value list, separated by commas. Ex:
Loading