summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/development/BluetoothAvrcpVersionPreferenceController.java
diff options
context:
space:
mode:
authorDoris Ling <dling@google.com>2018-03-01 10:33:14 -0800
committerDoris Ling <dling@google.com>2018-03-01 13:58:29 -0800
commit4fbf04cd1056928d1f2ef3c648b11112f80915de (patch)
treec32fb672c94d1543bb888f4b4499d5f92f238d36 /src/com/android/settings/development/BluetoothAvrcpVersionPreferenceController.java
parent46d6ecc2b186245785dfaa7936c0723b6ebb91a0 (diff)
downloadpackages_apps_Settings-4fbf04cd1056928d1f2ef3c648b11112f80915de.tar.gz
packages_apps_Settings-4fbf04cd1056928d1f2ef3c648b11112f80915de.tar.bz2
packages_apps_Settings-4fbf04cd1056928d1f2ef3c648b11112f80915de.zip
Remove unnecessary onDeveloperOptionsSwitchEnabled/Disabled override.
- default implementation has been added in the super class to handle enabling/disabling the preference when the master developer options switch it turned on/off. Removing all subclass that originally implemented the methods that only contains the default behavior. Bug: 73955632 Test: make RunSettingsRoboTests Change-Id: I13c372c2ab498a5786b40cdc1ad3b5f3424abb5a
Diffstat (limited to 'src/com/android/settings/development/BluetoothAvrcpVersionPreferenceController.java')
-rw-r--r--src/com/android/settings/development/BluetoothAvrcpVersionPreferenceController.java29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/com/android/settings/development/BluetoothAvrcpVersionPreferenceController.java b/src/com/android/settings/development/BluetoothAvrcpVersionPreferenceController.java
index a56f5ea443..ba75b35a04 100644
--- a/src/com/android/settings/development/BluetoothAvrcpVersionPreferenceController.java
+++ b/src/com/android/settings/development/BluetoothAvrcpVersionPreferenceController.java
@@ -21,16 +21,14 @@ import android.os.SystemProperties;
import android.support.annotation.VisibleForTesting;
import android.support.v7.preference.ListPreference;
import android.support.v7.preference.Preference;
-import android.support.v7.preference.PreferenceScreen;
import android.text.TextUtils;
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
-public class BluetoothAvrcpVersionPreferenceController extends
- DeveloperOptionsPreferenceController implements Preference.OnPreferenceChangeListener,
- PreferenceControllerMixin {
+public class BluetoothAvrcpVersionPreferenceController extends DeveloperOptionsPreferenceController
+ implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
private static final String BLUETOOTH_SELECT_AVRCP_VERSION_KEY =
"bluetooth_select_avrcp_version";
@@ -40,7 +38,6 @@ public class BluetoothAvrcpVersionPreferenceController extends
private final String[] mListValues;
private final String[] mListSummaries;
- private ListPreference mPreference;
public BluetoothAvrcpVersionPreferenceController(Context context) {
super(context);
@@ -55,13 +52,6 @@ public class BluetoothAvrcpVersionPreferenceController extends
}
@Override
- public void displayPreference(PreferenceScreen screen) {
- super.displayPreference(screen);
-
- mPreference = (ListPreference) screen.findPreference(getPreferenceKey());
- }
-
- @Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
SystemProperties.set(BLUETOOTH_AVRCP_VERSION_PROPERTY, newValue.toString());
updateState(mPreference);
@@ -70,6 +60,7 @@ public class BluetoothAvrcpVersionPreferenceController extends
@Override
public void updateState(Preference preference) {
+ final ListPreference listPreference = (ListPreference) preference;
final String currentValue = SystemProperties.get(BLUETOOTH_AVRCP_VERSION_PROPERTY);
int index = 0; // Defaults to AVRCP 1.4
for (int i = 0; i < mListValues.length; i++) {
@@ -78,17 +69,7 @@ public class BluetoothAvrcpVersionPreferenceController extends
break;
}
}
- mPreference.setValue(mListValues[index]);
- mPreference.setSummary(mListSummaries[index]);
- }
-
- @Override
- protected void onDeveloperOptionsSwitchEnabled() {
- mPreference.setEnabled(true);
- }
-
- @Override
- protected void onDeveloperOptionsSwitchDisabled() {
- mPreference.setEnabled(false);
+ listPreference.setValue(mListValues[index]);
+ listPreference.setSummary(mListSummaries[index]);
}
}