summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/bluetooth/CachedBluetoothDevice.java')
-rwxr-xr-xsrc/com/android/settings/bluetooth/CachedBluetoothDevice.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
index ef223d5cf..4b19b9c11 100755
--- a/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
+++ b/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
@@ -119,6 +119,11 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> {
Log.d(TAG, "onProfileStateChanged: profile " + profile +
" newProfileState " + newProfileState);
}
+ if (mLocalAdapter.getBluetoothState() == BluetoothAdapter.STATE_TURNING_OFF)
+ {
+ if (Utils.D) Log.d(TAG, " BT Turninig Off...Profile conn state change ignored...");
+ return;
+ }
mProfileConnectionState.put(profile, newProfileState);
if (newProfileState == BluetoothProfile.STATE_CONNECTED) {
if (!mProfiles.contains(profile)) {
@@ -328,6 +333,16 @@ final class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> {
return mProfileConnectionState.get(profile);
}
+ public void clearProfileConnectionState ()
+ {
+ if (Utils.D) {
+ Log.d(TAG," Clearing all connection state for dev:" + mDevice.getName());
+ }
+ for (LocalBluetoothProfile profile :getProfiles()) {
+ mProfileConnectionState.put(profile, BluetoothProfile.STATE_DISCONNECTED);
+ }
+ }
+
// TODO: do any of these need to run async on a background thread?
private void fillData() {
fetchName();