Add a Settings.Secure value to store extra battery saver schedule

- To store extra battery saver schedule mode

Bug: 224899180
Bug: 236688783
Bug: 238841059
Test: Build pass and local access verify
Change-Id: I4a394de04fdb9020ce22377390b81bccfaec2090
This commit is contained in:
Wesley Wang
2022-07-06 22:07:09 +08:00
committed by YK Hung
parent 305ccecea3
commit c7adaf6f0f
3 changed files with 22 additions and 1 deletions

View File

@@ -10879,6 +10879,14 @@ public final class Settings {
*/
public static final String ADAPTIVE_CHARGING_ENABLED = "adaptive_charging_enabled";
/**
* Whether battery saver is currently set to different schedule mode.
*
* @hide
*/
public static final String EXTRA_AUTOMATIC_POWER_SAVE_MODE =
"extra_automatic_power_save_mode";
/**
* These entries are considered common between the personal and the managed profile,
* since the managed profile doesn't get to change them.

View File

@@ -473,6 +473,13 @@ message SecureSettingsProto {
}
optional PowerMenuPrivacy power_menu_privacy = 81;
message ExtraLowPowerMode {
option (android.msg_privacy).dest = DEST_EXPLICIT;
optional SettingProto extra_automatic_power_save_mode = 1 [ (android.privacy).dest = DEST_AUTOMATIC ];
}
optional ExtraLowPowerMode extra_low_power_mode = 93;
message PrintService {
option (android.msg_privacy).dest = DEST_EXPLICIT;
@@ -679,5 +686,5 @@ message SecureSettingsProto {
// Please insert fields in alphabetical order and group them into messages
// if possible (to avoid reaching the method limit).
// Next tag = 93;
// Next tag = 94;
}

View File

@@ -2358,6 +2358,12 @@ class SettingsProtoDumpUtil {
SecureSettingsProto.PowerMenuPrivacy.SHOW);
p.end(powerMenuPrivacyToken);
final long extraLowPowerModeToken = p.start(SecureSettingsProto.EXTRA_LOW_POWER_MODE);
dumpSetting(s, p,
Settings.Secure.EXTRA_AUTOMATIC_POWER_SAVE_MODE,
SecureSettingsProto.ExtraLowPowerMode.EXTRA_AUTOMATIC_POWER_SAVE_MODE);
p.end(extraLowPowerModeToken);
final long printServiceToken = p.start(SecureSettingsProto.PRINT_SERVICE);
dumpSetting(s, p,
Settings.Secure.PRINT_SERVICE_SEARCH_URI,