Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 100f0861 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 24376 into eclair

* changes:
  Query for all properties if a property change is received and cache is empty.
parents cf7b5521 9519ce75
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);
+4 −0
Original line number Diff line number Diff line
@@ -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();