Add ScreenResolutionController to Settings app

Settings for resolution switch

Bug: b/199559703
Test: Check resolution switch UI in Settings app
      atest SettingsUnitTests:ScreenResolutionControllerTest
      atest SettingsUnitTests:ScreenResolutionFragmentTest

Change-Id: I46d3be3b82ca512b8672efaa489df2cdaab26d6d
Merged-In: I46d3be3b82ca512b8672efaa489df2cdaab26d6d
This commit is contained in:
Amy Hsu
2022-02-09 13:58:16 +08:00
committed by Tsung-Mao Fang
parent c08c6c5c16
commit 0dea418d57
10 changed files with 572 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape>
</shape>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape>
</shape>

View File

@@ -583,6 +583,18 @@
-->
</string-array>
<!-- The option list for switch screen resolution -->
<string-array name="config_screen_resolution_options_strings" translatable="false">
<item>@string/screen_resolution_option_high</item>
<item>@string/screen_resolution_option_highest</item>
</string-array>
<!-- The option summary list for screen resolution -->
<string-array name="config_screen_resolution_summaries_strings" translatable="false">
<item>@string/screen_resolution_summary_high</item>
<item>@string/screen_resolution_summary_highest</item>
</string-array>
<!-- Whether to aggregate for network selection list-->
<bool name="config_network_selection_list_aggregation_enabled">false</bool>

View File

@@ -2908,6 +2908,18 @@
<string name="auto_rotate_option_face_based">On - Face-based</string>
<!-- SmartAutoRotatePreferenceFragment settings screen, face-based rotation switch label [CHAR LIMIT=30] -->
<string name="auto_rotate_switch_face_based">Enable Face Detection</string>
<!-- Display settings screen, screen resolution settings title [CHAR LIMIT=30] -->
<string name="screen_resolution_title">Screen resolution</string>
<!-- Display settings screen, screen resolution option for "FHD+" [CHAR LIMIT=45] -->
<string name="screen_resolution_option_high">High resolution</string>
<!-- Display settings screen, screen resolution option for "QHD+" [CHAR LIMIT=45] -->
<string name="screen_resolution_option_highest">Highest resolution</string>
<!-- Display settings screen, "FHD+" screen resolution summary [CHAR LIMIT=NONE] -->
<string name="screen_resolution_summary_high">1080p FHD+</string>
<!-- Display settings screen, "QHD+" screen resolution summary [CHAR LIMIT=NONE] -->
<string name="screen_resolution_summary_highest">1440p QHD+</string>
<!-- Display settings screen, Color mode settings title [CHAR LIMIT=30] -->
<string name="color_mode_title">Colors</string>
<!-- Display settings screen, Color mode option for "natural(sRGB) color" [CHAR LIMIT=45] -->
@@ -8265,6 +8277,8 @@
<string name="keywords_default_apps">apps, default</string>
<string name="keywords_ignore_optimizations">ignore optimizations, doze, app standby</string>
<string name="keywords_color_mode">vibrant, RGB, sRGB, color, natural, standard</string>
<!-- Search keyword for "screen resolution" settings [CHAR_LIMIT=NONE]-->
<string name="keywords_screen_resolution">FHD, QHD, resolution, 1080p, 1440p</string>
<string name="keywords_color_temperature">color, temperature, D65, D73, white, yellow, blue, warm, cool</string>
<string name="keywords_lockscreen">slide to unlock, password, pattern, PIN</string>
<!-- Search keyword for App pinning Settings [CHAR LIMIT=NONE] -->

View File

@@ -117,6 +117,13 @@
settings:keywords="@string/keywords_auto_rotate"
settings:controller="com.android.settings.display.DeviceStateAutoRotateOverviewController"/>
<Preference
android:key="screen_resolution"
android:title="@string/screen_resolution_title"
android:fragment="com.android.settings.display.ScreenResolutionFragment"
settings:keywords="@string/keywords_screen_resolution"
settings:controller="com.android.settings.display.ScreenResolutionController"/>
<SwitchPreference
android:key="display_white_balance"
android:title="@string/display_white_balance_title"

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/screen_resolution_title"
android:key="screen_resolution" />