Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens when permission is disabled with OS 4.3's new feature?

I heard that OS 4.3 has hidden feature to disable some permissions w/o repackaging APK. When we release app, we add necessary permissions and make app work. But that feature can disable permissions. I know some app have been doing this though it's a hack and I don't need to care. But with OS 4.3, user can easily can do this.

Now my question is, when permission is disabled, does corresponding API throws exception? (I guess so.) If this is true, I should add try-catch for some operations otherwise novice user may end up thinking my app is poorly designed.

Or, I will add some code to check permissions are there for my app to work and if not I will show some rude, no polite message to tell don't do this and quit app.

(Someone may close this question saying this is not a true question.)

like image 701
Tomcat Avatar asked Jul 26 '13 13:07

Tomcat


People also ask

What does it mean when an app has permission to change system settings?

To appease power users by giving apps like Tasker more capabilities, there's a permission called "Modify System Settings" that can be granted. If an app has this permission, it can change Android options like your screen timeout duration.

What is permission control on my phone?

What is the Android permissions controller? The Android permissions controller is a part of the Android operating system that tells apps what they can and can't access. When you install a new app, the Android permissions controller is what gives you the option to allow or deny permissions for that app.

What does enable permissions mean?

You can allow some apps to use various features on your phone, such as your camera or contacts list. An app will send a notification to ask for permission to use features on your phone, which you can Allow or Deny. You can also change permissions for a single app or by permission type in your phone's Settings.


1 Answers

I heard that OS 4.3 has hidden feature to disable some permissions w/o repackaging APK.

The working term for this is "App Ops", based upon the title of the activity that allows user to control these operations.

Now my question is, when permission is disabled, does corresponding API throws exception?

That will depend upon the particular operation that was blocked. For example, trying to open() a Camera, when that has been blocked by App Ops, will throw a RuntimeException. But querying contacts, when the user blocked that in App Ops, simply returns empty result sets.

I should add try-catch for some operations otherwise novice user may end up thinking my app is poorly designed

Perhaps. It depends on what your app does that can be blocked and what the blocking behavior is.

I will add some code to check permissions are there for my app to work and if not I will show some rude, no polite message to tell don't do this and quit app.

App Ops does not revoke permissions. PackageManager and checkPermissions() will still report that you hold the permission, even if App Ops blocks some operation tied to that permission.

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

I have started a FAQ on my blog to try to collect information about this, until such time as official details emerge (if ever).

like image 198
CommonsWare Avatar answered Sep 21 '22 10:09

CommonsWare