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

Commit a600a8d1 authored by Yun-hao Chung's avatar Yun-hao Chung Committed by Automerger Merge Worker
Browse files

Merge changes I24cac585,Ib5e5d7ee am: 08715b05 am: e7f6597a am: 7d7e1185

parents 1076d08b 7d7e1185
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -84,10 +84,17 @@ impl BtHelper {
        let mut result = HashSet::<CommandCandidate>::new();

        for rule in self.command_rules.iter() {
            for (i, (rule_token, cmd_token)) in rule.split(" ").zip(cmd.split(" ")).enumerate() {
            let n_splits = cmd.split(" ").count();
            // The tokens should have empty strings removed from them, except the last one.
            let tokens = cmd
                .split(" ")
                .enumerate()
                .filter_map(|(i, token)| (i == n_splits - 1 || token != "").then(|| token));

            let n_cmd = tokens.clone().count();
            for (i, (rule_token, cmd_token)) in rule.split(" ").zip(tokens).enumerate() {
                let mut candidates = Vec::<String>::new();
                let mut match_some = false;
                let n_cmd = cmd.split(" ").count();

                for opt in rule_token.replace("<", "").replace(">", "").split("|") {
                    if opt.eq("address") {
+3 −4
Original line number Diff line number Diff line
@@ -572,15 +572,14 @@ async fn start_interactive_shell(
                    break;
                }
                Ok(line) => {
                    let command_vec =
                        line.split(" ").map(|s| String::from(s)).collect::<Vec<String>>();
                    let cmd = &command_vec[0];
                    let mut args = line.split_whitespace();
                    let cmd = args.next().unwrap_or("");
                    if cmd.eq("quit") {
                        break;
                    }
                    handler.process_cmd_line(
                        &String::from(cmd),
                        &command_vec[1..command_vec.len()].to_vec(),
                        &args.map(String::from).collect::<Vec<String>>(),
                    );
                    // Ready to do readline again.
                    semaphore_fg.add_permits(1);
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@

use crate::bluetooth::{Bluetooth, BtifBluetoothCallbacks};
use crate::callbacks::Callbacks;
use crate::{bluetooth_gatt::IBluetoothGatt, BluetoothGatt, Message, RPCProxy};
use crate::{BluetoothGatt, Message, RPCProxy};
use bt_topshim::btif::BluetoothInterface;
use log::warn;
use std::sync::{Arc, Mutex};