[REF] Disable Wifi On Screen Off

Search This thread

RyanZA

Senior Member
Jan 21, 2006
2,023
784
JHB
Some people have picked up an annoying bug - I'm not sure where it comes from, some believe it is the voodoo kernel, I think it is probably JPC firmware or similar.

The bug: When you have wifi on and you turn the screen off, wifi does not turn off like it should.

The reality: The wifi turn-off time has been reset to the android default 15 minutes. You can change this setting if you want. (I like 10 seconds myself.)

You will need:
1. ADB root shell access.
2. SQLite3 Explorer - http://www.singular.gr/sqlite/
or SQLiteBrowser - http://sqlitebrowser.sourceforge.net/

What to do:
1. shell command: busybox cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db
2. adb command: adb pull /sdcard/settings.db
3. Open settings.db in SQLExplorer
4. Right click on gservices or secure folders**, choose 'Show Data'
5. Click on the green plus icon "Insert Record"
6. Double click on name column, insert "wifi_idle_ms" - Double click on value column and insert "10000" for 10 seconds for wifi to turn off. 30000 for 30 seconds, etc.
7. Click on the green tick.
8. Right click on the folder again, choose show data, scroll to the bottom and ensure that your change has been made.
9. File -> Close Database
10. adb command: adb push settings.db /sdcard/settings.db
11. shell command: busybox mv /dbdata/databases/com.android.providers.settings/settings.db /dbdata/databases/com.android.providers.settings/settings.db.bak
12. shell command: busybox cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings/settings.db
13. shell command: chown system.system /dbdata/databases/com.android.providers.settings/settings.db

** I'm not sure if the correct folder is gservices, or secure. I believe secure is the correct one though. I just added it to both.

This is too hard:
If there are 10 or more people who have this bug but can't do the required fix, I'll make a small utility to do it for you. Let me know.
 
Last edited:

xan

Retired Recognized Developer
May 21, 2006
1,407
455
Crack-ow
Code:
D/WifiService( 2333): setting ACTION_DEVICE_IDLE timer for 900000ms.
 

fane1

Senior Member
Dec 8, 2008
315
36
Really i dont understand why people are so fuzzed about this "bug".Im really happy with it because at home i always use wiffi and usually i stay at home in the afternoons.So i set wiffi settings to never disconect even at night.Data connection over 3g is expensive here in portugal and i have 600mb month limit wich cost about 15 euro plus my normal bill.And its not by having wifi on during 15 minutes that will drain the battery so much.Anyways i want to thank you again for your work and dedication to help people like me that have some dificulties understanding how the android system works.
 

RyanZA

Senior Member
Jan 21, 2006
2,023
784
JHB
Really i dont understand why people are so fuzzed about this "bug".Im really happy with it because at home i always use wiffi and usually i stay at home in the afternoons.So i set wiffi settings to never disconect even at night.Data connection over 3g is expensive here in portugal and i have 600mb month limit wich cost about 15 euro plus my normal bill.And its not by having wifi on during 15 minutes that will drain the battery so much.Anyways i want to thank you again for your work and dedication to help people like me that have some dificulties understanding how the android system works.

If you want, you can use the guide to increase it up to 30 minutes or more. Point is - choice is good. :D
 

JaGuR

Senior Member
Jul 27, 2009
175
3
I am having trouble getting this to work

I am typing

adb pull /sdcard/settings.db

and I am getting

abd: not found

?
 

JaGuR

Senior Member
Jul 27, 2009
175
3
This is what I have done,

Opened CMD, in the adb folder.

adb shell
su

accepted SU permissions

#busybox cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db

#adb pull /sdcard/settings.db

Am I doing something wrong ?
 

Treggs

Senior Member
Aug 9, 2010
114
13
This is what I have done,

Opened CMD, in the adb folder.

adb shell
su

accepted SU permissions

#busybox cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db

#adb pull /sdcard/settings.db

Am I doing something wrong ?

Nope worked for me. I'm trying to figure out how to edit the file....
 

sunwee

Senior Member
May 8, 2009
517
60
ryanza, thanks for finding this out. tried but cant get sq3liteexplorer to work on win7 64. i get access violation errors.

hope you'll do a simple script for this. thanks@
 

Treggs

Senior Member
Aug 9, 2010
114
13
ryanza, thanks for finding this out. tried but cant get sq3liteexplorer to work on win7 64. i get access violation errors.

hope you'll do a simple script for this. thanks@

I thought I was doing it wrong but that's exactly what I'm getting and I'm on win 7 64 too.

Maybe I should try a compatibility mode...
 

JaGuR

Senior Member
Jul 27, 2009
175
3
ryanza, thanks for finding this out. tried but cant get sq3liteexplorer to work on win7 64. i get access violation errors.

hope you'll do a simple script for this. thanks@

Same here to RyanZA, having trouble gettin ADB, to play corrcetly.

And I know few from whirlpool. that would also appreciate, and easier fix :)

Cheers
 
Last edited:

jdrake001

Senior Member
Dec 23, 2007
71
3
This is what I have done,

Opened CMD, in the adb folder.

adb shell
su

accepted SU permissions

#busybox cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db

#adb pull /sdcard/settings.db

Am I doing something wrong ?

you need to exit before using adb pull
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Some people have picked up an annoying bug - I'm not sure where it comes from, some believe it is the voodoo kernel, I think it is probably JPC firmware or similar.

    The bug: When you have wifi on and you turn the screen off, wifi does not turn off like it should.

    The reality: The wifi turn-off time has been reset to the android default 15 minutes. You can change this setting if you want. (I like 10 seconds myself.)

    You will need:
    1. ADB root shell access.
    2. SQLite3 Explorer - http://www.singular.gr/sqlite/
    or SQLiteBrowser - http://sqlitebrowser.sourceforge.net/

    What to do:
    1. shell command: busybox cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db
    2. adb command: adb pull /sdcard/settings.db
    3. Open settings.db in SQLExplorer
    4. Right click on gservices or secure folders**, choose 'Show Data'
    5. Click on the green plus icon "Insert Record"
    6. Double click on name column, insert "wifi_idle_ms" - Double click on value column and insert "10000" for 10 seconds for wifi to turn off. 30000 for 30 seconds, etc.
    7. Click on the green tick.
    8. Right click on the folder again, choose show data, scroll to the bottom and ensure that your change has been made.
    9. File -> Close Database
    10. adb command: adb push settings.db /sdcard/settings.db
    11. shell command: busybox mv /dbdata/databases/com.android.providers.settings/settings.db /dbdata/databases/com.android.providers.settings/settings.db.bak
    12. shell command: busybox cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings/settings.db
    13. shell command: chown system.system /dbdata/databases/com.android.providers.settings/settings.db

    ** I'm not sure if the correct folder is gservices, or secure. I believe secure is the correct one though. I just added it to both.

    This is too hard:
    If there are 10 or more people who have this bug but can't do the required fix, I'll make a small utility to do it for you. Let me know.
    1
    Works on 2.2, and for 2.2.1,

    You need to add it to secure folder for 2.2 though, NOT gservices

    I use Root Explorer to copy it out, and paste it back in, been doing this for my last 10 flashes and never had a problem.

    If you do run into a problem I suggest you will need to flash new rom through CMW / Recovery, and or via odin
    1
    Late post here, but people google stuff, and come upon this stuff. So I'm gonna make one post here that will hopefully alleviate everyone's issues here.

    1) adb pull your "settings.db" - it may be in this location /data/data/com.android.providers.settings/databases/settings.db NOW MAKE A BACKUP OF THIS FILE! JUST IN CASE!

    2) sqlitebrowser - Great program, easy to use. Go to Browse Data > Under Table select Secure > Click new Record > under name put this >wifi_idle_ms > under value > 30000 (that is 30 seconds, I use that because my screen only stays on for 30 seconds)

    In some ROMS and some systems, The setting might be in System. It reads System first, then Secure <> You can see this in Sqlite sequence table.

    It will not hurt anything if you put the same value in both system and secure. Make sure no Values conflict. Take your time.

    3) Save it by clicking Write Changes (Hope you made a backup of the original)

    4) adb push settings.db /data/data/com.android.providers.settings/databases/

    5) Now type this: adb shell > then type this: su > now you should see a " # " and blinking cursor in front of it. > Type this: chmod 777 /data/data/com.android.providers.settings/databases.db --- You are giving Root permissions here to this file.

    6) Now type: chown system.system /data/data/com.android.providers.settings/databases.db (here you are making Owner and Group : System.)

    Step 5 and 6 are important or you will boot loop - Major trouble for most people so we must avoid that by using CHMOD and CHOWN.

    Enjoy your settings.db ---> Your wifi should turn off right away unless there is an app that requires wifi to be on for whatever it is doing.

    It's a late post but this information is still valid in May 2015.