diff options
author | Vasu Nori <vnori@google.com> | 2018-08-17 17:25:28 -0700 |
---|---|---|
committer | vnori <vnori@google.com> | 2018-09-25 21:39:31 +0000 |
commit | a06a03302abf47167c40202414750d9c9ecfd80b (patch) | |
tree | 08b1ea474773ea7fcd4d03269f1b5ccc22c3c4d5 /framework/java/android/bluetooth/BluetoothMapClient.java | |
parent | 0fa6f9bbe3b2d26e434fcb212c73e2074d2b6075 (diff) |
Add hidden API to return "Uploading" bit value from SDP record's MapSupportedFeatures.
Bug: 111614861
Test: tested w/ KitchenSink App
Change-Id: I43895183d7b315f57257e1d2045f17dedcb0cfcd
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothMapClient.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothMapClient.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothMapClient.java b/framework/java/android/bluetooth/BluetoothMapClient.java index 183be5f38b..559a59b68b 100644 --- a/framework/java/android/bluetooth/BluetoothMapClient.java +++ b/framework/java/android/bluetooth/BluetoothMapClient.java @@ -73,6 +73,8 @@ public final class BluetoothMapClient implements BluetoothProfile { /** Connection canceled before completion. */ public static final int RESULT_CANCELED = 2; + private static final int UPLOADING_FEATURE_BITMASK = 0x08; + private final IBluetoothStateChangeCallback mBluetoothStateChangeCallback = new IBluetoothStateChangeCallback.Stub() { public void onBluetoothStateChange(boolean up) { @@ -395,6 +397,23 @@ public final class BluetoothMapClient implements BluetoothProfile { return false; } + /** + * Returns the "Uploading" feature bit value from the SDP record's + * MapSupportedFeatures field (see Bluetooth MAP 1.4 spec, page 114). + * @param device The Bluetooth device to get this value for. + * @return Returns true if the Uploading bit value in SDP record's + * MapSupportedFeatures field is set. False is returned otherwise. + */ + public boolean isUploadingSupported(BluetoothDevice device) { + try { + return (mService != null && isEnabled() && isValidDevice(device)) + && ((mService.getSupportedFeatures(device) & UPLOADING_FEATURE_BITMASK) > 0); + } catch (RemoteException e) { + Log.e(TAG, e.getMessage()); + } + return false; + } + private final ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { if (DBG) Log.d(TAG, "Proxy object connected"); |