• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[REF] Disable Wifi On Screen Off

Search This thread

RyanZA

Senior Member
Jan 21, 2006
2,023
778
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:

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
778
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
174
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....
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    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.