Merge "Use searchable="false" to suppress nonIndexables."
diff --git a/res/xml/accessibility_magnification_settings.xml b/res/xml/accessibility_magnification_settings.xml
index bac01bd..bb40394 100644
--- a/res/xml/accessibility_magnification_settings.xml
+++ b/res/xml/accessibility_magnification_settings.xml
@@ -13,10 +13,12 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:settings="http://schemas.android.com/apk/res-auto"
- android:key="magnification_preference_screen_title"
- android:title="@string/accessibility_screen_magnification_title">
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
+ android:key="magnification_preference_screen_title"
+ android:title="@string/accessibility_screen_magnification_title"
+ settings:searchable="false">
<Preference
android:fragment="com.android.settings.accessibility.ToggleScreenMagnificationPreferenceFragment"
android:key="screen_magnification_gestures_preference_screen"
diff --git a/res/xml/accessibility_settings.xml b/res/xml/accessibility_settings.xml
index e36f578..95dba41 100644
--- a/res/xml/accessibility_settings.xml
+++ b/res/xml/accessibility_settings.xml
@@ -38,7 +38,8 @@
<Preference
android:key="tts_settings_preference"
android:fragment="com.android.settings.tts.TextToSpeechSettings"
- android:title="@string/tts_settings_title"/>
+ android:title="@string/tts_settings_title"
+ settings:searchable="false"/>
</PreferenceCategory>
<PreferenceCategory
@@ -48,12 +49,14 @@
<Preference
android:fragment="com.android.settings.accessibility.ToggleFontSizePreferenceFragment"
android:key="font_size_preference_screen"
- android:title="@string/title_font_size" />
+ android:title="@string/title_font_size"
+ settings:searchable="false"/>
<com.android.settings.display.ScreenZoomPreference
android:key="accessibility_settings_screen_zoom"
android:fragment="com.android.settings.display.ScreenZoomSettings"
- android:title="@string/screen_zoom_title" />
+ android:title="@string/screen_zoom_title"
+ settings:searchable="false"/>
<Preference
android:fragment="com.android.settings.accessibility.MagnificationPreferenceFragment"
@@ -77,7 +80,8 @@
<Preference
android:fragment="com.android.settings.accessibility.ToggleAutoclickPreferenceFragment"
android:key="autoclick_preference"
- android:title="@string/accessibility_autoclick_preference_title"/>
+ android:title="@string/accessibility_autoclick_preference_title"
+ settings:searchable="false"/>
<SwitchPreference
android:key="toggle_power_button_ends_call_preference"
@@ -136,7 +140,8 @@
android:fragment="com.android.settings.accessibility.ToggleDaltonizerPreferenceFragment"
android:key="daltonizer_preference"
android:title="@string/accessibility_display_daltonizer_preference_title"
- android:icon="@drawable/ic_daltonizer"/>
+ android:icon="@drawable/ic_daltonizer"
+ settings:searchable="false"/>
<SwitchPreference
android:key="toggle_inversion_preference"
diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml
index fbb464c..e4d948b 100644
--- a/res/xml/configure_notification_settings.xml
+++ b/res/xml/configure_notification_settings.xml
@@ -23,7 +23,8 @@
<com.android.settings.RestrictedListPreference
android:key="lock_screen_notifications"
android:title="@string/lock_screen_notifications_title"
- android:summary="@string/summary_placeholder"/>
+ android:summary="@string/summary_placeholder"
+ settings:searchable="false"/>
<!-- Notification badging -->
<SwitchPreference
@@ -35,7 +36,7 @@
<SwitchPreference
android:key="notification_pulse"
android:title="@string/notification_pulse_title"
- settings:controller="com.android.settings.notification.PulseNotificationPreferenceController" />
+ settings:controller="com.android.settings.notification.PulseNotificationPreferenceController"/>
<!-- Default notification ringtone -->
<com.android.settings.DefaultRingtonePreference
@@ -43,13 +44,13 @@
android:title="@string/notification_ringtone_title"
android:dialogTitle="@string/notification_ringtone_title"
android:summary="@string/summary_placeholder"
- android:ringtoneType="notification" />
+ android:ringtoneType="notification"/>
<Preference
android:key="gesture_swipe_down_fingerprint_notifications"
android:title="@string/fingerprint_swipe_for_notifications_title"
android:fragment="com.android.settings.gestures.SwipeToNotificationSettings"
- settings:controller="com.android.settings.gestures.SwipeToNotificationPreferenceController" />
+ settings:controller="com.android.settings.gestures.SwipeToNotificationPreferenceController"/>
<com.android.settingslib.RestrictedPreference
android:key="zen_mode_notifications"
@@ -57,7 +58,7 @@
settings:useAdminDisabledSummary="true"
android:fragment="com.android.settings.notification.ZenModeSettings"
settings:controller="com.android.settings.notification.ZenModePreferenceController"
- settings:allowDividerAbove="false" />
+ settings:allowDividerAbove="false"/>
<!-- Empty category to draw divider -->
<PreferenceCategory
@@ -79,7 +80,7 @@
android:order="22">
<extra
android:name="classname"
- android:value="com.android.settings.Settings$NotificationAppListActivity" />
+ android:value="com.android.settings.Settings$NotificationAppListActivity"/>
</Preference>
</PreferenceCategory>
@@ -88,13 +89,15 @@
<PreferenceCategory
android:key="lock_screen_notifications_profile_header"
android:title="@string/profile_section_header"
- android:order="23">
+ android:order="23"
+ settings:searchable="false">
<com.android.settings.RestrictedListPreference
android:key="lock_screen_notifications_profile"
android:title="@string/locked_work_profile_notification_title"
android:summary="@string/summary_placeholder"
- android:order="24"/>
+ android:order="24"
+ settings:searchable="false"/>
</PreferenceCategory>
</PreferenceScreen>
diff --git a/res/xml/connected_devices_advanced.xml b/res/xml/connected_devices_advanced.xml
index 2ff27c9..a959d02 100644
--- a/res/xml/connected_devices_advanced.xml
+++ b/res/xml/connected_devices_advanced.xml
@@ -25,7 +25,8 @@
android:key="bluetooth_settings"
android:title="@string/bluetooth_settings_title"
android:icon="@drawable/ic_settings_bluetooth"
- android:order="-9"/>
+ android:order="-9"
+ settings:searchable="false"/>
<SwitchPreference
android:key="toggle_nfc"
@@ -57,7 +58,8 @@
android:summary="@string/summary_placeholder"
android:icon="@drawable/ic_settings_print"
android:fragment="com.android.settings.print.PrintSettingsFragment"
- android:order="-3"/>
+ android:order="-3"
+ settings:searchable="false"/>
<Preference
android:key="bt_received_files"
diff --git a/res/xml/display_settings.xml b/res/xml/display_settings.xml
index 0686bdb..54769cf 100644
--- a/res/xml/display_settings.xml
+++ b/res/xml/display_settings.xml
@@ -37,20 +37,22 @@
android:fragment="com.android.settings.display.NightDisplaySettings"
android:widgetLayout="@null"
settings:widgetLayout="@null"
- settings:keywords="@string/keywords_display_night_display" />
+ settings:searchable="false" />
<Preference
android:key="auto_brightness_entry"
android:title="@string/auto_brightness_title"
android:summary="@string/summary_placeholder"
android:fragment="com.android.settings.display.AutoBrightnessSettings"
+ settings:searchable="false"
settings:controller="com.android.settings.display.AutoBrightnessPreferenceController" />
<com.android.settingslib.RestrictedPreference
android:key="wallpaper"
android:title="@string/wallpaper_settings_title"
settings:keywords="@string/keywords_display_wallpaper"
- settings:useAdminDisabledSummary="true">
+ settings:useAdminDisabledSummary="true"
+ settings:searchable="false">
<intent
android:targetPackage="@string/config_wallpaper_picker_package"
android:targetClass="@string/config_wallpaper_picker_class" />
@@ -88,7 +90,7 @@
android:key="display_settings_screen_zoom"
android:title="@string/screen_zoom_title"
android:fragment="com.android.settings.display.ScreenZoomSettings"
- settings:keywords="@string/screen_zoom_keywords" />
+ settings:searchable="false"/>
<SwitchPreference
android:key="show_operator_name"
@@ -99,7 +101,7 @@
android:key="screensaver"
android:title="@string/screensaver_settings_title"
android:fragment="com.android.settings.dream.DreamSettings"
- settings:controller="com.android.settings.dream.DreamEntryPreferenceController" />
+ settings:searchable="false" />
<com.android.settingslib.RestrictedPreference
android:key="lockscreen_from_display_settings"
diff --git a/res/xml/language_and_input.xml b/res/xml/language_and_input.xml
index 50c6a82..8b63e32 100644
--- a/res/xml/language_and_input.xml
+++ b/res/xml/language_and_input.xml
@@ -39,7 +39,8 @@
android:key="physical_keyboard_pref"
android:title="@string/physical_keyboard_title"
android:summary="@string/summary_placeholder"
- android:fragment="com.android.settings.inputmethod.PhysicalKeyboardFragment" />
+ android:fragment="com.android.settings.inputmethod.PhysicalKeyboardFragment"
+ settings:searchable="false"/>
</PreferenceCategory>
<PreferenceCategory
@@ -80,7 +81,8 @@
<Preference
android:key="tts_settings_summary"
android:title="@string/tts_settings_title"
- android:fragment="com.android.settings.tts.TextToSpeechSettings" />
+ android:fragment="com.android.settings.tts.TextToSpeechSettings"
+ settings:searchable="false"/>
</PreferenceCategory>
diff --git a/res/xml/location_settings.xml b/res/xml/location_settings.xml
index 22079bf..b53e986 100644
--- a/res/xml/location_settings.xml
+++ b/res/xml/location_settings.xml
@@ -29,7 +29,8 @@
android:title="@string/location_recent_location_requests_see_all"
android:icon="@drawable/ic_chevron_right_24dp"
android:selectable="true"
- android:fragment="com.android.settings.location.RecentLocationRequestSeeAllFragment"/>
+ android:fragment="com.android.settings.location.RecentLocationRequestSeeAllFragment"
+ settings:searchable="false"/>
<PreferenceCategory
android:key="location_advanced_settings"
diff --git a/res/xml/my_device_info.xml b/res/xml/my_device_info.xml
index 22c1844..957ba81 100644
--- a/res/xml/my_device_info.xml
+++ b/res/xml/my_device_info.xml
@@ -61,7 +61,8 @@
android:order="5"
android:title="@string/legal_information"
android:fragment="com.android.settings.LegalSettings"
- settings:allowDividerAbove="true"/>
+ settings:allowDividerAbove="true"
+ settings:searchable="false"/>
<!-- Regulatory labels -->
<Preference
diff --git a/res/xml/screen_lock_settings.xml b/res/xml/screen_lock_settings.xml
index 9b2ef7e..43f96e9 100644
--- a/res/xml/screen_lock_settings.xml
+++ b/res/xml/screen_lock_settings.xml
@@ -17,8 +17,10 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="security_settings_password_sub_screen"
- android:title="@string/unlock_set_unlock_launch_picker_title">
+ android:title="@string/unlock_set_unlock_launch_picker_title"
+ settings:searchable="false">
<!-- available in pattern -->
<SwitchPreference
diff --git a/res/xml/security_lockscreen_settings.xml b/res/xml/security_lockscreen_settings.xml
index 2cd92c5..71a1895 100644
--- a/res/xml/security_lockscreen_settings.xml
+++ b/res/xml/security_lockscreen_settings.xml
@@ -83,12 +83,14 @@
<PreferenceCategory
android:key="security_setting_lock_screen_notif_work_header"
android:title="@string/profile_section_header"
- android:order="1001">
+ android:order="1001"
+ settings:searchable="false">
<com.android.settings.RestrictedListPreference
android:key="security_setting_lock_screen_notif_work"
android:title="@string/locked_work_profile_notification_title"
- android:summary="@string/summary_placeholder" />
+ android:summary="@string/summary_placeholder"
+ settings:searchable="false"/>
</PreferenceCategory>
diff --git a/res/xml/tts_settings.xml b/res/xml/tts_settings.xml
index be34b28..4a24154 100644
--- a/res/xml/tts_settings.xml
+++ b/res/xml/tts_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="tts_settings_screen"
android:title="@string/tts_settings_title">
@@ -24,7 +25,8 @@
<com.android.settings.widget.GearPreference
android:key="tts_engine_preference"
android:title="@string/tts_engine_preference_title"
- android:fragment="com.android.settings.tts.TtsEnginePreferenceFragment"/>
+ android:fragment="com.android.settings.tts.TtsEnginePreferenceFragment"
+ settings:searchable="false"/>
<ListPreference
android:key="tts_default_lang"
diff --git a/res/xml/virtual_keyboard_settings.xml b/res/xml/virtual_keyboard_settings.xml
index 93445f4..78b27f9 100644
--- a/res/xml/virtual_keyboard_settings.xml
+++ b/res/xml/virtual_keyboard_settings.xml
@@ -15,11 +15,13 @@
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="virtual_keyboard_category"
android:title="@string/virtual_keyboard_category">
<!-- Enabled input method list will be populated programmatically here. -->
<Preference
android:key="add_virtual_keyboard_screen"
android:title="@string/add_virtual_keyboard"
- android:fragment="com.android.settings.inputmethod.AvailableVirtualKeyboardFragment" />
+ android:fragment="com.android.settings.inputmethod.AvailableVirtualKeyboardFragment"
+ settings:searchable="false"/>
</PreferenceScreen>
diff --git a/res/xml/wifi_tether_settings.xml b/res/xml/wifi_tether_settings.xml
index 3e8f93f..6c5e3c4 100644
--- a/res/xml/wifi_tether_settings.xml
+++ b/res/xml/wifi_tether_settings.xml
@@ -20,31 +20,32 @@
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">
<com.android.settings.widget.ValidatedEditTextPreference
android:key="wifi_tether_network_name"
android:title="@string/wifi_hotspot_name_title"
- android:summary="@string/summary_placeholder" />
+ android:summary="@string/summary_placeholder"/>
<ListPreference
android:key="wifi_tether_security"
android:title="@string/wifi_security"
android:summary="@string/summary_placeholder"
android:entries="@array/wifi_tether_security"
- android:entryValues="@array/wifi_tether_security_values" />
+ android:entryValues="@array/wifi_tether_security_values"/>
<com.android.settings.widget.ValidatedEditTextPreference
android:key="wifi_tether_network_password"
android:persistent="false"
- android:title="@string/wifi_hotspot_password_title" />
+ android:title="@string/wifi_hotspot_password_title"/>
<SwitchPreference
android:key="wifi_tether_auto_turn_off"
android:title="@string/wifi_hotspot_auto_off_title"
- android:summary="@string/wifi_hotspot_auto_off_summary" />
+ android:summary="@string/wifi_hotspot_auto_off_summary"/>
<ListPreference
android:key="wifi_tether_network_ap_band"
- android:title="@string/wifi_hotspot_ap_band_title" />
+ android:title="@string/wifi_hotspot_ap_band_title"/>
</PreferenceScreen>
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index 236c7db..75f13aa 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -46,11 +46,7 @@
public class DisplaySettings extends DashboardFragment {
private static final String TAG = "DisplaySettings";
- public static final String KEY_DISPLAY_SIZE = "display_settings_screen_zoom";
-
private static final String KEY_SCREEN_TIMEOUT = "screen_timeout";
- private static final String KEY_AUTO_BRIGHTNESS = "auto_brightness_entry";
- private static final String KEY_NIGHT_DISPLAY = "night_display";
@Override
public int getMetricsCategory() {
@@ -109,16 +105,6 @@
}
@Override
- public List<String> getNonIndexableKeys(Context context) {
- List<String> keys = super.getNonIndexableKeys(context);
- keys.add(KEY_DISPLAY_SIZE);
- keys.add(WallpaperPreferenceController.KEY_WALLPAPER);
- keys.add(KEY_NIGHT_DISPLAY);
- keys.add(KEY_AUTO_BRIGHTNESS);
- return keys;
- }
-
- @Override
public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return buildPreferenceControllers(context, null);
diff --git a/src/com/android/settings/accessibility/AccessibilitySettings.java b/src/com/android/settings/accessibility/AccessibilitySettings.java
index d1b1ad4..42dc7ac 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettings.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettings.java
@@ -118,8 +118,6 @@
"magnification_preference_screen";
private static final String FONT_SIZE_PREFERENCE_SCREEN =
"font_size_preference_screen";
- private static final String TTS_SETTINGS_PREFERENCE =
- "tts_settings_preference";
private static final String AUTOCLICK_PREFERENCE_SCREEN =
"autoclick_preference";
private static final String VIBRATION_PREFERENCE_SCREEN =
@@ -887,8 +885,6 @@
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider() {
- public static final String KEY_DISPLAY_SIZE = "accessibility_settings_screen_zoom";
-
@Override
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
boolean enabled) {
@@ -898,21 +894,5 @@
indexables.add(indexable);
return indexables;
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- List<String> keys = super.getNonIndexableKeys(context);
- // Duplicates in Display
- keys.add(FONT_SIZE_PREFERENCE_SCREEN);
- keys.add(KEY_DISPLAY_SIZE);
-
- // Duplicates in Language & Input
- keys.add(TTS_SETTINGS_PREFERENCE);
-
- // Duplicates in child page
- keys.add(DISPLAY_DALTONIZER_PREFERENCE_SCREEN);
- keys.add(AUTOCLICK_PREFERENCE_SCREEN);
- return keys;
- }
};
}
diff --git a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
index 5f1cee4..31b23fa 100644
--- a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
@@ -27,6 +27,9 @@
import android.text.TextUtils;
import android.view.accessibility.AccessibilityManager;
+import androidx.annotation.VisibleForTesting;
+import androidx.preference.Preference;
+
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -39,9 +42,6 @@
import java.util.Arrays;
import java.util.List;
-import androidx.annotation.VisibleForTesting;
-import androidx.preference.Preference;
-
@SearchIndexable
public final class MagnificationPreferenceFragment extends DashboardFragment {
@VisibleForTesting
@@ -172,12 +172,5 @@
protected boolean isPageSearchEnabled(Context context) {
return isApplicable(context.getResources());
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- List<String> keys = super.getNonIndexableKeys(context);
- keys.add(PREFERENCE_TITLE_KEY);
- return keys;
- }
};
}
diff --git a/src/com/android/settings/backup/BackupSettingsActivityPreferenceController.java b/src/com/android/settings/backup/BackupSettingsActivityPreferenceController.java
index 131a234..1af80d9 100644
--- a/src/com/android/settings/backup/BackupSettingsActivityPreferenceController.java
+++ b/src/com/android/settings/backup/BackupSettingsActivityPreferenceController.java
@@ -26,13 +26,12 @@
public class BackupSettingsActivityPreferenceController extends BasePreferenceController {
private static final String TAG = "BackupSettingActivityPC";
- private static final String KEY_BACKUP_SETTINGS = "backup_settings";
private final UserManager mUm;
private final BackupManager mBackupManager;
- public BackupSettingsActivityPreferenceController(Context context) {
- super(context, KEY_BACKUP_SETTINGS);
+ public BackupSettingsActivityPreferenceController(Context context, String key) {
+ super(context, key);
mUm = (UserManager) context.getSystemService(Context.USER_SERVICE);
mBackupManager = new BackupManager(context);
}
diff --git a/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java b/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java
index e58ac1f..5c678a9 100644
--- a/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java
@@ -108,9 +108,6 @@
keys.add(AndroidBeamPreferenceController.KEY_ANDROID_BEAM_SETTINGS);
}
- // Parent duplicate
- keys.add(KEY_BLUETOOTH);
-
return keys;
}
diff --git a/src/com/android/settings/connecteddevice/AvailableMediaDeviceGroupController.java b/src/com/android/settings/connecteddevice/AvailableMediaDeviceGroupController.java
index 183ed3f..e0a7d27 100644
--- a/src/com/android/settings/connecteddevice/AvailableMediaDeviceGroupController.java
+++ b/src/com/android/settings/connecteddevice/AvailableMediaDeviceGroupController.java
@@ -95,7 +95,7 @@
@Override
public int getAvailabilityStatus() {
return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)
- ? AVAILABLE
+ ? AVAILABLE_UNSEARCHABLE
: UNSUPPORTED_ON_DEVICE;
}
diff --git a/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java b/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
index 380e8a5..e9b076e 100644
--- a/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
@@ -19,6 +19,8 @@
import android.content.Context;
import android.provider.SearchIndexableResource;
+import androidx.annotation.VisibleForTesting;
+
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -32,8 +34,6 @@
import java.util.Arrays;
import java.util.List;
-import androidx.annotation.VisibleForTesting;
-
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class ConnectedDeviceDashboardFragment extends DashboardFragment {
@@ -139,14 +139,5 @@
context) {
return buildPreferenceControllers(context, null /* lifecycle */);
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- List<String> keys = super.getNonIndexableKeys(context);
- // Disable because they show dynamic data
- keys.add(KEY_AVAILABLE_DEVICES);
- keys.add(KEY_CONNECTED_DEVICES);
- return keys;
- }
};
}
diff --git a/src/com/android/settings/connecteddevice/ConnectedDeviceGroupController.java b/src/com/android/settings/connecteddevice/ConnectedDeviceGroupController.java
index 143b72d..e986bc2 100644
--- a/src/com/android/settings/connecteddevice/ConnectedDeviceGroupController.java
+++ b/src/com/android/settings/connecteddevice/ConnectedDeviceGroupController.java
@@ -89,7 +89,7 @@
@Override
public int getAvailabilityStatus() {
return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)
- ? AVAILABLE
+ ? AVAILABLE_UNSEARCHABLE
: UNSUPPORTED_ON_DEVICE;
}
diff --git a/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java b/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java
index 8fd0902..f5c3f53 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java
@@ -114,11 +114,6 @@
}
@Override
- public List<String> getNonIndexableKeys(Context context) {
- return super.getNonIndexableKeys(context);
- }
-
- @Override
public List<AbstractPreferenceController> createPreferenceControllers(
Context context) {
return new ArrayList<>(
diff --git a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
index 425edd9..3de46e01 100644
--- a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
+++ b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
@@ -65,7 +65,6 @@
private static final String LOG_TAG = "MyDeviceInfoFragment";
private static final String KEY_MY_DEVICE_INFO_HEADER = "my_device_info_header";
- private static final String KEY_LEGAL_CONTAINER = "legal_container";
@Override
public int getMetricsCategory() {
@@ -223,13 +222,5 @@
return buildPreferenceControllers(context, null /*activity */,
null /* fragment */, null /* lifecycle */);
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- List<String> keys = super.getNonIndexableKeys(context);
- // The legal container is duplicated, so we ignore it here.
- keys.add(KEY_LEGAL_CONTAINER);
- return keys;
- }
};
}
diff --git a/src/com/android/settings/display/AutoBrightnessPreferenceController.java b/src/com/android/settings/display/AutoBrightnessPreferenceController.java
index 3b7a076..3f5f2b0 100644
--- a/src/com/android/settings/display/AutoBrightnessPreferenceController.java
+++ b/src/com/android/settings/display/AutoBrightnessPreferenceController.java
@@ -52,7 +52,7 @@
public int getAvailabilityStatus() {
return mContext.getResources().getBoolean(
com.android.internal.R.bool.config_automatic_brightness_available)
- ? AVAILABLE
+ ? AVAILABLE_UNSEARCHABLE
: UNSUPPORTED_ON_DEVICE;
}
diff --git a/src/com/android/settings/dream/DreamEntryPreferenceController.java b/src/com/android/settings/dream/DreamEntryPreferenceController.java
deleted file mode 100644
index 097fa3a..0000000
--- a/src/com/android/settings/dream/DreamEntryPreferenceController.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.dream;
-
-import android.content.Context;
-
-import com.android.settings.core.BasePreferenceController;
-
-public class DreamEntryPreferenceController extends BasePreferenceController {
-
- public DreamEntryPreferenceController(Context context, String preferenceKey) {
- super(context, preferenceKey);
- }
-
- @Override
- public int getAvailabilityStatus() {
- return AVAILABLE_UNSEARCHABLE;
- }
-}
diff --git a/src/com/android/settings/fuelgauge/BatterySaverController.java b/src/com/android/settings/fuelgauge/BatterySaverController.java
index e77393e..28cc893 100644
--- a/src/com/android/settings/fuelgauge/BatterySaverController.java
+++ b/src/com/android/settings/fuelgauge/BatterySaverController.java
@@ -49,7 +49,7 @@
@Override
public int getAvailabilityStatus() {
- return AVAILABLE;
+ return AVAILABLE_UNSEARCHABLE;
}
@Override
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index 7563120..054c66b 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -68,7 +68,6 @@
private static final boolean DEBUG = false;
private static final String KEY_BATTERY_HEADER = "battery_header";
- private static final String KEY_BATTERY_TIP = "battery_tip";
private static final String KEY_SCREEN_USAGE = "screen_usage";
private static final String KEY_TIME_SINCE_LAST_FULL_CHARGE = "last_full_charge";
@@ -429,13 +428,6 @@
sir.xmlResId = R.xml.power_usage_summary;
return Collections.singletonList(sir);
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- List<String> niks = super.getNonIndexableKeys(context);
- niks.add(KEY_BATTERY_SAVER_SUMMARY);
- return niks;
- }
};
public static final SummaryLoader.SummaryProviderFactory SUMMARY_PROVIDER_FACTORY
diff --git a/src/com/android/settings/gestures/AssistGestureSettingsPreferenceController.java b/src/com/android/settings/gestures/AssistGestureSettingsPreferenceController.java
index f8b86b0..729962d 100644
--- a/src/com/android/settings/gestures/AssistGestureSettingsPreferenceController.java
+++ b/src/com/android/settings/gestures/AssistGestureSettingsPreferenceController.java
@@ -22,13 +22,13 @@
import android.content.Context;
import android.provider.Settings;
-import com.android.settings.R;
-import com.android.settings.overlay.FeatureFactory;
-
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
+import com.android.settings.R;
+import com.android.settings.overlay.FeatureFactory;
+
public class AssistGestureSettingsPreferenceController extends GesturePreferenceController {
private static final String PREF_KEY_VIDEO = "gesture_assist_video";
@@ -38,7 +38,6 @@
private static final int ON = 1;
private static final int OFF = 0;
- private final String mAssistGesturePrefKey;
private final AssistGestureFeatureProvider mFeatureProvider;
private boolean mWasAvailable;
@@ -48,12 +47,10 @@
@VisibleForTesting
boolean mAssistOnly;
- public AssistGestureSettingsPreferenceController(Context context,
- String key) {
+ public AssistGestureSettingsPreferenceController(Context context, String key) {
super(context, key);
mFeatureProvider = FeatureFactory.getFactory(context).getAssistGestureFeatureProvider();
mWasAvailable = isAvailable();
- mAssistGesturePrefKey = key;
}
@Override
diff --git a/src/com/android/settings/inputmethod/VirtualKeyboardFragment.java b/src/com/android/settings/inputmethod/VirtualKeyboardFragment.java
index 024fe60..e1c9615 100644
--- a/src/com/android/settings/inputmethod/VirtualKeyboardFragment.java
+++ b/src/com/android/settings/inputmethod/VirtualKeyboardFragment.java
@@ -27,6 +27,8 @@
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
+import androidx.preference.Preference;
+
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.util.Preconditions;
import com.android.settings.R;
@@ -42,8 +44,6 @@
import java.util.Arrays;
import java.util.List;
-import androidx.preference.Preference;
-
@SearchIndexable
public final class VirtualKeyboardFragment extends SettingsPreferenceFragment implements Indexable {
@@ -130,12 +130,5 @@
sir.xmlResId = R.xml.virtual_keyboard_settings;
return Arrays.asList(sir);
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- final List<String> keys = super.getNonIndexableKeys(context);
- keys.add("add_virtual_keyboard_screen");
- return keys;
- }
};
}
diff --git a/src/com/android/settings/language/LanguageAndInputSettings.java b/src/com/android/settings/language/LanguageAndInputSettings.java
index 68b1b24..ae0a568 100644
--- a/src/com/android/settings/language/LanguageAndInputSettings.java
+++ b/src/com/android/settings/language/LanguageAndInputSettings.java
@@ -23,12 +23,13 @@
import android.content.pm.PackageManager;
import android.provider.SearchIndexableResource;
import android.provider.Settings;
-import android.speech.tts.TtsEngines;
import android.text.TextUtils;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
+
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -41,6 +42,7 @@
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.search.SearchIndexable;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -53,7 +55,6 @@
private static final String KEY_KEYBOARDS_CATEGORY = "keyboards_category";
private static final String KEY_TEXT_TO_SPEECH = "tts_settings_summary";
private static final String KEY_POINTER_AND_TTS_CATEGORY = "pointer_and_tts_category";
- private static final String KEY_PHYSICAL_KEYBOARD = "physical_keyboard_pref";
@Override
public int getMetricsCategory() {
@@ -175,13 +176,5 @@
Context context) {
return buildPreferenceControllers(context, null);
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- List<String> keys = super.getNonIndexableKeys(context);
- // Duplicates in summary and details pages.
- keys.add(KEY_PHYSICAL_KEYBOARD);
- return keys;
- }
};
}
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java
index 18b1033..758ca57 100644
--- a/src/com/android/settings/location/LocationSettings.java
+++ b/src/com/android/settings/location/LocationSettings.java
@@ -22,6 +22,9 @@
import android.os.Bundle;
import android.provider.SearchIndexableResource;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceGroup;
+
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
@@ -41,9 +44,6 @@
import java.util.Comparator;
import java.util.List;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceGroup;
-
/**
* System location settings (Settings > Location). The screen has three parts:
* <ul>
@@ -180,12 +180,5 @@
return buildPreferenceControllers(context, null /* fragment */,
null /* lifecycle */);
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- final List<String> niks = super.getNonIndexableKeys(context);
- niks.add("recent_location_requests_see_all_button"); // 'See all' button
- return niks;
- }
};
}
diff --git a/src/com/android/settings/notification/ConfigureNotificationSettings.java b/src/com/android/settings/notification/ConfigureNotificationSettings.java
index 7120cf6..13c5e88 100644
--- a/src/com/android/settings/notification/ConfigureNotificationSettings.java
+++ b/src/com/android/settings/notification/ConfigureNotificationSettings.java
@@ -218,9 +218,6 @@
public List<String> getNonIndexableKeys(Context context) {
final List<String> keys = super.getNonIndexableKeys(context);
keys.add(KEY_SWIPE_DOWN);
- keys.add(KEY_LOCKSCREEN);
- keys.add(KEY_LOCKSCREEN_WORK_PROFILE);
- keys.add(KEY_LOCKSCREEN_WORK_PROFILE_HEADER);
return keys;
}
};
diff --git a/src/com/android/settings/notification/ZenModeBlockedEffectsSettings.java b/src/com/android/settings/notification/ZenModeBlockedEffectsSettings.java
index c105a1a..6c7477a 100644
--- a/src/com/android/settings/notification/ZenModeBlockedEffectsSettings.java
+++ b/src/com/android/settings/notification/ZenModeBlockedEffectsSettings.java
@@ -108,12 +108,6 @@
return result;
}
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- final List<String> keys = super.getNonIndexableKeys(context);
- return keys;
- }
-
@Override
public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, null);
diff --git a/src/com/android/settings/notification/ZenModeCallsSettings.java b/src/com/android/settings/notification/ZenModeCallsSettings.java
index bff1c9f..6ba53b5 100644
--- a/src/com/android/settings/notification/ZenModeCallsSettings.java
+++ b/src/com/android/settings/notification/ZenModeCallsSettings.java
@@ -82,14 +82,9 @@
}
@Override
- public List<String> getNonIndexableKeys(Context context) {
- final List<String> keys = super.getNonIndexableKeys(context);
- return keys;
+ public List<AbstractPreferenceController> createPreferenceControllers(
+ Context context) {
+ return buildPreferenceControllers(context, null);
}
-
- @Override
- public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
- return buildPreferenceControllers(context, null);
- }
- };
+ };
}
diff --git a/src/com/android/settings/notification/ZenModeMsgEventReminderSettings.java b/src/com/android/settings/notification/ZenModeMsgEventReminderSettings.java
index b61b76e..0e6747a 100644
--- a/src/com/android/settings/notification/ZenModeMsgEventReminderSettings.java
+++ b/src/com/android/settings/notification/ZenModeMsgEventReminderSettings.java
@@ -80,12 +80,6 @@
return result;
}
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- final List<String> keys = super.getNonIndexableKeys(context);
- return keys;
- }
-
@Override
public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, null);
diff --git a/src/com/android/settings/notification/ZenModeRestrictNotificationsSettings.java b/src/com/android/settings/notification/ZenModeRestrictNotificationsSettings.java
index bf170df..56ed086 100644
--- a/src/com/android/settings/notification/ZenModeRestrictNotificationsSettings.java
+++ b/src/com/android/settings/notification/ZenModeRestrictNotificationsSettings.java
@@ -90,12 +90,6 @@
return result;
}
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- final List<String> keys = super.getNonIndexableKeys(context);
- return keys;
- }
-
@Override
public List<AbstractPreferenceController> createPreferenceControllers(Context context) {
return buildPreferenceControllers(context, null);
diff --git a/src/com/android/settings/security/LockscreenDashboardFragment.java b/src/com/android/settings/security/LockscreenDashboardFragment.java
index 71130ea..3533915 100644
--- a/src/com/android/settings/security/LockscreenDashboardFragment.java
+++ b/src/com/android/settings/security/LockscreenDashboardFragment.java
@@ -154,8 +154,6 @@
public List<String> getNonIndexableKeys(Context context) {
final List<String> niks = super.getNonIndexableKeys(context);
niks.add(KEY_ADD_USER_FROM_LOCK_SCREEN);
- niks.add(KEY_LOCK_SCREEN_NOTIFICATON_WORK_PROFILE);
- niks.add(KEY_LOCK_SCREEN_NOTIFICATON_WORK_PROFILE_HEADER);
return niks;
}
diff --git a/src/com/android/settings/security/screenlock/ScreenLockSettings.java b/src/com/android/settings/security/screenlock/ScreenLockSettings.java
index abb4b33..90b5e3f 100644
--- a/src/com/android/settings/security/screenlock/ScreenLockSettings.java
+++ b/src/com/android/settings/security/screenlock/ScreenLockSettings.java
@@ -20,6 +20,8 @@
import android.os.UserHandle;
import android.provider.SearchIndexableResource;
+import androidx.fragment.app.Fragment;
+
import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
@@ -34,16 +36,12 @@
import java.util.ArrayList;
import java.util.List;
-import androidx.fragment.app.Fragment;
-
@SearchIndexable
public class ScreenLockSettings extends DashboardFragment
implements OwnerInfoPreferenceController.OwnerInfoCallback {
private static final String TAG = "ScreenLockSettings";
- private static final String KEY_LOCK_SCREEN_TITLE = "security_settings_password_sub_screen";
-
private static final int MY_USER_ID = UserHandle.myUserId();
private LockPatternUtils mLockPatternUtils;
@@ -107,12 +105,5 @@
return buildPreferenceControllers(context, null /* parent */,
null /* lifecycle */, new LockPatternUtils(context));
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- final List<String> keys = super.getNonIndexableKeys(context);
- keys.add(KEY_LOCK_SCREEN_TITLE);
- return keys;
- }
};
}
diff --git a/src/com/android/settings/system/ResetPreferenceController.java b/src/com/android/settings/system/ResetPreferenceController.java
index ec0c27b..050efc4 100644
--- a/src/com/android/settings/system/ResetPreferenceController.java
+++ b/src/com/android/settings/system/ResetPreferenceController.java
@@ -29,7 +29,7 @@
@Override
public int getAvailabilityStatus() {
return mContext.getResources().getBoolean(R.bool.config_show_reset_dashboard)
- ? AVAILABLE
+ ? AVAILABLE_UNSEARCHABLE
: UNSUPPORTED_ON_DEVICE;
}
}
diff --git a/src/com/android/settings/system/SystemDashboardFragment.java b/src/com/android/settings/system/SystemDashboardFragment.java
index 0c73e4d..4f0c738 100644
--- a/src/com/android/settings/system/SystemDashboardFragment.java
+++ b/src/com/android/settings/system/SystemDashboardFragment.java
@@ -19,9 +19,12 @@
import android.os.Bundle;
import android.provider.SearchIndexableResource;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceGroup;
+import androidx.preference.PreferenceScreen;
+
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
-import com.android.settings.backup.BackupSettingsActivityPreferenceController;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -30,10 +33,6 @@
import java.util.Arrays;
import java.util.List;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceGroup;
-import androidx.preference.PreferenceScreen;
-
@SearchIndexable
public class SystemDashboardFragment extends DashboardFragment {
@@ -97,12 +96,5 @@
sir.xmlResId = R.xml.system_dashboard_fragment;
return Arrays.asList(sir);
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- List<String> keys = super.getNonIndexableKeys(context);
- keys.add(KEY_RESET);
- return keys;
- }
};
}
\ No newline at end of file
diff --git a/src/com/android/settings/tts/TextToSpeechSettings.java b/src/com/android/settings/tts/TextToSpeechSettings.java
index d21d0c8..0f10d28 100644
--- a/src/com/android/settings/tts/TextToSpeechSettings.java
+++ b/src/com/android/settings/tts/TextToSpeechSettings.java
@@ -34,6 +34,10 @@
import android.util.Log;
import android.util.Pair;
+import androidx.appcompat.app.AlertDialog;
+import androidx.preference.ListPreference;
+import androidx.preference.Preference;
+
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
@@ -56,10 +60,6 @@
import java.util.Objects;
import java.util.Set;
-import androidx.appcompat.app.AlertDialog;
-import androidx.preference.ListPreference;
-import androidx.preference.Preference;
-
@SearchIndexable
public class TextToSpeechSettings extends SettingsPreferenceFragment
implements Preference.OnPreferenceChangeListener,
@@ -790,13 +790,6 @@
sir.xmlResId = R.xml.tts_settings;
return Arrays.asList(sir);
}
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- final List<String> keys = super.getNonIndexableKeys(context);
- keys.add("tts_engine_preference");
- return keys;
- }
};
}
diff --git a/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityPreferenceControllerTest.java
index 3f8c0ef..f6276d0 100644
--- a/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/backup/BackupSettingsActivityPreferenceControllerTest.java
@@ -17,6 +17,7 @@
package com.android.settings.backup;
import static com.google.common.truth.Truth.assertThat;
+
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -25,6 +26,8 @@
import android.content.Context;
import android.os.UserManager;
+import androidx.preference.Preference;
+
import com.android.settings.R;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
@@ -38,8 +41,6 @@
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
-import androidx.preference.Preference;
-
@RunWith(SettingsRobolectricTestRunner.class)
@Config(shadows = BackupSettingsActivityPreferenceControllerTest.ShadowBackupManager.class)
public class BackupSettingsActivityPreferenceControllerTest {
@@ -63,7 +64,7 @@
mContext = spy(RuntimeEnvironment.application.getApplicationContext());
when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
- mController = new BackupSettingsActivityPreferenceController(mContext);
+ mController = new BackupSettingsActivityPreferenceController(mContext, KEY_BACKUP_SETTINGS);
}
@Test
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/AvailableMediaDeviceGroupControllerTest.java b/tests/robotests/src/com/android/settings/connecteddevice/AvailableMediaDeviceGroupControllerTest.java
index 7814b18..7d99550 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/AvailableMediaDeviceGroupControllerTest.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/AvailableMediaDeviceGroupControllerTest.java
@@ -15,9 +15,11 @@
*/
package com.android.settings.connecteddevice;
-import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.AVAILABLE_UNSEARCHABLE;
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
+
import static com.google.common.truth.Truth.assertThat;
+
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doReturn;
@@ -29,6 +31,11 @@
import android.content.pm.PackageManager;
import android.media.AudioManager;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceGroup;
+import androidx.preference.PreferenceManager;
+import androidx.preference.PreferenceScreen;
+
import com.android.settings.R;
import com.android.settings.bluetooth.AvailableMediaBluetoothDeviceUpdater;
import com.android.settings.dashboard.DashboardFragment;
@@ -48,11 +55,6 @@
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceGroup;
-import androidx.preference.PreferenceManager;
-import androidx.preference.PreferenceScreen;
-
@RunWith(SettingsRobolectricTestRunner.class)
@Config(shadows = {
ShadowAudioManager.class,
@@ -177,7 +179,7 @@
doReturn(true).when(mPackageManager).hasSystemFeature(PackageManager.FEATURE_BLUETOOTH);
assertThat(mAvailableMediaDeviceGroupController.getAvailabilityStatus()).isEqualTo(
- AVAILABLE);
+ AVAILABLE_UNSEARCHABLE);
}
@Test
diff --git a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceGroupControllerTest.java b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceGroupControllerTest.java
index bd47f8b..a752a6c 100644
--- a/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceGroupControllerTest.java
+++ b/tests/robotests/src/com/android/settings/connecteddevice/ConnectedDeviceGroupControllerTest.java
@@ -15,9 +15,11 @@
*/
package com.android.settings.connecteddevice;
-import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.AVAILABLE_UNSEARCHABLE;
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
+
import static com.google.common.truth.Truth.assertThat;
+
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
@@ -27,6 +29,11 @@
import android.content.Context;
import android.content.pm.PackageManager;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceGroup;
+import androidx.preference.PreferenceManager;
+import androidx.preference.PreferenceScreen;
+
import com.android.settings.bluetooth.ConnectedBluetoothDeviceUpdater;
import com.android.settings.connecteddevice.dock.DockUpdater;
import com.android.settings.connecteddevice.usb.ConnectedUsbDeviceUpdater;
@@ -44,11 +51,6 @@
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplicationPackageManager;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceGroup;
-import androidx.preference.PreferenceManager;
-import androidx.preference.PreferenceScreen;
-
@RunWith(SettingsRobolectricTestRunner.class)
@Config(shadows = ShadowApplicationPackageManager.class)
public class ConnectedDeviceGroupControllerTest {
@@ -94,7 +96,7 @@
}
@Test
- public void testOnDeviceAdded_firstAdd_becomeVisibleAndPreferenceAdded() {
+ public void onDeviceAdded_firstAdd_becomeVisibleAndPreferenceAdded() {
mConnectedDeviceGroupController.onDeviceAdded(mPreference);
assertThat(mPreferenceGroup.isVisible()).isTrue();
@@ -102,7 +104,7 @@
}
@Test
- public void testOnDeviceRemoved_lastRemove_becomeInvisibleAndPreferenceRemoved() {
+ public void onDeviceRemoved_lastRemove_becomeInvisibleAndPreferenceRemoved() {
mPreferenceGroup.addPreference(mPreference);
mConnectedDeviceGroupController.onDeviceRemoved(mPreference);
@@ -112,7 +114,7 @@
}
@Test
- public void testOnDeviceRemoved_notLastRemove_stillVisible() {
+ public void onDeviceRemoved_notLastRemove_stillVisible() {
mPreferenceGroup.setVisible(true);
mPreferenceGroup.addPreference(mPreference);
mPreferenceGroup.addPreference(new Preference(mContext));
@@ -123,7 +125,7 @@
}
@Test
- public void testDisplayPreference_becomeInvisible() {
+ public void displayPreference_becomeInvisible() {
doReturn(mPreferenceGroup).when(mPreferenceScreen).findPreference(anyString());
mConnectedDeviceGroupController.displayPreference(mPreferenceScreen);
@@ -132,7 +134,7 @@
}
@Test
- public void testRegister() {
+ public void onStart_shouldRegisterUpdaters() {
// register the callback in onStart()
mConnectedDeviceGroupController.onStart();
verify(mConnectedBluetoothDeviceUpdater).registerCallback();
@@ -141,7 +143,7 @@
}
@Test
- public void testUnregister() {
+ public void onStop_shouldUnregisterUpdaters() {
// unregister the callback in onStop()
mConnectedDeviceGroupController.onStop();
verify(mConnectedBluetoothDeviceUpdater).unregisterCallback();
@@ -150,7 +152,7 @@
}
@Test
- public void testGetAvailabilityStatus_noBluetoothFeature_returnUnSupported() {
+ public void getAvailabilityStatus_noBluetoothFeature_returnUnSupported() {
mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, false);
assertThat(mConnectedDeviceGroupController.getAvailabilityStatus()).isEqualTo(
@@ -158,10 +160,10 @@
}
@Test
- public void testGetAvailabilityStatus_BluetoothFeature_returnSupported() {
+ public void getAvailabilityStatus_BluetoothFeature_returnSupported() {
mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, true);
assertThat(mConnectedDeviceGroupController.getAvailabilityStatus()).isEqualTo(
- AVAILABLE);
+ AVAILABLE_UNSEARCHABLE);
}
}
diff --git a/tests/robotests/src/com/android/settings/core/PreferenceXmlParserUtilsTest.java b/tests/robotests/src/com/android/settings/core/PreferenceXmlParserUtilsTest.java
index b3dbdab..06d75da 100644
--- a/tests/robotests/src/com/android/settings/core/PreferenceXmlParserUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/core/PreferenceXmlParserUtilsTest.java
@@ -263,9 +263,10 @@
}
@Test
+ @Config(qualifiers = "mcc998")
public void extractMetadata_requestSearchable_shouldDefaultToTrue() throws Exception {
final List<Bundle> metadata = PreferenceXmlParserUtils.extractMetadata(mContext,
- R.xml.display_settings, MetadataFlag.FLAG_NEED_SEARCHABLE);
+ R.xml.location_settings, MetadataFlag.FLAG_NEED_SEARCHABLE);
for (Bundle bundle : metadata) {
assertThat(bundle.getBoolean(METADATA_SEARCHABLE)).isTrue();
}