summaryrefslogtreecommitdiffstats
path: root/core/java/android/server/BluetoothDeviceService.java
diff options
context:
space:
mode:
authorJaikumar Ganesh <jaikumar@google.com>2009-08-03 17:17:37 -0700
committerJaikumar Ganesh <jaikumar@google.com>2009-08-04 10:06:35 -0700
commit9488cbd0b9ce0a9b49647910e76c6fa910f948ea (patch)
tree0756301813c07fa7a75836804ba095a9ef1440ab /core/java/android/server/BluetoothDeviceService.java
parentafcc40ac718e85ffdcadc1b9f8ff1bcc82822f02 (diff)
downloadframeworks_base-9488cbd0b9ce0a9b49647910e76c6fa910f948ea.zip
frameworks_base-9488cbd0b9ce0a9b49647910e76c6fa910f948ea.tar.gz
frameworks_base-9488cbd0b9ce0a9b49647910e76c6fa910f948ea.tar.bz2
Add incoming connections to the cache and change authorization check.
a) Add incoming connections to cache. b) Some devices like DS970 sends Adv Audio as the UUID for incoming connection.
Diffstat (limited to 'core/java/android/server/BluetoothDeviceService.java')
-rw-r--r--core/java/android/server/BluetoothDeviceService.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/java/android/server/BluetoothDeviceService.java b/core/java/android/server/BluetoothDeviceService.java
index afe4757..d2b4447 100644
--- a/core/java/android/server/BluetoothDeviceService.java
+++ b/core/java/android/server/BluetoothDeviceService.java
@@ -804,6 +804,15 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub {
return mBondState.getBondState(address.toUpperCase());
}
+ /*package*/ boolean isRemoteDeviceInCache(String address) {
+ return (mRemoteDeviceProperties.get(address) != null);
+ }
+
+ /*package*/ String[] getRemoteDeviceProperties(String address) {
+ String objectPath = getObjectPathFromAddress(address);
+ return (String [])getDevicePropertiesNative(objectPath);
+ }
+
/*package*/ synchronized String getRemoteDeviceProperty(String address, String property) {
Map<String, String> properties = mRemoteDeviceProperties.get(address);
if (properties != null) {
@@ -812,8 +821,7 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub {
// Query for remote device properties, again.
// We will need to reload the cache when we switch Bluetooth on / off
// or if we crash.
- String objectPath = getObjectPathFromAddress(address);
- String propValues[] = (String [])getDevicePropertiesNative(objectPath);
+ String[] propValues = getRemoteDeviceProperties(address);
if (propValues != null) {
addRemoteDeviceProperties(address, propValues);
return getRemoteDeviceProperty(address, property);