Adds APIs to let live caption can access the data in the DB (1/n)

Adds a new setting key, ODI_CAPTIONS_VOLUME_UI_ENABLED, in the
secure settings, to indicate the live caption button show or hide
in the volume rocker.

Bug: 136282740
Test: atest SettingsBackupTest
Change-Id: Ibcf3be36903450538696c75325c4a866942ce693
This commit is contained in:
Jacky Kao
2022-01-04 11:21:55 +08:00
parent fb42cf7e45
commit b5764cd804
5 changed files with 17 additions and 0 deletions

View File

@@ -6524,6 +6524,16 @@ public final class Settings {
@Readable
public static final String ODI_CAPTIONS_ENABLED = "odi_captions_enabled";
/**
* Setting to indicate live caption button show or hide in the volume
* rocker.
*
* @hide
*/
public static final String ODI_CAPTIONS_VOLUME_UI_ENABLED =
"odi_captions_volume_ui_enabled";
/**
* On Android 8.0 (API level 26) and higher versions of the platform,
* a 64-bit number (expressed as a hexadecimal string), unique to

View File

@@ -85,6 +85,7 @@ message SecureSettingsProto {
optional SettingProto accessibility_floating_menu_icon_type = 39 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto accessibility_floating_menu_opacity = 40 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto accessibility_floating_menu_fade_enabled = 41 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto odi_captions_volume_ui_enabled = 42 [ (android.privacy).dest = DEST_AUTOMATIC ];
}
optional Accessibility accessibility = 2;

View File

@@ -188,6 +188,7 @@ public class SecureSettings {
Settings.Secure.ACCESSIBILITY_FLOATING_MENU_ICON_TYPE,
Settings.Secure.ACCESSIBILITY_FLOATING_MENU_OPACITY,
Settings.Secure.ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED,
Settings.Secure.ODI_CAPTIONS_VOLUME_UI_ENABLED,
Settings.Secure.NOTIFICATION_BUBBLES,
Settings.Secure.LOCATION_TIME_ZONE_DETECTION_ENABLED,
Settings.Secure.LOCKSCREEN_SHOW_CONTROLS,

View File

@@ -321,5 +321,7 @@ public class SecureSettingsValidators {
}
return true;
});
VALIDATORS.put(Secure.ODI_CAPTIONS_VOLUME_UI_ENABLED, BOOLEAN_VALIDATOR);
}
}

View File

@@ -1813,6 +1813,9 @@ class SettingsProtoDumpUtil {
dumpSetting(s, p,
Settings.Secure.ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED,
SecureSettingsProto.Accessibility.ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED);
dumpSetting(s, p,
Settings.Secure.ODI_CAPTIONS_VOLUME_UI_ENABLED,
SecureSettingsProto.Accessibility.ODI_CAPTIONS_VOLUME_UI_ENABLED);
p.end(accessibilityToken);
final long adaptiveSleepToken = p.start(SecureSettingsProto.ADAPTIVE_SLEEP);