Merge change 24376 into eclair

* changes:
  Query for all properties if a property change is received and cache is empty.
This commit is contained in:
Android (Google) Code Review
2009-09-09 13:47:27 -04:00
2 changed files with 9 additions and 0 deletions

View File

@@ -240,6 +240,11 @@ class BluetoothEventLoop {
} }
/*package*/ void onPropertyChanged(String[] propValues) { /*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]; String name = propValues[0];
if (name.equals("Name")) { if (name.equals("Name")) {
Intent intent = new Intent(BluetoothIntent.NAME_CHANGED_ACTION); Intent intent = new Intent(BluetoothIntent.NAME_CHANGED_ACTION);

View File

@@ -538,6 +538,10 @@ public class BluetoothService extends IBluetooth.Stub {
} }
} }
/*package*/ synchronized boolean isAdapterPropertiesEmpty() {
return mAdapterProperties.isEmpty();
}
/*package*/synchronized void getAllProperties() { /*package*/synchronized void getAllProperties() {
mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
mAdapterProperties.clear(); mAdapterProperties.clear();