Merge "Use another callback to notify the updater that UI should be updated" into pi-dev am: dee5035764

am: 5d7faa9696

Change-Id: I7db97d62afbdb6deacc9f0b34393697acd44b0f2
This commit is contained in:
Ryan Lin
2018-05-11 15:24:30 -07:00
committed by android-build-merger
8 changed files with 78 additions and 61 deletions

View File

@@ -15,7 +15,6 @@
*/
package com.android.settings.bluetooth;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
@@ -64,19 +63,20 @@ public class ConnectedBluetoothDeviceUpdater extends BluetoothDeviceUpdater {
}
@Override
public void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) {
public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state,
int bluetoothProfile) {
if (DBG) {
Log.d(TAG,"onConnectionStateChanged() device : " +
cachedDevice.getName() + ", state : " + state);
Log.d(TAG, "onProfileConnectionStateChanged() device: " +
cachedDevice.getName() + ", state: " + state + ", bluetoothProfile: "
+ bluetoothProfile);
}
if (state == BluetoothAdapter.STATE_CONNECTED) {
if (state == BluetoothProfile.STATE_CONNECTED) {
if (isFilterMatched(cachedDevice)) {
addPreference(cachedDevice);
} else {
removePreference(cachedDevice);
}
} else if (state == BluetoothAdapter.STATE_DISCONNECTED) {
} else if (state == BluetoothProfile.STATE_DISCONNECTED) {
removePreference(cachedDevice);
}
}