I use Intent.ACTION_OPEN_DOCUMENT_TREE to give my application the ability to write to external storage (on Lollipop and Marshmallow).
But I would like to write external storage in a test application. Intent.ACTION_OPEN_DOCUMENT_TREE uses the system dialog, so I cannot provide permission during the tests. I also tried to resolve it in the application and then use it in tests, but it is not shared - the application project and the test project are different packages.
Does anyone know of a workaround that can, for example, provide permission for all external storage for testing purposes? Maybe by changing some kind of system property?
adb shell setprop SOMEPROPERTY 1
android testing android-externalstorage storage-access-framework
Bhiefer
source share