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

Commit ff8ad80e authored by Alice Kuo's avatar Alice Kuo
Browse files

csip: store the IsCoordinatedSetMember info in RemoteDevices

Update the IsCoordinatedSetMember from stack and use intent to notify Setting

Bug: 178981521
Bug: 150670922
Test: discover and pair with the CSIP supported device, check the
pairing dialog string

Change-Id: I61a17f3eab53f556134672f8fe9cd22169fad0ea
parent 2925ef43
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) {