What the patch changes, the firmware bug behind it, and how to install it with adb.
In Voice Access settings, Configure activation key opens a popup. It records every key you press, then waits for you to tap OK. On a keypad-only phone, that fails two separate ways.
Keypad phones move popup buttons to the soft-key bar. Pressing "OK" sends a key press, and the popup records it as your new key. Every attempt to save overwrites your choice.
On the Sonim XP3900 we tested, a firmware bug makes the OK button on this kind of settings popup quietly throw your choice away. More on that below.
A USB mouse doesn't help either. The phone turns clicks into key presses too.
One small part of the app, the key popup. Nothing else.
The key that opens the popup can't save itself by accident. The popup only saves on a release when the press also started inside it.
The first version of this patch was correct and still didn't save. Logging showed the key was captured and the save ran every time. The phone threw the value away at the last step.
Android settings popups remember which button you clicked, then check it when the popup closes. OK sets the value to -1. Stock Android checks for -1. This phone's firmware checks for -3, the "neutral" button:
# android.preference.DialogPreference.onDismiss, pulled from the phone
iget p1, p0, ...DialogPreference;->mWhichButtonClicked:I
const/4 v0, -0x3 # stock Android uses -0x1 here
if-ne p1, v0, :cancelled
So OK sets -1, the check looks for -3, and every save gets treated as a cancel. The popup closes and looks like it worked. This hits every settings popup of this type on the phone, not only Voice Access.
You need a computer with Android platform-tools (adb) and USB debugging turned on in the phone's developer options.
The modified app is signed with a different key than the original, so the original has to come off first. Its settings go with it.
adb uninstall com.android.cts.apps.accessibility.voiceaccess
adb install voiceaccess-autosave.apk
Turn Voice Access on from the phone itself. Don't flip accessibility settings over adb.
The line under "Activation key" should now show your key, for example KEYCODE_SPEAKER. "No key assigned" means nothing saved.
If the key saves but holding it doesn't start Voice Access, the phone is using that key for something else first. Pick a different key. That's not a problem with the patch.
Check the app, not the phone model.
4.0.304676510 only. Other builds rename their internals, so the patch would have to be redone for them. To check your version:
adb shell dumpsys package com.android.cts.apps.accessibility.voiceaccess | grep versionName| Tested on | Sonim XP3900 (TMO_XP3900), Android 11, 32-bit |
|---|---|
| Package | com.android.cts.apps.accessibility.voiceaccess |
| Version | 4.0.304676510 (unchanged) |
| Changed | KeyComboPreference only. No resources, manifest, or other classes. |
| Original sha256 | 91c07fd24999f1ca12f6cc24715451d5bf451370c7151ff08d84915651e51f71 |
| Modified sha256 | 8e9c4731133fa9d36c52f57133ef93513d654855755f173dd9c1c561d2916f5f |
Keep your original APK. To undo, uninstall the modified app and install the original. The two are signed with different keys, so one can't install over the other. You'll set up Voice Access again either way.