关于谷歌最近关于 Android M 和权限模型的公告。
根据 official Android documentation :
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 访问权限吗?
或者应用是否需要在其 list 中添加 INTERNET 权限才能进行网络调用?
最佳答案
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.
唯一不同的是不会向用户提示,应用程序仍需要 list 中的权限。
关于android - Android M 中的互联网权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30742186/