INTERNET permissions in Android M

2019-06-17 14:41发布

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

Per the 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.

Particular note that it says:

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

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

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

2条回答
混吃等死
2楼-- · 2019-06-17 15:35

Please check this video from Google IO - https://youtu.be/f17qe9vZ8RM?t=18m10s There is no more Internet permission - the app will have by default access to the internet. Their idea is that if you don't have access to the device data then you can not do anything dangerous

Kind Regards

查看更多
Emotional °昔
3楼-- · 2019-06-17 15:40

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.

查看更多
登录 后发表回答