device-settings
Reads and writes Android device settings — and wraps the one setting a screenshot suite has to change.
The screenshot AVDs are built hw.keyboard=yes, so Android suppresses the on-screen keyboard even where the page asks for one. show_ime_with_hard_keyboard is what turns it back on. withSoftKeyboardEnabled flips it, runs the work, and puts the device back exactly as it found it — including restoring a setting that had never been written, which takes a delete rather than a write (see device-setting-restore).
Every function here shells out, so the whole module is integration-time code; the restore decision and the argument list it depends on are unit-tested in their own modules.
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| DeviceSettingParams | Parameters for deleteDeviceSetting and readDeviceSetting. |
| WithSoftKeyboardEnabledParams | Parameters for withSoftKeyboardEnabled. |
| WriteDeviceSettingParams | Parameters for writeDeviceSetting. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
| deleteDeviceSetting | Clears a device setting, returning it to never-having-been-written. |
| readDeviceSetting | Reads a device setting. |
| withSoftKeyboardEnabled | Permits the on-screen keyboard for the duration of a callback, then restores the device exactly. The restore runs whether the callback succeeded or threw — a suite that dies mid-capture must not leave the device configured differently than it found it. |
| writeDeviceSetting | Writes a device setting. |