Merge "Check targetsdk for filtering partial overlay touches" into sc-dev
diff --git a/PermissionController/AndroidManifest.xml b/PermissionController/AndroidManifest.xml
index 652da21..a6fee58 100644
--- a/PermissionController/AndroidManifest.xml
+++ b/PermissionController/AndroidManifest.xml
@@ -121,7 +121,7 @@
         <activity android:name="com.android.permissioncontroller.permission.ui.ManagePermissionsActivity"
                   android:configChanges="orientation|keyboardHidden|screenSize"
                   android:label="@string/app_permissions"
-                  android:theme="@style/Settings.FilterTouches"
+                  android:theme="@style/Theme.PermissionController.Settings.FilterTouches"
                   android:permission="android.permission.GRANT_RUNTIME_PERMISSIONS">
             <intent-filter android:priority="1">
                 <action android:name="android.intent.action.MANAGE_APP_PERMISSIONS" />
@@ -148,7 +148,7 @@
 
         <activity android:name="com.android.permissioncontroller.permission.ui.legacy.AppPermissionActivity"
                   android:configChanges="orientation|keyboardHidden|screenSize"
-                  android:theme="@style/Settings.FilterTouches"
+                  android:theme="@style/Theme.PermissionController.Settings.FilterTouches"
                   android:permission="android.permission.GRANT_RUNTIME_PERMISSIONS">
         </activity>
 
@@ -210,7 +210,7 @@
 
         <activity android:name="com.android.permissioncontroller.role.ui.DefaultAppListActivity"
                   android:label="@string/default_apps"
-                  android:theme="@style/Settings.FilterTouches">
+                  android:theme="@style/Theme.PermissionController.Settings.FilterTouches">
             <intent-filter android:priority="2">
                 <action android:name="android.settings.MANAGE_DEFAULT_APPS_SETTINGS" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -219,7 +219,7 @@
 
         <activity android:name="com.android.permissioncontroller.role.ui.DefaultAppActivity"
                   android:permission="android.permission.MANAGE_ROLE_HOLDERS"
-                  android:theme="@style/Settings.FilterTouches">
+                  android:theme="@style/Theme.PermissionController.Settings.FilterTouches">
             <intent-filter android:priority="1">
                 <action android:name="android.intent.action.MANAGE_DEFAULT_APP" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -239,7 +239,7 @@
         <activity android:name="com.android.permissioncontroller.role.ui.SpecialAppAccessListActivity"
                   android:label="@string/special_app_access"
                   android:permission="android.permission.MANAGE_ROLE_HOLDERS"
-                  android:theme="@style/Settings.FilterTouches">
+                  android:theme="@style/Theme.PermissionController.Settings.FilterTouches">
             <intent-filter android:priority="1">
                 <action android:name="android.intent.action.MANAGE_SPECIAL_APP_ACCESSES" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -248,7 +248,7 @@
 
         <!-- TODO: Override other Settings intents when we've done migrating them. -->
         <activity android:name="com.android.permissioncontroller.role.ui.SpecialAppAccessActivity"
-                  android:theme="@style/Settings.FilterTouches" />
+                  android:theme="@style/Theme.PermissionController.Settings.FilterTouches" />
 
         <activity android:name="com.android.permissioncontroller.role.ui.RoleSearchTrampolineActivity"
                   android:excludeFromRecents="true"
diff --git a/PermissionController/res/color-v31/privacy_dash_graphic_pref_dark_mic.xml b/PermissionController/res/color-v31/privacy_dash_graphic_pref_dark_mic.xml
new file mode 100644
index 0000000..d743def
--- /dev/null
+++ b/PermissionController/res/color-v31/privacy_dash_graphic_pref_dark_mic.xml
@@ -0,0 +1,19 @@
+<?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.
+  -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@android:color/system_accent1_500" android:lStar="70" />
+</selector>
\ No newline at end of file
diff --git a/PermissionController/res/color-v31/privacy_dash_graphic_pref_dark_others.xml b/PermissionController/res/color-v31/privacy_dash_graphic_pref_dark_others.xml
new file mode 100644
index 0000000..a7e3d94
--- /dev/null
+++ b/PermissionController/res/color-v31/privacy_dash_graphic_pref_dark_others.xml
@@ -0,0 +1,19 @@
+<?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.
+  -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@android:color/system_accent2_500" android:lStar="98" />
+</selector>
\ No newline at end of file
diff --git a/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_camera.xml b/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_camera.xml
new file mode 100644
index 0000000..2dd7a2b
--- /dev/null
+++ b/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_camera.xml
@@ -0,0 +1,19 @@
+<?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.
+  -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@android:color/system_accent1_500" android:lStar="56" />
+</selector>
\ No newline at end of file
diff --git a/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_location.xml b/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_location.xml
new file mode 100644
index 0000000..5cc267d
--- /dev/null
+++ b/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_location.xml
@@ -0,0 +1,19 @@
+<?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.
+  -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@android:color/system_accent3_500" android:lStar="38" />
+</selector>
\ No newline at end of file
diff --git a/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_mic.xml b/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_mic.xml
new file mode 100644
index 0000000..49d85ef
--- /dev/null
+++ b/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_mic.xml
@@ -0,0 +1,19 @@
+<?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.
+  -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@android:color/system_accent1_500" android:lStar="14" />
+</selector>
\ No newline at end of file
diff --git a/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_others.xml b/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_others.xml
new file mode 100644
index 0000000..720cfd2
--- /dev/null
+++ b/PermissionController/res/color-v31/privacy_dash_graphic_pref_light_others.xml
@@ -0,0 +1,19 @@
+<?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.
+  -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@android:color/system_accent2_500" android:lStar="56" />
+</selector>
\ No newline at end of file
diff --git a/PermissionController/res/drawable/coarse_off_dark.gif b/PermissionController/res/drawable/coarse_off_dark.gif
index 5e350a4..209c07a 100644
--- a/PermissionController/res/drawable/coarse_off_dark.gif
+++ b/PermissionController/res/drawable/coarse_off_dark.gif
Binary files differ
diff --git a/PermissionController/res/drawable/coarse_off_light.gif b/PermissionController/res/drawable/coarse_off_light.gif
index 57b36e5..ace6858 100644
--- a/PermissionController/res/drawable/coarse_off_light.gif
+++ b/PermissionController/res/drawable/coarse_off_light.gif
Binary files differ
diff --git a/PermissionController/res/drawable/coarse_on_dark.gif b/PermissionController/res/drawable/coarse_on_dark.gif
index d6d09d1..74b2f2f 100644
--- a/PermissionController/res/drawable/coarse_on_dark.gif
+++ b/PermissionController/res/drawable/coarse_on_dark.gif
Binary files differ
diff --git a/PermissionController/res/drawable/coarse_on_light.gif b/PermissionController/res/drawable/coarse_on_light.gif
index b34741b..b66d5d7 100644
--- a/PermissionController/res/drawable/coarse_on_light.gif
+++ b/PermissionController/res/drawable/coarse_on_light.gif
Binary files differ
diff --git a/PermissionController/res/drawable/fine_off_dark.gif b/PermissionController/res/drawable/fine_off_dark.gif
index 9287173..124d8b9 100644
--- a/PermissionController/res/drawable/fine_off_dark.gif
+++ b/PermissionController/res/drawable/fine_off_dark.gif
Binary files differ
diff --git a/PermissionController/res/drawable/fine_off_light.gif b/PermissionController/res/drawable/fine_off_light.gif
index 1fe3c33..b15cc3d 100644
--- a/PermissionController/res/drawable/fine_off_light.gif
+++ b/PermissionController/res/drawable/fine_off_light.gif
Binary files differ
diff --git a/PermissionController/res/drawable/fine_on_dark.gif b/PermissionController/res/drawable/fine_on_dark.gif
index 713bdf0..49773a7 100644
--- a/PermissionController/res/drawable/fine_on_dark.gif
+++ b/PermissionController/res/drawable/fine_on_dark.gif
Binary files differ
diff --git a/PermissionController/res/drawable/fine_on_light.gif b/PermissionController/res/drawable/fine_on_light.gif
index 34a1cb1..47ba22f 100644
--- a/PermissionController/res/drawable/fine_on_light.gif
+++ b/PermissionController/res/drawable/fine_on_light.gif
Binary files differ
diff --git a/PermissionController/res/layout-v31/expand_button_with_large_title.xml b/PermissionController/res/layout-v31/expand_button_with_large_title.xml
index 8cee1c3..589a587 100644
--- a/PermissionController/res/layout-v31/expand_button_with_large_title.xml
+++ b/PermissionController/res/layout-v31/expand_button_with_large_title.xml
@@ -20,6 +20,7 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:textDirection="locale"
     android:minHeight="?android:attr/listPreferredItemHeightSmall"
     android:gravity="center_vertical"
     android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
diff --git a/PermissionController/res/values-te/strings.xml b/PermissionController/res/values-te/strings.xml
index 032a64a..076e5c3 100644
--- a/PermissionController/res/values-te/strings.xml
+++ b/PermissionController/res/values-te/strings.xml
@@ -39,15 +39,15 @@
     <string name="permission_revoked_count" msgid="4785082705441547086">"<xliff:g id="COUNT">%1$d</xliff:g> నిలిపివేయబడ్డాయి"</string>
     <string name="permission_revoked_all" msgid="3397649017727222283">"అన్నీ నిలిపివేయబడ్డాయి"</string>
     <string name="permission_revoked_none" msgid="9213345075484381180">"ఏవీ నిలిపివేయబడలేదు"</string>
-    <string name="grant_dialog_button_allow" msgid="5314677880021102550">"అనుమతించు"</string>
+    <string name="grant_dialog_button_allow" msgid="5314677880021102550">"అనుమతించండి"</string>
     <string name="grant_dialog_button_allow_always" msgid="4485552579273565981">"ఎల్ల‌ప్పుడూ అనుమతించు"</string>
     <string name="grant_dialog_button_allow_foreground" msgid="501896824973636533">"యాప్‌ను ఉపయోగిస్తున్నప్పుడు"</string>
     <string name="grant_dialog_button_change_to_precise_location" msgid="3273115879467236033">"ఖచ్చితమైన లొకేషన్‌కు మార్చండి"</string>
     <string name="grant_dialog_button_keey_approximate_location" msgid="438025182769080011">"లొకేషన్‌ను సుమారుగా ఉంచండి"</string>
     <string name="grant_dialog_button_allow_one_time" msgid="2618088516449706391">"ఈ ఒక్కసారి మాత్రమే"</string>
     <string name="grant_dialog_button_allow_background" msgid="8236044729434367833">"అన్ని సమయాలలో అనుమతించు"</string>
-    <string name="grant_dialog_button_allow_all_files" msgid="4955436994954829894">"అన్ని ఫైల్‌ల నిర్వహణకు అనుమతించండి"</string>
-    <string name="grant_dialog_button_allow_media_only" msgid="4832877658422573832">"మీడియా ఫైల్‌లను యాక్సెస్ చేయడానికి అనుమతించండి"</string>
+    <string name="grant_dialog_button_allow_all_files" msgid="4955436994954829894">"అన్ని ఫైళ్ల నిర్వహణకు అనుమతించండి"</string>
+    <string name="grant_dialog_button_allow_media_only" msgid="4832877658422573832">"మీడియా ఫైళ్లను యాక్సెస్ చేయడానికి అనుమతించండి"</string>
     <string name="app_permissions_breadcrumb" msgid="5136969550489411650">"యాప్‌లు"</string>
     <string name="app_permissions" msgid="3369917736607944781">"యాప్ అనుమతులు"</string>
     <string name="unused_apps" msgid="2058057455175955094">"ఉపయోగించని యాప్‌లు"</string>
@@ -201,8 +201,8 @@
     <string name="app_permission_usage_title" msgid="6676802437831981822">"యాప్ అనుమతుల వినియోగం"</string>
     <string name="app_permission_usage_summary" msgid="390383661936709672">"యాక్సెస్: <xliff:g id="NUM">%1$s</xliff:g> సార్లు. మొత్తం వ్యవధి: <xliff:g id="DURATION">%2$s</xliff:g>. <xliff:g id="TIME">%3$s</xliff:g> క్రితం చివరిగా ఉపయోగించబడింది."</string>
     <string name="app_permission_usage_summary_no_duration" msgid="3698475875179457400">"యాక్సెస్: <xliff:g id="NUM">%1$s</xliff:g> సార్లు. <xliff:g id="TIME">%2$s</xliff:g> క్రితం చివరిగా ఉపయోగించబడింది."</string>
-    <string name="app_permission_button_allow" msgid="5808039516494774647">"అనుమతించు"</string>
-    <string name="app_permission_button_allow_all_files" msgid="1792232272599018825">"అన్ని ఫైల్‌ల నిర్వహణకు అనుమతించండి"</string>
+    <string name="app_permission_button_allow" msgid="5808039516494774647">"అనుమతించండి"</string>
+    <string name="app_permission_button_allow_all_files" msgid="1792232272599018825">"అన్ని ఫైళ్ల నిర్వహణకు అనుమతించండి"</string>
     <string name="app_permission_button_allow_media_only" msgid="2834282724426046154">"మీడియాకు మాత్రమే యాక్సెస్‌ను అనుమతించు"</string>
     <string name="app_permission_button_allow_always" msgid="4573292371734011171">"అన్ని సమయాలలో అనుమతించు"</string>
     <string name="app_permission_button_allow_foreground" msgid="1991570451498943207">"యాప్‌ను ఉపయోగిస్తున్నప్పుడు మాత్రమే అనుమతించు"</string>
@@ -234,12 +234,12 @@
     <string name="auto_revoked_app_summary_two" msgid="1910545340763709389">"<xliff:g id="PERMISSION_NAME_0">%1$s</xliff:g> మరియు <xliff:g id="PERMISSION_NAME_1">%2$s</xliff:g> అనుమతులు తీసివేయబడ్డాయి"</string>
     <string name="auto_revoked_app_summary_many" msgid="5930976230827378798">"<xliff:g id="PERMISSION_NAME">%1$s</xliff:g>, మరో <xliff:g id="NUMBER">%2$s</xliff:g> ఇతర అనుమతులు తీసివేయబడ్డాయి"</string>
     <string name="unused_apps_page_title" msgid="6986983535677572559">"ఉపయోగించని యాప్‌లు"</string>
-    <string name="unused_apps_page_summary" msgid="1867593913217272155">"యాప్‌ను కొన్ని నెలలు ఉపయోగించకపోతే:\n\n• మీ డేటాను రక్షించడానికి అనుమతులు తీసివేయబడతాయి\n• బ్యాటరీని సేవ్ చేయడానికి నోటిఫికేషన్‌లు ఆపివేయబడతాయి\n• స్పేస్‌ను ఖాళీ చేయడానికి తాత్కాలిక ఫైల్‌లు తీసివేయబడతాయి\n\nఅనుమతులు, నోటిఫికేషన్‌లను మళ్ళీ అనుమతించడానికి యాప్‌ను తెరవండి."</string>
+    <string name="unused_apps_page_summary" msgid="1867593913217272155">"యాప్‌ను కొన్ని నెలలు ఉపయోగించకపోతే:\n\n• మీ డేటాను రక్షించడానికి అనుమతులు తీసివేయబడతాయి\n• బ్యాటరీని సేవ్ చేయడానికి నోటిఫికేషన్‌లు ఆపివేయబడతాయి\n• స్పేస్‌ను ఖాళీ చేయడానికి తాత్కాలిక ఫైళ్లు తీసివేయబడతాయి\n\nఅనుమతులు, నోటిఫికేషన్‌లను మళ్ళీ అనుమతించడానికి యాప్‌ను తెరవండి."</string>
     <string name="last_opened_category_title" msgid="7871347400611202595">"చివరిసారిగా <xliff:g id="NUMBER">%s</xliff:g> నెలల కంటే ముందు తెరవబడింది"</string>
     <string name="last_opened_summary" msgid="5248984030024968808">"యాప్ చివరిసారిగా <xliff:g id="DATE">%s</xliff:g> తేదీన తెరవబడింది"</string>
     <string name="last_opened_summary_short" msgid="1646067226191176825">"చివరిగా తెరిచినది <xliff:g id="DATE">%s</xliff:g>"</string>
-    <string name="app_permission_footer_special_file_access" msgid="1884202176147657788">"మీరు అన్ని ఫైల్‌ల మేనేజ్‌మెంట్‌కు అనుమతిస్తే,ఈ పరికరంలో లేదా కనెక్ట్ చేయబడిన స్టోరేజ్ పరికరాలలో ఉమ్మడి స్టోరేజ్‌లోని ఏ ఫైల్‌లను అయినా ఈ యాప్ యాక్సెస్ చేయగలదు, సవరించగలదు, లేదా తొలగించగలదు. యాప్ మీ అనుమతి తీసుకోకుండానే ఫైల్‌లను యాక్సెస్ చేయవచ్చు."</string>
-    <string name="special_file_access_dialog" msgid="583804114020740610">"ఈ పరికరంలో లేదా ఏవైనా కనెక్ట్ చేయబడిన స్టోరేజ్ పరికరాలలో ఫైల్‌లను యాక్సెస్ చేయడానికి, సవరించడానికి, లేదా తొలగించడానికి ఈ యాప్‌నకు అనుమతి ఇవ్వాలా? ఈ యాప్ మీ అనుమతి తీసుకోకుండానే ఫైల్‌లను యాక్సెస్ చేయవచ్చు."</string>
+    <string name="app_permission_footer_special_file_access" msgid="1884202176147657788">"మీరు అన్ని ఫైళ్ల మేనేజ్‌మెంట్‌కు అనుమతిస్తే,ఈ పరికరంలో లేదా కనెక్ట్ చేయబడిన స్టోరేజ్ పరికరాలలో ఉమ్మడి స్టోరేజ్‌లోని ఏ ఫైళ్లను అయినా ఈ యాప్ యాక్సెస్ చేయగలదు, సవరించగలదు, లేదా తొలగించగలదు. యాప్ మీ అనుమతి తీసుకోకుండానే ఫైళ్లను యాక్సెస్ చేయవచ్చు."</string>
+    <string name="special_file_access_dialog" msgid="583804114020740610">"ఈ పరికరంలో లేదా ఏవైనా కనెక్ట్ చేయబడిన స్టోరేజ్ పరికరాలలో ఫైళ్లను యాక్సెస్ చేయడానికి, సవరించడానికి, లేదా తొలగించడానికి ఈ యాప్‌నకు అనుమతి ఇవ్వాలా? ఈ యాప్ మీ అనుమతి తీసుకోకుండానే ఫైళ్లను యాక్సెస్ చేయవచ్చు."</string>
     <string name="permission_description_summary_generic" msgid="5401399408814903391">"ఈ యాప్‌ల‌కు ఈ అనుమ‌తి ఇస్తుంది- <xliff:g id="DESCRIPTION">%1$s</xliff:g>"</string>
     <string name="permission_description_summary_activity_recognition" msgid="2652850576497070146">"వాకింగ్, బైకింగ్, సైక్లింగ్, అడుగులను లెక్కించడం మొదలైన శారీరక శ్రమను, ఇంకా మరిన్నింటిని ఈ అనుమతి ఉన్న యాప్‌లు యాక్సెస్ చేయగలవు"</string>
     <string name="permission_description_summary_calendar" msgid="103329982944411010">"ఈ అనుమతి ఉన్న యాప్‌లు మీ క్యాలెండర్‌ను యాక్సెస్ చేయగలవు"</string>
@@ -252,7 +252,7 @@
     <string name="permission_description_summary_phone" msgid="4515277217435233619">"ఈ అనుమతులు ఉన్న యాప్‌లు ఫోన్ కాల్స్‌ చేయగలవు, మేనేజ్ చేయగలవు"</string>
     <string name="permission_description_summary_sensors" msgid="1836045815643119949">"ఈ అనుమతి ఉన్న యాప్‌లు మీ ఆరోగ్య స్థితిని తెలియజేసే గణాంకాల సెన్సార్ డేటాను యాక్సెస్ చేయగలవు"</string>
     <string name="permission_description_summary_sms" msgid="725999468547768517">"ఈ అనుమతి ఉన్న యాప్‌లు SMSలను పంపగలవు, అందుకోగలవు"</string>
-    <string name="permission_description_summary_storage" msgid="6575759089065303346">"మీ అనుమతితో, యాప్‌లు మీ పరికరంలోని ఫోటోలు, మీడియా మరియు ఫైల్‌లను యాక్సెస్ చేయగలవు"</string>
+    <string name="permission_description_summary_storage" msgid="6575759089065303346">"మీ అనుమతితో, యాప్‌లు మీ పరికరంలోని ఫోటోలు, మీడియా మరియు ఫైళ్లను యాక్సెస్ చేయగలవు"</string>
     <string name="app_permission_most_recent_summary" msgid="4292074449384040590">"చివరిసారి యాక్సెస్ చేసింది: <xliff:g id="TIME_DATE">%1$s</xliff:g>"</string>
     <string name="app_permission_most_recent_denied_summary" msgid="7659497197737708112">"ప్రస్తుతం తిరస్కరించబడింది / చివరి యాక్సెస్: <xliff:g id="TIME_DATE">%1$s</xliff:g>"</string>
     <string name="app_permission_never_accessed_summary" msgid="401346181461975090">"ఎప్పుడూ యాక్సెస్ చేయలేదు"</string>
@@ -294,7 +294,7 @@
       <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> ఉపయోగించని యాప్‌లు</item>
       <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> ఉపయోగించని యాప్</item>
     </plurals>
-    <string name="unused_apps_notification_content" msgid="9195026773244581246">"అనుమతులు, తాత్కాలిక ఫైల్‌లు తీసివేయబడ్డాయి అలాగే నోటిఫికేషన్‌లు ఆపివేయబడ్డాయి. రివ్యూ చేయడానికి ట్యాప్ చేయండి."</string>
+    <string name="unused_apps_notification_content" msgid="9195026773244581246">"అనుమతులు, తాత్కాలిక ఫైళ్లు తీసివేయబడ్డాయి అలాగే నోటిఫికేషన్‌లు ఆపివేయబడ్డాయి. రివ్యూ చేయడానికి ట్యాప్ చేయండి."</string>
     <string name="auto_revoke_setting_subtitle" msgid="8631720570723050460">"గత కొన్ని నెలలుగా కొన్ని యాప్‌లు వినియోగంలో లేవు"</string>
     <plurals name="auto_revoke_setting_subtitle_count" formatted="false" msgid="85594789277193087">
       <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> యాప్‌లు గత కొన్ని నెలలుగా వినియోగంలో లేవు</item>
@@ -325,7 +325,7 @@
     <string name="num_unused_apps_summary" msgid="1870719749940571227">"<xliff:g id="NUMBER_OF_APPS">%s</xliff:g> యాప్‌లు కొన్ని నెలలుగా వినియోగంలో లేవు"</string>
     <string name="permission_subtitle_only_in_foreground" msgid="9068389431267377564">"యాప్ వినియోగంలో ఉన్నప్పుడు మాత్రమే"</string>
     <string name="permission_subtitle_media_only" msgid="8917869683764720717">"మీడియా"</string>
-    <string name="permission_subtitle_all_files" msgid="4982613338298067862">"అన్ని ఫైల్‌లు"</string>
+    <string name="permission_subtitle_all_files" msgid="4982613338298067862">"అన్ని ఫైళ్లు"</string>
     <string name="permission_subtitle_background" msgid="8916750995309083180">"అన్ని సమయాలలో అనుమతించబడతాయి"</string>
     <string name="app_perms_24h_access" msgid="99069906850627181">"చివరగా యాక్సెస్ చేసిన సమయం <xliff:g id="TIME_DATE">%1$s</xliff:g>"</string>
     <string name="app_perms_24h_access_yest" msgid="5411926024794555022">"నిన్న <xliff:g id="TIME_DATE">%1$s</xliff:g> సమయంలో చివరగా యాక్సెస్ చేయబడింది"</string>
@@ -336,13 +336,13 @@
     <string name="app_perms_24h_access_media_only" msgid="6651699644199132054">"చివరగా యాక్సెస్ చేసిన సమయం <xliff:g id="TIME_DATE">%1$s</xliff:g> • మీడియా"</string>
     <string name="app_perms_24h_access_yest_media_only" msgid="7213187706424998792">"నిన్న <xliff:g id="TIME_DATE">%1$s</xliff:g> సమయంలో చివరగా యాక్సెస్ చేయబడింది • మీడియా"</string>
     <string name="app_perms_content_provider_media_only" msgid="6206759230589923421">"గత 24 గంటల్లో యాక్సెస్ చేయబడింది • మీడియా"</string>
-    <string name="app_perms_24h_access_all_files" msgid="8902360456978159091">"చివరగా యాక్సెస్ చేసిన సమయం <xliff:g id="TIME_DATE">%1$s</xliff:g> • అన్ని ఫైల్‌లు"</string>
-    <string name="app_perms_24h_access_yest_all_files" msgid="5708424073126844909">"నిన్న <xliff:g id="TIME_DATE">%1$s</xliff:g> సమయంలో చివరగా యాక్సెస్ చేయబడింది • అన్ని ఫైల్‌లు"</string>
-    <string name="app_perms_content_provider_all_files" msgid="3315281519230304799">"గత 24 గంటల్లో యాక్సెస్ చేయబడింది • అన్ని ఫైల్‌లు"</string>
+    <string name="app_perms_24h_access_all_files" msgid="8902360456978159091">"చివరగా యాక్సెస్ చేసిన సమయం <xliff:g id="TIME_DATE">%1$s</xliff:g> • అన్ని ఫైళ్లు"</string>
+    <string name="app_perms_24h_access_yest_all_files" msgid="5708424073126844909">"నిన్న <xliff:g id="TIME_DATE">%1$s</xliff:g> సమయంలో చివరగా యాక్సెస్ చేయబడింది • అన్ని ఫైళ్లు"</string>
+    <string name="app_perms_content_provider_all_files" msgid="3315281519230304799">"గత 24 గంటల్లో యాక్సెస్ చేయబడింది • అన్ని ఫైళ్లు"</string>
     <string name="no_permissions_allowed" msgid="6081976856354669209">"అనుమతులు ఏవీ ఇవ్వలేదు"</string>
     <string name="no_permissions_denied" msgid="8159923922804043282">"అన్ని అనుమతులు ఇచ్చారు"</string>
     <string name="no_apps_allowed" msgid="7718822655254468631">"ఏ యాప్‌న‌కు అనుమతి లేదు"</string>
-    <string name="no_apps_allowed_full" msgid="8011716991498934104">"అన్ని ఫైల్‌ల కోసం యాప్‌లు అనుమతించబడవు"</string>
+    <string name="no_apps_allowed_full" msgid="8011716991498934104">"అన్ని ఫైళ్ల కోసం యాప్‌లు అనుమతించబడవు"</string>
     <string name="no_apps_allowed_scoped" msgid="4908850477787659501">"మీడియా మాత్రమే కోసం యాప్‌లు అనుమతించబడవు"</string>
     <string name="no_apps_denied" msgid="7663435886986784743">"ఏ యాప్‌నూ నిరాక‌రించ‌లేదు"</string>
     <string name="car_permission_selected" msgid="180837028920791596">"ఎంచుకోబడింది"</string>
@@ -363,7 +363,7 @@
     <string name="role_browser_request_description" msgid="5888803407905985941">"అనుమతులు ఇవ్వనవసరం లేదు"</string>
     <string name="role_dialer_label" msgid="1100224146343237968">"డిఫాల్ట్ ఫోన్ యాప్"</string>
     <string name="role_dialer_short_label" msgid="7186888549465352489">"ఫోన్ యాప్"</string>
-    <string name="role_dialer_description" msgid="8768708633696539612">"మీ పరికరంలో టెలిఫోన్ కాల్‌లు చేయడానికి, అందుకోవడానికి మిమ్మల్ని అనుమతించే యాప్‌లు"</string>
+    <string name="role_dialer_description" msgid="8768708633696539612">"మీ పరికరంలో టెలిఫోన్ కాల్స్‌ చేయడానికి, అందుకోవడానికి మిమ్మల్ని అనుమతించే యాప్‌లు"</string>
     <string name="role_dialer_request_title" msgid="5959618560705912058">"<xliff:g id="APP_NAME">%1$s</xliff:g>ను మీ డిఫాల్ట్ ఫోన్ యాప్‌గా సెట్ చేయాలా?"</string>
     <string name="role_dialer_request_description" msgid="2264219375528345270">"కాల్ లాగ్, అలాగే SMSలు పంపడానికి యాక్సెస్ పొందుతుంది"</string>
     <string name="role_dialer_search_keywords" msgid="3324448983559188087">"డయలర్"</string>
@@ -392,7 +392,7 @@
     <string name="role_call_redirection_request_description" msgid="3118895714178527164">"అనుమతులు ఇవ్వనవసరం లేదు"</string>
     <string name="role_call_screening_label" msgid="883935222060878724">"కాలర్ ID &amp; స్పామ్‌ల కోసం ఆటోమేటిక్ యాప్"</string>
     <string name="role_call_screening_short_label" msgid="2048465565063130834">"కాలర్ ID &amp; స్పామ్ యాప్"</string>
-    <string name="role_call_screening_description" msgid="2349431420497468981">"కాల్‌లను గుర్తించడానికి, స్పామ్, స్వయంచాలక కాల్‌లు లేదా వద్దనుకునే నంబర్‌లను బ్లాక్ చేయడానికి మిమ్మల్ని అనుమతించే యాప్‌లు"</string>
+    <string name="role_call_screening_description" msgid="2349431420497468981">"కాల్స్‌ను గుర్తించడానికి, స్పామ్, స్వయంచాలక కాల్స్‌ లేదా వద్దనుకునే నంబర్‌లను బ్లాక్ చేయడానికి మిమ్మల్ని అనుమతించే యాప్‌లు"</string>
     <string name="role_call_screening_request_title" msgid="7358309224566977290">"<xliff:g id="APP_NAME">%1$s</xliff:g>ను మీ డిఫాల్ట్ కాలర్ ID &amp; స్పామ్ యాప్‌గా సెట్ చేయాలా?"</string>
     <string name="role_call_screening_request_description" msgid="7338511921032446006">"అనుమతులు ఇవ్వనవసరం లేదు"</string>
     <string name="role_watch_description" msgid="267003778693177779">"మీ నోటిఫికేషన్‌లతో ఇంటరాక్ట్ అవ్వడానికి అలాగే మీ ఫోన్, SMS, కాంటాక్ట్‌లు అలాగే Calendar అనుమతులను యాక్సెస్ చేయడానికి <xliff:g id="APP_NAME">%1$s</xliff:g> అనుమతించబడుతుంది."</string>
@@ -438,8 +438,8 @@
     <string name="incident_report_notification_text" msgid="3376480583513587923">"<xliff:g id="APP_NAME">%1$s</xliff:g>డీబగ్గింగ్ సమాచారాన్ని అప్‌లో డ్ చేయదలుచుకుంటున్నారు."</string>
     <string name="incident_report_dialog_title" msgid="669104389325204095">"డీబగ్గింగ్ డేటాను షేర్ చేయమంటారా?"</string>
     <string name="incident_report_dialog_intro" msgid="5897733669850951832">"సిస్టమ్ ఒక సమస్యను గుర్తించింది."</string>
-    <string name="incident_report_dialog_text" msgid="5675553296891757523">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> <xliff:g id="DATE">%2$s</xliff:g>న <xliff:g id="TIME">%3$s</xliff:g>కు ఈ డివైజ్‌లో జ‌నరేట్ అయిన‌ డీబగ్ నివేదికను అప్‌లోడ్ చేయండి అని అభ్యర్థిస్తోంది. బగ్ నివేదికలు మీ డివైజ్‌ లేదా లాగిన్ చేసిన యాప్‌ల వ్యక్తిగత సమాచారం, ఉదాహరణకు యూజ‌ర్‌ పేర్లు, లొకేష‌న్‌ డేటా, డివైజ్ గుర్తింపుల‌తో పాటు నెట్‌వర్క్ సమాచారాన్ని కలిగి ఉంటాయి. ఈ సమాచారం విషయంలో మీకు నమ్మకం ఉన్న‌ వ్యక్తులకు, యాప్‌లకు మాత్రమే బగ్ నివేదిక వివరాలను షేర్ చేయండి. బగ్ నివేదికను అప్‌లోడ్ చేయడానికి <xliff:g id="APP_NAME_1">%4$s</xliff:g>ను అనుమతించాలా?"</string>
-    <string name="incident_report_error_dialog_text" msgid="4189647113387092272">"<xliff:g id="APP_NAME">%1$s</xliff:g> కోసం బగ్ నివేదిక ప్రాసెస్ చేయడంలో ఎర్రర్ ఉంది. కాబట్టి వివరణాత్మక డీబగ్గింగ్ డేటాను షేర్ చేయడాన్ని నిరాకరించారు. అంతరాయానికి చింతిస్తున్నాము."</string>
+    <string name="incident_report_dialog_text" msgid="5675553296891757523">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> <xliff:g id="DATE">%2$s</xliff:g>న <xliff:g id="TIME">%3$s</xliff:g>కు ఈ డివైజ్‌లో జ‌నరేట్ అయిన‌ డీబగ్ రిపోర్ట్‌ను అప్‌లోడ్ చేయండి అని అభ్యర్థిస్తోంది. బగ్ రిపోర్ట్‌లు మీ డివైజ్‌ లేదా లాగిన్ చేసిన యాప్‌ల వ్యక్తిగత సమాచారం, ఉదాహరణకు యూజ‌ర్‌ పేర్లు, లొకేష‌న్‌ డేటా, డివైజ్ గుర్తింపుల‌తో పాటు నెట్‌వర్క్ సమాచారాన్ని కలిగి ఉంటాయి. ఈ సమాచారం విషయంలో మీకు నమ్మకం ఉన్న‌ వ్యక్తులకు, యాప్‌లకు మాత్రమే బగ్ రిపోర్ట్‌ వివరాలను షేర్ చేయండి. బగ్ రిపోర్ట్‌ను అప్‌లోడ్ చేయడానికి <xliff:g id="APP_NAME_1">%4$s</xliff:g>ను అనుమతించాలా?"</string>
+    <string name="incident_report_error_dialog_text" msgid="4189647113387092272">"<xliff:g id="APP_NAME">%1$s</xliff:g> కోసం బగ్ రిపోర్ట్‌ ప్రాసెస్ చేయడంలో ఎర్రర్ ఉంది. కాబట్టి వివరణాత్మక డీబగ్గింగ్ డేటాను షేర్ చేయడాన్ని నిరాకరించారు. అంతరాయానికి చింతిస్తున్నాము."</string>
     <string name="incident_report_dialog_allow_label" msgid="2970242967721155239">"అనుమతించు"</string>
     <string name="incident_report_dialog_deny_label" msgid="3535314290677579383">"తిరస్కరించు"</string>
     <string name="adjust_user_sensitive_title" msgid="4196724451314280527">"అధునాతన సెట్టింగ్‌లు"</string>
@@ -465,7 +465,7 @@
     <string name="permgrouprequest_coarselocation_imagetext" msgid="8650605041483025297">"సుమారుగా"</string>
     <string name="permgrouprequest_calendar" msgid="1493150855673603806">"మీ క్యాలెండర్‌ని యాక్సెస్ చేయడానికి &lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt;ని అనుమతించాలా?"</string>
     <string name="permgrouprequest_sms" msgid="5672063688745420991">"SMS మెసేజ్‌లు పంపడం, చూడటం చేయగలిగేలా &lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt;ను అనుమతించాలా?"</string>
-    <string name="permgrouprequest_storage" msgid="8717773092518621602">"మీ పరికరంలోని ఫోటోలు, మీడియా మరియు ఫైల్‌లను యాక్సెస్ చేయడానికి &lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt;ను అనుమతించాలా?"</string>
+    <string name="permgrouprequest_storage" msgid="8717773092518621602">"మీ పరికరంలోని ఫోటోలు, మీడియా, ఫైళ్లను యాక్సెస్ చేయడానికి &lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt;‌ను అనుమతించాలా?"</string>
     <string name="permgrouprequest_microphone" msgid="2825208549114811299">"ఆడియోను రికార్డ్ చేయడానికి &lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt;ను అనుమతించాలా?"</string>
     <string name="permgrouprequestdetail_microphone" msgid="8510456971528228861">"మీరు యాప్‌ను ఉపయోగిస్తున్నప్పుడు మాత్రమే ఈ యాప్, ఆడియోను రికార్డ్ చేయగలుగుతుంది"</string>
     <string name="permgroupbackgroundrequest_microphone" msgid="8874462606796368183">"ఆడియోను రికార్డ్ చేయడానికి &lt;b&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/b&gt;ను అనుమతించాలా?"</string>
diff --git a/PermissionController/res/values-television/themes.xml b/PermissionController/res/values-television/themes.xml
index 333eb65..12d03b2 100644
--- a/PermissionController/res/values-television/themes.xml
+++ b/PermissionController/res/values-television/themes.xml
@@ -24,6 +24,8 @@
         <item name="android:backgroundDimAmount">0.8</item>
     </style>
 
+    <style name="Theme.PermissionController.Settings" parent="Settings" />
+
     <style name="GrantPermissions" parent="Theme.Leanback">
         <item name="android:windowIsFloating">true</item>
         <item name="android:windowAnimationStyle">@style/Animation.Snackbar</item>
diff --git a/PermissionController/res/values-watch/themes.xml b/PermissionController/res/values-watch/themes.xml
index a8186dd..0e9b7a9 100644
--- a/PermissionController/res/values-watch/themes.xml
+++ b/PermissionController/res/values-watch/themes.xml
@@ -18,6 +18,8 @@
 <resources>
     <style name="Settings" parent="@android:style/Theme.DeviceDefault.NoActionBar" />
 
+    <style name="Theme.PermissionController.Settings" parent="Settings" />
+
     <style name="GrantPermissions" parent="@android:style/Theme.DeviceDefault.NoActionBar">
         <item name="android:windowBackground">@android:color/transparent</item>
     </style>
diff --git a/PermissionController/res/values/themes.xml b/PermissionController/res/values/themes.xml
index 236cff6..04265a3 100644
--- a/PermissionController/res/values/themes.xml
+++ b/PermissionController/res/values/themes.xml
@@ -17,10 +17,21 @@
 
 <resources>
 
+    <!--
+      ~ This theme should have been named SettingsBase, but it is exposed as overlayable to OEMs and
+      ~ cannot be renamed now.
+      -->
     <style name="Settings" parent="Theme.SubSettingsBase">
         <item name="preferenceCategoryTitleTextAppearance">@style/TextAppearance.CategoryTitle</item>
     </style>
 
+    <!-- This theme should contain attributes that should always be set despite OEM overlays. -->
+    <style name="Theme.PermissionController.Settings" parent="Settings">
+        <!-- These two attributes are required when using Toolbar as ActionBar. -->
+        <item name="android:windowActionBar">false</item>
+        <item name="android:windowNoTitle">true</item>
+    </style>
+
     <style name="TextAppearance.CategoryTitle"
            parent="@android:style/TextAppearance.DeviceDefault.Medium">
         <item name="android:textAllCaps">true</item>
@@ -46,6 +57,7 @@
         <item name="android:windowIsTranslucent">true</item>
     </style>
 
+    <!-- Unused since R but exposed as overlayable. -->
     <style name="Header.Settings"
             parent="@android:style/Theme.DeviceDefault.Settings">
     </style>
@@ -94,7 +106,7 @@
         <item name="android:filterTouchesWhenObscured">true</item>
     </style>
 
-    <style name="Settings.FilterTouches">
+    <style name="Theme.PermissionController.Settings.FilterTouches">
         <item name="android:filterTouchesWhenObscured">true</item>
     </style>
 
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/GrantPermissionsActivity.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/GrantPermissionsActivity.java
index 97e329f..b96efef 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/GrantPermissionsActivity.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/GrantPermissionsActivity.java
@@ -137,6 +137,13 @@
 
         getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
 
+        mRequestedPermissions = getIntent().getStringArrayExtra(
+                PackageManager.EXTRA_REQUEST_PERMISSIONS_NAMES);
+        if (mRequestedPermissions == null || mRequestedPermissions.length == 0) {
+            setResultAndFinish();
+            return;
+        }
+
         // Cache this as this can only read on onCreate, not later.
         mCallingPackage = getCallingPackage();
         if (mCallingPackage == null) {
@@ -150,14 +157,6 @@
 
         setTitle(R.string.permission_request_title);
 
-        mRequestedPermissions = getIntent().getStringArrayExtra(
-                PackageManager.EXTRA_REQUEST_PERMISSIONS_NAMES);
-        if (mRequestedPermissions == null || mRequestedPermissions.length == 0) {
-            mRequestedPermissions = new String[0];
-            setResultAndFinish();
-            return;
-        }
-
         if (DeviceUtils.isTelevision(this)) {
             mViewHandler = new com.android.permissioncontroller.permission.ui.television
                     .GrantPermissionsViewHandlerImpl(this,
@@ -471,13 +470,15 @@
                 mViewModel.logRequestedPermissionGroups();
             }
             Intent result = new Intent(PackageManager.ACTION_REQUEST_PERMISSIONS);
-            String[] resultPermissions = mRequestedPermissions;
-            int[] grantResults = new int[mRequestedPermissions.length];
+            String[] resultPermissions = mRequestedPermissions != null
+                    ? mRequestedPermissions : new String[0];
+            int[] grantResults = new int[resultPermissions.length];
 
-            if (mViewModel != null && mViewModel.shouldReturnPermissionState()) {
+            if (mViewModel != null && mViewModel.shouldReturnPermissionState()
+                    && mCallingPackage != null) {
                 PackageManager pm = getPackageManager();
-                for (int i = 0; i < mRequestedPermissions.length; i++) {
-                    grantResults[i] = pm.checkPermission(mRequestedPermissions[i], mCallingPackage);
+                for (int i = 0; i < resultPermissions.length; i++) {
+                    grantResults[i] = pm.checkPermission(resultPermissions[i], mCallingPackage);
                 }
             } else {
                 grantResults = new int[0];
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/CompositeCircleViewLabeler.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/CompositeCircleViewLabeler.java
index 16a2dcf..f222ec3 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/CompositeCircleViewLabeler.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/CompositeCircleViewLabeler.java
@@ -19,6 +19,8 @@
 import android.content.Context;
 import android.util.AttributeSet;
 import android.view.View;
+import android.view.WindowManager;
+import android.view.WindowMetrics;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
@@ -112,6 +114,9 @@
                 continue;
             }
             label.setVisibility((ccv.getValue(i) > 0) ? View.VISIBLE : View.GONE);
+            label.measure(0, 0);
+            int width = label.getMeasuredWidth();
+            int height = label.getMeasuredHeight();
 
             // For circle path, top angle is 270d. Convert to unit circle rads.
             double angle = Math.toRadians(360 - ccv.getPartialCircleCenterAngle(i));
@@ -120,13 +125,25 @@
 
             // Determine anchor corner for text, adjust accordingly.
             if (angle < (Math.PI * 0.5d)) {
-                y -= label.getHeight();
+                y -= height;
             } else if (angle < Math.PI) {
-                x -= label.getWidth();
-                y -= label.getHeight();
+                x -= width;
+                y -= height;
             } else if (angle < (Math.PI * 1.5d)) {
-                x -= label.getWidth();
+                x -= width;
             }
+            WindowManager wm = getContext().getSystemService(WindowManager.class);
+            WindowMetrics metrics = wm.getCurrentWindowMetrics();
+            int maxX = metrics.getBounds().right;
+
+            double offset = 0;
+            if (x < 0) {
+                x = 0;
+            } else if ((x + width) > maxX) {
+                offset = x + width - maxX;
+                x -= offset;
+            }
+
             label.setX((int) x);
             label.setY((int) y);
         }
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/PermissionUsageGraphicPreference.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/PermissionUsageGraphicPreference.java
index 6b1f550..dc47a9d 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/PermissionUsageGraphicPreference.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/PermissionUsageGraphicPreference.java
@@ -18,6 +18,8 @@
 
 import android.Manifest;
 import android.content.Context;
+import android.content.res.Configuration;
+import android.os.Build;
 import android.util.AttributeSet;
 import android.util.TypedValue;
 import android.widget.TextView;
@@ -25,6 +27,7 @@
 import androidx.annotation.AttrRes;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
 import androidx.annotation.StyleRes;
 import androidx.preference.Preference;
 import androidx.preference.PreferenceViewHolder;
@@ -40,6 +43,7 @@
 /**
  * A Preference for the permission usage graphic.
  */
+@RequiresApi(Build.VERSION_CODES.S)
 public class PermissionUsageGraphicPreference extends Preference {
 
     /** Permission group to count mapping. */
@@ -47,31 +51,35 @@
 
     /** Whether to show the "Other" category. */
     private boolean mShowOtherCategory;
+    private boolean mIsNightMode;
 
     public PermissionUsageGraphicPreference(@NonNull Context context, @Nullable AttributeSet attrs,
             @AttrRes int defStyleAttr, @StyleRes int defStyleRes) {
         super(context, attrs, defStyleAttr, defStyleRes);
-        init();
+        init(context);
     }
 
     public PermissionUsageGraphicPreference(@NonNull Context context, @Nullable AttributeSet attrs,
             @AttrRes int defStyleAttr) {
         super(context, attrs, defStyleAttr);
-        init();
+        init(context);
     }
 
     public PermissionUsageGraphicPreference(@NonNull Context context,
             @Nullable AttributeSet attrs) {
         super(context, attrs);
-        init();
+        init(context);
     }
 
     public PermissionUsageGraphicPreference(@NonNull Context context) {
         super(context);
-        init();
+        init(context);
     }
 
-    private void init() {
+    private void init(Context context) {
+        Configuration configuration = context.getResources().getConfiguration();
+        mIsNightMode = (configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK)
+                == Configuration.UI_MODE_NIGHT_YES;
         setLayoutResource(R.layout.permission_usage_graphic);
         setSelectable(false);
     }
@@ -109,11 +117,20 @@
         centerLabel.setText(getContext().getString(R.string.privdash_label_24h));
         centerLabel.setTextAppearance(R.style.PrivacyDashboardGraphicLabel);
 
+        int colorCameraRes = mIsNightMode ? android.R.color.system_accent1_100 :
+                R.color.privacy_dash_graphic_pref_light_camera;
+        int colorMicrophoneRes = mIsNightMode ? R.color.privacy_dash_graphic_pref_dark_mic :
+                R.color.privacy_dash_graphic_pref_light_mic;
+        int colorLocationRes = mIsNightMode ? android.R.color.system_accent3_300 :
+                R.color.privacy_dash_graphic_pref_light_location;
+        int colorOtherRes = mIsNightMode ? R.color.privacy_dash_graphic_pref_dark_others :
+                R.color.privacy_dash_graphic_pref_light_others;
+
         // Sample colors.
-        final int colorCamera = getContext().getColor(android.R.color.system_accent1_300);
-        final int colorMicrophone = getContext().getColor(android.R.color.system_accent1_100);
-        final int colorLocation = getContext().getColor(android.R.color.system_accent3_100);
-        final int colorOther = getContext().getColor(android.R.color.system_accent2_100);
+        final int colorCamera = getContext().getColor(colorCameraRes);
+        final int colorMicrophone = getContext().getColor(colorMicrophoneRes);
+        final int colorLocation = getContext().getColor(colorLocationRes);
+        final int colorOther = getContext().getColor(colorOtherRes);
 
         // Create labels, counts, and colors.
         TextView[] labels;
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/PermissionUsageV2Fragment.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/PermissionUsageV2Fragment.java
index 33662a9..caeca2d 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/PermissionUsageV2Fragment.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/handheld/dashboard/PermissionUsageV2Fragment.java
@@ -48,7 +48,6 @@
 import androidx.preference.PreferenceScreen;
 import androidx.recyclerview.widget.RecyclerView;
 
-import com.android.modules.utils.build.SdkLevel;
 import com.android.permissioncontroller.R;
 import com.android.permissioncontroller.permission.model.AppPermissionGroup;
 import com.android.permissioncontroller.permission.model.AppPermissionUsage;
@@ -199,9 +198,7 @@
             mOtherExpanded = false;
             preference.setTitle(R.string.perm_usage_adv_info_title);
             preference.setSummary(preferenceScreen.getSummary());
-            if (SdkLevel.isAtLeastS()) {
-                preference.setLayoutResource(R.layout.expand_button_with_large_title);
-            }
+            preference.setLayoutResource(R.layout.expand_button_with_large_title);
             if (mGraphic != null) {
                 mGraphic.setShowOtherCategory(false);
             }