summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Joseph Pirozzo <pirozzoj@google.com> 2019-02-11 17:04:40 -0800
committer android-build-merger <android-build-merger@google.com> 2019-02-11 17:04:40 -0800
commite005b50ebb2c3ad501e30b63cf781198f82fdcf0 (patch)
tree215239c6b837ec087803e787ab4db760fa9eefbb
parentc36e36b87efbc86f93ad50c03d8fca81c3fc9104 (diff)
parent7128032d136cba0964621bfe692d8c2dbd23d32c (diff)
Merge "Check PBAP Server before disconnecting" am: 87d1cdd45e
am: 7128032d13 Change-Id: I4cebaf6741c2f1a6ee567ee8fc0afa5ae5ddc43e
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index 2aabb8a533e6..cba823c15e62 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -16,6 +16,7 @@
package com.android.settingslib.bluetooth;
+import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHearingAid;
@@ -28,7 +29,7 @@ import android.os.ParcelUuid;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
-import android.bluetooth.BluetoothAdapter;
+
import androidx.annotation.VisibleForTesting;
import com.android.settingslib.R;
@@ -201,7 +202,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
// This is to ensure all the profiles are disconnected as some CK/Hs do not
// disconnect PBAP connection when HF connection is brought down
PbapServerProfile PbapProfile = mProfileManager.getPbapProfile();
- if (PbapProfile.getConnectionStatus(mDevice) == BluetoothProfile.STATE_CONNECTED)
+ if (PbapProfile != null && isConnectedProfile(PbapProfile))
{
PbapProfile.disconnect(mDevice);
}