Skip to content

Add a Copy command action to the speaker switch while it needs adb - #196

Merged
trypsynth merged 2 commits into
trypsynth:masterfrom
aaron-gh:copy-adb-command
Oct 16, 2026
Merged

trypsynth merged 2 commits into
trypsynth:masterfrom
aaron-gh:copy-adb-command

Conversation

@aaron-gh

Copy link
Copy Markdown
Contributor

Speaker when away from your ear needs MANAGE_ONGOING_CALLS, which is granted with adb or Shizuku. Until then the switch's summary shows the command, which then has to be typed out on a computer.

While the permission is missing, the switch now has a Copy command action that copies the command to the clipboard. The action works on the disabled switch, and it is removed once the permission is granted. Below Android 13, a "Command copied" toast confirms the copy. From Android 13 the system confirms it.

Changes:

  • CommandSwitchPreference: a switch with an optional adb command and the Copy command action, for any setting that needs a permission granted with adb. Fix stuck touch exploration (Fix touch exploration when Android leaves touches down #194) will use it for the DUMP command once this is merged.
  • The speaker switch in both sound_and_vibration_preferences.xml files uses it, and SoundAndVibrationFragment sets the command while the permission is missing.
  • The two new strings have lint-baseline.xml entries.
  • differences.md mentions the action.

Tested on an Android 16 emulator. Without the permission, Actions > Copy command put adb shell appops set fyi.quin.backtalk MANAGE_ONGOING_CALLS allow on the clipboard. After granting it, the action was gone.

While Backtalk lacks MANAGE_ONGOING_CALLS, the "Speaker when away from
your ear" switch has a "Copy command" action that copies the adb command
from its summary to the clipboard. The action is removed once the
permission is granted. Below Android 13, a "Command copied" toast
confirms the copy; from Android 13 the system confirms it.

The switch stays disabled until the permission is granted, and Backtalk
does not speak the actions hint on disabled items, so the action is found
through the Actions reading control.

- CommandSwitchPreference: a switch with an optional adb command and the
  Copy command action, for any setting that needs a permission granted
  with adb.
@trypsynth
trypsynth merged commit 7270124 into trypsynth:master Oct 16, 2026
2 checks passed
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