Unable to set system setting
Posted: Mon Jul 27, 2026 3:21 pm
I'm trying to create a rule to enter battery saving mode - this can be achieved by setting low_power to 1, which I confined via adb. I've also enabled WRITE_SECURE_SETTINGS via adb.
But, when I try to add this action, and set Type to Int, a toast is shown stating "Enter a number" when pressing "Save".
[Edit] I think the following check in ActivityManageActionSetSystemSetting.java is incorrect
Miscellaneous.isNumericDecimal() just checks if a number can be parsed as a Double - and "1" can, so the above test fails.
But, when I try to add this action, and set Type to Int, a toast is shown stating "Enter a number" when pressing "Save".
[Edit] I think the following check in ActivityManageActionSetSystemSetting.java is incorrect
Code: Select all
if(Miscellaneous.isNumericDecimal(etSettingValue.getText().toString()) || !Miscellaneous.isNumeric(etSettingValue.getText().toString()))
{
Toast.makeText(ActivityManageActionSetSystemSetting.this, getResources().getString(R.string.enter_a_number), Toast.LENGTH_LONG).show();
return;
}