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

Commit 5caa3536 authored by Kweku Adams's avatar Kweku Adams
Browse files

Adjust idle timings.

1. Reduce the time to enter deep device idle from ~71 minutes to a few
   minutes. Based on user behavior, the system can be more confident
   than not that the user won't turn the screen on for a while after
   a few minutes of screen off time.
2. Shorten the time to enter light Doze and increase the max light idle
   time to 30 minutes and change the backoff system to get to 30 minutes
   more slowly.

Bug: 187947479
Bug: 299329948
Test: atest DeviceIdleTest
Test: atest FrameworksMockingServicesTests:DeviceIdleControllerTest
Change-Id: Id4fb80d9def10d511759f6ae853ab6ce8909ca36
parent 418c3175
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1102,7 +1102,7 @@ public class DeviceIdleController extends SystemService
        private long mDefaultInactiveTimeout =
                (30 * 60 * 1000L) / (!COMPRESS_TIME ? 1 : 10);
        private static final long DEFAULT_INACTIVE_TIMEOUT_SMALL_BATTERY =
                (15 * 60 * 1000L) / (!COMPRESS_TIME ? 1 : 10);
                (60 * 1000L) / (!COMPRESS_TIME ? 1 : 10);
        private long mDefaultSensingTimeout =
                !COMPRESS_TIME ? 4 * 60 * 1000L : 60 * 1000L;
        private long mDefaultLocatingTimeout =
@@ -1115,7 +1115,7 @@ public class DeviceIdleController extends SystemService
        private long mDefaultIdleAfterInactiveTimeout =
                (30 * 60 * 1000L) / (!COMPRESS_TIME ? 1 : 10);
        private static final long DEFAULT_IDLE_AFTER_INACTIVE_TIMEOUT_SMALL_BATTERY =
                (15 * 60 * 1000L) / (!COMPRESS_TIME ? 1 : 10);
                (60 * 1000L) / (!COMPRESS_TIME ? 1 : 10);
        private long mDefaultIdlePendingTimeout =
                !COMPRESS_TIME ? 5 * 60 * 1000L : 30 * 1000L;
        private long mDefaultMaxIdlePendingTimeout =
+8 −8
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
    <integer name="device_idle_flex_time_short_ms">60000</integer>

    <!-- Default for DeviceIdleController.Constants.LIGHT_IDLE_AFTER_INACTIVE_TIMEOUT -->
    <integer name="device_idle_light_after_inactive_to_ms">240000</integer>
    <integer name="device_idle_light_after_inactive_to_ms">60000</integer>

    <!-- Default for DeviceIdleController.Constants.LIGHT_IDLE_TIMEOUT -->
    <integer name="device_idle_light_idle_to_ms">300000</integer>
@@ -43,7 +43,7 @@
    <item name="device_idle_light_idle_factor" format="float" type="integer">2.0</item>

    <!-- Default for DeviceIdleController.Constants.LIGHT_IDLE_INCREASE_LINEARLY -->
    <bool name="device_idle_light_idle_increase_linearly">false</bool>
    <bool name="device_idle_light_idle_increase_linearly">true</bool>

    <!-- Default for DeviceIdleController.Constants.LIGHT_IDLE_LINEAR_INCREASE_FACTOR_MS -->
    <integer name="device_idle_light_idle_linear_increase_factor_ms">300000</integer>
@@ -52,7 +52,7 @@
    <integer name="device_idle_light_idle_flex_linear_increase_factor_ms">60000</integer>

    <!-- Default for DeviceIdleController.Constants.LIGHT_MAX_IDLE_TIMEOUT -->
    <integer name="device_idle_light_max_idle_to_ms">900000</integer>
    <integer name="device_idle_light_max_idle_to_ms">1800000</integer>

    <!-- Default for DeviceIdleController.Constants.LIGHT_IDLE_MAINTENANCE_MIN_BUDGET -->
    <integer name="device_idle_light_idle_maintenance_min_budget_ms">60000</integer>
@@ -67,13 +67,13 @@
    <integer name="device_idle_min_deep_maintenance_time_ms">30000</integer>

    <!-- Default for DeviceIdleController.Constants.INACTIVE_TIMEOUT -->
    <integer name="device_idle_inactive_to_ms">1800000</integer>
    <integer name="device_idle_inactive_to_ms">60000</integer>

    <!-- Default for DeviceIdleController.Constants.SENSING_TIMEOUT -->
    <integer name="device_idle_sensing_to_ms">240000</integer>
    <integer name="device_idle_sensing_to_ms">30000</integer>

    <!-- Default for DeviceIdleController.Constants.LOCATING_TIMEOUT -->
    <integer name="device_idle_locating_to_ms">30000</integer>
    <integer name="device_idle_locating_to_ms">15000</integer>

    <!-- Default for DeviceIdleController.Constants.LOCATION_ACCURACY -->
    <item name="device_idle_location_accuracy" format="float" type="integer">20.0</item>
@@ -85,7 +85,7 @@
    <integer name="device_idle_motion_inactive_to_flex_ms">60000</integer>

    <!-- Default for DeviceIdleController.Constants.IDLE_AFTER_INACTIVE_TIMEOUT -->
    <integer name="device_idle_idle_after_inactive_to_ms">1800000</integer>
    <integer name="device_idle_idle_after_inactive_to_ms">60000</integer>

    <!-- Default for DeviceIdleController.Constants.IDLE_PENDING_TIMEOUT -->
    <integer name="device_idle_idle_pending_to_ms">300000</integer>
@@ -100,7 +100,7 @@
    <integer name="device_idle_quick_doze_delay_to_ms">60000</integer>

    <!-- Default for DeviceIdleController.Constants.IDLE_TIMEOUT -->
    <integer name="device_idle_idle_to_ms">3600000</integer>
    <integer name="device_idle_idle_to_ms">900000</integer>

    <!-- Default for DeviceIdleController.Constants.MAX_IDLE_TIMEOUT -->
    <integer name="device_idle_max_idle_to_ms">21600000</integer>
+2 −3
Original line number Diff line number Diff line
@@ -2164,9 +2164,8 @@ public class DeviceIdleControllerTest {
    public void testStationaryDetection_QuickDozeOff() {
        setQuickDozeEnabled(false);
        enterDeepState(STATE_IDLE);
        // Regular progression through states, so time should have increased appropriately.
        mInjector.nowElapsed += mConstants.IDLE_AFTER_INACTIVE_TIMEOUT + mConstants.SENSING_TIMEOUT
                + mConstants.LOCATING_TIMEOUT;
        // Indicate that enough time has passed for the device to be considered stationary.
        mInjector.nowElapsed += mConstants.MOTION_INACTIVE_TIMEOUT;

        StationaryListenerForTest stationaryListener = new StationaryListenerForTest();