1

With Android 4.3 we have a hidden Intent of the OS - App Ops - that allows us to disable some of the permissions of the installed apps (that's great!).

But as an app developer i'm trying to find out if there is a way to check if the permission has been disabled to warn the user to enable it to have access to the feature again, or something like that.

If there is, how?

Note: In case you are asking yourselves what I'm talking about: https://play.google.com/store/apps/details?id=com.appaholics.applauncher

neteinstein
  • 17,529
  • 11
  • 93
  • 123
  • 2
    Related: http://stackoverflow.com/questions/17882316/what-happens-when-permission-is-disabled-with-os-4-3s-new-feature/17889167 – laalto Aug 12 '13 at 10:58

2 Answers2

1

Eventually I found that a similiar question had been asked and answered:

At present, I know of no direct way to determine if you have been blocked by App Ops. - CommonsWare

More info: http://commonsware.com/blog/2013/07/26/app-ops-developer-faq.html

Community
  • 1
  • 1
neteinstein
  • 17,529
  • 11
  • 93
  • 123
-1

Hope this helps :

 PackageManager pm = getPackageManager();
if (pm.checkPermission(permission.FINE_LOCATION, getPackageName()) == PackageManager.PERMISSION_GRANTED) {
    // do something
} else {
    // do something
}

Check below links for more help :

How permission can be checked at runtime without throwing SecurityException?

Is there a way to check for manifest permission from code?

Community
  • 1
  • 1
Eldhose M Babu
  • 14,382
  • 8
  • 39
  • 44