Merge "rename emergency tone settings"
am: 2054a4d6d4

Change-Id: I106fc98ae0dab79e5e8bc9b5ec10c3810a440aaa
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 3984c21..5e1a468 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -316,24 +316,6 @@
         <item>Never time out</item>
     </string-array>
 
-    <!-- Bluetooth developer settings: Titles for maximum number of connected audio devices -->
-    <string-array name="bluetooth_max_connected_audio_devices">
-        <item>1 (Default)</item>
-        <item>2</item>
-        <item>3</item>
-        <item>4</item>
-        <item>5</item>
-    </string-array>
-
-    <!-- Bluetooth developer settings: Values for maximum number of connected audio devices -->
-    <string-array name="bluetooth_max_connected_audio_devices_values">
-        <item>1</item>
-        <item>2</item>
-        <item>3</item>
-        <item>4</item>
-        <item>5</item>
-    </string-array>
-
     <!-- Match this with drawable.wifi_signal. --> <skip />
     <!-- Wi-Fi settings. The signal strength a Wi-Fi network has. -->
     <string-array name="wifi_signal">
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f037eb1..79e8452 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1606,16 +1606,6 @@
     <!-- Summary of checkbox for disabling Bluetooth inband ringing in Development Settings -->
     <string name="bluetooth_disable_inband_ringing_summary">Don’t play custom phone ringtones on Bluetooth headsets</string>
 
-    <!-- Setting title for enabling Bluetooth delay reporting in Development Settings -->
-    <string name="bluetooth_enable_avdtp_delay_reports">Enable Bluetooth Audio Delay Report handling</string>
-    <!-- Summary of checkbox for enabling Bluetooth delay reporting in Development Settings -->
-    <string name="bluetooth_enable_avdtp_delay_reports_summary">Handle Audio Delay Reports recieved from remote devices</string>
-
-    <!-- Bluetooth developer settings: Maximum number of connected audio devices -->
-    <string name="bluetooth_max_connected_audio_devices_string">Maximum number of connected Bluetooth audio devices</string>
-    <!-- Bluetooth developer settings: Maximum number of connected audio devices -->
-    <string name="bluetooth_max_connected_audio_devices_dialog_title">Select maximum number of connected Bluetooth audio devices</string>
-
     <!-- Wifi Display settings. The title of the screen. [CHAR LIMIT=40] -->
     <string name="wifi_display_settings_title">Cast</string>
     <!-- Wifi Display settings. The title of a menu item to enable wireless display [CHAR LIMIT=40] -->
diff --git a/res/values/styles_preference.xml b/res/values/styles_preference.xml
index 99ccdfc..056d55a 100644
--- a/res/values/styles_preference.xml
+++ b/res/values/styles_preference.xml
@@ -36,9 +36,4 @@
         <item name="android:widgetLayout">@layout/preference_widget_sync_toggle</item>
     </style>
 
-    <style name="SettingsMultiSelectListPreference" parent="Preference.SettingsBase">
-        <item name="android:positiveButtonText">@android:string/ok</item>
-        <item name="android:negativeButtonText">@android:string/cancel</item>
-    </style>
-
 </resources>
\ No newline at end of file
diff --git a/res/xml/apn_editor.xml b/res/xml/apn_editor.xml
index 742a436..b1e332b 100644
--- a/res/xml/apn_editor.xml
+++ b/res/xml/apn_editor.xml
@@ -157,7 +157,6 @@
         android:entries="@array/bearer_entries"
         android:entryValues="@array/bearer_values"
         android:persistent="false"
-        style="@style/SettingsMultiSelectListPreference"
         />
     <ListPreference
         android:title="@string/mvno_type"
diff --git a/res/xml/development_prefs.xml b/res/xml/development_prefs.xml
index 1993857..bf83a5e 100644
--- a/res/xml/development_prefs.xml
+++ b/res/xml/development_prefs.xml
@@ -228,11 +228,6 @@
             android:title="@string/bluetooth_disable_inband_ringing"
             android:summary="@string/bluetooth_disable_inband_ringing_summary"/>
 
-        <SwitchPreference
-            android:key="bluetooth_enable_avdtp_delay_reports"
-            android:title="@string/bluetooth_enable_avdtp_delay_reports"
-            android:summary="@string/bluetooth_enable_avdtp_delay_reports_summary"/>
-
         <ListPreference
             android:key="bluetooth_select_avrcp_version"
             android:title="@string/bluetooth_select_avrcp_version_string"
@@ -275,13 +270,6 @@
             android:entries="@array/bluetooth_a2dp_codec_ldac_playback_quality_titles"
             android:entryValues="@array/bluetooth_a2dp_codec_ldac_playback_quality_values" />
 
-        <ListPreference
-            android:key="bluetooth_max_connected_audio_devices"
-            android:title="@string/bluetooth_max_connected_audio_devices_string"
-            android:dialogTitle="@string/bluetooth_max_connected_audio_devices_dialog_title"
-            android:entries="@array/bluetooth_max_connected_audio_devices"
-            android:entryValues="@array/bluetooth_max_connected_audio_devices_values" />
-
         <com.android.settings.development.PrivateDnsModeDialogPreference
             android:key="select_private_dns_configuration"
             android:title="@string/select_private_dns_configuration_title"
diff --git a/src/com/android/settings/development/DevelopmentSettings.java b/src/com/android/settings/development/DevelopmentSettings.java
index 2912e17..2d5c70f 100644
--- a/src/com/android/settings/development/DevelopmentSettings.java
+++ b/src/com/android/settings/development/DevelopmentSettings.java
@@ -214,22 +214,14 @@
                                     "persist.bluetooth.disableinbandringing";
     private static final String BLUETOOTH_BTSNOOP_ENABLE_PROPERTY =
                                     "persist.bluetooth.btsnoopenable";
-    private static final String BLUETOOTH_ENABLE_AVDTP_DELAY_REPORTS_PROPERTY =
-            "persist.bluetooth.enabledelayreports";
-
-    static final String BLUETOOTH_MAX_CONNECTED_AUDIO_DEVICES_PROPERTY =
-            "persist.bluetooth.maxconnectedaudiodevices";
 
     private static final String BLUETOOTH_DISABLE_INBAND_RINGING_KEY = "bluetooth_disable_inband_ringing";
-    private static final String BLUETOOTH_ENABLE_AVDTP_DELAY_REPORT_KEY = "bluetooth_enable_avdtp_delay_reports";
     private static final String BLUETOOTH_SELECT_AVRCP_VERSION_KEY = "bluetooth_select_avrcp_version";
     private static final String BLUETOOTH_SELECT_A2DP_CODEC_KEY = "bluetooth_select_a2dp_codec";
     private static final String BLUETOOTH_SELECT_A2DP_SAMPLE_RATE_KEY = "bluetooth_select_a2dp_sample_rate";
     private static final String BLUETOOTH_SELECT_A2DP_BITS_PER_SAMPLE_KEY = "bluetooth_select_a2dp_bits_per_sample";
     private static final String BLUETOOTH_SELECT_A2DP_CHANNEL_MODE_KEY = "bluetooth_select_a2dp_channel_mode";
     private static final String BLUETOOTH_SELECT_A2DP_LDAC_PLAYBACK_QUALITY_KEY = "bluetooth_select_a2dp_ldac_playback_quality";
-    private static final String BLUETOOTH_MAX_CONNECTED_AUDIO_DEVICES_KEY =
-            "bluetooth_max_connected_audio_devices";
 
     private static final String PRIVATE_DNS_PREF_KEY = "select_private_dns_configuration";
 
@@ -300,7 +292,6 @@
     private SwitchPreference mBluetoothShowDevicesWithoutNames;
     private SwitchPreference mBluetoothDisableAbsVolume;
     private SwitchPreference mBluetoothDisableInbandRinging;
-    private SwitchPreference mBluetoothEnableAvdtpDelayReport;
 
     private BluetoothA2dp mBluetoothA2dp;
     private final Object mBluetoothA2dpLock = new Object();
@@ -310,7 +301,6 @@
     private ListPreference mBluetoothSelectA2dpBitsPerSample;
     private ListPreference mBluetoothSelectA2dpChannelMode;
     private ListPreference mBluetoothSelectA2dpLdacPlaybackQuality;
-    private ListPreference mBluetoothSelectMaxConnectedAudioDevices;
 
     private SwitchPreference mOtaDisableAutomaticUpdate;
     private SwitchPreference mWifiAllowScansWithTraffic;
@@ -530,7 +520,6 @@
             removePreference(mBluetoothDisableInbandRinging);
             mBluetoothDisableInbandRinging = null;
         }
-        mBluetoothEnableAvdtpDelayReport = findAndInitSwitchPref(BLUETOOTH_ENABLE_AVDTP_DELAY_REPORT_KEY);
 
         mBluetoothSelectAvrcpVersion = addListPreference(BLUETOOTH_SELECT_AVRCP_VERSION_KEY);
         mBluetoothSelectA2dpCodec = addListPreference(BLUETOOTH_SELECT_A2DP_CODEC_KEY);
@@ -538,7 +527,6 @@
         mBluetoothSelectA2dpBitsPerSample = addListPreference(BLUETOOTH_SELECT_A2DP_BITS_PER_SAMPLE_KEY);
         mBluetoothSelectA2dpChannelMode = addListPreference(BLUETOOTH_SELECT_A2DP_CHANNEL_MODE_KEY);
         mBluetoothSelectA2dpLdacPlaybackQuality = addListPreference(BLUETOOTH_SELECT_A2DP_LDAC_PLAYBACK_QUALITY_KEY);
-        mBluetoothSelectMaxConnectedAudioDevices = addListPreference(BLUETOOTH_MAX_CONNECTED_AUDIO_DEVICES_KEY);
         initBluetoothConfigurationValues();
 
         updatePrivateDnsSummary();
@@ -873,7 +861,6 @@
         updateBluetoothShowDevicesWithoutUserFriendlyNameOptions();
         updateBluetoothDisableAbsVolumeOptions();
         updateBluetoothDisableInbandRingingOptions();
-        updateBluetoothEnableAvdtpDelayReportOptions();
         updateBluetoothA2dpConfigurationValues();
         updatePrivateDnsSummary();
     }
@@ -1548,16 +1535,6 @@
         }
     }
 
-    private void updateBluetoothEnableAvdtpDelayReportOptions() {
-        updateSwitchPreference(mBluetoothEnableAvdtpDelayReport,
-                SystemProperties.getBoolean(BLUETOOTH_ENABLE_AVDTP_DELAY_REPORTS_PROPERTY, false));
-    }
-
-    private void writeBluetoothEnableAvdtpDelayReportOptions() {
-        SystemProperties.set(BLUETOOTH_ENABLE_AVDTP_DELAY_REPORTS_PROPERTY,
-                mBluetoothEnableAvdtpDelayReport.isChecked() ? "true" : "false");
-    }
-
     private void updateMobileDataAlwaysOnOptions() {
         updateSwitchPreference(mMobileDataAlwaysOn, Settings.Global.getInt(
                 getActivity().getContentResolver(),
@@ -1883,13 +1860,6 @@
         index = 3;
         mBluetoothSelectA2dpLdacPlaybackQuality.setValue(values[index]);
         mBluetoothSelectA2dpLdacPlaybackQuality.setSummary(summaries[index]);
-
-        // Init the maximum connected devices - Default
-        values = getResources().getStringArray(R.array.bluetooth_max_connected_audio_devices_values);
-        summaries = getResources().getStringArray(R.array.bluetooth_max_connected_audio_devices);
-        index = 0;
-        mBluetoothSelectMaxConnectedAudioDevices.setValue(values[index]);
-        mBluetoothSelectMaxConnectedAudioDevices.setSummary(summaries[index]);
     }
 
     private void writeBluetoothAvrcpVersion(Object newValue) {
@@ -2058,15 +2028,6 @@
         }
     }
 
-    private void writeBluetoothMaxConnectedAudioDevices(Object newValue) {
-        SystemProperties.set(BLUETOOTH_MAX_CONNECTED_AUDIO_DEVICES_PROPERTY, newValue.toString());
-        int index = mBluetoothSelectMaxConnectedAudioDevices.findIndexOfValue(newValue.toString());
-        if (index >= 0) {
-            String[] titles = getResources().getStringArray(R.array.bluetooth_max_connected_audio_devices);
-            mBluetoothSelectMaxConnectedAudioDevices.setSummary(titles[index]);
-        }
-    }
-
     private void writeBluetoothConfigurationOption(Preference preference,
                                                    Object newValue) {
         String[] summaries;
@@ -2632,8 +2593,6 @@
             writeBluetoothDisableAbsVolumeOptions();
         } else if (preference == mBluetoothDisableInbandRinging) {
             writeBluetoothDisableInbandRingingOptions();
-        } else if (preference == mBluetoothEnableAvdtpDelayReport) {
-            writeBluetoothEnableAvdtpDelayReportOptions();
         } else if (SHORTCUT_MANAGER_RESET_KEY.equals(preference.getKey())) {
             resetShortcutManagerThrottling();
         } else {
@@ -2665,9 +2624,6 @@
                    (preference == mBluetoothSelectA2dpLdacPlaybackQuality)) {
             writeBluetoothConfigurationOption(preference, newValue);
             return true;
-        } else if (preference == mBluetoothSelectMaxConnectedAudioDevices) {
-            writeBluetoothMaxConnectedAudioDevices(newValue);
-            return true;
         } else if (preference == mLogdSize) {
             writeLogdSizeOption(newValue);
             return true;
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index d61b71c..190af4d 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -37,7 +37,6 @@
 import android.net.wifi.WpsInfo;
 import android.nfc.NfcAdapter;
 import android.os.Bundle;
-import android.os.Handler;
 import android.os.HandlerThread;
 import android.os.PowerManager;
 import android.os.Process;
@@ -704,10 +703,6 @@
     private void updateAccessPointsDelayed() {
         // Safeguard from some delayed event handling
         if (getActivity() != null && !mIsRestricted && mWifiManager.isWifiEnabled()) {
-            Handler handler = getView().getHandler();
-            if (handler != null && handler.hasCallbacks(mUpdateAccessPointsRunnable)) {
-                return;
-            }
             setProgressBarVisible(true);
             getView().postDelayed(mUpdateAccessPointsRunnable, 300 /* delay milliseconds */);
         }
diff --git a/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentableFragmentCodeInspector.java b/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentableFragmentCodeInspector.java
index be1a599..4455549 100644
--- a/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentableFragmentCodeInspector.java
+++ b/tests/robotests/src/com/android/settings/core/instrumentation/InstrumentableFragmentCodeInspector.java
@@ -16,8 +16,6 @@
 
 package com.android.settings.core.instrumentation;
 
-import static com.google.common.truth.Truth.assertWithMessage;
-
 import android.app.Fragment;
 import android.util.ArraySet;
 
@@ -27,6 +25,8 @@
 import java.util.List;
 import java.util.Set;
 
+import static com.google.common.truth.Truth.assertWithMessage;
+
 /**
  * {@link CodeInspector} that verifies all fragments implements Instrumentable.
  */
@@ -67,5 +67,7 @@
         assertWithMessage(sb.toString())
                 .that(broken.isEmpty())
                 .isTrue();
+        assertNoObsoleteInGrandfatherList("grandfather_not_implementing_instrumentable",
+                grandfather_notImplementingInstrumentable);
     }
 }
diff --git a/tests/robotests/src/com/android/settings/search/SearchIndexProviderCodeInspector.java b/tests/robotests/src/com/android/settings/search/SearchIndexProviderCodeInspector.java
index 0769af5..b4a91c5 100644
--- a/tests/robotests/src/com/android/settings/search/SearchIndexProviderCodeInspector.java
+++ b/tests/robotests/src/com/android/settings/search/SearchIndexProviderCodeInspector.java
@@ -16,8 +16,6 @@
 
 package com.android.settings.search;
 
-import static com.google.common.truth.Truth.assertWithMessage;
-
 import android.util.ArraySet;
 import android.util.Log;
 
@@ -30,6 +28,8 @@
 import java.util.List;
 import java.util.Set;
 
+import static com.google.common.truth.Truth.assertWithMessage;
+
 /**
  * {@link CodeInspector} to ensure fragments implement search components correctly.
  */
@@ -144,6 +144,15 @@
         assertWithMessage(notInProviderRegistryError)
                 .that(notInSearchProviderRegistry)
                 .isEmpty();
+        assertNoObsoleteInGrandfatherList("grandfather_not_implementing_indexable",
+                notImplementingIndexableGrandfatherList);
+        assertNoObsoleteInGrandfatherList("grandfather_not_implementing_index_provider",
+                notImplementingIndexProviderGrandfatherList);
+        assertNoObsoleteInGrandfatherList("grandfather_not_in_search_index_provider_registry",
+                notInSearchIndexableRegistryGrandfatherList);
+        assertNoObsoleteInGrandfatherList(
+                "grandfather_not_sharing_pref_controllers_with_search_provider",
+                notSharingPrefControllersGrandfatherList);
     }
 
     private boolean hasSearchIndexProvider(Class clazz) {