Due to the Android Wi-Fi Driver issue, I like to disable the Wi-Fi during the boot time. Even if Wi-Fi is enabled in the setting, it should be disabled forcefully. User have to enable it after booting the device. Is there any specific property setting is available? If yes, how to disable during boot time?
4 Answers
If you've got root access and you're running a custom ROM you should be able to run scripts at boot time. Here is a thread on xda that discusses boot time scripts.
Then you'd just need to figure out the commands to disable wifi. On my Desire HD the wireless interface is called eth0. This command should disable wireless:
ifconfig eth0 down
Whether or not that will disable it permanently i.e. the system won't just do the equivalent of:
ifconfig eth0 up
in the background, I do not know... I'm afraid I don't know much about how the android system handles networking, or at least not enough to help more directly with what to put in the the script!
-
Thanks Ben. I am trying this on a Beagle Board and not on mobile device.– MidsonCommented Mar 30, 2011 at 13:24
-
If that's the case you'll have to manually patch the boot.img to either run scripts from a specified folder, or just have the wireless disabled there. The former would obviously allow for greater options. See android-dls.com/wiki/… for how to unpack and repack the boot.img Commented Mar 30, 2011 at 16:20
You can try to automate this with Tasker by setting up a task to disable WiFi during device boot-up:
- Tap "New" to create a new profile, and give it a name, e.g. "No WiFi on Boot".
- Select the "Event" from the "First Context" pop-up.
- Select the "System" category, and then "Device Boot" event.
- Tap "New Task" and give it a descriptive name like "WiFi Off" for example.
- Tap the "+" button, select the "Net" category, then "WiFi" net action, change the "Set" drop-down to "Off", and tap the "Done" button.
- Tap the "Done" button on the "Task Edit / Test" screen.
- Ensure the "On" option is enabled (bottom-right of the screen), and tap the "Apply" button.
Tasker is not free, but worth every penny, IMHO.
#!/system/bin/sh
sqlite3 /data/data/com.android.providers.settings/databases/settings.db "UPDATE secure
SET name='mobile_data',value='0'
WHERE name='mobile_data'"
You can add this as init.d
script, if your ROM supports init.d
. Or else you can patch boot.img
with autobootimage patcher from xda.
The above script is for mobile data: for Wi-Fi, change mobile_data
to wifi_on
.
I found a much easier solution to disabling Wifi on my Android "Jelly Bean" phone - the Google Play Store has an app called "AutomateIt" https://play.google.com/store/apps/details?id=AutomateIt.mainPackage&hl=en -configure the app to stop the switching on at boot time. Even has a Pro version you can buy!