1. ohan's Avatar

    I've encountered a very strange problem for programmatically turning on/off the airplane mode.
    I'm aware that it's one of the secure settings, and my app is a system app that is correctly signed.

    However, I'm not able to correctly turn on/off the airplane mode.
    I have the following codes: (checked value is from onCheckedChanged callback of a check box UI)

    int isAirplaneModeOn = checked ? 1 : 0;
    Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, isAirplaneModeOn);
    Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
    intent.putExtra("state", checked);

    The line where it calls Settings.Global.putInt(....) works, because we can see that the airplane mode's check box in the android's settings app will changes as we change this value from our app, so we know that our app is indeed a system app. Otherwise, it will throw a SecurityException at this line.

    However, we're getting "Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE", at the line where it calls mContext.sendBroadcast(...). I have no idea why this fails while Settings.Global.putInt works.

    One last note is that we're using Android 4.4.2 (KitKat).

    Any help will be appreciated

    03-13-2014 12:58 PM
  2. Gagan Malik's Avatar
    Hi Ohan!

    Were you able to resolve your problem? If so, could you please share the solution.

    05-21-2014 01:28 PM
  3. mishraranajit's Avatar
    Hi I have the same issue .. SO if you had any solution for this please share it.. Will be grateful to you..
    10-20-2014 05:00 AM

Similar Threads

  1. Replies: 7
    Last Post: 12-27-2014, 12:09 PM
  2. Quite mode problems
    By bfuels1993 in forum AT&T LG G2
    Replies: 16
    Last Post: 07-09-2014, 12:15 PM
  3. I've deleted my android operating system on Galaxy Fit. HELP!
    By Alexghe966 in forum General Help and How To
    Replies: 1
    Last Post: 03-13-2014, 10:46 PM
  4. Can I use some apps on WiFi and some on my data?
    By PittsburghJake in forum Motorola Droid Ultra
    Replies: 3
    Last Post: 03-13-2014, 05:07 PM
  5. HELP Apps question
    By jfb42 in forum HTC EVO 4G LTE
    Replies: 2
    Last Post: 03-13-2014, 01:10 PM