Android permissions questions

I looked at classes related to Android permissions and I have a few questions.

In the BasePermission class, I see three fields: TYPE_NORMAL, TYPE_BUILTIN and TYPE_DYNAMIC. What do they represent? I assume that TYPE_DYNAMIC is used so that when using the addPermission () API method, the application creates a dynamic application to create permission, but I'm not entirely sure of the other two. Does Android support tracking how permissions were created (i.e., Defined by a system, system application, or third-party application)? The PermissionInfo class seems to be tracking some flags, but I could not find any flag that directly corresponded to how the permission was created.

Thank you very much in advance!

+4
source share
2 answers

Faraz is right, but I have some additions. I studied the Android source code and found some information.

  • You can add, update or remove TYPE_DYNAMIC permissions.

  • TYPE_DYNAMIC permissions are determined by application developers.

  • TYPE_BUILTIN permissions can only be obtained by system applications.

EDIT: TYPE_DYNAMIC permission example How to use user permissions in Android?

+1
source

, TYPE_BUILTIN Linux, TYPE_DYNAMIC ( AddPermission *() API) TYPE_NORMAL ( ).

, .

0

Source: https://habr.com/ru/post/1662222/


All Articles