Loading src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java +8 −6 Original line number Diff line number Diff line Loading @@ -16,11 +16,11 @@ package com.android.settings.bluetooth; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothAdapter; import android.content.Context; import android.media.AudioManager; import androidx.annotation.VisibleForTesting; import android.util.Log; import com.android.settings.connecteddevice.DevicePreferenceCallback; import com.android.settings.dashboard.DashboardFragment; import com.android.settingslib.bluetooth.LocalBluetoothManager; Loading Loading @@ -57,18 +57,20 @@ public class AvailableMediaBluetoothDeviceUpdater 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); } } Loading src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java +5 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,11 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback, public void onAudioModeChanged() { } @Override public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state, int bluetoothProfile) { } @Override public void onServiceConnected() { // When bluetooth service connected update the UI Loading src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java +7 −7 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } } Loading src/com/android/settings/bluetooth/SavedBluetoothDeviceUpdater.java +5 −4 Original line number Diff line number Diff line Loading @@ -15,8 +15,8 @@ */ package com.android.settings.bluetooth; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import androidx.annotation.VisibleForTesting; Loading @@ -43,10 +43,11 @@ public class SavedBluetoothDeviceUpdater extends BluetoothDeviceUpdater { } @Override public void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { if (state == BluetoothAdapter.STATE_CONNECTED) { public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state, int bluetoothProfile) { if (state == BluetoothProfile.STATE_CONNECTED) { removePreference(cachedDevice); } else if (state == BluetoothAdapter.STATE_DISCONNECTED) { } else if (state == BluetoothProfile.STATE_DISCONNECTED) { addPreference(cachedDevice); } } Loading src/com/android/settings/sound/AudioSwitchPreferenceController.java +6 −1 Original line number Diff line number Diff line Loading @@ -161,7 +161,6 @@ public abstract class AudioSwitchPreferenceController extends BasePreferenceCont */ @Override public void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { updateState(mPreference); } @Override Loading @@ -174,6 +173,12 @@ public abstract class AudioSwitchPreferenceController extends BasePreferenceCont updateState(mPreference); } @Override public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state, int bluetoothProfile) { updateState(mPreference); } @Override public void onBluetoothStateChanged(int bluetoothState) { } Loading Loading
src/com/android/settings/bluetooth/AvailableMediaBluetoothDeviceUpdater.java +8 −6 Original line number Diff line number Diff line Loading @@ -16,11 +16,11 @@ package com.android.settings.bluetooth; import android.bluetooth.BluetoothProfile; import android.bluetooth.BluetoothAdapter; import android.content.Context; import android.media.AudioManager; import androidx.annotation.VisibleForTesting; import android.util.Log; import com.android.settings.connecteddevice.DevicePreferenceCallback; import com.android.settings.dashboard.DashboardFragment; import com.android.settingslib.bluetooth.LocalBluetoothManager; Loading Loading @@ -57,18 +57,20 @@ public class AvailableMediaBluetoothDeviceUpdater 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); } } Loading
src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java +5 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,11 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback, public void onAudioModeChanged() { } @Override public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state, int bluetoothProfile) { } @Override public void onServiceConnected() { // When bluetooth service connected update the UI Loading
src/com/android/settings/bluetooth/ConnectedBluetoothDeviceUpdater.java +7 −7 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } } Loading
src/com/android/settings/bluetooth/SavedBluetoothDeviceUpdater.java +5 −4 Original line number Diff line number Diff line Loading @@ -15,8 +15,8 @@ */ package com.android.settings.bluetooth; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import androidx.annotation.VisibleForTesting; Loading @@ -43,10 +43,11 @@ public class SavedBluetoothDeviceUpdater extends BluetoothDeviceUpdater { } @Override public void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { if (state == BluetoothAdapter.STATE_CONNECTED) { public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state, int bluetoothProfile) { if (state == BluetoothProfile.STATE_CONNECTED) { removePreference(cachedDevice); } else if (state == BluetoothAdapter.STATE_DISCONNECTED) { } else if (state == BluetoothProfile.STATE_DISCONNECTED) { addPreference(cachedDevice); } } Loading
src/com/android/settings/sound/AudioSwitchPreferenceController.java +6 −1 Original line number Diff line number Diff line Loading @@ -161,7 +161,6 @@ public abstract class AudioSwitchPreferenceController extends BasePreferenceCont */ @Override public void onConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state) { updateState(mPreference); } @Override Loading @@ -174,6 +173,12 @@ public abstract class AudioSwitchPreferenceController extends BasePreferenceCont updateState(mPreference); } @Override public void onProfileConnectionStateChanged(CachedBluetoothDevice cachedDevice, int state, int bluetoothProfile) { updateState(mPreference); } @Override public void onBluetoothStateChanged(int bluetoothState) { } Loading