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. Manual merge for: ag/2588219/ Change-Id: I3b8eea4f82764852cea642db4455ba57f10a7d37 Fixes: 63955012 Test: robotests
This commit is contained in:
@@ -45,8 +45,8 @@ public class InlineSwitchPayload extends InlinePayload {
|
||||
* @param isDeviceSupported is true when the setting is valid for the given device.
|
||||
*/
|
||||
public InlineSwitchPayload(String key, @SettingsSource int source,
|
||||
int onValue, Intent intent, boolean isDeviceSupported) {
|
||||
super(key, source, intent, isDeviceSupported);
|
||||
int onValue, Intent intent, boolean isDeviceSupported, int defaultValue) {
|
||||
super(key, source, intent, isDeviceSupported, defaultValue);
|
||||
// If on is stored as TRUE then the switch is standard.
|
||||
mIsStandard = onValue == TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user