Showing posts with label screen. Show all posts
Showing posts with label screen. Show all posts

Don't want your android to sleep soon!!!


Hi friend,

I got another one interesting task in my project.  The task is by default the sleep time in Android ICS was 1 min, we want to set to 30 minutes as default.

If you check in Settings > display > sleep, it will display as 1 minute as default and there will not be any never option.

So now if we want to change the default sleep value while customizing the android, just follow the following steps…

Step 1: open the following xml file… android/frameworks/base/packages/SettingsProvider/res/values/defaults.xml.

Step 2: change the default sleep time value in the line,
<"integer name="def_screen_off_timeout">60000<"/integer">… I changed it to 1800000 (30 minutes)…
Now, if you check in Settings > display > sleep, it will display as 30 minutes as default…

And if you don’t want timeout, set it to ‘-1’ …
Now, if you check in Settings > display > sleep, it won’t show any time out value… :)


ANOTHER METHOD: Editing the sleep time in the Settings source…

Step 1: open the file, android/packages/apps/Settings/src/com/android/settings/DisplaySettings.java

Step 2: Add the line, “Settings.System.putInt(getContentResolver(), SCREEN_OFF_TIMEOUT, -1);” before the line “ final long currentTimeout = Settings.System.getLong(resolver, SCREEN_OFF_TIMEOUT,               FALLBACK_SCREEN_TIMEOUT_VALUE);”

Now, if you check in Settings > display > sleep, it won’t show any time out value… :)

DO REBUILD THE ANDROID AFTER THE CHANGES!!! DON’T FORGET!!!

Task Completed :) :) :)

Older Posts Home

About Me

My photo
Hi everyone,myself Alagappan...electronic and communication engg. student... living in madurai... interested in everything... want to achieve something great in my lifetime...

Followers


Recent Comments