From fbb088ffdb309aaa3ebdf47ae186e5f9c1bb0aa6 Mon Sep 17 00:00:00 2001 From: Sally Qi Date: Mon, 26 Jun 2023 16:11:53 -0700 Subject: [PATCH] Settings: add a new developer menu entry to show hdr/sdr ratio overlay. - The hdr/sdr ratio overlay will be shown on screen if the option is selected from the developer option. - This option is hidden on non-HDR-supported devices. - Add flags: com.android.settings.flags.development_hdr_sdr_ratio Test: enable show hdr/sdr ratio from developer menu; com.android.settings.development.ShowHdrSdrRatioPreferenceControllerTest Bug: 291863102 Change-Id: Idd72f95c67c95cd8127f9b94e031b3d87b18e307 --- aconfig/Android.bp | 1 + ...ings_development_flag_declarations.aconfig | 13 ++ res/values/strings.xml | 5 + res/xml/development_settings.xml | 5 + .../DevelopmentSettingsDashboardFragment.java | 1 + src/com/android/settings/development/OWNERS | 5 + .../ShowHdrSdrRatioPreferenceController.java | 144 +++++++++++++++ ...owHdrSdrRatioPreferenceControllerTest.java | 171 ++++++++++++++++++ 8 files changed, 345 insertions(+) create mode 100644 aconfig/settings_development_flag_declarations.aconfig create mode 100644 src/com/android/settings/development/OWNERS create mode 100644 src/com/android/settings/development/ShowHdrSdrRatioPreferenceController.java create mode 100644 tests/robotests/src/com/android/settings/development/ShowHdrSdrRatioPreferenceControllerTest.java diff --git a/aconfig/Android.bp b/aconfig/Android.bp index 78fba34bd1c..5c6c8c3435f 100644 --- a/aconfig/Android.bp +++ b/aconfig/Android.bp @@ -8,6 +8,7 @@ aconfig_declarations { srcs: [ "settings_accessibility_flag_declarations.aconfig", "settings_connecteddevice_flag_declarations.aconfig", + "settings_development_flag_declarations.aconfig", "settings_globalintl_flag_declarations.aconfig", "settings_experience_flag_declarations.aconfig", "settings_onboarding_experience_flag_declarations.aconfig", diff --git a/aconfig/settings_development_flag_declarations.aconfig b/aconfig/settings_development_flag_declarations.aconfig new file mode 100644 index 00000000000..c23a38f3f62 --- /dev/null +++ b/aconfig/settings_development_flag_declarations.aconfig @@ -0,0 +1,13 @@ +package: "com.android.settings.flags" + +# NOTE: Keep alphabetized to help limit merge conflicts from multiple simultaneous editors. + +# NOTE: All Settings flags share the same Flags class, so prefix our +# flags with 'development' to prevent naming collision. + +flag { + name: "development_hdr_sdr_ratio" + namespace: "core_graphics" + description: "Shows hdr/sdr dev opton on the development options page from aconfig" + bug: "291863102" +} diff --git a/res/values/strings.xml b/res/values/strings.xml index a3760c547e8..a5037104b48 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1853,6 +1853,11 @@ Show the current display refresh rate + + Show HDR/SDR ratio + + Show the current HDR/SDR ratio + NFC diff --git a/res/xml/development_settings.xml b/res/xml/development_settings.xml index b05342400ec..f890984f34b 100644 --- a/res/xml/development_settings.xml +++ b/res/xml/development_settings.xml @@ -273,6 +273,11 @@ android:title="@string/show_refresh_rate" android:summary="@string/show_refresh_rate_summary" /> + +