Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,781,073 Members 45,408 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] How to change WiFi sleep timeout (idle time)

Tip us?
 
Proverbs2
Old
#1  
Proverbs2's Avatar
Senior Member - OP
Thanks Meter 296
Posts: 285
Join Date: Feb 2012
Default [GUIDE] How to change WiFi sleep timeout (idle time)

All credit goes to RyanZA for his awesome guide for the Samsung Galaxy S: http://forum.xda-developers.com/showthread.php?t=774507
I have merely adapted his guide to the Motorola DEFY and simplified a few steps.

What this guide is for:
The Android settings menu only gives you three options for the wifi sleep policy: When screen turns off, Never when plugged in, or Never. (These options are found in Settings > Wireless & networks > Wi-Fi settings > menu button > Advanced > Wi-Fi sleep policy.) The When screen turns off option does not turn off the wifi immediately after the screen is turned off, however. By default, the system waits 15 minutes before disabling the wifi. This guide explains how to change that wifi timeout duration.

What you’ll need:
- ES File Explorer (with the Root Explorer and Mount File System settings enabled), or some other root-enabled file explorer app on your phone

- SQLite Database Browser on your computer: http://sqlitebrowser.sourceforge.net/

Instructions:
1) In ES File Explorer, go to the following directory in your phone’s internal memory: /data/data/com.android.providers.settings/databases/

2) Copy the “settings.db” file to your SDcard, then to your computer. Make a backup of the original file before making any changes.

3) Open SQLite Database Browser on your computer, select File > Open Database, and open your “settings.db” file.

4) Click the Browse Data tab, and on the Table dropdown menu, select secure.

5) Click New Record. Scroll down to the new empty line that was just created in the table, and double-click on the empty cell in the name column. In the Edit database cell window that appears, type “wifi_idle_ms” (without quotation marks), then click Apply Changes. Next, double click on the cell in the value column, and enter the desired wifi timeout duration in milliseconds (e.g. enter “30000” to specify a timeout duration of 30 seconds), and click Apply Changes.

6) Save the file and exit SQLite. Move the edited file back to your phone’s SD card, then use ES File Explorer to copy and paste it back into the directory where you found it, replacing the original file. (Remember to keep a backup of the original, just in case something goes wrong.) Then reboot the phone.
The Following User Says Thank You to Proverbs2 For This Useful Post: [ Click to Expand ]
 
Ukiand1
Old
#2  
Member
Thanks Meter 16
Posts: 56
Join Date: Dec 2010
Default It won't open file on computer

No database shown, nothing. Help somehow?
 
Unr3aL67
Old
(Last edited by Unr3aL67; 15th August 2012 at 12:28 AM.)
#3  
Unr3aL67's Avatar
Member
Thanks Meter 29
Posts: 39
Join Date: Jan 2012
Quote:
Originally Posted by Ukiand1 View Post
No database shown, nothing. Help somehow?
Are you sure you are browsing as root? If you are using ES File Explorer, check the settings and make sure you have "Root-Explorer" enabled with the SU-permissions granted and the filesystem is mounted as R/W.

@Proverbs2
You should also mention to set the permissions for settings.db to -rw-rw---- (660) and the owner to system.system again after overwriting the old file, otherwise you'll get a bootloop.

This can by done either by using adb or terminal emulator:
Code:
> adb shell
$ su
# chmod 660 /data/data/com.android.providers.settings/settings.db
# chown system.system /data/data/com.android.providers.settings/settings.db
# exit
$ exit

> adb reboot
or by using any other app that can do both (I recommend Solid Explorer)

Nice tut otherwise. Now let's see, if it works...

Greetz, Unr3aL67
▬▬▬▬▬▬▬▬▬▬▬▬▬
SONY Xperia Z1 Compact @ CM11 nightly
▬▬▬▬▬▬▬▬▬▬▬▬▬
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes