Snap for 7078355 from 050b54165f to sc-release

Change-Id: I3010d3a49fef244091951d2aac3f939af7e0f558
This commit is contained in:
android-build-team Robot
2021-01-13 02:11:54 +00:00
74 changed files with 2164 additions and 256 deletions

View File

@@ -174,7 +174,8 @@
</intent-filter>
</receiver>
<activity android:name=".SubSettings"/>
<activity android:name=".SubSettings"
android:theme="@style/Theme.SubSettings" />
<activity android:name=".Settings$CreateShortcutActivity"
android:exported="true"

View File

@@ -1,6 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="4">
<issue
id="LintError"
severity="Error"
message="No `.class` files were found in project &quot;.&quot;, so none of the classfile based checks could be run. Does the project need to be built first?"
category="Lint"
priority="10"
summary="Lint Failure"
explanation="This issue type represents a problem running lint itself. Examples include failure to find bytecode for source files (which means certain detectors could not be run), parsing errors in lint configuration files, etc.&#xA;These errors are not errors in your own code, but they are shown to make it clear that some checks were not completed.">
<location
file="."/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2273,6 +2285,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_about_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_about_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2305,6 +2333,38 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_accessibility_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_accessibility_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_accessibility_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_accessibility_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2321,6 +2381,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_accounts_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_accounts_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2337,6 +2413,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_app_and_notification_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_apps_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2353,6 +2445,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_battery_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_battery_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2369,6 +2477,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_connected_device_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_connected_device_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2385,6 +2509,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_display_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_display_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2401,6 +2541,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_emergency_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_emergency_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2417,6 +2573,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_location_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_location_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2433,6 +2605,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_network_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_network_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2465,6 +2653,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_generic_icon_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_notification_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2481,6 +2685,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_privacy_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_privacy_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2497,6 +2717,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_security_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_security_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2513,6 +2749,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_sound_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_sound_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2529,6 +2781,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_storage_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_storage_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2561,6 +2829,38 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_support_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_support_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_support_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_support_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2577,6 +2877,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_system_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_system_dashboard_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2593,6 +2909,22 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/homepage_wallpaper_background&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_homepage_wallpaper_v2.xml"
line="24"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -2957,7 +3289,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/screen_zoom_preview_1.xml"
line="44"
line="45"
column="17"/>
</issue>
@@ -2973,7 +3305,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/screen_zoom_preview_1.xml"
line="45"
line="46"
column="17"/>
</issue>
@@ -2989,7 +3321,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/screen_zoom_preview_1.xml"
line="54"
line="55"
column="17"/>
</issue>
@@ -3005,7 +3337,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/screen_zoom_preview_1.xml"
line="55"
line="56"
column="17"/>
</issue>
@@ -3021,7 +3353,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/screen_zoom_preview_1.xml"
line="64"
line="65"
column="17"/>
</issue>
@@ -3037,7 +3369,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/screen_zoom_preview_1.xml"
line="65"
line="66"
column="17"/>
</issue>
@@ -3053,7 +3385,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/screen_zoom_preview_1.xml"
line="74"
line="75"
column="17"/>
</issue>
@@ -3069,7 +3401,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/layout/screen_zoom_preview_1.xml"
line="75"
line="76"
column="17"/>
</issue>
@@ -3121,6 +3453,22 @@
column="9"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" &lt;string name=&quot;sync_plug&quot; msgid=&quot;7956982719077985381&quot;>&quot;&quot;&lt;font fgcolor=&quot;#ffffffff&quot;>&quot;Welcome to Google sync!&quot;&lt;/font>&quot; \nA Google approach to syncing data to allow access to your contacts, appointments, and more from wherever you are.&quot;&lt;/string>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="res/values-en-rXC/strings.xml"
line="2815"
column="170"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -3133,7 +3481,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="res/values-en-rAU/strings.xml"
line="2818"
line="2816"
column="64"/>
</issue>
@@ -3149,7 +3497,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="res/values-en-rCA/strings.xml"
line="2818"
line="2816"
column="64"/>
</issue>
@@ -3165,7 +3513,7 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="res/values-en-rGB/strings.xml"
line="2818"
line="2816"
column="64"/>
</issue>
@@ -3181,26 +3529,10 @@
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="res/values-en-rIN/strings.xml"
line="2818"
line="2816"
column="64"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" &lt;string name=&quot;sync_plug&quot; msgid=&quot;7956982719077985381&quot;>&quot;&quot;&lt;font fgcolor=&quot;#ffffffff&quot;>&quot;Welcome to Google sync!&quot;&lt;/font>&quot; \nA Google approach to syncing data to allow access to your contacts, appointments, and more from wherever you are.&quot;&lt;/string>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
<location
file="res/values-en-rXC/strings.xml"
line="2818"
column="170"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -3245,7 +3577,7 @@
errorLine2=" ^">
<location
file="res/values/styles.xml"
line="428"
line="434"
column="44"/>
</issue>
@@ -3261,7 +3593,7 @@
errorLine2=" ^">
<location
file="res/values/styles.xml"
line="434"
line="440"
column="44"/>
</issue>
@@ -3277,7 +3609,7 @@
errorLine2=" ^">
<location
file="res/values/styles.xml"
line="435"
line="441"
column="44"/>
</issue>
@@ -3293,7 +3625,7 @@
errorLine2=" ^">
<location
file="res/values/styles.xml"
line="471"
line="477"
column="34"/>
</issue>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_about_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_phone_info" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_accessibility_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_accessibility" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_accounts_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_accounts" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_app_and_notification_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_apps" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_battery_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_battery_white" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_connected_device_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_devices_other" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_display_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_display_white" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_emergency_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_emergency" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_location_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_location"/>
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_network_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_wireless_white" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_generic_icon_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_notifications_white" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_privacy_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_privacy"/>
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_security_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_security_white" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_sound_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_volume_up_24dp" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_storage_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_storage_white" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_support_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_help" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_system_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_system_dashboard_white" />
</layer-list>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/homepage_image_size"
android:height="@dimen/homepage_image_size"
android:color="@color/homepage_wallpaper_background" />
</item>
<item
android:width="@dimen/dashboard_tile_foreground_image_size"
android:height="@dimen/dashboard_tile_foreground_image_size"
android:start="@dimen/homepage_foreground_image_inset"
android:top="@dimen/homepage_foreground_image_inset"
android:drawable="@drawable/ic_settings_wallpaper_white" />
</layer-list>

View File

@@ -36,7 +36,7 @@
android:padding="6dp" />
</LinearLayout>
<ScrollView
<androidx.core.widget.NestedScrollView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
@@ -104,5 +104,5 @@
android:layout_marginBottom="16dp"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead" />
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View File

@@ -38,7 +38,7 @@
android:padding="6dp" />
</LinearLayout>
<ScrollView
<androidx.core.widget.NestedScrollView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
@@ -106,5 +106,5 @@
android:layout_marginBottom="16dp"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead" />
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

View File

@@ -14,17 +14,18 @@
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:layout_height="wrap_content">
<include layout="@layout/preview_seek_bar_view_pager" />
<include layout="@layout/preview_seek_bar_view_pager"/>
<LinearLayout
android:orientation="vertical"
@@ -40,7 +41,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="6dp" />
android:padding="6dp"/>
<TextView
android:id="@+id/current_label"
@@ -49,7 +50,7 @@
android:layout_gravity="center_horizontal"
android:padding="6dp"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView"
android:elevation="2dp" />
android:elevation="2dp"/>
<LinearLayout
android:layout_width="match_parent"
@@ -68,7 +69,7 @@
android:tintMode="src_in"
android:scaleType="center"
android:focusable="true"
android:contentDescription="@string/font_size_make_smaller_desc" />
android:contentDescription="@string/font_size_make_smaller_desc"/>
<com.android.settings.widget.LabeledSeekBar
android:id="@+id/seek_bar"
@@ -87,7 +88,7 @@
android:tintMode="src_in"
android:scaleType="center"
android:focusable="true"
android:contentDescription="@string/font_size_make_larger_desc" />
android:contentDescription="@string/font_size_make_larger_desc"/>
</LinearLayout>
<TextView
@@ -95,7 +96,7 @@
android:layout_height="wrap_content"
android:text="@string/font_size_summary"
android:layout_marginBottom="16dp"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead" />
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>

View File

@@ -14,7 +14,8 @@
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
@@ -57,4 +58,4 @@
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"/>
</LinearLayout>
</view>
</ScrollView>
</androidx.core.widget.NestedScrollView>

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="72dp"
android:gravity="center_vertical"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:background="?android:attr/selectableItemBackground"
android:clipToPadding="false"
android:baselineAligned="false">
<LinearLayout
android:id="@+id/icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
android:orientation="horizontal"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:layout_marginEnd="16dp">
<androidx.preference.internal.PreferenceImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:maxWidth="48dp"
app:maxHeight="48dp"/>
</LinearLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.HomepagePreferenceTitle"
android:ellipsize="marquee"/>
</RelativeLayout>
</LinearLayout>

View File

@@ -25,7 +25,7 @@
<androidx.viewpager.widget.ViewPager
android:id="@+id/preview_pager"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_height="400dp"
android:layout_weight="1"
android:background="?android:attr/colorBackgroundFloating"
android:contentDescription="@string/preview_pager_content_description" />

View File

@@ -14,17 +14,18 @@
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:layout_height="wrap_content">
<include layout="@layout/preview_seek_bar_view_pager" />
<include layout="@layout/preview_seek_bar_view_pager"/>
<LinearLayout
android:orientation="vertical"
@@ -40,7 +41,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="6dp" />
android:padding="6dp"/>
<TextView
android:id="@+id/current_label"
@@ -49,7 +50,7 @@
android:layout_gravity="center_horizontal"
android:padding="6dp"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Widget.TextView"
android:elevation="2dp" />
android:elevation="2dp"/>
<LinearLayout
android:layout_width="match_parent"
@@ -66,7 +67,7 @@
android:tintMode="src_in"
android:scaleType="center"
android:focusable="true"
android:contentDescription="@string/screen_zoom_make_smaller_desc" />
android:contentDescription="@string/screen_zoom_make_smaller_desc"/>
<com.android.settings.widget.LabeledSeekBar
android:id="@+id/seek_bar"
@@ -85,7 +86,7 @@
android:tintMode="src_in"
android:scaleType="center"
android:focusable="true"
android:contentDescription="@string/screen_zoom_make_larger_desc" />
android:contentDescription="@string/screen_zoom_make_larger_desc"/>
</LinearLayout>
<TextView
@@ -93,7 +94,7 @@
android:layout_height="wrap_content"
android:text="@string/screen_zoom_summary"
android:layout_marginBottom="16dp"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead" />
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>

View File

@@ -13,7 +13,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -75,4 +76,4 @@
app:iconBackgroundColor="@color/message_icon_background_incoming" />
</LinearLayout>
</view>
</ScrollView>
</androidx.core.widget.NestedScrollView>

View File

@@ -14,7 +14,8 @@
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
@@ -223,4 +224,4 @@
</LinearLayout>
</LinearLayout>
</view>
</ScrollView>
</androidx.core.widget.NestedScrollView>

View File

@@ -20,7 +20,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/search_bar_margin"
android:layout_marginTop="@dimen/search_bar_margin"
android:layout_marginStart="@dimen/search_bar_margin"
android:layout_marginEnd="@dimen/search_bar_margin"
android:layout_marginBottom="16dp"
app:layout_scrollFlags="scroll|enterAlways">
<com.google.android.material.card.MaterialCardView

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/content_parent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="160dp"
android:theme="@style/Theme.CollapsingToolbar.Settings">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:background="?android:attr/colorPrimary"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:maxLines="3"
app:contentScrim="?android:attr/colorPrimary"
app:collapsedTitleTextAppearance="@style/ToolbarText.Collapsed"
app:statusBarScrim="?android:attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:toolbarId="@id/tool_bar">
<androidx.appcompat.widget.Toolbar
android:id="@+id/tool_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:contentInsetStart="68dp"/>
<Toolbar
android:id="@+id/action_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="pin"
android:theme="?android:attr/actionBarTheme"/>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@@ -44,4 +44,10 @@
<style name="Theme.TabTheme" parent="@style/Theme.MaterialComponents.DayNight">
<item name="colorPrimary">@*android:color/edge_effect_device_default_dark</item>
</style>
<style name="Theme.CollapsingToolbar.Settings"
parent="@style/Theme.MaterialComponents.DayNight">
<item name="colorPrimary">@*android:color/primary_dark_device_default_settings</item>
<item name="colorAccent">@*android:color/accent_device_default_dark</item>
</style>
</resources>

View File

@@ -116,6 +116,12 @@
<!-- Dashboard foreground image inset (from background edge to foreground edge) -->
<dimen name="dashboard_tile_foreground_image_inset">6dp</dimen>
<!-- Homepage image tile size -->
<dimen name="homepage_image_size">48dp</dimen>
<!-- Homepage foreground image inset (from background edge to foreground edge) -->
<dimen name="homepage_foreground_image_inset">12dp</dimen>
<!-- Preference icon foreground image inset (from background edge to foreground edge) -->
<dimen name="preference_icon_foreground_image_inset">12dp</dimen>

View File

@@ -4950,6 +4950,8 @@
<string name="accessibility_text_and_display_title">Text and display</string>
<!-- Title for the accessibility preference category of interaction control services and settings. [CHAR LIMIT=50] -->
<string name="interaction_control_category_title">Interaction controls</string>
<!-- Title for the accessibility tap assistance page. [CHAR LIMIT=50] -->
<string name="accessibility_tap_assistance_title">Tap assistance</string>
<!-- Title for the accessibility preference category of services downloaded by the user. [CHAR LIMIT=50] -->
<string name="user_installed_services_category_title">Downloaded apps</string>
<!-- Title for the accessibility preference category of settings considered to be experimental, meaning they might be changed or removed in the future. [CHAR LIMIT=50] -->
@@ -11666,11 +11668,9 @@
<!-- Option for prevent ringing setting -->
<string name="prevent_ringing_option_none">Do nothing</string>
<!-- Summary for prevent ringing setting -->
<string name="prevent_ringing_option_vibrate_summary">On (vibrate)</string>
<string name="prevent_ringing_option_vibrate_summary">Vibrate</string>
<!-- Summary for prevent ringing setting -->
<string name="prevent_ringing_option_mute_summary">On (mute)</string>
<!-- Summary for prevent ringing setting -->
<string name="prevent_ringing_option_none_summary">Off</string>
<string name="prevent_ringing_option_mute_summary">Mute</string>
<!-- Title for detail page of wifi network [CHAR LIMIT=30] -->
<string name="pref_title_network_details">Network details</string>

View File

@@ -312,6 +312,12 @@
<item name="android:textSize">@dimen/search_bar_text_size</item>
</style>
<style name="TextAppearance.HomepagePreferenceTitle"
parent="@*android:style/TextAppearance.DeviceDefault">
<item name="android:fontFamily">google-sans</item>
<item name="android:textSize">20sp</item>
</style>
<style name="TextAppearance.HomepageCardTitle"
parent="@*android:style/TextAppearance.DeviceDefault.Subhead">
<item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item>
@@ -874,4 +880,17 @@
<item name="android:textSize">16sp</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
</style>
<style name="ToolbarText.Collapsed"
parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title">
</style>
<style name="ToolbarText"
parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title" >
<item name="android:textSize">32sp</item>
</style>
<style name="ToolbarText.MoreThanTwoLines">
<item name="android:textSize">24sp</item>
</style>
</resources>

View File

@@ -72,7 +72,7 @@
<item name="android:windowNoTitle">true</item>
</style>
<style name="Theme.SubSettings.Base" parent="Theme.Settings">
<style name="Theme.SubSettings.Base" parent="Theme.Settings.NoActionBar">
<!-- Redefine the ActionBar style for contentInsetStart -->
<item name="android:actionBarStyle">@style/Widget.ActionBar.SubSettings</item>
@@ -276,4 +276,10 @@
<style name="Theme.TabTheme" parent="@style/Theme.MaterialComponents.DayNight">
<item name="colorPrimary">@*android:color/edge_effect_device_default_light</item>
</style>
<style name="Theme.CollapsingToolbar.Settings"
parent="@style/Theme.MaterialComponents.DayNight">
<item name="colorPrimary">@*android:color/primary_device_default_settings_light</item>
<item name="colorAccent">@*android:color/accent_device_default_light</item>
</style>
</resources>

View File

@@ -65,13 +65,6 @@
android:persistent="false"
android:title="@string/interaction_control_category_title">
<Preference
android:fragment="com.android.settings.accessibility.ToggleAutoclickPreferenceFragment"
android:key="autoclick_preference"
android:persistent="false"
android:title="@string/accessibility_autoclick_preference_title"
settings:controller="com.android.settings.accessibility.AutoclickPreferenceController"/>
<SwitchPreference
android:key="toggle_power_button_ends_call_preference"
android:persistent="false"
@@ -84,21 +77,6 @@
android:title="@string/accelerometer_title"
settings:controller="com.android.settings.accessibility.LockScreenRotationPreferenceController"/>
<ListPreference
android:entries="@array/long_press_timeout_selector_list_titles"
android:entryValues="@array/long_press_timeout_selector_values"
android:key="select_long_press_timeout_preference"
android:persistent="false"
android:title="@string/accessibility_long_press_timeout_preference_title"
settings:controller="com.android.settings.accessibility.SelectLongPressTimeoutPreferenceController"/>
<Preference
android:fragment="com.android.settings.accessibility.AccessibilityControlTimeoutPreferenceFragment"
android:key="accessibility_control_timeout_preference_fragment"
android:persistent="false"
android:title="@string/accessibility_setting_item_control_timeout_title"
settings:controller="com.android.settings.accessibility.AccessibilityTimeoutPreferenceController"/>
<Preference
android:fragment="com.android.settings.accessibility.VibrationSettings"
android:key="vibration_preference_screen"
@@ -106,6 +84,13 @@
android:title="@string/accessibility_vibration_settings_title"
settings:controller="com.android.settings.accessibility.VibrationPreferenceController"/>
<Preference
android:fragment="com.android.settings.accessibility.TapAssistanceFragment"
android:key="tap_assistance_preference_screen"
android:persistent="false"
android:title="@string/accessibility_tap_assistance_title"
settings:searchable="true"/>
<Preference
android:fragment="com.android.settings.gestures.SystemNavigationGestureSettings"
android:key="gesture_system_navigation_input_summary_accessibility"

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="accessibility_tap_assistance"
android:persistent="false"
android:title="@string/accessibility_tap_assistance_title">
<ListPreference
android:entries="@array/long_press_timeout_selector_list_titles"
android:entryValues="@array/long_press_timeout_selector_values"
android:key="select_long_press_timeout_preference"
android:persistent="false"
android:title="@string/accessibility_long_press_timeout_preference_title"
settings:controller="com.android.settings.accessibility.SelectLongPressTimeoutPreferenceController"/>
<Preference
android:fragment="com.android.settings.accessibility.AccessibilityControlTimeoutPreferenceFragment"
android:key="accessibility_control_timeout_preference_fragment"
android:persistent="false"
android:title="@string/accessibility_setting_item_control_timeout_title"
settings:controller="com.android.settings.accessibility.AccessibilityTimeoutPreferenceController"/>
<Preference
android:fragment="com.android.settings.accessibility.ToggleAutoclickPreferenceFragment"
android:key="autoclick_preference"
android:persistent="false"
android:title="@string/accessibility_autoclick_preference_title"
settings:controller="com.android.settings.accessibility.AutoclickPreferenceController"/>
</PreferenceScreen>

View File

@@ -20,12 +20,6 @@
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/gesture_preference_title">
<Preference
android:key="gesture_emergency_summary"
android:title="@string/emergency_gesture_screen_title"
android:fragment="com.android.settings.gestures.EmergencyGestureSettings"
settings:controller="com.android.settings.gestures.EmergencyGestureEntrypointPreferenceController" />
<Preference
android:key="gesture_assist_input_summary"
android:title="@string/assist_gesture_title"

View File

@@ -56,13 +56,6 @@
settings:controller="com.android.settings.deviceinfo.PhoneNumberPreferenceController"
settings:enableCopying="true"/>
<Preference
android:key="emergency_info"
android:order="14"
android:title="@string/emergency_info_title"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.accounts.EmergencyInfoPreferenceController"/>
<!-- Legal information -->
<Preference
android:key="legal_container"

View File

@@ -118,7 +118,7 @@
settings:controller="com.android.settings.sound.MediaControlsParentPreferenceController"
settings:keywords="@string/keywords_media_controls"/>
<Preference
<com.android.settings.widget.PrimarySwitchPreference
android:key="gesture_prevent_ringing_sound"
android:title="@string/gesture_prevent_ringing_sound_title"
android:order="-107"

View File

@@ -0,0 +1,251 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/sound_settings"
android:key="sound_settings"
settings:keywords="@string/keywords_sounds"
settings:initialExpandedChildrenCount="9">
<!-- Remote volume group -->
<PreferenceCategory
android:key="remote_media_group"
android:title=""
android:order="-185"
settings:allowDividerBelow="true"
settings:controller="com.android.settings.notification.RemoteVolumeGroupController">
</PreferenceCategory>
<!-- Media volume -->
<com.android.settings.notification.VolumeSeekBarPreference
android:key="media_volume"
android:icon="@drawable/ic_media_stream"
android:title="@string/media_volume_option_title"
android:order="-180"
settings:controller="com.android.settings.notification.MediaVolumePreferenceController"/>
<!-- Media output switcher -->
<Preference
android:key="media_output"
android:title="@string/media_output_title"
android:dialogTitle="@string/media_output_title"
android:order="-175"
settings:searchable="false"
settings:controller="com.android.settings.sound.MediaOutputPreferenceController"/>
<!-- Call volume -->
<com.android.settings.notification.VolumeSeekBarPreference
android:key="call_volume"
android:icon="@drawable/ic_local_phone_24_lib"
android:title="@string/call_volume_option_title"
android:order="-170"
settings:controller="com.android.settings.notification.CallVolumePreferenceController"/>
<!-- Hands free profile output switcher -->
<ListPreference
android:key="take_call_on_output"
android:title="@string/take_call_on_title"
android:dialogTitle="@string/take_call_on_title"
android:order="-165"
settings:searchable="false"
settings:controller="com.android.settings.sound.HandsFreeProfileOutputPreferenceController"/>
<!-- Ring volume -->
<com.android.settings.notification.VolumeSeekBarPreference
android:key="ring_volume"
android:icon="@drawable/ic_notifications"
android:title="@string/ring_volume_option_title"
android:order="-160"
settings:controller="com.android.settings.notification.RingVolumePreferenceController"/>
<!-- Alarm volume -->
<com.android.settings.notification.VolumeSeekBarPreference
android:key="alarm_volume"
android:icon="@*android:drawable/ic_audio_alarm"
android:title="@string/alarm_volume_option_title"
android:order="-150"
settings:controller="com.android.settings.notification.AlarmVolumePreferenceController"/>
<!-- Notification volume -->
<com.android.settings.notification.VolumeSeekBarPreference
android:key="notification_volume"
android:icon="@drawable/ic_notifications"
android:title="@string/notification_volume_option_title"
android:order="-140"
settings:controller="com.android.settings.notification.NotificationVolumePreferenceController"/>
<!-- Also vibrate for calls -->
<Preference
android:fragment="com.android.settings.sound.VibrateForCallsPreferenceFragment"
android:key="vibrate_for_calls"
android:title="@string/vibrate_when_ringing_title"
android:order="-130"
settings:controller="com.android.settings.sound.VibrateForCallsPreferenceController"
settings:keywords="@string/keywords_vibrate_for_calls"/>
<!-- Interruptions -->
<com.android.settingslib.RestrictedPreference
android:key="zen_mode"
android:title="@string/zen_mode_settings_title"
android:fragment="com.android.settings.notification.zen.ZenModeSettings"
android:order="-120"
settings:useAdminDisabledSummary="true"
settings:keywords="@string/keywords_sounds_and_notifications_interruptions"
settings:allowDividerAbove="true"
settings:controller="com.android.settings.notification.zen.ZenModePreferenceController"/>
<Preference
android:key="media_controls_summary"
android:title="@string/media_controls_title"
android:fragment="com.android.settings.sound.MediaControlsSettings"
android:order="-110"
settings:controller="com.android.settings.sound.MediaControlsParentPreferenceController"
settings:keywords="@string/keywords_media_controls"/>
<com.android.settings.widget.PrimarySwitchPreference
android:key="gesture_prevent_ringing_sound"
android:title="@string/gesture_prevent_ringing_sound_title"
android:order="-107"
android:fragment="com.android.settings.gestures.PreventRingingGestureSettings"
settings:controller="com.android.settings.gestures.PreventRingingParentPreferenceController"/>
<!-- Phone ringtone -->
<com.android.settings.DefaultRingtonePreference
android:key="phone_ringtone"
android:title="@string/ringtone_title"
android:dialogTitle="@string/ringtone_title"
android:summary="@string/summary_placeholder"
android:ringtoneType="ringtone"
android:order="-100"
settings:keywords="@string/sound_settings"/>
<!-- Default notification ringtone -->
<com.android.settings.DefaultRingtonePreference
android:key="notification_ringtone"
android:title="@string/notification_ringtone_title"
android:dialogTitle="@string/notification_ringtone_title"
android:summary="@string/summary_placeholder"
android:ringtoneType="notification"
android:order="-90"/>
<!-- Default alarm ringtone -->
<com.android.settings.DefaultRingtonePreference
android:key="alarm_ringtone"
android:title="@string/alarm_ringtone_title"
android:dialogTitle="@string/alarm_ringtone_title"
android:summary="@string/summary_placeholder"
android:persistent="false"
android:ringtoneType="alarm"
android:order="-80"/>
<!-- Other sounds -->
<PreferenceCategory
android:key="other_sounds_and_vibrations_category"
android:title="@string/other_sound_category_preference_title"
android:order="-50">
<!-- Dial pad tones -->
<SwitchPreference
android:key="dial_pad_tones"
android:title="@string/dial_pad_tones_title"/>
<!-- Screen locking sounds -->
<SwitchPreference
android:key="screen_locking_sounds"
android:title="@string/screen_locking_sounds_title"/>
<!-- Charging sounds -->
<SwitchPreference
android:key="charging_sounds"
android:title="@string/charging_sounds_title"/>
<!-- Docking sounds -->
<SwitchPreference
android:key="docking_sounds"
android:title="@string/docking_sounds_title"/>
<!-- Touch sounds -->
<SwitchPreference
android:key="touch_sounds"
android:title="@string/touch_sounds_title"/>
<!-- Vibrate on touch -->
<SwitchPreference
android:key="vibrate_on_touch"
android:title="@string/vibrate_on_touch_title"
android:summary="@string/vibrate_on_touch_summary"
settings:keywords="@string/keywords_vibrate_on_touch"/>
<!-- Dock speaker plays -->
<DropDownPreference
android:key="dock_audio_media"
android:title="@string/dock_audio_media_title"
android:summary="%s"/>
<!-- Boot sounds -->
<SwitchPreference
android:key="boot_sounds"
android:title="@string/boot_sounds_title"/>
<!-- Emergency tone -->
<DropDownPreference
android:key="emergency_tone"
android:title="@string/emergency_tone_title"
android:summary="%s"/>
</PreferenceCategory>
<com.android.settings.widget.WorkOnlyCategory
android:key="sound_work_settings_section"
android:title="@string/sound_work_settings"
android:order="100">
<!-- Use the same sounds of the work profile -->
<SwitchPreference
android:key="work_use_personal_sounds"
android:title="@string/work_use_personal_sounds_title"
android:summary="@string/work_use_personal_sounds_summary"
android:disableDependentsState="true"/>
<!-- Work phone ringtone -->
<com.android.settings.DefaultRingtonePreference
android:key="work_ringtone"
android:title="@string/work_ringtone_title"
android:dialogTitle="@string/work_alarm_ringtone_title"
android:ringtoneType="ringtone"
android:dependency="work_use_personal_sounds"/>
<!-- Default work notification ringtone -->
<com.android.settings.DefaultRingtonePreference
android:key="work_notification_ringtone"
android:title="@string/work_notification_ringtone_title"
android:dialogTitle="@string/work_alarm_ringtone_title"
android:ringtoneType="notification"
android:dependency="work_use_personal_sounds"/>
<!-- Default work alarm ringtone -->
<com.android.settings.DefaultRingtonePreference
android:key="work_alarm_ringtone"
android:title="@string/work_alarm_ringtone_title"
android:dialogTitle="@string/work_alarm_ringtone_title"
android:persistent="false"
android:ringtoneType="alarm"
android:dependency="work_use_personal_sounds"/>
</com.android.settings.widget.WorkOnlyCategory>
</PreferenceScreen>

View File

@@ -125,13 +125,12 @@
android:fragment="com.android.settings.accessibility.AccessibilitySettings"
settings:controller="com.android.settings.accessibility.TopLevelAccessibilityPreferenceController"/>
<!-- TODO(b/175158310): Enable this tile when the setting content is more flushed out-->
<!-- <Preference-->
<!-- android:key="top_level_emergency"-->
<!-- android:title="@string/emergency_settings_preference_title"-->
<!-- android:icon="@drawable/ic_homepage_emergency"-->
<!-- android:order="-10"-->
<!-- android:fragment="com.android.settings.emergency.EmergencyDashboardFragment"/>-->
<Preference
android:key="top_level_emergency"
android:title="@string/emergency_settings_preference_title"
android:icon="@drawable/ic_homepage_emergency"
android:order="-10"
android:fragment="com.android.settings.emergency.EmergencyDashboardFragment"/>
<Preference
android:key="top_level_system"

View File

@@ -20,17 +20,17 @@
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="top_level_settings_grouped">
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.network.NetworkDashboardFragment"
android:icon="@drawable/ic_homepage_network"
android:icon="@drawable/ic_homepage_network_v2"
android:key="top_level_network"
android:order="-140"
android:title="@string/network_dashboard_title"
settings:controller="com.android.settings.network.TopLevelNetworkEntryPreferenceController"/>
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment"
android:icon="@drawable/ic_homepage_connected_device"
android:icon="@drawable/ic_homepage_connected_device_v2"
android:key="top_level_connected_devices"
android:order="-130"
android:title="@string/connected_devices_dashboard_title"
@@ -40,16 +40,16 @@
android:key="apps"
android:order="-120"
settings:allowDividerAbove="false">
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.applications.AppAndNotificationDashboardFragment"
android:icon="@drawable/ic_homepage_apps"
android:icon="@drawable/ic_homepage_apps_v2"
android:key="top_level_apps_and_notifs"
android:order="-120"
android:title="@string/apps_dashboard_title"/>
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.notification.ConfigureNotificationSettings"
android:icon="@drawable/ic_homepage_notification"
android:icon="@drawable/ic_homepage_notification_v2"
android:key="top_level_notification"
android:order="-110"
android:title="@string/configure_notification_settings"/>
@@ -61,47 +61,47 @@
android:key="phone_essential"
android:order="-100"
settings:allowDividerAbove="false">
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.fuelgauge.PowerUsageSummary"
android:icon="@drawable/ic_homepage_battery"
android:icon="@drawable/ic_homepage_battery_v2"
android:key="top_level_battery"
android:order="-100"
android:title="@string/power_usage_summary_title"
settings:controller="com.android.settings.fuelgauge.TopLevelBatteryPreferenceController"/>
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.deviceinfo.StorageSettings"
android:icon="@drawable/ic_homepage_storage"
android:icon="@drawable/ic_homepage_storage_v2"
android:key="top_level_storage"
android:order="-90"
android:title="@string/storage_settings"
settings:controller="com.android.settings.deviceinfo.TopLevelStoragePreferenceController"/>
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.notification.SoundSettings"
android:icon="@drawable/ic_homepage_sound"
android:icon="@drawable/ic_homepage_sound_v2"
android:key="top_level_sound"
android:order="-80"
android:title="@string/sound_settings"/>
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.DisplaySettings"
android:icon="@drawable/ic_homepage_display"
android:icon="@drawable/ic_homepage_display_v2"
android:key="top_level_display"
android:order="-70"
android:title="@string/display_settings"
settings:controller="com.android.settings.display.TopLevelDisplayPreferenceController"/>
<com.android.settingslib.RestrictedTopLevelPreference
android:icon="@drawable/ic_homepage_wallpaper"
<com.android.settings.homepage.RestrictedHomepagePreference
android:icon="@drawable/ic_homepage_wallpaper_v2"
android:key="top_level_wallpaper"
android:order="-60"
android:title="@string/wallpaper_settings_title"
settings:controller="com.android.settings.display.TopLevelWallpaperPreferenceController"/>
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.accessibility.AccessibilitySettings"
android:icon="@drawable/ic_homepage_accessibility"
android:icon="@drawable/ic_homepage_accessibility_v2"
android:key="top_level_accessibility"
android:order="-50"
android:title="@string/accessibility_settings"
@@ -112,44 +112,44 @@
android:key="privacy_and_security"
android:order="-40"
settings:allowDividerAbove="false">
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.privacy.PrivacyDashboardFragment"
android:icon="@drawable/ic_homepage_privacy"
android:icon="@drawable/ic_homepage_privacy_v2"
android:key="top_level_privacy"
android:order="-40"
android:title="@string/privacy_dashboard_title"/>
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.location.LocationSettings"
android:icon="@drawable/ic_homepage_location"
android:icon="@drawable/ic_homepage_location_v2"
android:key="top_level_location"
android:order="-30"
android:title="@string/location_settings_title"
settings:controller="com.android.settings.location.TopLevelLocationPreferenceController"/>
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.security.SecuritySettings"
android:icon="@drawable/ic_homepage_security"
android:icon="@drawable/ic_homepage_security_v2"
android:key="top_level_security"
android:order="-20"
android:title="@string/security_settings_title"
settings:controller="com.android.settings.security.TopLevelSecurityEntryPreferenceController"/>
<!-- TODO(b/175158310): Enable this tile when the setting content is more flushed out-->
<!-- <Preference-->
<!-- android:key="top_level_emergency"-->
<!-- android:title="@string/emergency_settings_preference_title"-->
<!-- android:icon="@drawable/ic_homepage_emergency"-->
<!-- android:order="-10"-->
<!-- android:fragment="com.android.settings.emergency.EmergencyDashboardFragment"/>-->
<com.android.settings.homepage.HomePagePreference
android:key="top_level_emergency"
android:title="@string/emergency_settings_preference_title"
android:icon="@drawable/ic_homepage_emergency_v2"
android:order="-10"
android:fragment="com.android.settings.emergency.EmergencyDashboardFragment"/>
</PreferenceCategory>
<PreferenceCategory
android:key="accounts"
android:order="-10"
settings:allowDividerAbove="false">
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.accounts.AccountDashboardFragment"
android:icon="@drawable/ic_homepage_accounts"
android:icon="@drawable/ic_homepage_accounts_v2"
android:key="top_level_accounts"
android:order="-10"
android:title="@string/account_dashboard_title"
@@ -160,23 +160,23 @@
android:key="system"
android:order="10"
settings:allowDividerAbove="false">
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.system.SystemDashboardFragment"
android:icon="@drawable/ic_homepage_system_dashboard"
android:icon="@drawable/ic_homepage_system_dashboard_v2"
android:key="top_level_system"
android:order="10"
android:title="@string/header_category_system"/>
<Preference
<com.android.settings.homepage.HomePagePreference
android:fragment="com.android.settings.deviceinfo.aboutphone.MyDeviceInfoFragment"
android:icon="@drawable/ic_homepage_about"
android:icon="@drawable/ic_homepage_about_v2"
android:key="top_level_about_device"
android:order="20"
android:title="@string/about_settings"
settings:controller="com.android.settings.deviceinfo.aboutphone.TopLevelAboutDevicePreferenceController"/>
<Preference
android:icon="@drawable/ic_homepage_support"
<com.android.settings.homepage.HomePagePreference
android:icon="@drawable/ic_homepage_support_v2"
android:key="top_level_support"
android:order="100"
android:title="@string/page_tab_title_support"

View File

@@ -288,7 +288,9 @@ public class SettingsActivity extends SettingsBaseActivity
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(!isInSetupWizard);
actionBar.setHomeButtonEnabled(!isInSetupWizard);
actionBar.setDisplayShowTitleEnabled(true);
// TODO(b/176882938): Enable title after material component updated
// If CollapsingToolbarLayout is applied, the old action bar won't show title.
actionBar.setDisplayShowTitleEnabled(mCollapsingToolbarLayout == null);
}
mSwitchBar = findViewById(R.id.switch_bar);
if (mSwitchBar != null) {

View File

@@ -26,6 +26,7 @@ import android.content.pm.PackageManager;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.FeatureFlagUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -42,6 +43,7 @@ import androidx.preference.PreferenceScreen;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.InstrumentedPreferenceFragment;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.search.actionbar.SearchMenuController;
@@ -126,8 +128,11 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
SearchMenuController.init(this /* host */);
HelpMenuController.init(this /* host */);
// TODO(b/176883483): Remove both search and help menu if this feature rolled out
if (!FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)) {
SearchMenuController.init(this /* host */);
HelpMenuController.init(this /* host */);
}
if (icicle != null) {
mPreferenceHighlighted = icicle.getBoolean(SAVE_HIGHLIGHTED_KEY);

View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2021 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.
*/
package com.android.settings.accessibility;
import android.app.settings.SettingsEnums;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.SearchIndexable;
/** Accessibility settings for tap assistance. */
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class TapAssistanceFragment extends DashboardFragment {
private static final String TAG = "TapAssistanceFragment";
@Override
public int getMetricsCategory() {
return SettingsEnums.ACCESSIBILITY_TAP_ASSISTANCE;
}
@Override
protected int getPreferenceScreenResId() {
return R.xml.accessibility_tap_assistance;
}
@Override
protected String getLogTag() {
return TAG;
}
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.accessibility_tap_assistance);
}

View File

@@ -29,6 +29,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.ArraySet;
import android.util.FeatureFlagUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -43,8 +44,11 @@ import com.android.settings.SubSettings;
import com.android.settings.dashboard.CategoryManager;
import com.android.settingslib.drawer.Tile;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.setupcompat.util.WizardManagerHelper;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -55,6 +59,7 @@ public class SettingsBaseActivity extends FragmentActivity {
protected static final boolean DEBUG_TIMING = false;
private static final String TAG = "SettingsBaseActivity";
private static final String DATA_SCHEME_PKG = "package";
private static final int TOOLBAR_MAX_LINE_NUMBER = 2;
// Serves as a temporary list of tiles to ignore until we heard back from the PM that they
// are disabled.
@@ -62,6 +67,8 @@ public class SettingsBaseActivity extends FragmentActivity {
private final PackageReceiver mPackageReceiver = new PackageReceiver();
private final List<CategoryListener> mCategoryListeners = new ArrayList<>();
protected CollapsingToolbarLayout mCollapsingToolbarLayout;
private int mCategoriesUpdateTaskCount;
@Override
@@ -79,21 +86,30 @@ public class SettingsBaseActivity extends FragmentActivity {
requestWindowFeature(Window.FEATURE_NO_TITLE);
}
// Apply SetupWizard light theme during setup flow. This is for SubSettings pages.
if (WizardManagerHelper.isAnySetupWizard(getIntent()) && this instanceof SubSettings) {
final boolean isAnySetupWizard = WizardManagerHelper.isAnySetupWizard(getIntent());
if (isAnySetupWizard && this instanceof SubSettings) {
setTheme(R.style.LightTheme_SubSettings_SetupWizard);
}
super.setContentView(R.layout.settings_base_layout);
if (FeatureFlagUtils.isEnabled(this, FeatureFlags.SILKY_HOME)
&& isToolbarEnabled() && !isAnySetupWizard) {
super.setContentView(R.layout.settings_collapsing_base_layout);
mCollapsingToolbarLayout = findViewById(R.id.collapsing_toolbar);
} else {
super.setContentView(R.layout.settings_base_layout);
}
// This is to hide the toolbar from those pages which don't need a toolbar originally.
final Toolbar toolbar = findViewById(R.id.action_bar);
if (theme.getBoolean(android.R.styleable.Theme_windowNoTitle, false)) {
if (!isToolbarEnabled() || isAnySetupWizard) {
toolbar.setVisibility(View.GONE);
return;
}
setActionBar(toolbar);
initCollapsingToolbar();
if (DEBUG_TIMING) {
Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime)
+ " ms");
Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime) + " ms");
}
}
@@ -151,6 +167,70 @@ public class SettingsBaseActivity extends FragmentActivity {
((ViewGroup) findViewById(R.id.content_frame)).addView(view, params);
}
@Override
public void setTitle(CharSequence title) {
if (mCollapsingToolbarLayout != null) {
mCollapsingToolbarLayout.setTitle(title);
}
super.setTitle(title);
}
@Override
public void setTitle(int titleId) {
if (mCollapsingToolbarLayout != null) {
mCollapsingToolbarLayout.setTitle(getText(titleId));
}
super.setTitle(titleId);
}
/**
* SubSetting page should show a toolbar by default. If the page wouldn't show a toolbar,
* override this method and return false value.
* @return ture by default
*/
protected boolean isToolbarEnabled() {
return true;
}
private void initCollapsingToolbar() {
if (mCollapsingToolbarLayout == null) {
return;
}
mCollapsingToolbarLayout.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) {
v.removeOnLayoutChangeListener(this);
final int count = getLineCount();
if (count > TOOLBAR_MAX_LINE_NUMBER) {
mCollapsingToolbarLayout
.setExpandedTitleTextAppearance(R.style.ToolbarText_MoreThanTwoLines);
} else {
mCollapsingToolbarLayout.setExpandedTitleTextAppearance(R.style.ToolbarText);
}
}
});
}
private int getLineCount() {
try {
final Class<?> toolbarClazz = mCollapsingToolbarLayout.getClass();
final Field textHelperField = toolbarClazz.getDeclaredField("collapsingTextHelper");
textHelperField.setAccessible(true);
final Object textHelperObj = textHelperField.get(mCollapsingToolbarLayout);
final Field layoutField = textHelperObj.getClass().getDeclaredField("textLayout");
layoutField.setAccessible(true);
final Object layoutObj = layoutField.get(textHelperObj);
final Method method = layoutObj.getClass().getDeclaredMethod("getLineCount");
return (int) method.invoke(layoutObj);
} catch (Exception e) {
return 0;
}
}
private void onCategoriesChanged(Set<String> categories) {
final int N = mCategoryListeners.size();
for (int i = 0; i < N; i++) {

View File

@@ -25,6 +25,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.FeatureFlagUtils;
import android.util.Log;
import androidx.preference.Preference;
@@ -32,6 +33,8 @@ import androidx.preference.PreferenceScreen;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.FeatureFlags;
import com.android.settings.homepage.RestrictedHomepagePreference;
import com.android.settingslib.RestrictedLockUtilsInternal;
import com.android.settingslib.RestrictedTopLevelPreference;
@@ -89,7 +92,11 @@ public class TopLevelWallpaperPreferenceController extends BasePreferenceControl
@Override
public void updateState(Preference preference) {
disablePreferenceIfManaged((RestrictedTopLevelPreference) preference);
if (FeatureFlagUtils.isEnabled(mContext, FeatureFlags.SILKY_HOME)) {
disablePreferenceIfManaged((RestrictedHomepagePreference) preference);
} else {
disablePreferenceIfManaged((RestrictedTopLevelPreference) preference);
}
}
@Override
@@ -133,4 +140,18 @@ public class TopLevelWallpaperPreferenceController extends BasePreferenceControl
}
}
}
private void disablePreferenceIfManaged(RestrictedHomepagePreference pref) {
final String restriction = DISALLOW_SET_WALLPAPER;
if (pref != null) {
pref.setDisabledByAdmin(null);
if (RestrictedLockUtilsInternal.hasBaseUserRestriction(mContext,
restriction, UserHandle.myUserId())) {
// Do not show the admin dialog for system restriction.
pref.setEnabled(false);
} else {
pref.checkRestrictionAndSetDisabled(restriction);
}
}
}
}

View File

@@ -20,20 +20,84 @@ import static android.provider.Settings.Secure.VOLUME_HUSH_GESTURE;
import static android.provider.Settings.Secure.VOLUME_HUSH_MUTE;
import static android.provider.Settings.Secure.VOLUME_HUSH_VIBRATE;
import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;
import android.provider.Settings;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
public class PreventRingingParentPreferenceController extends BasePreferenceController {
import com.android.settings.R;
import com.android.settings.core.TogglePreferenceController;
import com.android.settings.widget.PrimarySwitchPreference;
import com.android.settingslib.core.lifecycle.LifecycleObserver;
import com.android.settingslib.core.lifecycle.events.OnStart;
import com.android.settingslib.core.lifecycle.events.OnStop;
/** The controller manages the behaviour of the Prevent Ringing gesture setting. */
public class PreventRingingParentPreferenceController extends TogglePreferenceController
implements LifecycleObserver, OnStart, OnStop {
final String SECURE_KEY = VOLUME_HUSH_GESTURE;
private PrimarySwitchPreference mPreference;
private SettingObserver mSettingObserver;
public PreventRingingParentPreferenceController(Context context, String preferenceKey) {
super(context, preferenceKey);
}
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
mPreference = screen.findPreference(getPreferenceKey());
mSettingObserver = new SettingObserver(mPreference);
}
@Override
public boolean isChecked() {
final int preventRinging = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.VOLUME_HUSH_GESTURE,
Settings.Secure.VOLUME_HUSH_VIBRATE);
return preventRinging != Settings.Secure.VOLUME_HUSH_OFF;
}
@Override
public boolean setChecked(boolean isChecked) {
final int preventRingingSetting = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.VOLUME_HUSH_GESTURE, Settings.Secure.VOLUME_HUSH_VIBRATE);
final int newRingingSetting = preventRingingSetting == Settings.Secure.VOLUME_HUSH_OFF
? Settings.Secure.VOLUME_HUSH_VIBRATE
: preventRingingSetting;
return Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.VOLUME_HUSH_GESTURE, isChecked
? newRingingSetting
: Settings.Secure.VOLUME_HUSH_OFF);
}
@Override
public void updateState(Preference preference) {
super.updateState(preference);
final int value = Settings.Secure.getInt(
mContext.getContentResolver(), SECURE_KEY, VOLUME_HUSH_VIBRATE);
CharSequence summary;
switch (value) {
case VOLUME_HUSH_VIBRATE:
summary = mContext.getText(R.string.prevent_ringing_option_vibrate_summary);
break;
case VOLUME_HUSH_MUTE:
summary = mContext.getText(R.string.prevent_ringing_option_mute_summary);
break;
default:
summary = null;
}
preference.setSummary(summary);
}
@Override
public int getAvailabilityStatus() {
return mContext.getResources().getBoolean(
@@ -42,20 +106,45 @@ public class PreventRingingParentPreferenceController extends BasePreferenceCont
}
@Override
public CharSequence getSummary() {
int value = Settings.Secure.getInt(
mContext.getContentResolver(), SECURE_KEY, VOLUME_HUSH_VIBRATE);
int summary;
switch (value) {
case VOLUME_HUSH_VIBRATE:
summary = R.string.prevent_ringing_option_vibrate_summary;
break;
case VOLUME_HUSH_MUTE:
summary = R.string.prevent_ringing_option_mute_summary;
break;
default:
summary = R.string.prevent_ringing_option_none_summary;
public void onStart() {
if (mSettingObserver != null) {
mSettingObserver.register(mContext.getContentResolver());
mSettingObserver.onChange(false, null);
}
}
@Override
public void onStop() {
if (mSettingObserver != null) {
mSettingObserver.unregister(mContext.getContentResolver());
}
}
private class SettingObserver extends ContentObserver {
private final Uri mVolumeHushGestureUri = Settings.Secure.getUriFor(
Settings.Secure.VOLUME_HUSH_GESTURE);
private final Preference mPreference;
SettingObserver(Preference preference) {
super(new Handler());
mPreference = preference;
}
public void register(ContentResolver cr) {
cr.registerContentObserver(mVolumeHushGestureUri, false, this);
}
public void unregister(ContentResolver cr) {
cr.unregisterContentObserver(this);
}
@Override
public void onChange(boolean selfChange, Uri uri) {
super.onChange(selfChange, uri);
if (uri == null || mVolumeHushGestureUri.equals(uri)) {
updateState(mPreference);
}
}
return mContext.getText(summary);
}
}

View File

@@ -16,11 +16,7 @@
package com.android.settings.gestures;
import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;
import android.provider.Settings;
import android.widget.Switch;
@@ -39,7 +35,6 @@ public class PreventRingingSwitchPreferenceController extends AbstractPreference
private static final String KEY = "gesture_prevent_ringing_switch";
private final Context mContext;
private SettingObserver mSettingObserver;
@VisibleForTesting
SwitchBar mSwitch;
@@ -60,7 +55,6 @@ public class PreventRingingSwitchPreferenceController extends AbstractPreference
if (isAvailable()) {
LayoutPreference pref = screen.findPreference(getPreferenceKey());
if (pref != null) {
mSettingObserver = new SettingObserver(pref);
pref.setOnPreferenceClickListener(preference -> {
int preventRinging = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.VOLUME_HUSH_GESTURE,
@@ -113,32 +107,4 @@ public class PreventRingingSwitchPreferenceController extends AbstractPreference
? newRingingSetting
: Settings.Secure.VOLUME_HUSH_OFF);
}
private class SettingObserver extends ContentObserver {
private final Uri VOLUME_HUSH_GESTURE = Settings.Secure.getUriFor(
Settings.Secure.VOLUME_HUSH_GESTURE);
private final Preference mPreference;
public SettingObserver(Preference preference) {
super(new Handler());
mPreference = preference;
}
public void register(ContentResolver cr) {
cr.registerContentObserver(VOLUME_HUSH_GESTURE, false, this);
}
public void unregister(ContentResolver cr) {
cr.unregisterContentObserver(this);
}
@Override
public void onChange(boolean selfChange, Uri uri) {
super.onChange(selfChange, uri);
if (uri == null || VOLUME_HUSH_GESTURE.equals(uri)) {
updateState(mPreference);
}
}
}
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright (C) 2021 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.
*/
package com.android.settings.homepage;
import android.content.Context;
import android.util.AttributeSet;
import androidx.preference.Preference;
import com.android.settings.R;
/** A customized layout for homepage preference. */
public class HomePagePreference extends Preference {
public HomePagePreference(Context context) {
super(context);
setLayoutResource(R.layout.homepage_preference);
}
public HomePagePreference(Context context, AttributeSet attrs) {
super(context, attrs);
setLayoutResource(R.layout.homepage_preference);
}
public HomePagePreference(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, /* defStyleRes= */ 0);
setLayoutResource(R.layout.homepage_preference);
}
public HomePagePreference(Context context, AttributeSet attrs,
int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
setLayoutResource(R.layout.homepage_preference);
}
}

View File

@@ -0,0 +1,122 @@
/*
* Copyright (C) 2021 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.
*/
package com.android.settings.homepage;
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
import android.content.Context;
import android.os.UserHandle;
import android.util.AttributeSet;
import androidx.core.content.res.TypedArrayUtils;
import androidx.preference.PreferenceManager;
import androidx.preference.PreferenceViewHolder;
import com.android.settings.R;
import com.android.settingslib.RestrictedPreferenceHelper;
/** Homepage preference that can be disabled by a device admin using a user restriction. */
public class RestrictedHomepagePreference extends HomePagePreference {
private RestrictedPreferenceHelper mHelper;
public RestrictedHomepagePreference(Context context, AttributeSet attrs,
int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
mHelper = new RestrictedPreferenceHelper(context, /* preference= */ this, attrs);
}
public RestrictedHomepagePreference(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, /* defStyleRes= */ 0);
}
public RestrictedHomepagePreference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.preferenceStyle,
android.R.attr.preferenceStyle));
}
public RestrictedHomepagePreference(Context context) {
this(context, /* attrs= */ null);
}
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
mHelper.onBindViewHolder(holder);
}
@Override
public void performClick() {
if (!mHelper.performClick()) {
super.performClick();
}
}
@Override
protected void onAttachedToHierarchy(PreferenceManager preferenceManager) {
mHelper.onAttachedToHierarchy();
super.onAttachedToHierarchy(preferenceManager);
}
/**
* Set the user restriction and disable this preference.
*
* @param userRestriction constant from {@link android.os.UserManager}
*/
public void checkRestrictionAndSetDisabled(String userRestriction) {
mHelper.checkRestrictionAndSetDisabled(userRestriction, UserHandle.myUserId());
}
/**
* Set the user restriction and disable this preference for the given user.
*
* @param userRestriction constant from {@link android.os.UserManager}
* @param userId user to check the restriction for.
*/
public void checkRestrictionAndSetDisabled(String userRestriction, int userId) {
mHelper.checkRestrictionAndSetDisabled(userRestriction, userId);
}
@Override
public void setEnabled(boolean enabled) {
if (enabled && isDisabledByAdmin()) {
mHelper.setDisabledByAdmin(/* admin= */ null);
return;
}
super.setEnabled(enabled);
}
/**
* Check whether this preference is disabled by admin.
*
* @return true if this preference is disabled by admin.
*/
public boolean isDisabledByAdmin() {
return mHelper.isDisabledByAdmin();
}
/**
* Disable preference based on the enforce admin.
*
* @param admin details of the admin who enforced the restriction. If it is {@code null}, then
* this preference will be enabled. Otherwise, it will be disabled.
*/
public void setDisabledByAdmin(EnforcedAdmin admin) {
if (mHelper.setDisabledByAdmin(admin)) {
notifyChanged();
}
}
}

View File

@@ -143,8 +143,8 @@ public class FaceSetupSlice implements CustomSliceable {
private static RowBuilder buildRowBuilder(CharSequence title, CharSequence subTitle,
IconCompat icon, Context context, Intent intent) {
final SliceAction primarySliceAction = SliceAction.createDeeplink(
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_MUTABLE_UNAUDITED), icon, ListBuilder.ICON_IMAGE,
title);
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE),
icon, ListBuilder.ICON_IMAGE, title);
return new RowBuilder()
.setTitleItem(icon, ListBuilder.ICON_IMAGE)
.setTitle(title)

View File

@@ -26,6 +26,7 @@ import android.database.Cursor;
import android.os.Bundle;
import android.provider.UserDictionary;
import android.text.TextUtils;
import android.util.FeatureFlagUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@@ -44,6 +45,7 @@ import androidx.loader.app.LoaderManager;
import androidx.loader.content.Loader;
import com.android.settings.R;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.core.instrumentation.Instrumentable;
@@ -104,6 +106,10 @@ public class UserDictionarySettings extends ListFragment implements Instrumentab
@Override
public View onCreateView(
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// TODO(b/176883483): Remove the title after material component updated
if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)) {
getActivity().setTitle(R.string.user_dict_settings_title);
}
// Show the language as a subtitle of the action bar
final ActionBar actionBar = getActivity().getActionBar();
if (actionBar != null) {

View File

@@ -99,7 +99,8 @@ public abstract class EuiccOperationSidecar extends SidecarFragment {
Intent intent = new Intent(getReceiverAction());
intent.putExtra(EXTRA_OP_ID, mOpId);
return PendingIntent.getBroadcast(
getContext(), REQUEST_CODE, intent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
getContext(), REQUEST_CODE, intent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
@Override

View File

@@ -172,8 +172,8 @@ public class MobileDataSlice implements CustomSliceable {
private PendingIntent getPrimaryAction() {
final Intent intent = getIntent();
return PendingIntent.getActivity(mContext, 0 /* requestCode */,
intent, PendingIntent.FLAG_MUTABLE_UNAUDITED /* flags */);
return PendingIntent.getActivity(mContext, 0 /* requestCode */, intent,
PendingIntent.FLAG_IMMUTABLE);
}
/**

View File

@@ -115,6 +115,9 @@ public class MobileNetworkActivity extends SettingsBaseActivity
final ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
// TODO(b/176882938): Enable title after material component updated
// If CollapsingToolbarLayout is applied, the old action bar won't show title.
actionBar.setDisplayShowTitleEnabled(mCollapsingToolbarLayout == null);
}
getProxySubscriptionManager().setLifecycle(getLifecycle());

View File

@@ -77,6 +77,11 @@ public class RedactionInterstitial extends SettingsActivity {
findViewById(R.id.content_parent).setFitsSystemWindows(false);
}
@Override
protected boolean isToolbarEnabled() {
return false;
}
/**
* Create an intent for launching RedactionInterstitial.
*

View File

@@ -26,6 +26,7 @@ import android.os.Message;
import android.os.UserHandle;
import android.preference.SeekBarVolumizer;
import android.text.TextUtils;
import android.util.FeatureFlagUtils;
import androidx.annotation.VisibleForTesting;
import androidx.preference.ListPreference;
@@ -33,6 +34,7 @@ import androidx.preference.Preference;
import com.android.settings.R;
import com.android.settings.RingtonePreference;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.OnActivityResultListener;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -152,6 +154,9 @@ public class SoundSettings extends DashboardFragment implements OnActivityResult
@Override
protected int getPreferenceScreenResId() {
if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlags.SILKY_HOME)) {
return R.xml.sound_settings_v2;
}
return R.xml.sound_settings;
}

View File

@@ -34,10 +34,6 @@ import java.util.List;
/**
* Represents the Internet Connectivity Panel.
*
* <p>
* Displays Wifi (full Slice) and Airplane mode.
* </p>
*/
public class InternetConnectivityPanel implements PanelContent {
@@ -78,6 +74,21 @@ public class InternetConnectivityPanel implements PanelContent {
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
@Override
public boolean isCustomizedButtonUsed() {
return Utils.isProviderModelEnabled(mContext);
}
@Override
public CharSequence getCustomizedButtonTitle() {
return mContext.getText(R.string.settings_button);
}
@Override
public void onClickCustomizedButton() {
mContext.startActivity(getSeeMoreIntent());
}
@Override
public int getMetricsCategory() {
return SettingsEnums.PANEL_INTERNET_CONNECTIVITY;

View File

@@ -452,13 +452,13 @@ public class PanelFragment extends Fragment {
View.OnClickListener getSeeMoreListener() {
return (v) -> {
mPanelClosedKey = PanelClosedKeys.KEY_SEE_MORE;
final FragmentActivity activity = getActivity();
if (mPanel.isCustomizedButtonUsed()) {
mPanel.onClickCustomizedButton();
} else {
final FragmentActivity activity = getActivity();
activity.startActivityForResult(mPanel.getSeeMoreIntent(), 0);
activity.finish();
}
activity.finish();
};
}

View File

@@ -184,6 +184,11 @@ public class ChooseLockPassword extends SettingsActivity {
return false;
}
@Override
protected boolean isToolbarEnabled() {
return false;
}
/* package */ Class<? extends Fragment> getFragmentClass() {
return ChooseLockPasswordFragment.class;
}

View File

@@ -194,6 +194,11 @@ public class ChooseLockPattern extends SettingsActivity {
return super.onKeyDown(keyCode, event);
}
@Override
protected boolean isToolbarEnabled() {
return false;
}
public static class ChooseLockPatternFragment extends InstrumentedFragment
implements SaveAndFinishWorker.Listener {

View File

@@ -176,6 +176,11 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi
}
}
@Override
protected boolean isToolbarEnabled() {
return false;
}
public void prepareEnterAnimation() {
getFragment().prepareEnterAnimation();
}

View File

@@ -24,7 +24,6 @@ import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
@@ -65,8 +64,7 @@ public class SetupChooseLockPassword extends ChooseLockPassword {
@Override
protected void onCreate(Bundle savedInstance) {
super.onCreate(savedInstance);
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent);
layout.setFitsSystemWindows(false);
findViewById(R.id.content_parent).setFitsSystemWindows(false);
}
public static class SetupChooseLockPasswordFragment extends ChooseLockPasswordFragment

View File

@@ -226,7 +226,7 @@ public class SimSelectNotification extends BroadcastReceiver {
resultIntent.setPackage(SETTINGS_PACKAGE_NAME);
resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
builder.setContentIntent(resultPendingIntent);
NotificationManager notificationManager =
(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
@@ -264,7 +264,7 @@ public class SimSelectNotification extends BroadcastReceiver {
resultIntent.putExtra(Settings.EXTRA_SUB_ID, subId);
resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
builder.setContentIntent(resultPendingIntent);
// Notify the notification.
@@ -312,7 +312,7 @@ public class SimSelectNotification extends BroadcastReceiver {
resultIntent.putExtra(Intent.EXTRA_TEXT, "help_uri_sim_combination_warning");
PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
builder.setContentIntent(resultPendingIntent);
NotificationManager notificationManager =

View File

@@ -18,9 +18,9 @@ package com.android.settings.wifi.calling;
import static android.app.slice.Slice.EXTRA_TOGGLE_STATE;
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
import static com.android.settings.slices.CustomSliceRegistry.WIFI_CALLING_PREFERENCE_URI;
import static com.android.settings.slices.CustomSliceRegistry.WIFI_CALLING_URI;
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
import android.app.PendingIntent;
import android.content.ComponentName;
@@ -539,7 +539,8 @@ public class WifiCallingSliceHelper {
*/
public static PendingIntent getSettingsIntent(Context context) {
final Intent intent = new Intent(Settings.ACTION_SETTINGS);
return PendingIntent.getActivity(context, 0 /* requestCode */, intent, PendingIntent.FLAG_MUTABLE_UNAUDITED /* flags */);
return PendingIntent.getActivity(context, 0 /* requestCode */, intent,
PendingIntent.FLAG_IMMUTABLE);
}
private PendingIntent getBroadcastIntent(String action) {
@@ -547,7 +548,7 @@ public class WifiCallingSliceHelper {
intent.setClass(mContext, SliceBroadcastReceiver.class);
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
return PendingIntent.getBroadcast(mContext, 0 /* requestCode */, intent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
/**
@@ -557,7 +558,8 @@ public class WifiCallingSliceHelper {
final Intent intent = new Intent(action);
intent.setPackage(SETTINGS_PACKAGE_NAME);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return PendingIntent.getActivity(mContext, 0 /* requestCode */, intent, PendingIntent.FLAG_MUTABLE_UNAUDITED /* flags */);
return PendingIntent.getActivity(mContext, 0 /* requestCode */, intent,
PendingIntent.FLAG_IMMUTABLE);
}
private Resources getResourcesForSubId(int subId) {

View File

@@ -0,0 +1,49 @@
/*
* Copyright (C) 2021 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.
*/
package com.android.settings.accessibility;
import static com.google.common.truth.Truth.assertThat;
import android.content.Context;
import androidx.test.core.app.ApplicationProvider;
import com.android.settings.R;
import com.android.settings.testutils.XmlTestUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import java.util.List;
@RunWith(RobolectricTestRunner.class)
/** Tests for {@link TapAssistanceFragment}. */
public class TapAssistanceFragmentTest {
private Context mContext = ApplicationProvider.getApplicationContext();
@Test
public void getNonIndexableKeys_existInXmlLayout() {
final List<String> niks = TapAssistanceFragment.SEARCH_INDEX_DATA_PROVIDER
.getNonIndexableKeys(mContext);
final List<String> keys =
XmlTestUtils.getKeysFromPreferenceXml(mContext, R.xml.accessibility_tap_assistance);
assertThat(keys).containsAtLeastElementsIn(niks);
}
}

View File

@@ -88,14 +88,16 @@ public class PlatformCompatDashboardTest {
public void setUp() throws RemoteException, NameNotFoundException {
MockitoAnnotations.initMocks(this);
mChanges = new CompatibilityChangeInfo[5];
mChanges[0] = new CompatibilityChangeInfo(1L, "Default_Enabled", 0, 0, false, false, "");
mChanges[1] = new CompatibilityChangeInfo(2L, "Default_Disabled", 0, 0, true, false, "");
mChanges[2] = new CompatibilityChangeInfo(3L, "Enabled_Since_SDK_1_1", -1, 1, false, false,
"");
mChanges[3] = new CompatibilityChangeInfo(4L, "Enabled_Since_SDK_1_2", -1, 1, false, false,
"");
mChanges[4] = new CompatibilityChangeInfo(5L, "Enabled_Since_SDK_2", -1, 2, false, false,
"");
mChanges[0] = new CompatibilityChangeInfo(
1L, "Default_Enabled", 0, 0, false, false, "", false);
mChanges[1] = new CompatibilityChangeInfo(
2L, "Default_Disabled", 0, 0, true, false, "", false);
mChanges[2] = new CompatibilityChangeInfo(
3L, "Enabled_Since_SDK_1_1", -1, 1, false, false, "", false);
mChanges[3] = new CompatibilityChangeInfo(
4L, "Enabled_Since_SDK_1_2", -1, 1, false, false, "", false);
mChanges[4] = new CompatibilityChangeInfo(
5L, "Enabled_Since_SDK_2", -1, 2, false, false, "", false);
when(mPlatformCompat.listUIChanges()).thenReturn(mChanges);
when(mPlatformCompat.getOverrideValidator()).thenReturn(mOverrideValidator);
// By default, allow any change
@@ -208,7 +210,8 @@ public class PlatformCompatDashboardTest {
for (int i = 0; i < mChanges.length; ++i) {
changesToAdd.add(new CompatibilityChangeInfo(mChanges[i].getId(), mChanges[i].getName(),
-1, mChanges[i].getEnableSinceTargetSdk(), mChanges[i].getDisabled(),
mChanges[i].getLoggingOnly(), mChanges[i].getDescription()));
mChanges[i].getLoggingOnly(), mChanges[i].getDescription(),
mChanges[i].getOverridable()));
}
PreferenceCategory category = mDashboard.createChangeCategoryPreference(changesToAdd,

View File

@@ -32,6 +32,8 @@ import android.content.Context;
import android.content.res.Resources;
import android.provider.Settings;
import androidx.preference.Preference;
import com.android.settings.R;
import org.junit.Before;
@@ -50,12 +52,14 @@ public class PreventRingingParentPreferenceControllerTest {
private Context mContext;
private PreventRingingParentPreferenceController mController;
private Preference mPreference;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application.getApplicationContext());
mController = new PreventRingingParentPreferenceController(mContext, "test_key");
mPreference = new Preference(mContext);
}
@Test
@@ -80,17 +84,43 @@ public class PreventRingingParentPreferenceControllerTest {
public void updateState_summaryUpdated() {
Settings.Secure.putInt(mContext.getContentResolver(), VOLUME_HUSH_GESTURE,
VOLUME_HUSH_MUTE);
assertThat(mController.getSummary()).isEqualTo(mContext.getResources().getText(
mController.updateState(mPreference);
assertThat(mPreference.getSummary()).isEqualTo(mContext.getResources().getText(
R.string.prevent_ringing_option_mute_summary));
Settings.Secure.putInt(mContext.getContentResolver(), VOLUME_HUSH_GESTURE,
VOLUME_HUSH_VIBRATE);
assertThat(mController.getSummary()).isEqualTo(mContext.getResources().getText(
mController.updateState(mPreference);
assertThat(mPreference.getSummary()).isEqualTo(mContext.getResources().getText(
R.string.prevent_ringing_option_vibrate_summary));
Settings.Secure.putInt(mContext.getContentResolver(), VOLUME_HUSH_GESTURE,
VOLUME_HUSH_OFF);
assertThat(mController.getSummary()).isEqualTo(mContext.getResources().getText(
R.string.prevent_ringing_option_none_summary));
mController.updateState(mPreference);
assertThat(mPreference.getSummary()).isEqualTo(null);
}
@Test
public void isChecked_vibrate_shouldReturnTrue() {
Settings.Secure.putInt(mContext.getContentResolver(), VOLUME_HUSH_GESTURE,
VOLUME_HUSH_VIBRATE);
assertThat(mController.isChecked()).isTrue();
}
@Test
public void isChecked_mute_shouldReturnTrue() {
Settings.Secure.putInt(mContext.getContentResolver(), VOLUME_HUSH_GESTURE,
VOLUME_HUSH_MUTE);
assertThat(mController.isChecked()).isTrue();
}
@Test
public void isChecked_off_shouldReturnFalse() {
Settings.Secure.putInt(mContext.getContentResolver(), VOLUME_HUSH_GESTURE,
VOLUME_HUSH_OFF);
assertThat(mController.isChecked()).isFalse();
}
}

View File

@@ -20,10 +20,12 @@ package com.android.settings.panel;
import static com.google.common.truth.Truth.assertThat;
import android.net.Uri;
import android.os.SystemProperties;
import com.android.settings.network.AirplaneModePreferenceController;
import com.android.settings.slices.CustomSliceRegistry;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -37,14 +39,25 @@ import java.util.List;
public class InternetConnectivityPanelTest {
private InternetConnectivityPanel mPanel;
private static final String SETTINGS_PROVIDER_MODEL =
"persist.sys.fflag.override.settings_provider_model";
private boolean mSettingsProviderModelState;
@Before
public void setUp() {
mPanel = InternetConnectivityPanel.create(RuntimeEnvironment.application);
mSettingsProviderModelState = SystemProperties.getBoolean(SETTINGS_PROVIDER_MODEL, false);
}
@After
public void tearDown() {
SystemProperties.set(SETTINGS_PROVIDER_MODEL,
mSettingsProviderModelState ? "true" : "false");
}
@Test
public void getSlices_containsNecessarySlices() {
public void getSlices_providerModelDisabled_containsNecessarySlices() {
SystemProperties.set(SETTINGS_PROVIDER_MODEL, "false");
final List<Uri> uris = mPanel.getSlices();
assertThat(uris).containsExactly(
@@ -53,6 +66,16 @@ public class InternetConnectivityPanelTest {
CustomSliceRegistry.WIFI_SLICE_URI);
}
@Test
public void getSlices_providerModelEnabled_containsNecessarySlices() {
SystemProperties.set(SETTINGS_PROVIDER_MODEL, "true");
final List<Uri> uris = mPanel.getSlices();
assertThat(uris).containsExactly(
CustomSliceRegistry.PROVIDER_MODEL_SLICE_URI,
CustomSliceRegistry.AIRPLANE_SAFE_NETWORKS_SLICE_URI);
}
@Test
public void getSeeMoreIntent_notNull() {
assertThat(mPanel.getSeeMoreIntent()).isNotNull();

View File

@@ -59,6 +59,7 @@ import android.provider.Settings;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import com.android.settings.R;
import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
@@ -89,6 +90,8 @@ public class SimSelectNotificationTest {
private Resources mResources;
@Mock
private SubscriptionInfo mSubInfo;
@Mock
private DisplayMetrics mDisplayMetrics;
private final String mFakeDisplayName = "fake_display_name";
private final CharSequence mFakeNotificationChannelTitle = "fake_notification_channel_title";
@@ -141,6 +144,9 @@ public class SimSelectNotificationTest {
.thenReturn(mFakeDualCdmaWarningTitle);
when(mResources.getString(R.string.dual_cdma_sim_warning_notification_summary,
mSimCombinationName)).thenReturn(mFakeDualCdmaWarningSummary);
when(mResources.getDisplayMetrics()).thenReturn(mDisplayMetrics);
mDisplayMetrics.density = 1.5f;
}
@Test
@@ -275,4 +281,3 @@ public class SimSelectNotificationTest {
assertThat(notification.getValue().contentIntent).isNotNull();
}
}

View File

@@ -397,14 +397,15 @@ public class WifiCallingSliceHelperTest {
final Intent intent = new Intent(action);
intent.setClass(mContext, SliceBroadcastReceiver.class);
return PendingIntent.getBroadcast(mContext, 0 /* requestCode */, intent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
private PendingIntent getActivityIntent(String action) {
final Intent intent = new Intent(action);
intent.setPackage(SETTINGS_PACKAGE_NAME);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return PendingIntent.getActivity(mContext, 0 /* requestCode */, intent, PendingIntent.FLAG_MUTABLE_UNAUDITED /* flags */);
return PendingIntent.getActivity(mContext, 0 /* requestCode */, intent,
PendingIntent.FLAG_IMMUTABLE);
}
private void assertTitle(List<SliceItem> sliceItems, String title) {