Unable to set system setting

Post Reply
CraigD
Posts: 1
Joined: Mon Jul 27, 2026 3:15 pm

Unable to set system setting

Post by CraigD »

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

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;
                        }
Miscellaneous.isNumericDecimal() just checks if a number can be parsed as a Double - and "1" can, so the above test fails.
Post Reply