From 47445745beb3d9197bc358a91a6dc15bdbf78b76 Mon Sep 17 00:00:00 2001 From: Manish Singh Date: Wed, 2 Dec 2020 06:42:07 +0000 Subject: [PATCH] Introduce new preference indicating user control. If the user enables this, then that means that we will respect user's choices for all the preferences, i.e. we will not update the preferences based on the updates from server. On the other hand, if it's disabled, then the rest of the preferences would not be considered. And we'd decide their values based on the values from the DeviceConfig (which in turn come from the server). The controller for the default-transcoding-behavior for apps was also added. Also, renaming the set prop key for enabling-transcode to match the one in DeviceConfig - transcode_enabled. And while we were at it, we renamed the stirng from "disabling transcoding for all apps" to "enabling transcoding for all apps"; and also changed the controller to enable (instead of disable) transcoding. BUG:169327180 Test: manual testing. And added unit test for TranscodeUserControlPreferenceControllerTest. Change-Id: If9b9face51b669f5177be8bfa18f44471f531058 --- res/xml/transcode_settings.xml | 10 +++ ...codeDefaultOptionPreferenceController.java | 51 ++++++++++++ ...scodeGlobalTogglePreferenceController.java | 8 +- ...nscodeUserControlPreferenceController.java | 51 ++++++++++++ ...DefaultOptionPreferenceControllerTest.java | 77 +++++++++++++++++++ ...eGlobalTogglePreferenceControllerTest.java | 14 ++-- ...deUserControlPreferenceControllerTest.java | 77 +++++++++++++++++++ 7 files changed, 277 insertions(+), 11 deletions(-) create mode 100644 src/com/android/settings/development/transcode/TranscodeDefaultOptionPreferenceController.java create mode 100644 src/com/android/settings/development/transcode/TranscodeUserControlPreferenceController.java create mode 100644 tests/robotests/src/com/android/settings/development/transcode/TranscodeDefaultOptionPreferenceControllerTest.java create mode 100644 tests/robotests/src/com/android/settings/development/transcode/TranscodeUserControlPreferenceControllerTest.java diff --git a/res/xml/transcode_settings.xml b/res/xml/transcode_settings.xml index c6fbdfd1dab..65f6cd824b4 100644 --- a/res/xml/transcode_settings.xml +++ b/res/xml/transcode_settings.xml @@ -21,11 +21,21 @@ android:title="@string/transcode_settings_title" settings:searchable="false"> + + + +