Add default value to inline payloads

If we try to set an inline result when it has not yet been
accessed in settings, nothing is read from Settings.
Thus, include a default value for a fallback.

Change-Id: I8a593d9ff3308b2d0cd5bc65658d160abf55b07e
Fixes: 63955012
Test: robotests
This commit is contained in:
Matthew Fritze
2017-07-24 14:58:36 -07:00
parent 2b689e63ca
commit 73056522b3
17 changed files with 87 additions and 66 deletions

View File

@@ -85,6 +85,7 @@ public class AmbientDisplayAlwaysOnPreferenceController extends PreferenceContro
mContext.getString(R.string.ambient_display_screen_title));
return new InlineSwitchPayload(Settings.Secure.DOZE_ALWAYS_ON,
ResultPayload.SettingsSource.SECURE, ON, intent, isAvailable());
ResultPayload.SettingsSource.SECURE, ON /* onValue */, intent, isAvailable(),
ON /* defaultValue */);
}
}