am 100f0861: Merge change 24376 into eclair

Merge commit '100f08613392c225b8dff3f1e1d586f981884e29' into eclair-plus-aosp

* commit '100f08613392c225b8dff3f1e1d586f981884e29':
  Query for all properties if a property change is received and cache is empty.
This commit is contained in:
Jaikumar Ganesh
2009-09-09 10:55:14 -07:00
committed by Android Git Automerger
2 changed files with 9 additions and 0 deletions

View File

@@ -240,6 +240,11 @@ class BluetoothEventLoop {
}
/*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);

View File

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