Merge "Check the device is connected when receive onProfileConnectionStateChanged()"
This commit is contained in:
committed by
Android (Google) Code Review
commit
bf506bf01a
@@ -59,25 +59,6 @@ public class AvailableMediaBluetoothDeviceUpdater extends BluetoothDeviceUpdater
|
||||
forceUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state,
|
||||
int bluetoothProfile) {
|
||||
if (DBG) {
|
||||
Log.d(TAG, "onProfileConnectionStateChanged() device: " +
|
||||
cachedDevice.getName() + ", state: " + state + ", bluetoothProfile: "
|
||||
+ bluetoothProfile);
|
||||
}
|
||||
if (state == BluetoothProfile.STATE_CONNECTED) {
|
||||
if (isFilterMatched(cachedDevice)) {
|
||||
addPreference(cachedDevice);
|
||||
} else {
|
||||
removePreference(cachedDevice);
|
||||
}
|
||||
} else if (state == BluetoothProfile.STATE_DISCONNECTED) {
|
||||
removePreference(cachedDevice);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFilterMatched(CachedBluetoothDevice cachedDevice) {
|
||||
final int audioMode = mAudioManager.getMode();
|
||||
|
@@ -162,6 +162,11 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback,
|
||||
@Override
|
||||
public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state,
|
||||
int bluetoothProfile) {
|
||||
if (DBG) {
|
||||
Log.d(TAG, "onProfileConnectionStateChanged() device: " + cachedDevice.getName()
|
||||
+ ", state: " + state + ", bluetoothProfile: " + bluetoothProfile);
|
||||
}
|
||||
update(cachedDevice);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -59,25 +59,6 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater {
|
||||
forceUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state,
|
||||
int bluetoothProfile) {
|
||||
if (DBG) {
|
||||
Log.d(TAG, "onProfileConnectionStateChanged() device: " +
|
||||
cachedDevice.getName() + ", state: " + state + ", bluetoothProfile: "
|
||||
+ bluetoothProfile);
|
||||
}
|
||||
if (state == BluetoothProfile.STATE_CONNECTED) {
|
||||
if (isFilterMatched(cachedDevice)) {
|
||||
addPreference(cachedDevice);
|
||||
} else {
|
||||
removePreference(cachedDevice);
|
||||
}
|
||||
} else if (state == BluetoothProfile.STATE_DISCONNECTED) {
|
||||
removePreference(cachedDevice);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFilterMatched(CachedBluetoothDevice cachedDevice) {
|
||||
final int audioMode = mAudioManager.getMode();
|
||||
|
@@ -48,16 +48,6 @@ public class SavedBluetoothDeviceUpdater extends BluetoothDeviceUpdater
|
||||
super(fragment, devicePreferenceCallback, localBluetoothManager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state,
|
||||
int bluetoothProfile) {
|
||||
if (state == BluetoothProfile.STATE_CONNECTED) {
|
||||
removePreference(cachedDevice);
|
||||
} else if (state == BluetoothProfile.STATE_DISCONNECTED) {
|
||||
addPreference(cachedDevice);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFilterMatched(CachedBluetoothDevice cachedDevice) {
|
||||
final BluetoothDevice device = cachedDevice.getDevice();
|
||||
|
Reference in New Issue
Block a user