Android 11 and MANAGE_EXTERNAL_STORAGE permission

Usually when installing apps from package or App Catalog, it grants automatically all permissions requested by the app.

In Android 11 it does not grant MANAGE_EXTERNAL_STORAGE.

It is possible to grant the permission by

 afw_set_permission_grant_state app.name android.permission.MANAGE_EXTERNAL_STORAGE allow

It means by a package it flows fine, by adding a post-script.

Is there a way to do it by app catalog, or get a kind of trigger to start a script when the app is installed ?

My workaround is to create a schedule task running periodically with the afw_set_permission script.

Edited 4 years ago
MobiControl - Android Script Engine
ANSWERS
J
JCMOD@SOTI
4 years ago

Hi Joao,

Thank you for posting in SOTI Central.

According to Google, on Android 11 you will need to use more privacy-friendly APIs when reading storage. Reference this link: https://developer.android.com/training/data-storage/manage-all-files. Then CTRL+F Android 11:

Source: https://developer.android.com/training/data-storage/manage-all-files

If this resolves your query, please mark this post as the solution. Also, feel free to reach out if you have any questions or need clarification.

Regards,

JN
Joao Nelson Cavezale de la Torre
4 years ago (edited 4 years ago)

Thanks for reply.

The app request the MANAGE_EXTERNAL_STORAGE as described and works fine when  end user grant it.

The issue is how to grant the rights by script when app is installed by catalog rule as mandatory application with no interaction by user.

Releasing the app by package, it works, because we may set a post script on the installation, But by package the app is not able to update itself due lack of authorization to install from unknown sources.

So what I am looking for is a way to identify programmatically/alert that the catalog rule has installed an application and then trigger the script that holds the afw_set_permission command.

There is an alert rule triggered when uninstalling the package, but there is none for when package is installed.

RC
Raymond Chan Diamond Contributor
4 years ago

Hi Joao,

You probably need to raise a new feature request to have Android alert rule triggered when installing a specific package.  Besides, to be able to use script  as a viable action for your use case,  there should also be support for a new macro for the package-bundle-ID that can be passed to the script as dynamic argument for the afw_set_permission_grant_state script command. 

Make sure you get an offical Soti support case number for this.  Request relevant personnel from Soti to inform you if such feature has been implemented and released.  By then, maybe you can update everyone in this forum with another post regarding the new feature.

Thanks Raymond.

I will request it.