当许可被禁止与OS 4.3的新功能,会发生什么? [英] What happens when permission is disabled with OS 4.3's new feature?

查看:158
本文介绍了当许可被禁止与OS 4.3的新功能,会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说OS 4.3已经隐藏功能禁用某些权限W / O重新打包APK。当我们发布的应用程序,我们添加必要的权限,使应用程序的工作。不过该功能可以禁用权限。我知道有些应用程序一直在做这个,虽然这是一个黑客,我也不需要关心。但随着OS 4.3,用户可以很容易地可以做到这一点。

现在我的问题是,当许可被禁止,没有相应的API抛出异常? (我猜是这样)。如果这是真的,我要补充的try-catch对于某些操作,否则新手用户最终可能会想我的应用程序设计不当。

或者,我会添加一些code,检查权限在那里为我的应用程序的工作,如果没有,我会表现出一定的粗鲁,说毫不客气的消息不这样做并退出应用程序。

(有人可能会关闭这个问题,说这是不是一个真正的问题。)

解决方案
  

我听说OS 4.3已经隐藏功能禁用某些权限W / O重新包装APK。

工作术语是应用程序行动,根据活动的,允许用户控制这些操作的称号。

  

现在我的问题是,当许可被禁止,没有相应的API抛出异常?

这将取决于被阻塞的具体操作。例如,试图的open() A 摄像机,当已被封锁病死猪行动,将抛出一个的RuntimeException 。但是,查询联系人,当用户被阻止在应用行动,仅仅返回空结果集。

  

我要补充的try-catch对于某些操作,否则新手用户最终可能会想我的应用程序设计不当

也许。这取决于阻塞的行为是你的应用程序,这是否可以被阻止什么。

  

我会添加一些code,检查权限有我的应用程序的工作,如果没有,我会表现出一定的粗鲁,说毫不客气的消息不这样做并退出应用程序。

应用行动不会撤消权限。 PackageManager checkPermissions()仍然会报告,您有权限,即使应用行动阻止某些操作绑到许可。

在present,据我所知,没有直接的方法来确定是否已被封锁病死猪行动。

我已经开始一个常见问题在我的博客尝试收集这方面的信息,直至官方细节出现(如果有的话)。

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.)

解决方案

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).

这篇关于当许可被禁止与OS 4.3的新功能,会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆