Skip to content

android/device-setting-restore

Decides how a device setting that was changed for a capture gets put back.

A suite that flips a setting owes the device its original value back — including the case where it never had one. settings get prints the literal null for a setting that has never been written, and settings put … null does not reproduce that state: it writes the four-character string null. Restoring an unset setting takes settings delete, which is why this is a decision rather than a straight write-back.

Pure and unit-tested; the calls that carry it out live in device-settings.

Interface Description
DeviceSettingRestoreDelete Restoring a setting by removing it, because it had never been written.
DeviceSettingRestoreWrite Restoring a setting by writing its previous value back.
Function Description
resolveDeviceSettingRestore Decides how a setting read before a change is put back afterwards.
Type Description
DeviceSettingRestore What restoring a setting requires: putting a value back, or removing it again.
Enum Description
DeviceSettingRestoreKind How a setting is restored.