Android M中的INTERNET权限 [英] INTERNET permissions in Android M

查看:111
本文介绍了Android M中的INTERNET权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于Google最近发布的有关Android M和Permissions模型的公告.

Regarding Google's recent announcement about Android M and Permissions model.

根据 Android官方文档:

在安装时授予的有限权限:当用户安装或 更新应用程序,系统会授予该应用程序所有的权限,这些权限包括 应用程序的请求属于PROTECTION_NORMAL.例如警报 时钟和互联网权限属于PROTECTION_NORMAL,因此它们 在安装时自动授予.系统也可以授予 应用签名和系统权限,如系统应用中所述 和签名权限.不提示用户授予任何权限 安装时具有权限.

Limited Permissions Granted at Install Time: When the user installs or updates the app, the system grants the app all permissions that the app requests that fall under PROTECTION_NORMAL. For example, alarm clock and internet permissions fall under PROTECTION_NORMAL, so they are automatically granted at install time. The system may also grant the app signature and system permissions, as described in System apps and signature permissions. The user is not prompted to grant any permissions at install time.

特别说明:

...系统授予该应用程序所请求的所有权限.

...the system grants the app all permissions that the app requests.

那么,如果该应用在其AndroidManifest.xml中没有INTERNET权限,那么在这种情况下将不会被授予对INTERNET的访问权限?

So, if the app does not have INTERNET permission in its AndroidManifest.xml, it won't be granted access to INTERNET in that case?

或者应用程序需要在清单中添加INTERNET权限才能进行网络通话吗?

Or will an app require to add INTERNET permission in its manifest in order to be able to make network calls?

推荐答案

对于特定的android.permission.INTERNET权限,对于将要访问Internet的应用程序仍然是强制性的.如果开发人员在未在Android清单中定义应用程序的情况下发布应用程序,则在首次尝试进行连接时将引发异常,并且该应用程序可能会崩溃.这和以前没什么不同.

As for the specific android.permission.INTERNET permission, it is still mandatory for apps that will access the Internet. If a developer were to publish an app without defining it in the Android manifest, an exception will be thrown the first time a connection attempt is made, and the app will possibly crash. This is no different than before.

所有已更改的是,不会向用户提示,该应用仍将需要清单中的许可.

All that has changed is that there won't be a prompt to the user, the app will still require the permission in the manifest.

这篇关于Android M中的INTERNET权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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