In marshmallow's runtime permission, user can choose "never ask again" in permission requests. In this case, we have to redirect user to app settings to let them enable the permissions for the app. Also, Android permissions are group based, it will be very handy to display names of the permission groups that the app needs before we send the user to the settings.
I've seen the strings in android.Manifest such as "android.permission-group.LOCATION". Is it possible to get the permission group names programmatically?
<permission-group>Members of a group are presented together in the user interface. Note that this element does not declare a permission itself, only a category in which permissions can be placed. See the <permission> element for element for information on declaring permissions and assigning them to groups.
Allows read only access to phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any PhoneAccounts registered on the device. Used to determine the state of the mobile app. Jacob to provide additional details on exact functions.
REQUEST_INSTALL_PACKAGES permission provides apps with the ability to install new packages on a user's device.
getPermissionGroupInfo()
on PackageManager
returns a PermissionGroupInfo
for that group name (android.permission-group.LOCATION
). On that, call loadLabel()
, supplying the PackageManager
as input, to get the human-readable name of the permission group. This should be localized for the user's chosen device locale.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With