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

Commit dd070462 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "csip: store the IsCoordinatedSetMember info in RemoteDevices"

parents 2925ef43 ff8ad80e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ public final class AbstractionLayer {
    static final int BT_PROPERTY_LOCAL_LE_FEATURES = 0x0D;

    static final int BT_PROPERTY_DYNAMIC_AUDIO_BUFFER = 0x10;
    static final int BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER = 0x11;

    public static final int BT_DEVICE_TYPE_BREDR = 0x01;
    public static final int BT_DEVICE_TYPE_BLE = 0x02;
+15 −0
Original line number Diff line number Diff line
@@ -216,6 +216,7 @@ final class RemoteDevices {
        private BluetoothDevice mDevice;
        private boolean mIsBondingInitiatedLocally;
        private int mBatteryLevel = BluetoothDevice.BATTERY_LEVEL_UNKNOWN;
        private boolean mIsCoordinatedSetMember;
        @VisibleForTesting int mBondState;
        @VisibleForTesting int mDeviceType;
        @VisibleForTesting ParcelUuid[] mUuids;
@@ -378,6 +379,15 @@ final class RemoteDevices {
                this.mBatteryLevel = batteryLevel;
            }
        }

        /**
         * @return the mIsCoordinatedSetMember
        */
        private boolean isCoordinatedSetMember() {
            synchronized (mObject) {
                return mIsCoordinatedSetMember;
            }
        }
    }

    private void sendUuidIntent(BluetoothDevice device, DeviceProperties prop) {
@@ -573,6 +583,9 @@ final class RemoteDevices {
                            // RSSI from hal is in one byte
                            device.mRssi = val[0];
                            break;
                        case AbstractionLayer.BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER:
                            device.mIsCoordinatedSetMember = (boolean) (val[0] != 0);
                            break;
                    }
                }
            }
@@ -596,6 +609,8 @@ final class RemoteDevices {
                new BluetoothClass(deviceProp.mBluetoothClass));
        intent.putExtra(BluetoothDevice.EXTRA_RSSI, deviceProp.mRssi);
        intent.putExtra(BluetoothDevice.EXTRA_NAME, deviceProp.mName);
        intent.putExtra(BluetoothDevice.EXTRA_IS_COORDINATED_SET_MEMBER,
                deviceProp.mIsCoordinatedSetMember);

        final ArrayList<DiscoveringPackage> packages = sAdapterService.getDiscoveringPackages();
        synchronized (packages) {