LockSettingsService: reject null keys in setString() et al.
Make the setBoolean(), setLong(), and setString() methods of
ILockSettings throw an exception if the given key is null, rather than
allowing it to be inserted into the locksettings database, where it
previously would cause a crash upon preloading.
This is a small cleanup only; we probably should go further and use an
allowlist of key names. Still, the ACCESS_KEYGUARD_SECURE_STORAGE
permission is required to call these methods, so there doesn't appear to
be any security impact from the lax input validation.
Bug: 261860102
Test: com.android.server.locksettings
Change-Id: Ic8632068b92182425e78e2f28a1c4016b7af4a3b
2 files changed