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

Commit 082ea901 authored by howardchung's avatar howardchung
Browse files

Floss: Fix build warnings

Bug: 284100355
Test: emerge and run ./build.py on aosp ToT
Change-Id: I2a016e72f35cdba23776473a87ba59faabe70db8
parent 63718132
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -1536,7 +1536,7 @@ impl CommandHandler {
                let (addr, sock_type, psm_or_uuid) =
                let (addr, sock_type, psm_or_uuid) =
                    (&get_arg(args, 1)?, &get_arg(args, 2)?, &get_arg(args, 3)?);
                    (&get_arg(args, 1)?, &get_arg(args, 2)?, &get_arg(args, 3)?);
                let device = BluetoothDevice {
                let device = BluetoothDevice {
                    address: addr.clone().into(),
                    address: String::from(*addr),
                    name: String::from("Socket Connect Device"),
                    name: String::from("Socket Connect Device"),
                };
                };


@@ -1558,7 +1558,7 @@ impl CommandHandler {


                    match &sock_type[0..] {
                    match &sock_type[0..] {
                        "l2cap" => {
                        "l2cap" => {
                            let psm = match psm_or_uuid.clone().parse::<i32>() {
                            let psm = match psm_or_uuid.parse::<i32>() {
                                Ok(v) => v,
                                Ok(v) => v,
                                Err(e) => {
                                Err(e) => {
                                    return Err(CommandError::Failed(format!(
                                    return Err(CommandError::Failed(format!(
@@ -1583,7 +1583,7 @@ impl CommandHandler {
                            }
                            }
                        }
                        }
                        "rfcomm" => {
                        "rfcomm" => {
                            let uuid = match UuidHelper::parse_string(psm_or_uuid.clone()) {
                            let uuid = match UuidHelper::parse_string(*psm_or_uuid) {
                                Some(uu) => uu,
                                Some(uu) => uu,
                                None => {
                                None => {
                                    return Err(CommandError::Failed(format!(
                                    return Err(CommandError::Failed(format!(
+2 −2
Original line number Original line Diff line number Diff line
@@ -3146,7 +3146,7 @@ impl BtifGattClientCallbacks for BluetoothGatt {
    }
    }


    fn congestion_cb(&mut self, conn_id: i32, congested: bool) {
    fn congestion_cb(&mut self, conn_id: i32, congested: bool) {
        if let Some(mut client) = self.context_map.get_client_by_conn_id_mut(conn_id) {
        if let Some(client) = self.context_map.get_client_by_conn_id_mut(conn_id) {
            client.is_congested = congested;
            client.is_congested = congested;
            if !client.is_congested {
            if !client.is_congested {
                let cbid = client.cbid;
                let cbid = client.cbid;
@@ -3682,7 +3682,7 @@ impl BtifGattServerCallbacks for BluetoothGatt {
    }
    }


    fn congestion_cb(&mut self, conn_id: i32, congested: bool) {
    fn congestion_cb(&mut self, conn_id: i32, congested: bool) {
        if let Some(mut server) = self.server_context_map.get_mut_by_conn_id(conn_id) {
        if let Some(server) = self.server_context_map.get_mut_by_conn_id(conn_id) {
            server.is_congested = congested;
            server.is_congested = congested;
            if !server.is_congested {
            if !server.is_congested {
                let cbid = server.cbid;
                let cbid = server.cbid;
+1 −1
Original line number Original line Diff line number Diff line
@@ -559,7 +559,7 @@ impl BluetoothProperty {
                // Do an unsafe cast to binding:: type and assign the values
                // Do an unsafe cast to binding:: type and assign the values
                // The underlying memory location is provided by |data| which will
                // The underlying memory location is provided by |data| which will
                // have enough space because it uses get_len()
                // have enough space because it uses get_len()
                let mut record =
                let record =
                    unsafe { &mut *(data.as_mut_ptr() as *mut bindings::bt_service_record_t) };
                    unsafe { &mut *(data.as_mut_ptr() as *mut bindings::bt_service_record_t) };
                record.uuid = sr.uuid;
                record.uuid = sr.uuid;
                record.channel = sr.channel;
                record.channel = sr.channel;