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

Commit eebc450a authored by Sonny Sasaka's avatar Sonny Sasaka
Browse files

floss: Update TODOs

* Added b/200066804 for LE Scanning API
* Added b/200065274 for restricted services/chars
* Added b/200070162 for concurrent write characteristic
* Removed a completed TODO in BtifGattClientCallbacks

Bug: 193685325
Tag: #floss
Test: Build

Change-Id: I33f93326f3bf07c18edafbc21ff1d48f05319fb0
parent 14b1d137
Loading
Loading
Loading
Loading
+17 −18
Original line number Diff line number Diff line
@@ -458,7 +458,7 @@ impl Default for ScanType {
}

/// Represents RSSI configurations for hardware offloaded scanning.
// TODO: This is still a placeholder struct, not yet complete.
// TODO(b/200066804): This is still a placeholder struct, not yet complete.
#[derive(Debug, Default)]
pub struct RSSISettings {
    pub low_threshold: i32,
@@ -554,19 +554,19 @@ pub enum GattWriteRequestStatus {

impl IBluetoothGatt for BluetoothGatt {
    fn register_scanner(&self, _callback: Box<dyn IScannerCallback + Send>) {
        // TODO: implement
        // TODO(b/200066804): implement
    }

    fn unregister_scanner(&self, _scanner_id: i32) {
        // TODO: implement
        // TODO(b/200066804): implement
    }

    fn start_scan(&self, _scanner_id: i32, _settings: ScanSettings, _filters: Vec<ScanFilter>) {
        // TODO: implement
        // TODO(b/200066804): implement
    }

    fn stop_scan(&self, _scanner_id: i32) {
        // TODO: implement
        // TODO(b/200066804): implement
    }

    fn register_client(
@@ -689,7 +689,7 @@ impl IBluetoothGatt for BluetoothGatt {
            return;
        }

        // TODO(b/193685325): Perform check on restricted handles.
        // TODO(b/200065274): Perform check on restricted handles.

        self.gatt.as_ref().unwrap().client.read_characteristic(
            conn_id.unwrap(),
@@ -717,7 +717,7 @@ impl IBluetoothGatt for BluetoothGatt {
            return;
        }

        // TODO(b/193685325): Perform check on restricted handles.
        // TODO(b/200065274): Perform check on restricted handles.

        self.gatt.as_ref().unwrap().client.read_using_characteristic_uuid(
            conn_id.unwrap(),
@@ -746,9 +746,9 @@ impl IBluetoothGatt for BluetoothGatt {
            write_type = GattWriteType::WritePrepare;
        }

        // TODO(b/193685325): Perform check on restricted handles.
        // TODO(b/200065274): Perform check on restricted handles.

        // TODO(b/193685325): Lock the thread until onCharacteristicWrite callback comes back?
        // TODO(b/200070162): Handle concurrent write characteristic.

        self.gatt.as_ref().unwrap().client.write_characteristic(
            conn_id.unwrap(),
@@ -767,7 +767,7 @@ impl IBluetoothGatt for BluetoothGatt {
            return;
        }

        // TODO(b/193685325): Perform check on restricted handles.
        // TODO(b/200065274): Perform check on restricted handles.

        self.gatt.as_ref().unwrap().client.read_descriptor(
            conn_id.unwrap(),
@@ -789,7 +789,7 @@ impl IBluetoothGatt for BluetoothGatt {
            return;
        }

        // TODO(b/193685325): Perform check on restricted handles.
        // TODO(b/200065274): Perform check on restricted handles.

        self.gatt.as_ref().unwrap().client.write_descriptor(
            conn_id.unwrap(),
@@ -805,7 +805,7 @@ impl IBluetoothGatt for BluetoothGatt {
            return;
        }

        // TODO(b/193685325): Perform check on restricted handles.
        // TODO(b/200065274): Perform check on restricted handles.

        if enable {
            self.gatt.as_ref().unwrap().client.register_for_notification(
@@ -952,8 +952,6 @@ pub(crate) trait BtifGattClientCallbacks {

    #[btif_callback(ReadPhy)]
    fn read_phy_cb(&mut self, client_id: i32, addr: RawAddress, tx_phy: u8, rx_phy: u8, status: u8);

    // TODO(b/193685325): Define all callbacks.
}

impl BtifGattClientCallbacks for BluetoothGatt {
@@ -1062,7 +1060,8 @@ impl BtifGattClientCallbacks for BluetoothGatt {
            return;
        }

        // TODO(b/193685325): Handle increasing permit.
        // TODO(b/200070162): Design how to handle concurrent write characteristic to the same
        // peer.

        let client = self.context_map.get_client_by_conn_id_mut(conn_id);
        if client.is_none() {
@@ -1199,7 +1198,7 @@ impl BtifGattClientCallbacks for BluetoothGatt {
                        elem.id as i32,
                        elem.type_ as i32,
                    ));
                    // TODO(b/193685325): Mark restricted services.
                    // TODO(b/200065274): Mark restricted services.
                }

                GattDbElementType::Characteristic => {
@@ -1214,7 +1213,7 @@ impl BtifGattClientCallbacks for BluetoothGatt {
                            // TODO(b/193685325): Log error.
                        }
                    }
                    // TODO(b/193685325): Mark restricted characteristics.
                    // TODO(b/200065274): Mark restricted characteristics.
                }

                GattDbElementType::Descriptor => {
@@ -1233,7 +1232,7 @@ impl BtifGattClientCallbacks for BluetoothGatt {
                            // TODO(b/193685325): Log error.
                        }
                    }
                    // TODO(b/193685325): Mark restricted descriptors.
                    // TODO(b/200065274): Mark restricted descriptors.
                }

                GattDbElementType::IncludedService => {