Is there a way to disable or enable Flight Mode on Android 4.2?
I use this code that works only for previous Android versions:
android.provider.Settings.System.putInt( c.getContentResolver(), android.provider.Settings.System.AIRPLANE_MODE_ON, enable ? 0 : 1 );
To turn Airplane mode on or off: Open your phone's Settings app. Tap Network & internet. Turn Airplane mode on or off.
When you activate airplane mode, it stops all signal transmission from your device. You'll see an airplane icon in your phone's status bar when it's turned on.
Swipe down on the notification bar and touch the "Add" button in the AutoInput notification. Touch "Accept" in the notification and go back to Tasker. There select the "Airplane Mode" text and accept (tap on tick) these settings.
So does that mean Google can track your every move even if you don't have a SIM card in your phone and even if it is not connected to a Wi-Fi network? The answer is YES, as many apps use location sharing – which leaves your phone's GPS antenna on, even in airplane mode.
There exist a simple workaround on rooted devices.
To enable Airplane Mode the following root shell commands can be used:
settings put global airplane_mode_on 1 am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
To disable Airplane Mode these root shell commands can be used:
settings put global airplane_mode_on 0 am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
Info taken from here
Disclaimer: This info is provided "as-is" without any form of warranty.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With