Can I allow display over other app and battery optimization permission using amapi?

mhfaruk
Level 2.0: Eclair

One of my client's requirements is to forcefully allow the following two of these permissions. Is there any policy in Android management API to do that?

I  appreciate any help you can provide.

5 REPLIES 5

jasonbayton
Level 4.0: Ice Cream Sandwich

Hi @mhfaruk 

 

I'm afraid these are what's known as Special Permissions and aren't possible to be set through policy with AMAPI. They will need to be requested through the application needing them on launch, and the end-user will have to enable them.

 

There are exceptions, for example Samsung devices have an API for battery optimisation through their OEMConfig application, Knox Service Plugin. Other OEMs do also, so depending on what you're using, you may be able to find a custom API that way. 

 

Another alternative would be to work with the OEM directly if the application in scope is something you've developed yourself. The OEM would be able to offer permission allowlisting on these specific permissions.

 

Hope that helps.

mattdermody
Level 2.2: Froyo

I can confirm you can also have these special runtime permissions silently granted to applications on managed Zebra and Honeywell Android devices using OEM specific mechanisms. AMAPI is the baseline lowest common denominator of management features for Android. Many OEMs offer specialized extensions and capabilities beyond that.

Alex_Muc
Level 2.2: Froyo

In addition to the answers from Jason and Matt on OEMConfig, I would like to address another point.

 

Battery optimization for example can be switched off by default if the developer writes the permission in the manifest.xml of the app. Samsung does this with its own e-mail app, for example. (Manifest permissions)

 

<uses-permission name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>

 

BUT there's a catch. Even if it is technically possible and some developers are apparently allowed to set these permissions, this is generally not permitted for developers. A public app with this permission will not get through the approval process at the Google Play Console. Otherwise, developers would simply set this permission across the board and undermine Android's energy-saving concept.
Even if the chances of success are very low: If these apps are self-developed, private apps (uploaded by the EMM), I would try adding permission to see if the app-approval is denied for Managed Google Play.

mhfaruk
Level 2.0: Eclair

Thanks for your reply. Did you test the result by adding this permission? If you get any results please let me know.

Alex_Muc
Level 2.2: Froyo

This permission works. Samsung Mail is an example here. When the app is installed, battery optimization is already turned off.
However, this permission cannot be set by UEM, but must be listed in the manifest.xml of the app. If the developer does this, there will most likely be a problem with approval in Google Play.
For this reason, developers usually build a workflow into the app that informs the user about the battery optimization and asks the user to deactivate the optimization for the app manually.