summaryrefslogtreecommitdiffstats
path: root/core/java/android/bluetooth/BluetoothAdapter.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/bluetooth/BluetoothAdapter.java')
-rw-r--r--core/java/android/bluetooth/BluetoothAdapter.java26
1 files changed, 22 insertions, 4 deletions
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index d971652..5f5ba50 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -1180,11 +1180,29 @@ public final class BluetoothAdapter {
* @param proxy Profile proxy object
*/
public void closeProfileProxy(int profile, BluetoothProfile proxy) {
- if (profile == BluetoothProfile.HEADSET) {
- BluetoothHeadset headset = (BluetoothHeadset)proxy;
- if (headset != null) {
+ if (proxy == null) return;
+
+ switch (profile) {
+ case BluetoothProfile.HEADSET:
+ BluetoothHeadset headset = (BluetoothHeadset)proxy;
headset.close();
- }
+ break;
+ case BluetoothProfile.A2DP:
+ BluetoothA2dp a2dp = (BluetoothA2dp)proxy;
+ a2dp.close();
+ break;
+ case BluetoothProfile.INPUT_DEVICE:
+ BluetoothInputDevice iDev = (BluetoothInputDevice)proxy;
+ iDev.close();
+ break;
+ case BluetoothProfile.PAN:
+ BluetoothPan pan = (BluetoothPan)proxy;
+ pan.close();
+ break;
+ case BluetoothProfile.HEALTH:
+ BluetoothHealth health = (BluetoothHealth)proxy;
+ health.close();
+ break;
}
}