Merge changes from topic "wear_power_service-master"

* changes:
  Start the WearPowerService with the other Wear system services
  Add a setting for the User Absent, Touch Off feature in Wear
This commit is contained in:
Damien Bargiacchi
2018-06-11 17:49:24 +00:00
committed by Android (Google) Code Review
5 changed files with 36 additions and 10 deletions

View File

@@ -11044,6 +11044,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)

View File

@@ -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 ];

View File

@@ -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,

View File

@@ -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,

View File

@@ -201,6 +201,8 @@ public final class SystemServer {
"com.google.android.clockwork.ThermalObserver";
private static final String WEAR_CONNECTIVITY_SERVICE_CLASS =
"com.android.clockwork.connectivity.WearConnectivityService";
private static final String WEAR_POWER_SERVICE_CLASS =
"com.android.clockwork.power.WearPowerService";
private static final String WEAR_SIDEKICK_SERVICE_CLASS =
"com.google.android.clockwork.sidekick.SidekickService";
private static final String WEAR_DISPLAY_SERVICE_CLASS =
@@ -1549,12 +1551,20 @@ public final class SystemServer {
}
if (isWatch) {
// Must be started before services that depend it, e.g. WearConnectivityService
traceBeginAndSlog("StartWearPowerService");
mSystemServiceManager.startService(WEAR_POWER_SERVICE_CLASS);
traceEnd();
traceBeginAndSlog("StartWearConnectivityService");
mSystemServiceManager.startService(WEAR_CONNECTIVITY_SERVICE_CLASS);
traceEnd();
traceBeginAndSlog("StartWearTimeService");
traceBeginAndSlog("StartWearDisplayService");
mSystemServiceManager.startService(WEAR_DISPLAY_SERVICE_CLASS);
traceEnd();
traceBeginAndSlog("StartWearTimeService");
mSystemServiceManager.startService(WEAR_TIME_SERVICE_CLASS);
traceEnd();