diff options
| author | Matthew Xie <mattx@google.com> | 2011-06-25 21:47:07 -0700 |
|---|---|---|
| committer | Matthew Xie <mattx@google.com> | 2011-07-07 12:43:27 -0700 |
| commit | a0c680393f2dd03a937c598b2cb9abf98a58152c (patch) | |
| tree | d8d240310c4a4d31d9215174643a95da016bc0c0 /core/java/android/server/BluetoothA2dpService.java | |
| parent | b75a798471342da5e4624048c5516773dfecf4ca (diff) | |
| download | frameworks_base-a0c680393f2dd03a937c598b2cb9abf98a58152c.zip frameworks_base-a0c680393f2dd03a937c598b2cb9abf98a58152c.tar.gz frameworks_base-a0c680393f2dd03a937c598b2cb9abf98a58152c.tar.bz2 | |
Incoming Bluetooth Connection requests - dialog.
This sends the intents to the Settings app to show
the dialogs for the incoming connection requests.
Includes down merged contributions from Jaikumar Ganesh.
Change-Id: Ic8b857aad3554315aae39a0e871eb94d0ac98a91
Diffstat (limited to 'core/java/android/server/BluetoothA2dpService.java')
| -rw-r--r-- | core/java/android/server/BluetoothA2dpService.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/server/BluetoothA2dpService.java b/core/java/android/server/BluetoothA2dpService.java index 8a6fdb4..fd277d0 100644 --- a/core/java/android/server/BluetoothA2dpService.java +++ b/core/java/android/server/BluetoothA2dpService.java @@ -449,6 +449,22 @@ public class BluetoothA2dpService extends IBluetoothA2dp.Stub { Settings.Secure.getBluetoothA2dpSinkPriorityKey(device.getAddress()), priority); } + public synchronized boolean allowIncomingConnect(BluetoothDevice device, boolean value) { + mContext.enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, + "Need BLUETOOTH_ADMIN permission"); + String address = device.getAddress(); + if (!BluetoothAdapter.checkBluetoothAddress(address)) { + return false; + } + Integer data = mBluetoothService.getAuthorizationAgentRequestData(address); + if (data == null) { + Log.w(TAG, "allowIncomingConnect(" + device + ") called but no native data available"); + return false; + } + log("allowIncomingConnect: A2DP: " + device + ":" + value); + return mBluetoothService.setAuthorizationNative(address, value, data.intValue()); + } + /** * Called by native code on a PropertyChanged signal from * org.bluez.AudioSink. |
