summaryrefslogtreecommitdiffstats
path: root/packages/SettingsLib/src
diff options
context:
space:
mode:
authorHemant Gupta <hemantg@codeaurora.org>2015-08-12 22:41:19 +0530
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:27:35 -0600
commit1e01d0870033a0a9ba2f05ede7502a3fc1529569 (patch)
tree601261bc1b17dee43e7dbe7cdff0c78d805fd788 /packages/SettingsLib/src
parent5f0fa58869ffc00e4cc9dc1b2e8d6e82b348e2c2 (diff)
downloadframeworks_base-1e01d0870033a0a9ba2f05ede7502a3fc1529569.zip
frameworks_base-1e01d0870033a0a9ba2f05ede7502a3fc1529569.tar.gz
frameworks_base-1e01d0870033a0a9ba2f05ede7502a3fc1529569.tar.bz2
PBAP: Disconnect PBAP profile only if connected
This patch is needed to handle the PBAP cases for multicast scenarios. This change will let the disconnection of the PBAP profile with that remote device only which was actually connected via PBAP among all the BT connected devices. Change-Id: I76f6215d1d407d789654e78e448aea5324816a71 CRs-Fixed: 843160
Diffstat (limited to 'packages/SettingsLib/src')
-rwxr-xr-xpackages/SettingsLib/src/com/android/settingslib/bluetooth/PbapServerProfile.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/PbapServerProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/PbapServerProfile.java
index 9e76933..fea7b34 100755
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/PbapServerProfile.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/PbapServerProfile.java
@@ -88,8 +88,13 @@ public final class PbapServerProfile implements LocalBluetoothProfile {
}
public boolean disconnect(BluetoothDevice device) {
- if (mService == null) return false;
- return mService.disconnect();
+ if (mService == null || device == null) return false;
+
+ if (getConnectionStatus(device) == BluetoothProfile.STATE_CONNECTED)
+ return mService.disconnect();
+
+ Log.d(TAG, "pbap server not connected to " + device.getAddress());
+ return false;
}
public int getConnectionStatus(BluetoothDevice device) {