summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Joseph Pirozzo <pirozzoj@google.com> 2019-02-12 00:29:30 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-02-12 00:29:30 +0000
commit87d1cdd45e80812d98bee450c9bc951ef2dd4fcc (patch)
tree91dc34a93bc1cb3f910003f622f35ab2b6b53804
parentbbbeba3c02822e5cd43fd169e7105063a7331af5 (diff)
parentcdbab12707c5802c718e8149a435e076b49dbda1 (diff)
Merge "Check PBAP Server before disconnecting"
-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 9f3401ea7463..6cd2f45213e3 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;
@@ -205,7 +206,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);
}