title: Turn Airplane mode via commandLine without root
body: <p>I want to Enable and Disable Airplane Mode on my device which is not rooted.</p>
  
  <p>To enable the Airplane mode i use the following commands:</p>
  
  <p><em>adb shell settings put global airplane_mode_on 1
  adb shell am broadcast -a android.intent.action.AIRPLANE_MODE</em></p>
  
  <p>To disable the Airplane mode i use the following command:</p>
  
  <p><em>adb shell settings put global airplane_mode_on 0
  adb shell am broadcast -a android.intent.action.AIRPLANE_MODE</em></p>
  
  <p>This commands work well for android &lt;7.0 but for android version >=7.0 i get the following error:</p>
  
  <p><em>ZX1G523ZW6 : Enabling airplane mode...</em><br>
  Broadcasting: <code>Intent { act=android.intent.action.AIRPLANE_MODE (has extras) }</code></p>
  
  <pre><code>java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE from pid=8824, uid=2000
      at android.os.Parcel.readException(Parcel.java:1684)
      at android.os.Parcel.readException(Parcel.java:1637)
      at android.app.ActivityManagerProxy.broadcastIntent(ActivityManagerNative.java:3537)
      at com.android.commands.am.Am.sendBroadcast(Am.java:772)
      at com.android.commands.am.Am.onRun(Am.java:404)
      at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
      at com.android.commands.am.Am.main(Am.java:121)
      at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
      at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:262)
  </code></pre>
  
  <p>Is there a solution to this for Android version >=7.0 without a rooted device?
  Thank you in advance. </p>