If you change screen_off_timeout to a value of 0, your screen will never turn off automatically. To fix it without a backup, you’d need to re-run ADB or factory reset. Always export your settings before editing.
There is one loophole: Android Debug Bridge (ADB). You can use a PC (or apps like LADB) to grant SetEdit the WRITE_SECURE_SETTINGS permission via USB debugging. setedit no root
If you do this, you can edit the Secure and Global tables on a non-rooted device. However: If you change screen_off_timeout to a value of
Useful edits via ADB+SetEdit:
These modifications are more powerful and can cause system instability if misused. I recommend researching each key specific to your device model first. There is one loophole: Android Debug Bridge (ADB)