i want to change the “DiSPLAY TIMEOUT” from scripting.
i want to change the “DiSPLAY TIMEOUT” from scripting. I found that it should work with somethinthing like “android.provider.Settings.System.putInt(getContentResolver(),
Settings.System.SCREEN_OFF_TIMEOUT, time);”
how should be done in LL
]]>« I’m currently using a lightning desktop as a lock screen. (Previous Post)
(Next Post) Hey guys, I need your help one more time. »
< ![CDATA[
If you have Tasker you can invoke Tasker action from LL!
Here is a little working script :
// Change Display Timeout using Tasker from LL
var dispTimeout = {
secs: 42,
mins: 0,
hours: 0,
}
var synchronous = true
var ti = new TaskerIntent()
ti.addAction(ActionCodes.SCREEN_OFF_TIMEOUT)
ti.addArg(dispTimeout.secs)
ti.addArg(dispTimeout.mins)
ti.addArg(dispTimeout.hours)
LL.sendTaskerIntent(ti, synchronous)
Android.makeNewToast(“Display Timeout set to ” + dispTimeout.secs + “s ” + dispTimeout.mins + “m ” + dispTimeout.hours + “h”, true).show()
]]>
< ![CDATA[
Unforteunately i don’t have Tasker. I hate it’s GUI.
LL has no class to change Settings by itself?
]]>
< ![CDATA[
LL can invoke Java directly. Try something like LL.bindClass(“android.provider.Settings”);
Settings.System.putInt(LL.getContext().getContentResolver(),Settings.System.SCREEN_OFF_TIMEOUT, time);
]]>
< ![CDATA[
Roberto Brunelli LL only, there is another solution here!
]]>
< ![CDATA[
I just tested it and noticed it requires WRITE_SETTINGS permissions, which you can currently only get through my module https://play.google.com/store/apps/details?id=com.faendir.lightning_launcher.permission_manager. This requires root though.
]]>
< ![CDATA[
You can also install the package found at http://www.lightninglauncher.com/permissions/
]]>
< ![CDATA[
Pierre Hébert oh great, I didn’t know there was one for settings too.
]]>
< ![CDATA[
It’s a recent one (and a coincidence!)
]]>
< ![CDATA[
that sounds great.
I should be able to do it.
Isn’t it possible to grant the permission in a scpt like:
su pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS pm grant com.asksven.betterbatterystats android.permission.DUMP
I should only change the appname and the permission. Example for bbs found in the net.
]]>
< ![CDATA[
That might as well work.
]]>
< ![CDATA[
thanks i will tell you when i will success
]]>