Merge "[Wi-Fi] Support hidden SSID Wi-Fi networks for Wi-Fi QR code scanner & generator"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a0f66d1..103d671 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2725,7 +2725,7 @@
<activity
android:name=".wifi.NetworkRequestDialogActivity"
- android:theme="@style/Transparent"
+ android:theme="@style/Theme.AlertDialog"
android:excludeFromRecents="true"
android:launchMode="singleTop"
android:taskAffinity=".wifi.NetworkRequestDialogActivity"
diff --git a/res/drawable-hdpi/ic_menu_refresh_holo_dark.png b/res/drawable-hdpi/ic_menu_refresh_holo_dark.png
deleted file mode 100644
index 69ac31b..0000000
--- a/res/drawable-hdpi/ic_menu_refresh_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_network_signal_0.png b/res/drawable-hdpi/ic_network_signal_0.png
deleted file mode 100644
index 1629ae6..0000000
--- a/res/drawable-hdpi/ic_network_signal_0.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_network_signal_1.png b/res/drawable-hdpi/ic_network_signal_1.png
deleted file mode 100644
index 162ade2..0000000
--- a/res/drawable-hdpi/ic_network_signal_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_network_signal_2.png b/res/drawable-hdpi/ic_network_signal_2.png
deleted file mode 100644
index d91273c..0000000
--- a/res/drawable-hdpi/ic_network_signal_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_network_signal_3.png b/res/drawable-hdpi/ic_network_signal_3.png
deleted file mode 100644
index 5634bc9..0000000
--- a/res/drawable-hdpi/ic_network_signal_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_network_signal_4.png b/res/drawable-hdpi/ic_network_signal_4.png
deleted file mode 100644
index 0588950..0000000
--- a/res/drawable-hdpi/ic_network_signal_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_sim_card_alert_white_48dp.png b/res/drawable-hdpi/ic_sim_card_alert_white_48dp.png
deleted file mode 100644
index c8fbf42..0000000
--- a/res/drawable-hdpi/ic_sim_card_alert_white_48dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/ic_network_signal_0.png b/res/drawable-ldrtl-hdpi/ic_network_signal_0.png
deleted file mode 100644
index 54e7af9..0000000
--- a/res/drawable-ldrtl-hdpi/ic_network_signal_0.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/ic_network_signal_1.png b/res/drawable-ldrtl-hdpi/ic_network_signal_1.png
deleted file mode 100644
index de959d5..0000000
--- a/res/drawable-ldrtl-hdpi/ic_network_signal_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/ic_network_signal_2.png b/res/drawable-ldrtl-hdpi/ic_network_signal_2.png
deleted file mode 100644
index 097b9fb..0000000
--- a/res/drawable-ldrtl-hdpi/ic_network_signal_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/ic_network_signal_3.png b/res/drawable-ldrtl-hdpi/ic_network_signal_3.png
deleted file mode 100644
index 11cb40b..0000000
--- a/res/drawable-ldrtl-hdpi/ic_network_signal_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-hdpi/ic_network_signal_4.png b/res/drawable-ldrtl-hdpi/ic_network_signal_4.png
deleted file mode 100644
index d741ffc..0000000
--- a/res/drawable-ldrtl-hdpi/ic_network_signal_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/ic_network_signal_0.png b/res/drawable-ldrtl-mdpi/ic_network_signal_0.png
deleted file mode 100644
index 4cac9ed..0000000
--- a/res/drawable-ldrtl-mdpi/ic_network_signal_0.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/ic_network_signal_1.png b/res/drawable-ldrtl-mdpi/ic_network_signal_1.png
deleted file mode 100644
index 9323a13..0000000
--- a/res/drawable-ldrtl-mdpi/ic_network_signal_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/ic_network_signal_2.png b/res/drawable-ldrtl-mdpi/ic_network_signal_2.png
deleted file mode 100644
index e2f38a9..0000000
--- a/res/drawable-ldrtl-mdpi/ic_network_signal_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/ic_network_signal_3.png b/res/drawable-ldrtl-mdpi/ic_network_signal_3.png
deleted file mode 100644
index b565289..0000000
--- a/res/drawable-ldrtl-mdpi/ic_network_signal_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-mdpi/ic_network_signal_4.png b/res/drawable-ldrtl-mdpi/ic_network_signal_4.png
deleted file mode 100644
index f63a426..0000000
--- a/res/drawable-ldrtl-mdpi/ic_network_signal_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/ic_network_signal_0.png b/res/drawable-ldrtl-xhdpi/ic_network_signal_0.png
deleted file mode 100644
index e4ec015..0000000
--- a/res/drawable-ldrtl-xhdpi/ic_network_signal_0.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/ic_network_signal_1.png b/res/drawable-ldrtl-xhdpi/ic_network_signal_1.png
deleted file mode 100644
index 712685a..0000000
--- a/res/drawable-ldrtl-xhdpi/ic_network_signal_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/ic_network_signal_2.png b/res/drawable-ldrtl-xhdpi/ic_network_signal_2.png
deleted file mode 100644
index 99fe1ac..0000000
--- a/res/drawable-ldrtl-xhdpi/ic_network_signal_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/ic_network_signal_3.png b/res/drawable-ldrtl-xhdpi/ic_network_signal_3.png
deleted file mode 100644
index 4ac2f10..0000000
--- a/res/drawable-ldrtl-xhdpi/ic_network_signal_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-ldrtl-xhdpi/ic_network_signal_4.png b/res/drawable-ldrtl-xhdpi/ic_network_signal_4.png
deleted file mode 100644
index 34608f1..0000000
--- a/res/drawable-ldrtl-xhdpi/ic_network_signal_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_refresh_holo_dark.png b/res/drawable-mdpi/ic_menu_refresh_holo_dark.png
deleted file mode 100644
index f68aacf..0000000
--- a/res/drawable-mdpi/ic_menu_refresh_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_network_signal_0.png b/res/drawable-mdpi/ic_network_signal_0.png
deleted file mode 100644
index a1b8431..0000000
--- a/res/drawable-mdpi/ic_network_signal_0.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_network_signal_1.png b/res/drawable-mdpi/ic_network_signal_1.png
deleted file mode 100644
index cc6179d..0000000
--- a/res/drawable-mdpi/ic_network_signal_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_network_signal_2.png b/res/drawable-mdpi/ic_network_signal_2.png
deleted file mode 100644
index 1373fb6..0000000
--- a/res/drawable-mdpi/ic_network_signal_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_network_signal_3.png b/res/drawable-mdpi/ic_network_signal_3.png
deleted file mode 100644
index 14468eb..0000000
--- a/res/drawable-mdpi/ic_network_signal_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_network_signal_4.png b/res/drawable-mdpi/ic_network_signal_4.png
deleted file mode 100644
index 43cdf26..0000000
--- a/res/drawable-mdpi/ic_network_signal_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_sim_card_alert_white_48dp.png b/res/drawable-mdpi/ic_sim_card_alert_white_48dp.png
deleted file mode 100644
index 18cd7f9..0000000
--- a/res/drawable-mdpi/ic_sim_card_alert_white_48dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_refresh_holo_dark.png b/res/drawable-xhdpi/ic_menu_refresh_holo_dark.png
deleted file mode 100644
index 3db90ee..0000000
--- a/res/drawable-xhdpi/ic_menu_refresh_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_network_signal_0.png b/res/drawable-xhdpi/ic_network_signal_0.png
deleted file mode 100644
index b609ecf..0000000
--- a/res/drawable-xhdpi/ic_network_signal_0.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_network_signal_1.png b/res/drawable-xhdpi/ic_network_signal_1.png
deleted file mode 100644
index 854921f..0000000
--- a/res/drawable-xhdpi/ic_network_signal_1.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_network_signal_2.png b/res/drawable-xhdpi/ic_network_signal_2.png
deleted file mode 100644
index 3db4ce6..0000000
--- a/res/drawable-xhdpi/ic_network_signal_2.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_network_signal_3.png b/res/drawable-xhdpi/ic_network_signal_3.png
deleted file mode 100644
index 18003e5..0000000
--- a/res/drawable-xhdpi/ic_network_signal_3.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_network_signal_4.png b/res/drawable-xhdpi/ic_network_signal_4.png
deleted file mode 100644
index 304108f..0000000
--- a/res/drawable-xhdpi/ic_network_signal_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_sim_card_alert_white_48dp.png b/res/drawable-xhdpi/ic_sim_card_alert_white_48dp.png
deleted file mode 100644
index 6d983b7..0000000
--- a/res/drawable-xhdpi/ic_sim_card_alert_white_48dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_network_signal_4.png b/res/drawable-xxhdpi/ic_network_signal_4.png
deleted file mode 100644
index dafe7c4..0000000
--- a/res/drawable-xxhdpi/ic_network_signal_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_sim_card_alert_white_48dp.png b/res/drawable-xxhdpi/ic_sim_card_alert_white_48dp.png
deleted file mode 100644
index 6c8dd1f..0000000
--- a/res/drawable-xxhdpi/ic_sim_card_alert_white_48dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_network_signal_4.png b/res/drawable-xxxhdpi/ic_network_signal_4.png
deleted file mode 100644
index 622cc4c..0000000
--- a/res/drawable-xxxhdpi/ic_network_signal_4.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_sim_card_alert_white_48dp.png b/res/drawable-xxxhdpi/ic_sim_card_alert_white_48dp.png
deleted file mode 100644
index e8b6667..0000000
--- a/res/drawable-xxxhdpi/ic_sim_card_alert_white_48dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/ic_sim_alert.xml b/res/drawable/ic_sim_alert.xml
new file mode 100644
index 0000000..ed9aa43
--- /dev/null
+++ b/res/drawable/ic_sim_alert.xml
@@ -0,0 +1,27 @@
+<!--
+ Copyright (C) 2019 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.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:pathData="m4.8578,21.8264c-0.2247,-0.137 -0.5206,-0.4329 -0.6575,-0.6575 -0.2399,-0.3935 -0.2491,-0.6433 -0.2495,-6.7995l-0.0005,-6.391 2.9757,-2.9776 2.9757,-2.9776 4.3876,0.0005c4.1571,0.0004 4.4091,0.0135 4.7961,0.2495 0.2247,0.137 0.5206,0.4329 0.6575,0.6575 0.2422,0.3972 0.2491,0.6479 0.2491,9.1192 0,8.4712 -0.007,8.7219 -0.2491,9.1191 -0.137,0.2247 -0.4329,0.5206 -0.6575,0.6575 -0.3942,0.2403 -0.6436,0.2491 -7.1138,0.2491 -6.4703,0 -6.7197,-0.009 -7.1138,-0.2491zM12.9743,16.0604v-1.0027h-1.0027,-1.0027v1.0027,1.0027h1.0027,1.0027zM12.9743,10.5457L12.9743,8.039h-1.0027,-1.0027v2.5067,2.5067h1.0027,1.0027z"
+ android:strokeWidth="0.12533334"
+ android:fillColor="#ffffff"/>
+</vector>
+
diff --git a/res/drawable/signal.xml b/res/drawable/signal.xml
deleted file mode 100644
index f315600..0000000
--- a/res/drawable/signal.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 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.
--->
-
-<level-list xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:maxLevel="0" android:drawable="@drawable/ic_network_signal_0" />
- <item android:maxLevel="1" android:drawable="@drawable/ic_network_signal_1" />
- <item android:maxLevel="2" android:drawable="@drawable/ic_network_signal_2" />
- <item android:maxLevel="3" android:drawable="@drawable/ic_network_signal_3" />
- <item android:maxLevel="4" android:drawable="@drawable/ic_network_signal_4" />
-</level-list>
-
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2b24a4c..c88eec9 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -966,7 +966,7 @@
<!-- Button text in face settings which lets the user enroll their face [CHAR LIMIT=40] -->
<string name="security_settings_face_settings_enroll">Set up face unlock</string>
<!-- Text shown in face settings explaining what your face can be used for. [CHAR LIMIT=NONE] -->
- <string name="security_settings_face_settings_footer">Use face unlock to unlock your device, sign in to apps, and confirm payments.\n\nKeep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face while your eyes are open.\n\nYour phone can be unlocked by someone who looks a lot like you, say, an identical sibling.</string>
+ <string name="security_settings_face_settings_footer">Use face unlock to unlock your device, sign in to apps, and confirm payments.\n\nKeep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face, even if your eyes are closed.\n\nYour phone can be unlocked by someone who looks a lot like you, say, an identical sibling.</string>
<!-- Dialog title shown when the user removes an enrollment [CHAR LIMIT=35] -->
<string name="security_settings_face_settings_remove_dialog_title">Delete face data?</string>
<!-- Dialog contents shown when the user removes an enrollment [CHAR LIMIT=NONE] -->
diff --git a/res/xml/accessibility_autoclick_settings.xml b/res/xml/accessibility_autoclick_settings.xml
index bb77002..0351faf 100644
--- a/res/xml/accessibility_autoclick_settings.xml
+++ b/res/xml/accessibility_autoclick_settings.xml
@@ -16,6 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="autoclick_preference_screen"
android:title="@string/accessibility_autoclick_preference_title">
@@ -24,4 +25,9 @@
android:key="autoclick_delay"
android:title="@string/accessibility_autoclick_delay_preference_title" />
+ <com.android.settingslib.widget.FooterPreference
+ android:key="autoclick_footer"
+ android:title="@string/accessibility_autoclick_description"
+ android:selectable="false"
+ settings:searchable="false"/>
</PreferenceScreen>
diff --git a/res/xml/accessibility_daltonizer_settings.xml b/res/xml/accessibility_daltonizer_settings.xml
index 9cd3865..496c515 100644
--- a/res/xml/accessibility_daltonizer_settings.xml
+++ b/res/xml/accessibility_daltonizer_settings.xml
@@ -16,6 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="daltonizer_preference_screen"
android:title="@string/accessibility_display_daltonizer_preference_title">
@@ -27,4 +28,9 @@
android:title="@string/daltonizer_type"
android:icon="@drawable/ic_accessibility_illustration_colorblind" />
+ <com.android.settingslib.widget.FooterPreference
+ android:key="daltonizer_footer"
+ android:title="@string/accessibility_display_daltonizer_preference_subtitle"
+ android:selectable="false"
+ settings:searchable="false"/>
</PreferenceScreen>
diff --git a/res/xml/accessibility_shortcut_settings.xml b/res/xml/accessibility_shortcut_settings.xml
index 1245050..f431dec 100644
--- a/res/xml/accessibility_shortcut_settings.xml
+++ b/res/xml/accessibility_shortcut_settings.xml
@@ -14,6 +14,7 @@
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/accessibility_global_gesture_preference_title" >
<Preference
@@ -24,4 +25,10 @@
<SwitchPreference
android:key="accessibility_shortcut_on_lock_screen"
android:title="@string/accessibility_shortcut_service_on_lock_screen_title"/>
+
+ <com.android.settingslib.widget.FooterPreference
+ android:key="accessibility_shortcut_footer"
+ android:title="@string/accessibility_shortcut_description"
+ android:selectable="false"
+ settings:searchable="false"/>
</PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/bluetooth_screen.xml b/res/xml/bluetooth_screen.xml
index 42f71b3..2a52a7c 100644
--- a/res/xml/bluetooth_screen.xml
+++ b/res/xml/bluetooth_screen.xml
@@ -36,4 +36,8 @@
settings:useAdminDisabledSummary="true"
settings:controller="com.android.settings.connecteddevice.AddDevicePreferenceController"/>
+ <com.android.settingslib.widget.FooterPreference
+ android:key="bluetooth_screen_footer"
+ android:selectable="false"
+ settings:searchable="false"/>
</PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/manage_assist.xml b/res/xml/manage_assist.xml
index bb387b5..ef0f696 100644
--- a/res/xml/manage_assist.xml
+++ b/res/xml/manage_assist.xml
@@ -53,4 +53,10 @@
android:title="@string/voice_input_settings_title"
android:fragment="com.android.settings.applications.assist.DefaultVoiceInputPicker" />
+ <com.android.settingslib.widget.FooterPreference
+ android:key="manage_assist_footer"
+ android:title="@string/assist_footer"
+ android:selectable="false"
+ settings:searchable="false"/>
+
</PreferenceScreen>
diff --git a/res/xml/power_usage_summary.xml b/res/xml/power_usage_summary.xml
index b32af46..005ce17 100644
--- a/res/xml/power_usage_summary.xml
+++ b/res/xml/power_usage_summary.xml
@@ -63,4 +63,9 @@
android:title="@string/device_screen_usage"
android:selectable="false" />
+ <com.android.settingslib.widget.FooterPreference
+ android:key="power_usage_footer"
+ android:title="@string/battery_footer_summary"
+ android:selectable="false"
+ settings:searchable="false"/>
</PreferenceScreen>
diff --git a/res/xml/restricted_apps_detail.xml b/res/xml/restricted_apps_detail.xml
index 1e08a7e..76c656e 100644
--- a/res/xml/restricted_apps_detail.xml
+++ b/res/xml/restricted_apps_detail.xml
@@ -16,9 +16,15 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/restricted_app_title">
<PreferenceCategory
android:key="restrict_app_list"/>
+ <com.android.settingslib.widget.FooterPreference
+ android:key="restricted_app_footer"
+ android:title="@string/restricted_app_detail_footer"
+ android:selectable="false"
+ settings:searchable="false"/>
</PreferenceScreen>
diff --git a/res/xml/security_settings_face.xml b/res/xml/security_settings_face.xml
index 19d6ed0..4b4de17 100644
--- a/res/xml/security_settings_face.xml
+++ b/res/xml/security_settings_face.xml
@@ -52,13 +52,6 @@
android:key="security_settings_face_manage_category"
android:title="@string/security_settings_face_settings_require_category">
<SwitchPreference
- android:key="security_settings_face_require_attention"
- android:title="@string/security_settings_face_settings_require_attention"
- android:summary="@string/security_settings_face_settings_require_attention_details"
- app:keywords="@string/keywords_face_unlock"
- app:controller="com.android.settings.biometrics.face.FaceSettingsAttentionPreferenceController"/>
-
- <SwitchPreference
android:key="security_settings_face_require_confirmation"
android:title="@string/security_settings_face_settings_require_confirmation"
android:summary="@string/security_settings_face_settings_require_confirmation_details"
diff --git a/res/xml/smart_battery_detail.xml b/res/xml/smart_battery_detail.xml
index fa1b20b..87eeb86 100644
--- a/res/xml/smart_battery_detail.xml
+++ b/res/xml/smart_battery_detail.xml
@@ -46,4 +46,9 @@
android:key="restricted_app"
android:title="@string/restricted_app_title"/>
+ <com.android.settingslib.widget.FooterPreference
+ android:key="smart_battery_detail_footer"
+ android:title="@string/smart_battery_footer"
+ android:selectable="false"
+ settings:searchable="false"/>
</PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/wifi_tether_settings.xml b/res/xml/wifi_tether_settings.xml
index 81e60a2..3a3bdc4 100644
--- a/res/xml/wifi_tether_settings.xml
+++ b/res/xml/wifi_tether_settings.xml
@@ -20,8 +20,7 @@
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="wifi_tether_settings_screen"
android:title="@string/wifi_hotspot_checkbox_text"
- settings:searchable="false"
- settings:initialExpandedChildrenCount="3">
+ settings:searchable="false">
<com.android.settings.wifi.tether.WifiTetherSsidPreference
android:key="wifi_tether_network_name"
diff --git a/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java b/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
index de65324..cd13875 100644
--- a/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
@@ -80,8 +80,6 @@
((Boolean) o) ? 1 : 0);
return true;
});
- mFooterPreferenceMixin.createFooterPreference()
- .setTitle(R.string.accessibility_shortcut_description);
}
@Override
@@ -186,7 +184,8 @@
return getServiceInfo(context) != null;
}
- private static @Nullable ComponentName getShortcutComponent(Context context) {
+ private static @Nullable
+ ComponentName getShortcutComponent(Context context) {
String componentNameString = AccessibilityUtils.getShortcutTargetServiceComponentNameString(
context, UserHandle.myUserId());
if (componentNameString == null) return null;
diff --git a/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java
index 8e12339..49f752e 100644
--- a/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java
@@ -77,8 +77,9 @@
/**
* Gets string that should be used as a autoclick preference summary for provided autoclick
* delay.
+ *
* @param resources Resources from which string should be retrieved.
- * @param delay Delay for whose value summary should be retrieved.
+ * @param delay Delay for whose value summary should be retrieved.
*/
static CharSequence getAutoclickPreferenceSummary(Resources resources, int delay) {
int summaryIndex = getAutoclickPreferenceSummaryIndex(delay);
@@ -136,8 +137,6 @@
mDelay.setMax(delayToSeekBarProgress(MAX_AUTOCLICK_DELAY));
mDelay.setProgress(delayToSeekBarProgress(delay));
mDelay.setOnPreferenceChangeListener(this);
- mFooterPreferenceMixin.createFooterPreference()
- .setTitle(R.string.accessibility_autoclick_description);
}
@Override
@@ -166,11 +165,11 @@
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (preference == mDelay && newValue instanceof Integer) {
Settings.Secure.putInt(getContentResolver(),
- Settings.Secure.ACCESSIBILITY_AUTOCLICK_DELAY,
- seekBarProgressToDelay((int)newValue));
+ Settings.Secure.ACCESSIBILITY_AUTOCLICK_DELAY,
+ seekBarProgressToDelay((int) newValue));
return true;
- }
- return false;
+ }
+ return false;
}
/**
diff --git a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
index 8924899..e307e9b 100644
--- a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
@@ -43,6 +43,7 @@
private static final String ENABLED = Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED;
private static final String TYPE = Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER;
private static final int DEFAULT_TYPE = AccessibilityManager.DALTONIZER_CORRECT_DEUTERANOMALY;
+ private static final String KEY_DALTONIZER_FOOTER = "daltonizer_footer";
private ListPreference mType;
@@ -62,10 +63,8 @@
mType = (ListPreference) findPreference("type");
- if (!ColorDisplayManager.isColorTransformAccelerated(getActivity())) {
- mFooterPreferenceMixin.createFooterPreference().setTitle(
- R.string.accessibility_display_daltonizer_preference_subtitle);
- }
+ final Preference footer = findPreference(KEY_DALTONIZER_FOOTER);
+ footer.setVisible(!ColorDisplayManager.isColorTransformAccelerated(getActivity()));
initPreferences();
}
diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java
index 992cc67..85c3e2c 100644
--- a/src/com/android/settings/accounts/AccountSyncSettings.java
+++ b/src/com/android/settings/accounts/AccountSyncSettings.java
@@ -188,11 +188,9 @@
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
MenuItem syncNow = menu.add(0, MENU_SYNC_NOW_ID, 0,
- getString(R.string.sync_menu_sync_now))
- .setIcon(R.drawable.ic_menu_refresh_holo_dark);
+ getString(R.string.sync_menu_sync_now));
MenuItem syncCancel = menu.add(0, MENU_SYNC_CANCEL_ID, 0,
- getString(R.string.sync_menu_sync_cancel))
- .setIcon(com.android.internal.R.drawable.ic_menu_close_clear_cancel);
+ getString(R.string.sync_menu_sync_cancel));
syncNow.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER |
MenuItem.SHOW_AS_ACTION_WITH_TEXT);
@@ -210,6 +208,7 @@
mUserHandle.getIdentifier()).isEmpty();
menu.findItem(MENU_SYNC_NOW_ID).setVisible(!syncActive);
menu.findItem(MENU_SYNC_CANCEL_ID).setVisible(syncActive);
+
}
@Override
diff --git a/src/com/android/settings/applications/assist/ManageAssist.java b/src/com/android/settings/applications/assist/ManageAssist.java
index 952a3ad..ae2728d 100644
--- a/src/com/android/settings/applications/assist/ManageAssist.java
+++ b/src/com/android/settings/applications/assist/ManageAssist.java
@@ -68,14 +68,6 @@
use(AssistGestureSettingsPreferenceController.class).setAssistOnly(true);
}
- @Override
- public void onResume() {
- super.onResume();
-
- mFooterPreferenceMixin.createFooterPreference()
- .setTitle(R.string.assist_footer);
- }
-
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
Lifecycle lifecycle) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollEducation.java b/src/com/android/settings/biometrics/face/FaceEnrollEducation.java
index 011cc12..e1253c1 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollEducation.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollEducation.java
@@ -16,7 +16,6 @@
package com.android.settings.biometrics.face;
-import static android.provider.Settings.Secure.FACE_UNLOCK_EDUCATION_INFO_DISPLAYED;
import static android.security.KeyStore.getApplicationContext;
import android.app.settings.SettingsEnums;
@@ -50,8 +49,6 @@
private static final String TAG = "FaceEducation";
private static final int ON = 1;
private static final int OFF = 0;
- // 8 seconds.
- private static final long FACE_ENROLL_EDUCATION_DELAY = 3000;
private FaceManager mFaceManager;
private FaceEnrollAccessibilityToggle mSwitchDiversity;
@@ -140,21 +137,9 @@
&& accessibilityManager.isTouchExplorationEnabled();
}
mFooterBarMixin.setPrimaryButton(footerButton);
- final Context context = getApplicationContext();
- final boolean didDisplayEdu = Settings.Secure.getIntForUser(context.getContentResolver(),
- FACE_UNLOCK_EDUCATION_INFO_DISPLAYED, OFF, mUserId) == ON;
- if (!didDisplayEdu && !accessibilityEnabled) {
- Settings.Secure.putIntForUser(context.getContentResolver(),
- FACE_UNLOCK_EDUCATION_INFO_DISPLAYED, ON, mUserId);
- footerButton.setEnabled(false);
- mHandler.postDelayed(() -> {
- footerButton.setEnabled(true);
- }, FACE_ENROLL_EDUCATION_DELAY);
- }
final Button accessibilityButton = findViewById(R.id.accessibility_button);
accessibilityButton.setOnClickListener(view -> {
- footerButton.setEnabled(true);
mSwitchDiversity.setChecked(true);
accessibilityButton.setVisibility(View.GONE);
mSwitchDiversity.setVisibility(View.VISIBLE);
diff --git a/src/com/android/settings/biometrics/face/FaceSettings.java b/src/com/android/settings/biometrics/face/FaceSettings.java
index 373cfbf..8771802 100644
--- a/src/com/android/settings/biometrics/face/FaceSettings.java
+++ b/src/com/android/settings/biometrics/face/FaceSettings.java
@@ -60,7 +60,6 @@
private FaceManager mFaceManager;
private int mUserId;
private byte[] mToken;
- private FaceSettingsAttentionPreferenceController mAttentionController;
private FaceSettingsRemoveButtonPreferenceController mRemoveController;
private FaceSettingsEnrollButtonPreferenceController mEnrollController;
private List<AbstractPreferenceController> mControllers;
@@ -134,12 +133,11 @@
Preference keyguardPref = findPreference(FaceSettingsKeyguardPreferenceController.KEY);
Preference appPref = findPreference(FaceSettingsAppPreferenceController.KEY);
- Preference attentionPref = findPreference(FaceSettingsAttentionPreferenceController.KEY);
Preference confirmPref = findPreference(FaceSettingsConfirmPreferenceController.KEY);
Preference bypassPref =
findPreference(FaceSettingsLockscreenBypassPreferenceController.KEY);
mTogglePreferences = new ArrayList<>(
- Arrays.asList(keyguardPref, appPref, attentionPref, confirmPref, bypassPref));
+ Arrays.asList(keyguardPref, appPref, confirmPref, bypassPref));
mRemoveButton = findPreference(FaceSettingsRemoveButtonPreferenceController.KEY);
mEnrollButton = findPreference(FaceSettingsEnrollButtonPreferenceController.KEY);
@@ -183,7 +181,6 @@
finish();
}
} else {
- mAttentionController.setToken(mToken);
mEnrollController.setToken(mToken);
}
@@ -204,7 +201,6 @@
mToken = data.getByteArrayExtra(
ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
if (mToken != null) {
- mAttentionController.setToken(mToken);
mEnrollController.setToken(mToken);
}
}
@@ -248,9 +244,7 @@
mControllers = buildPreferenceControllers(context, getSettingsLifecycle());
// There's no great way of doing this right now :/
for (AbstractPreferenceController controller : mControllers) {
- if (controller instanceof FaceSettingsAttentionPreferenceController) {
- mAttentionController = (FaceSettingsAttentionPreferenceController) controller;
- } else if (controller instanceof FaceSettingsRemoveButtonPreferenceController) {
+ if (controller instanceof FaceSettingsRemoveButtonPreferenceController) {
mRemoveController = (FaceSettingsRemoveButtonPreferenceController) controller;
mRemoveController.setListener(mRemovalListener);
mRemoveController.setActivity((SettingsActivity) getActivity());
@@ -269,7 +263,6 @@
controllers.add(new FaceSettingsVideoPreferenceController(context));
controllers.add(new FaceSettingsKeyguardPreferenceController(context));
controllers.add(new FaceSettingsAppPreferenceController(context));
- controllers.add(new FaceSettingsAttentionPreferenceController(context));
controllers.add(new FaceSettingsRemoveButtonPreferenceController(context));
controllers.add(new FaceSettingsFooterPreferenceController(context));
controllers.add(new FaceSettingsConfirmPreferenceController(context));
diff --git a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
index c56c50e..a8b1c97 100644
--- a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
+++ b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
@@ -221,7 +221,7 @@
return mCachedDevice
.compareTo(((BluetoothDevicePreference) another).mCachedDevice);
case SortType.TYPE_FIFO:
- return (int)(mCurrentTime - ((BluetoothDevicePreference) another).mCurrentTime);
+ return mCurrentTime > ((BluetoothDevicePreference) another).mCurrentTime ? 1 : -1;
default:
return super.compareTo(another);
}
diff --git a/src/com/android/settings/connecteddevice/BluetoothDashboardFragment.java b/src/com/android/settings/connecteddevice/BluetoothDashboardFragment.java
index ecbda15..36b2ae8 100644
--- a/src/com/android/settings/connecteddevice/BluetoothDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/BluetoothDashboardFragment.java
@@ -46,6 +46,7 @@
public class BluetoothDashboardFragment extends DashboardFragment {
private static final String TAG = "BluetoothDashboardFrag";
+ private static final String KEY_BLUETOOTH_SCREEN_FOOTER = "bluetooth_screen_footer";
public static final String KEY_BLUETOOTH_SCREEN = "bluetooth_switchbar_screen";
private FooterPreference mFooterPreference;
@@ -75,7 +76,7 @@
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
- mFooterPreference = mFooterPreferenceMixin.createFooterPreference();
+ mFooterPreference = findPreference(KEY_BLUETOOTH_SCREEN_FOOTER);
}
@Override
diff --git a/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java b/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java
index 4c00c3e..d4f1283 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java
@@ -32,7 +32,6 @@
import com.android.settings.widget.RadioButtonPickerFragment;
import com.android.settingslib.widget.CandidateInfo;
import com.android.settingslib.widget.FooterPreference;
-import com.android.settingslib.widget.FooterPreferenceMixinCompat;
import com.google.android.collect.Lists;
@@ -61,10 +60,8 @@
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
super.onCreatePreferences(savedInstanceState, rootKey);
- FooterPreferenceMixinCompat footer = new FooterPreferenceMixinCompat(this,
- this.getSettingsLifecycle());
- FooterPreference pref = footer.createFooterPreference();
- pref.setTitle(R.string.usb_default_info);
+ getPreferenceScreen().addPreference(new FooterPreference.Builder(getActivity()).setTitle(
+ R.string.usb_default_info).build());
}
@Override
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index 4a68be9..04f6b31 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -225,7 +225,6 @@
mScreenUsagePref = (PowerGaugePreference) findPreference(KEY_SCREEN_USAGE);
mLastFullChargePref = (PowerGaugePreference) findPreference(
KEY_TIME_SINCE_LAST_FULL_CHARGE);
- mFooterPreferenceMixin.createFooterPreference().setTitle(R.string.battery_footer_summary);
mBatteryUtils = BatteryUtils.getInstance(getContext());
restartBatteryInfoLoader();
diff --git a/src/com/android/settings/fuelgauge/RestrictedAppDetails.java b/src/com/android/settings/fuelgauge/RestrictedAppDetails.java
index 6722b4a..db83140 100644
--- a/src/com/android/settings/fuelgauge/RestrictedAppDetails.java
+++ b/src/com/android/settings/fuelgauge/RestrictedAppDetails.java
@@ -47,7 +47,6 @@
import com.android.settings.widget.AppCheckBoxPreference;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.utils.StringUtil;
-import com.android.settingslib.widget.FooterPreferenceMixinCompat;
import java.util.List;
@@ -76,8 +75,6 @@
PackageManager mPackageManager;
@VisibleForTesting
BatteryDatabaseManager mBatteryDatabaseManager;
- private final FooterPreferenceMixinCompat mFooterPreferenceMixin =
- new FooterPreferenceMixinCompat(this, getSettingsLifecycle());
public static void startRestrictedAppDetails(InstrumentedPreferenceFragment fragment,
List<AppInfo> appInfos) {
@@ -97,8 +94,6 @@
super.onCreate(icicle);
final Context context = getContext();
- mFooterPreferenceMixin.createFooterPreference().setTitle(
- R.string.restricted_app_detail_footer);
mRestrictedAppListGroup = (PreferenceGroup) findPreference(KEY_PREF_RESTRICTED_APP_LIST);
mAppInfos = getArguments().getParcelableArrayList(EXTRA_APP_INFO_LIST);
mPackageManager = context.getPackageManager();
diff --git a/src/com/android/settings/fuelgauge/SmartBatterySettings.java b/src/com/android/settings/fuelgauge/SmartBatterySettings.java
index 5fddbac..8fc8f87 100644
--- a/src/com/android/settings/fuelgauge/SmartBatterySettings.java
+++ b/src/com/android/settings/fuelgauge/SmartBatterySettings.java
@@ -18,7 +18,6 @@
import android.app.settings.SettingsEnums;
import android.content.Context;
-import android.os.Bundle;
import android.provider.SearchIndexableResource;
import com.android.settings.R;
@@ -41,12 +40,6 @@
public static final String TAG = "SmartBatterySettings";
@Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- mFooterPreferenceMixin.createFooterPreference().setTitle(R.string.smart_battery_footer);
- }
-
- @Override
public int getMetricsCategory() {
return SettingsEnums.FUELGAUGE_SMART_BATTERY;
}
diff --git a/src/com/android/settings/sim/SimSelectNotification.java b/src/com/android/settings/sim/SimSelectNotification.java
index fb83a4d..7153d15 100644
--- a/src/com/android/settings/sim/SimSelectNotification.java
+++ b/src/com/android/settings/sim/SimSelectNotification.java
@@ -202,7 +202,7 @@
Notification.Builder builder =
new Notification.Builder(context, SIM_SELECT_NOTIFICATION_CHANNEL)
- .setSmallIcon(R.drawable.ic_sim_card_alert_white_48dp)
+ .setSmallIcon(R.drawable.ic_sim_alert)
.setColor(context.getColor(R.color.sim_noitification))
.setContentTitle(resources.getText(R.string.sim_notification_title))
.setContentText(resources.getText(R.string.sim_notification_summary))
@@ -282,7 +282,7 @@
Notification.Builder builder =
new Notification.Builder(context, SIM_WARNING_NOTIFICATION_CHANNEL)
- .setSmallIcon(R.drawable.ic_sim_card_alert_white_48dp)
+ .setSmallIcon(R.drawable.ic_sim_alert)
.setColor(context.getColor(R.color.sim_noitification))
.setContentTitle(resources.getText(
R.string.sim_combination_warning_notification_title))
diff --git a/src/com/android/settings/wifi/CellularFallbackPreferenceController.java b/src/com/android/settings/wifi/CellularFallbackPreferenceController.java
index c411aba..659ddbe 100644
--- a/src/com/android/settings/wifi/CellularFallbackPreferenceController.java
+++ b/src/com/android/settings/wifi/CellularFallbackPreferenceController.java
@@ -19,7 +19,6 @@
import android.content.Context;
import android.content.res.Resources;
import android.provider.Settings;
-import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import com.android.internal.annotations.VisibleForTesting;
@@ -37,7 +36,7 @@
@Override
public int getAvailabilityStatus() {
- return !avoidBadWifiConfig() ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
+ return avoidBadWifiConfig() ? UNSUPPORTED_ON_DEVICE : AVAILABLE;
}
@Override
@@ -53,20 +52,18 @@
}
private boolean avoidBadWifiConfig() {
- boolean avoidBadWifiConfig = true;
- final SubscriptionManager subscriptionManager =
- mContext.getSystemService(SubscriptionManager.class);
-
- for (SubscriptionInfo subscriptionInfo :
- subscriptionManager.getActiveSubscriptionInfoList()) {
- final Resources resources = getResourcesForSubId(subscriptionInfo.getSubscriptionId());
- if (resources.getInteger(
- com.android.internal.R.integer.config_networkAvoidBadWifi) == 0) {
- avoidBadWifiConfig = false;
- break;
- }
+ final int activeDataSubscriptionId = getActiveDataSubscriptionId();
+ if (activeDataSubscriptionId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
+ return true;
}
- return avoidBadWifiConfig;
+
+ final Resources resources = getResourcesForSubId(activeDataSubscriptionId);
+ return resources.getInteger(com.android.internal.R.integer.config_networkAvoidBadWifi) == 1;
+ }
+
+ @VisibleForTesting
+ int getActiveDataSubscriptionId() {
+ return SubscriptionManager.getActiveDataSubscriptionId();
}
@VisibleForTesting
diff --git a/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceController.java b/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceController.java
index 3a85f7b..388cbf2 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceController.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceController.java
@@ -90,7 +90,7 @@
mBandIndex = validateSelection(Integer.parseInt((String) newValue));
Log.d(TAG, "Band preference changed, updating band index to " + mBandIndex);
preference.setSummary(getConfigSummary());
- mListener.onTetherConfigUpdated();
+ mListener.onTetherConfigUpdated(this);
return true;
}
diff --git a/src/com/android/settings/wifi/tether/WifiTetherBasePreferenceController.java b/src/com/android/settings/wifi/tether/WifiTetherBasePreferenceController.java
index 94e9209..2a5dea9 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherBasePreferenceController.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherBasePreferenceController.java
@@ -30,7 +30,7 @@
implements PreferenceControllerMixin, Preference.OnPreferenceChangeListener {
public interface OnTetherConfigUpdateListener {
- void onTetherConfigUpdated();
+ void onTetherConfigUpdated(AbstractPreferenceController context);
}
protected final WifiManager mWifiManager;
diff --git a/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceController.java b/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceController.java
index 8d9e858..81239a8 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceController.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceController.java
@@ -65,7 +65,7 @@
public boolean onPreferenceChange(Preference preference, Object newValue) {
mPassword = (String) newValue;
updatePasswordDisplay((EditTextPreference) mPreference);
- mListener.onTetherConfigUpdated();
+ mListener.onTetherConfigUpdated(this);
return true;
}
diff --git a/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceController.java b/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceController.java
index 1197db4..a35450f 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceController.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceController.java
@@ -93,7 +93,7 @@
public boolean onPreferenceChange(Preference preference, Object newValue) {
mSSID = (String) newValue;
updateSsidDisplay((EditTextPreference) preference);
- mListener.onTetherConfigUpdated();
+ mListener.onTetherConfigUpdated(this);
return true;
}
diff --git a/src/com/android/settings/wifi/tether/WifiTetherSecurityPreferenceController.java b/src/com/android/settings/wifi/tether/WifiTetherSecurityPreferenceController.java
index f97a209..9ce05ed 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherSecurityPreferenceController.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherSecurityPreferenceController.java
@@ -45,7 +45,7 @@
public boolean onPreferenceChange(Preference preference, Object newValue) {
mSecurityValue = Integer.parseInt((String) newValue);
preference.setSummary(getSummaryForSecurityType(mSecurityValue));
- mListener.onTetherConfigUpdated();
+ mListener.onTetherConfigUpdated(this);
return true;
}
diff --git a/src/com/android/settings/wifi/tether/WifiTetherSettings.java b/src/com/android/settings/wifi/tether/WifiTetherSettings.java
index aecc053..3636eb8 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherSettings.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherSettings.java
@@ -30,9 +30,8 @@
import android.os.UserManager;
import android.provider.SearchIndexableResource;
import android.util.Log;
-
import androidx.annotation.VisibleForTesting;
-
+import androidx.preference.PreferenceGroup;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.dashboard.RestrictedDashboardFragment;
@@ -42,7 +41,6 @@
import com.android.settingslib.TetherUtil;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.search.SearchIndexable;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -54,6 +52,9 @@
private static final String TAG = "WifiTetherSettings";
private static final IntentFilter TETHER_STATE_CHANGE_FILTER;
private static final String KEY_WIFI_TETHER_SCREEN = "wifi_tether_settings_screen";
+ private static final int EXPANDED_CHILD_COUNT_WITH_SECURITY_NON = 2;
+ private static final int EXPANDED_CHILD_COUNT_DEFAULT = 3;
+
@VisibleForTesting
static final String KEY_WIFI_TETHER_NETWORK_NAME = "wifi_tether_network_name";
@VisibleForTesting
@@ -185,7 +186,7 @@
}
@Override
- public void onTetherConfigUpdated() {
+ public void onTetherConfigUpdated(AbstractPreferenceController context) {
final WifiConfiguration config = buildNewConfig();
mPasswordPreferenceController.updateVisibility(config.getAuthType());
@@ -201,6 +202,10 @@
mSwitchBarController.stopTether();
}
mWifiManager.setWifiApConfiguration(config);
+
+ if (context instanceof WifiTetherSecurityPreferenceController) {
+ reConfigInitialExpandedChildCount();
+ }
}
private WifiConfiguration buildNewConfig() {
@@ -285,4 +290,23 @@
}
}
}
+
+ private void reConfigInitialExpandedChildCount() {
+ final PreferenceGroup screen = getPreferenceScreen();
+ if (mSecurityPreferenceController.getSecurityType() == WifiConfiguration.KeyMgmt.NONE) {
+ screen.setInitialExpandedChildrenCount(EXPANDED_CHILD_COUNT_WITH_SECURITY_NON);
+ return;
+ }
+ screen.setInitialExpandedChildrenCount(EXPANDED_CHILD_COUNT_DEFAULT);
+ }
+
+ @Override
+ public int getInitialExpandedChildCount() {
+ if (mSecurityPreferenceController == null) {
+ return EXPANDED_CHILD_COUNT_DEFAULT;
+ }
+
+ return (mSecurityPreferenceController.getSecurityType() == WifiConfiguration.KeyMgmt.NONE) ?
+ EXPANDED_CHILD_COUNT_WITH_SECURITY_NON : EXPANDED_CHILD_COUNT_DEFAULT;
+ }
}
diff --git a/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java
index e5d5d8f..6f3230c 100644
--- a/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/CellularFallbackPreferenceControllerTest.java
@@ -26,12 +26,8 @@
import android.content.Context;
import android.content.res.Resources;
-import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
-import java.util.ArrayList;
-import java.util.List;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -39,32 +35,35 @@
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
-import org.robolectric.shadows.ShadowApplication;
@RunWith(RobolectricTestRunner.class)
public class CellularFallbackPreferenceControllerTest {
private static final String KEY_CELLULAR_FALLBACK = "wifi_cellular_data_fallback";
- @Mock
- private SubscriptionManager mSubscriptionManager;
-
private CellularFallbackPreferenceController mController;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- ShadowApplication shadowApplication = ShadowApplication.getInstance();
- shadowApplication.setSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE,
- mSubscriptionManager);
+
mController = spy(new CellularFallbackPreferenceController(RuntimeEnvironment.application,
KEY_CELLULAR_FALLBACK));
}
@Test
+ public void isAvailable_invalidActiveSubscriptionId_shouldReturnFalse() {
+ doReturn(SubscriptionManager.INVALID_SUBSCRIPTION_ID)
+ .when(mController).getActiveDataSubscriptionId();
+
+ assertThat(mController.isAvailable()).isFalse();
+ }
+
+ @Test
public void isAvailable_avoidBadWifiConfigIsFalse_shouldReturnTrue() {
- setupMockIcc();
final Resources resources = mock(Resources.class);
+ doReturn(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID)
+ .when(mController).getActiveDataSubscriptionId();
doReturn(resources).when(mController).getResourcesForSubId(anyInt());
when(resources.getInteger(
com.android.internal.R.integer.config_networkAvoidBadWifi))
@@ -75,9 +74,10 @@
@Test
public void isAvailable_avoidBadWifiConfigIsTrue_shouldReturnFalse() {
- setupMockIcc();
final Resources resources = mock(Resources.class);
+ doReturn(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID)
+ .when(mController).getActiveDataSubscriptionId();
doReturn(resources).when(mController).getResourcesForSubId(anyInt());
when(resources.getInteger(
com.android.internal.R.integer.config_networkAvoidBadWifi))
@@ -85,14 +85,4 @@
assertThat(mController.isAvailable()).isFalse();
}
-
- private void setupMockIcc() {
- final List<SubscriptionInfo> subscriptionInfoList = new ArrayList<>();
- final SubscriptionInfo info1 = mock(SubscriptionInfo.class);
- final SubscriptionInfo info2 = mock(SubscriptionInfo.class);
- subscriptionInfoList.add(info1);
- subscriptionInfoList.add(info2);
- when(mSubscriptionManager.getActiveSubscriptionInfoList())
- .thenReturn(subscriptionInfoList);
- }
-}
+}
\ No newline at end of file
diff --git a/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java b/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java
index 5cfc3e8..3335f10 100644
--- a/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java
@@ -17,6 +17,7 @@
package com.android.settings.wifi;
import static com.google.common.truth.Truth.assertThat;
+
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
@@ -27,12 +28,16 @@
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.Bundle;
+
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
+
+import com.android.settings.R;
import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
import com.android.settings.wifi.NetworkRequestErrorDialogFragment.ERROR_DIALOG_TYPE;
import com.android.settingslib.wifi.WifiTracker;
import com.android.settingslib.wifi.WifiTrackerFactory;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -122,4 +127,12 @@
verify(mActivity).finish();
}
+
+ @Test
+ public void launchActivityDialog_shouldApplyAlertDialogTheme() {
+ final NetworkRequestDialogActivity activity = Robolectric
+ .setupActivity(NetworkRequestDialogActivity.class);
+
+ assertThat(activity.getThemeResId()).isEqualTo(R.style.Theme_AlertDialog);
+ }
}
diff --git a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceControllerTest.java
index 6bc2869..590d386 100644
--- a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherApBandPreferenceControllerTest.java
@@ -128,19 +128,19 @@
mController.onPreferenceChange(mPreference, "-1");
assertThat(mController.getBandIndex()).isEqualTo(1);
assertThat(mPreference.getSummary()).isEqualTo(FIVE_GHZ_STRING);
- verify(mListener, times(1)).onTetherConfigUpdated();
+ verify(mListener, times(1)).onTetherConfigUpdated(mController);
// set to 5 Ghz
mController.onPreferenceChange(mPreference, "1");
assertThat(mController.getBandIndex()).isEqualTo(1);
assertThat(mPreference.getSummary()).isEqualTo(FIVE_GHZ_STRING);
- verify(mListener, times(2)).onTetherConfigUpdated();
+ verify(mListener, times(2)).onTetherConfigUpdated(mController);
// set to 2 Ghz
mController.onPreferenceChange(mPreference, "0");
assertThat(mController.getBandIndex()).isEqualTo(0);
assertThat(mPreference.getSummary()).isEqualTo(TWO_GHZ_STRING);
- verify(mListener, times(3)).onTetherConfigUpdated();
+ verify(mListener, times(3)).onTetherConfigUpdated(mController);
}
@Test
@@ -155,19 +155,19 @@
mController.onPreferenceChange(mPreference, "-1");
assertThat(mController.getBandIndex()).isEqualTo(-1);
assertThat(mPreference.getSummary()).isEqualTo(ALL_BANDS);
- verify(mListener, times(1)).onTetherConfigUpdated();
+ verify(mListener, times(1)).onTetherConfigUpdated(mController);
// should revert to the default for 5 Ghz only since this is not supported with this config
mController.onPreferenceChange(mPreference, "1");
assertThat(mController.getBandIndex()).isEqualTo(-1);
assertThat(mPreference.getSummary()).isEqualTo(ALL_BANDS);
- verify(mListener, times(2)).onTetherConfigUpdated();
+ verify(mListener, times(2)).onTetherConfigUpdated(mController);
// set to 2 Ghz
mController.onPreferenceChange(mPreference, "0");
assertThat(mController.getBandIndex()).isEqualTo(0);
assertThat(mPreference.getSummary()).isEqualTo(TWO_GHZ_STRING);
- verify(mListener, times(3)).onTetherConfigUpdated();
+ verify(mListener, times(3)).onTetherConfigUpdated(mController);
}
@Test
diff --git a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceControllerTest.java
index 62fb277..07e7821 100644
--- a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherPasswordPreferenceControllerTest.java
@@ -99,7 +99,7 @@
assertThat(mController.getPasswordValidated(WifiConfiguration.KeyMgmt.WPA2_PSK))
.isEqualTo(VALID_PASS2);
- verify(mListener, times(2)).onTetherConfigUpdated();
+ verify(mListener, times(2)).onTetherConfigUpdated(mController);
}
@Test
diff --git a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceControllerTest.java
index 3d15197..974dc2f 100644
--- a/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceControllerTest.java
@@ -102,7 +102,7 @@
mController.onPreferenceChange(mPreference, "0");
assertThat(mController.getSSID()).isEqualTo("0");
- verify(mListener, times(2)).onTetherConfigUpdated();
+ verify(mListener, times(2)).onTetherConfigUpdated(mController);
}
@Test