Skip to content

Add Do Not Disturb, volume, status and find voice commands - #404

Open
amanKG777 wants to merge 2 commits into
trypsynth:masterfrom
amanKG777:voice-system-commands
Open

amanKG777 wants to merge 2 commits into
trypsynth:masterfrom
amanKG777:voice-system-commands

Conversation

@amanKG777

@amanKG777 amanKG777 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

This adds a few system voice commands to Backtalk, so you can change common phone settings and hear device status without leaving what you're doing.

Say "turn on Do Not Disturb" or "turn off dnd" to switch Do Not Disturb. The first time, Backtalk says it needs Do Not Disturb access and opens Android's setting for it. "Volume up" and "volume down" change the media volume and say the new level as a percentage, and "mute" and "unmute" mute and unmute it. "Battery" says the battery level and charging state, and "status" says what the status bar shows. "Open settings" opens Android Settings, and "open Backtalk settings" opens Backtalk's. "Find [name]", also "focus", "locate" and "search for", moves focus to the control on screen that best matches the name, and says what it found, or that it found nothing.

Do Not Disturb uses the notification policy API. Wi-Fi, hotspot, mobile data and Bluetooth aren't included, because Android has no supported way for an app to switch them. Turning Do Not Disturb off is decided by the word "off" or "disable" in what you said, since the "on" and "off" phrases are close enough that a fuzzy match alone finds both. If a phrase has both words, or neither and is unclear, Backtalk does nothing instead of guessing.

As with the calling commands, there is no switch: they only run when you say them after the voice command gesture. The new behaviour is described in differences.md.

Tested on a POCO M7 5G with Android 16, using Google's speech recognition service. I tried every command on the phone: Do Not Disturb on and off, volume up and down, mute and unmute, battery, status, open settings, open Backtalk settings, and find, both with a control that is on screen and with one that isn't. The first pass found three mistakes ("unmute" muted, "status" read only the battery, and "open Backtalk settings" opened Android Settings), which are fixed and described in my comment below, and I then tried them again. testPhoneDebugUnitTest, :lintPhoneDebug and :lintWearDebug all pass.

Say "turn on Do Not Disturb" or "turn off dnd", "volume up", "volume down",
"mute" or "unmute", "battery" or "status", "open settings" or "open Backtalk
settings". "Find [control]" moves focus to a matching control on screen.

Do Not Disturb uses the notification policy API, and asks for access the
first time. Wi-Fi, hotspot and mobile data aren't included, as Android
has no supported way for an app to switch them.
@amanKG777
amanKG777 force-pushed the voice-system-commands branch from e546496 to e74cd7e Compare November 1, 2026 22:35
@trypsynth

Copy link
Copy Markdown
Owner

Could you try volume, mute, battery, status, open settings and find on a device, and say how they went? Only Do Not Disturb has been tried so far.

Phone testing found three mistakes in the system voice commands. "Unmute"
muted, because the fuzzy match found "mute" inside it and the mute check came
first. "Status" read the battery, because "battery status" contains "status".
"Open Backtalk settings" opened Android Settings, because the speech
recognizer writes "Backtalk" as "back talk" and Settings matched any sentence
that contained the word "settings".

These commands now match whole phrases, not words found inside a sentence. The
unmute check uses the whole word, and "back talk" is read as "Backtalk".
@amanKG777

Copy link
Copy Markdown
Contributor Author

I tried the commands you asked about on a POCO M7 5G with Android 16, using Google's speech recognition service. Most worked, and I found three mistakes, which I've fixed in the new commit.

What worked at first: "volume up" and "volume down" change the volume and say the new level. "Mute" mutes. "Battery" says the battery status. "Open settings" opens Android Settings. "Find" with a button's name moves focus to it, and "find" with something that isn't on screen says so. "Turn off do not disturb" works.

What was wrong:

  • "Unmute" kept muting. The matcher found "mute" inside "unmute", and the mute check ran first.
  • "Status" said only the battery, not the time and network. "Battery status" contains "status", so the battery check took it.
  • "Open Backtalk settings" opened Android Settings, while "open talkback settings" opened Backtalk's. The speech recognizer writes "Backtalk" as "back talk", and the Android Settings check matched any sentence that contained "settings".

These commands now match whole phrases and not words found inside a sentence, "unmute" is checked as a whole word, and "back talk" is read as "Backtalk". I added SystemCommandPhrasesTest for these cases.

After the fix I tried "mute" then "unmute", "status", "battery", "open settings" and "open Backtalk settings" again on the phone, and all of them did the right thing. testPhoneDebugUnitTest, :lintPhoneDebug and :lintWearDebug pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants