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

Commit 2e9b8c37 authored by Damien Bargiacchi's avatar Damien Bargiacchi
Browse files

Add a setting for the User Absent, Touch Off feature in Wear

This is an extension of the User Absent power feature on Wear aka "for small batteries". Turning the
sensor off is one of the aspects of power saving we want to take advantage of when the user is
absent.

Bug: 77293569
Test: make -j80
Test: Device boots
Change-Id: I25a3577d8eb2d157c20ed344056138bc32e8d158
parent 1a8ca4a1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -11038,6 +11038,15 @@ public final class Settings {
        public static final String USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED
                = "user_absent_radios_off_for_small_battery_enabled";
        /**
         * Whether or not to enable the User Absent, Touch Off feature on small battery devices.
         * Type: int (0 for false, 1 for true)
         * Default: 0
         * @hide
         */
        public static final String USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED
                = "user_absent_touch_off_for_small_battery_enabled";
        /**
         * Whether or not to turn on Wifi when proxy is disconnected.
         * Type: int (0 for false, 1 for true)
+8 −5
Original line number Diff line number Diff line
@@ -600,14 +600,17 @@ message GlobalSettingsProto {
    }
    optional Ntp ntp = 84;

    // Details about the User Absent, Radios Off feature.
    message UserAbsentRadiosOff {
    // Details about the User Absent For Small Battery feature.
    message UserAbsentSmallBattery {
        option (android.msg_privacy).dest = DEST_EXPLICIT;

        // Whether or not to enable the User Absent, Radios Off feature on small battery devices.
        optional SettingProto enabled_for_small_battery = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
        // Whether or not to enable the User Absent, Radios Off feature
        optional SettingProto radios_off_enabled = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];

        // Whether or not to enable the User Absent, Touch Off feature
        optional SettingProto touch_off_enabled = 2 [ (android.privacy).dest = DEST_AUTOMATIC ];
    }
    optional UserAbsentRadiosOff user_absent_radios_off = 85;
    optional UserAbsentSmallBattery user_absent_small_battery = 85;

    // Whether to disable the automatic scheduling of system updates.
    optional SettingProto ota_disable_automatic_update = 86 [ (android.privacy).dest = DEST_AUTOMATIC ];
+2 −1
Original line number Diff line number Diff line
@@ -340,7 +340,6 @@ public class SettingsBackupTest {
                    Settings.Global.NTP_SERVER,
                    Settings.Global.NTP_TIMEOUT,
                    Settings.Global.OTA_DISABLE_AUTOMATIC_UPDATE,
                    Settings.Global.USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED,
                    Settings.Global.OVERLAY_DISPLAY_DEVICES,
                    Settings.Global.PAC_CHANGE_DELAY,
                    Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE,
@@ -434,6 +433,8 @@ public class SettingsBackupTest {
                    Settings.Global.UNGAZE_SLEEP_ENABLED,
                    Settings.Global.UNLOCK_SOUND,
                    Settings.Global.USE_GOOGLE_MAIL,
                    Settings.Global.USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED,
                    Settings.Global.USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED,
                    Settings.Global.VT_IMS_ENABLED,
                    Settings.Global.WAIT_FOR_DEBUGGER,
                    Settings.Global.ENABLE_GPU_DEBUG_LAYERS,
+6 −3
Original line number Diff line number Diff line
@@ -963,11 +963,14 @@ class SettingsProtoDumpUtil {
                GlobalSettingsProto.Ntp.TIMEOUT_MS);
        p.end(ntpToken);

        final long uaroToken = p.start(GlobalSettingsProto.USER_ABSENT_RADIOS_OFF);
        final long uasbToken = p.start(GlobalSettingsProto.USER_ABSENT_SMALL_BATTERY);
        dumpSetting(s, p,
                Settings.Global.USER_ABSENT_RADIOS_OFF_FOR_SMALL_BATTERY_ENABLED,
                GlobalSettingsProto.UserAbsentRadiosOff.ENABLED_FOR_SMALL_BATTERY);
        p.end(uaroToken);
                GlobalSettingsProto.UserAbsentSmallBattery.RADIOS_OFF_ENABLED);
        dumpSetting(s, p,
                Settings.Global.USER_ABSENT_TOUCH_OFF_FOR_SMALL_BATTERY_ENABLED,
                GlobalSettingsProto.UserAbsentSmallBattery.TOUCH_OFF_ENABLED);
        p.end(uasbToken);

        dumpSetting(s, p,
                Settings.Global.OTA_DISABLE_AUTOMATIC_UPDATE,