Merge change 24376 into eclair
* changes:
Query for all properties if a property change is received and cache is empty.
diff --git a/core/java/android/server/BluetoothEventLoop.java b/core/java/android/server/BluetoothEventLoop.java
index 8cef3a2..e341b74 100644
--- a/core/java/android/server/BluetoothEventLoop.java
+++ b/core/java/android/server/BluetoothEventLoop.java
@@ -240,6 +240,11 @@
}
/*package*/ void onPropertyChanged(String[] propValues) {
+ if (mBluetoothService.isAdapterPropertiesEmpty()) {
+ // We have got a property change before
+ // we filled up our cache.
+ mBluetoothService.getAllProperties();
+ }
String name = propValues[0];
if (name.equals("Name")) {
Intent intent = new Intent(BluetoothIntent.NAME_CHANGED_ACTION);
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index b168850..5fe0d4e 100644
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -538,6 +538,10 @@
}
}
+ /*package*/ synchronized boolean isAdapterPropertiesEmpty() {
+ return mAdapterProperties.isEmpty();
+ }
+
/*package*/synchronized void getAllProperties() {
mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
mAdapterProperties.clear();