简体   繁体   中英

How to get runtime time permissions using android management API?

I am using the Android Management API to get runtime permission android.permission.SYSTEM_ALERT_WINDOW . The app is going to be installed on fully managed devices. The policy has the below permissions defined:-

defaultPermissionPolicy: "GRANT"

I have added this to the application section of the policy as well. However, the app does not obtain these permissions and the user has to manually go to the settings and enable this permission. I understand that this permission is rated as advanced level permission, but this is a fully managed device.

Android Management API defaultPermissionPolicy can only grant/deny runtime permission requests. For example, READ_CONTACTS, WRITE_CONTACTS, ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION and etc.

SYSTEM_ALERT_WINDOW is a special permission . This permission doesn't behave like a dangerous or normal permission. This is a sensitive permission that needs user authorization.

For more information you may refer to this link .

I had the same problem with AE. The solution was set targetSdkVersion to 19 in your app.

To fully benefit from android.permission.SYSTEM_ALERT_WINDOW , it's usually necessary to request also Draw over other apps which is special permission that the user must grant manually per app. It's nicely described here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM