summaryrefslogtreecommitdiff
path: root/src/com/android/settings/development/AbstractBluetoothA2dpPreferenceController.java
diff options
context:
space:
mode:
authorjeffreyhuang <jeffreyhuang@google.com>2017-10-12 16:39:26 -0700
committerjeffreyhuang <jeffreyhuang@google.com>2017-10-17 11:18:06 -0700
commit0ef326f365e44a03deaa69c7880feb5cc92a2bf6 (patch)
treeebe24818ec610c86bd5d2b90205a9711b9b42751 /src/com/android/settings/development/AbstractBluetoothA2dpPreferenceController.java
parent32b0f1d4865a8a5e3f3643df92c9d40490aa1809 (diff)
Introduce BluetoothAudioCodecPreferenceController
- Create new BluetoothAudioCodecPreferenceController - Create controller inside the DashboardFragment - Port logic from DevelopmentSettings into the controller Bug: 34203528 Test: make RunSettingsRoboTests -j40 Change-Id: I90a0e58328196315fccbecd6d46531b4f0fcaef1
Diffstat (limited to 'src/com/android/settings/development/AbstractBluetoothA2dpPreferenceController.java')
-rw-r--r--src/com/android/settings/development/AbstractBluetoothA2dpPreferenceController.java26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/com/android/settings/development/AbstractBluetoothA2dpPreferenceController.java b/src/com/android/settings/development/AbstractBluetoothA2dpPreferenceController.java
index bb03df1f7b..e4e6493886 100644
--- a/src/com/android/settings/development/AbstractBluetoothA2dpPreferenceController.java
+++ b/src/com/android/settings/development/AbstractBluetoothA2dpPreferenceController.java
@@ -40,17 +40,15 @@ public abstract class AbstractBluetoothA2dpPreferenceController extends
static final int STREAMING_LABEL_ID = R.string.bluetooth_select_a2dp_codec_streaming_label;
protected final BluetoothA2dpConfigStore mBluetoothA2dpConfigStore;
- protected final Object mBluetoothA2dpLock;
protected BluetoothA2dp mBluetoothA2dp;
+ protected ListPreference mPreference;
private final String[] mListValues;
private final String[] mListSummaries;
- private ListPreference mPreference;
public AbstractBluetoothA2dpPreferenceController(Context context, Lifecycle lifecycle,
- Object bluetoothA2dpLock, BluetoothA2dpConfigStore store) {
+ BluetoothA2dpConfigStore store) {
super(context);
- mBluetoothA2dpLock = bluetoothA2dpLock;
mBluetoothA2dpConfigStore = store;
mListValues = getListValues();
mListSummaries = getListSummaries();
@@ -80,7 +78,7 @@ public abstract class AbstractBluetoothA2dpPreferenceController extends
writeConfigurationValues(newValue);
final BluetoothCodecConfig codecConfig = mBluetoothA2dpConfigStore.createCodecConfig();
- synchronized (mBluetoothA2dpLock) {
+ synchronized (mBluetoothA2dpConfigStore) {
if (mBluetoothA2dp != null) {
setCodecConfigPreference(codecConfig);
}
@@ -106,7 +104,7 @@ public abstract class AbstractBluetoothA2dpPreferenceController extends
}
BluetoothCodecConfig codecConfig;
- synchronized (mBluetoothA2dpLock) {
+ synchronized (mBluetoothA2dpConfigStore) {
codecConfig = getCodecConfig();
}
@@ -168,7 +166,7 @@ public abstract class AbstractBluetoothA2dpPreferenceController extends
protected abstract String[] getListSummaries();
/**
- * Updates the new value to the {@link BluetoothA2dpConfigStore}.
+ * Updates the new value to the {@link BluetoothA2dpConfigStore} and the {@link BluetoothA2dp}.
*
* @param newValue the new setting value
*/
@@ -197,18 +195,4 @@ public abstract class AbstractBluetoothA2dpPreferenceController extends
return mBluetoothA2dp.getCodecStatus().getCodecConfig();
}
-
- @VisibleForTesting
- BluetoothCodecConfig createCodecConfig(int codecTypeValue, int codecPriorityValue,
- int sampleRateValue, int bitsPerSampleValue,
- int channelModeValue, long codecSpecific1Value,
- long codecSpecific2Value, long codecSpecific3Value,
- long codecSpecific4Value) {
- return new BluetoothCodecConfig(codecTypeValue, codecPriorityValue,
- sampleRateValue, bitsPerSampleValue,
- channelModeValue, codecSpecific1Value,
- codecSpecific2Value, codecSpecific3Value,
- codecSpecific4Value);
- }
-
}