Multiple choice question:
which of the follow will correctly check whether or not an application has a certain permission declared in their AndroidManifest.xml?
getContext().checkCallingOrSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED
or
getContext().getPackageManager().checkPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, getContext().getPackageName()) == PackageManager.PERMISSION_GRANTED
Basically, i got scared from the android documentation of what checkCallingOrSelfPermission
claims -> it grants an IPC permissions if you just check for it?? what does that even mean?
http://developer.android.com/reference/android/content/Context.html#checkCallingOrSelfPermission(java.lang.String)
So any explanation on the true differences would be awesome :D
*note: I am giving this code in a library, so i am only allowed to check permissions at runtime, unless you know of a better way.