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

Commit 5d34179e authored by Yun-Hao Chung's avatar Yun-Hao Chung
Browse files

Floss: Add phone-ops mode in btclient

Simply add a command in btclient to enable/disable phone-ops mode for
qualification usage.

Bug: 324158435
Bug: 324157546
Test: m -j
Tag: #floss
Flag: EXEMPT, Floss only change

Change-Id: I865c083174a0e7c8ff6fe77a97857ec583e1e2ab
parent d965f000
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -343,6 +343,7 @@ fn build_commands() -> HashMap<String, CommandOption> {
                String::from("telephony set-roaming <on|off>"),
                String::from("telephony set-signal <strength>"),
                String::from("telephony set-battery <level>"),
                String::from("telephony set-phone-opss <on|off>"),
                String::from("telephony <enable|disable>"),
                String::from("telephony <incoming-call|dialing-call> <number>"),
                String::from("telephony <answer-call|hangup-call>"),
@@ -2065,6 +2066,22 @@ impl CommandHandler {
                    }
                }
            }
            "set-phone-ops" => {
                let on_or_off = match &get_arg(args, 1)?[..] {
                    "on" => true,
                    "off" => false,
                    _ => {
                        return Err("Failed to parse on|off".into());
                    }
                };
                self.context
                    .lock()
                    .unwrap()
                    .telephony_dbus
                    .as_mut()
                    .unwrap()
                    .set_phone_ops_enabled(on_or_off);
            }
            "incoming-call" => {
                let success = self
                    .context