diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-22 21:54:29 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-11-22 21:54:29 -0800 |
commit | ad431ad8631d8b19b04193ff1f89a955a7643c60 (patch) | |
tree | 6d4bcc252161c5203790584097cd285420a9e85e /core/java/android/server/BluetoothService.java | |
parent | e7800946a42c0ebe8e0b3f6eba04a96a9641aaff (diff) | |
parent | b148bc844e5eddb07bef2fd1b4b754716decb43e (diff) | |
download | frameworks_base-ad431ad8631d8b19b04193ff1f89a955a7643c60.zip frameworks_base-ad431ad8631d8b19b04193ff1f89a955a7643c60.tar.gz frameworks_base-ad431ad8631d8b19b04193ff1f89a955a7643c60.tar.bz2 |
Merge change Ia3acc2ee into eclair
* changes:
Fix pairings lost on reboot.
Diffstat (limited to 'core/java/android/server/BluetoothService.java')
-rw-r--r-- | core/java/android/server/BluetoothService.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index 809e230..db9f34a 100644 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -531,7 +531,7 @@ public class BluetoothService extends IBluetooth.Stub { return; } String []bonds = null; - String val = getProperty("Devices"); + String val = getPropertyInternal("Devices"); if (val != null) { bonds = val.split(","); } @@ -681,7 +681,6 @@ public class BluetoothService extends IBluetooth.Stub { /*package*/synchronized void getAllProperties() { mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); - if (!isEnabledInternal()) return; mAdapterProperties.clear(); String properties[] = (String [])getAdapterPropertiesNative(); @@ -806,7 +805,12 @@ public class BluetoothService extends IBluetooth.Stub { return true; } - /*package*/ synchronized String getProperty (String name) { + /*package*/ synchronized String getProperty(String name) { + if (!isEnabledInternal()) return null; + return getPropertyInternal(name); + } + + /*package*/ synchronized String getPropertyInternal(String name) { if (!mAdapterProperties.isEmpty()) return mAdapterProperties.get(name); getAllProperties(); @@ -1639,7 +1643,7 @@ public class BluetoothService extends IBluetooth.Stub { } /*package*/ String getAddressFromObjectPath(String objectPath) { - String adapterObjectPath = getProperty("ObjectPath"); + String adapterObjectPath = getPropertyInternal("ObjectPath"); if (adapterObjectPath == null || objectPath == null) { Log.e(TAG, "getAddressFromObjectPath: AdpaterObjectPath:" + adapterObjectPath + " or deviceObjectPath:" + objectPath + " is null"); @@ -1659,7 +1663,7 @@ public class BluetoothService extends IBluetooth.Stub { } /*package*/ String getObjectPathFromAddress(String address) { - String path = getProperty("ObjectPath"); + String path = getPropertyInternal("ObjectPath"); if (path == null) { Log.e(TAG, "Error: Object Path is null"); return null; |