cancel
Showing results for 
Search instead for 
Did you mean: 

How to get around Android permission ACCESS_MEDIA_LOCATION in Unity?

Luis.Zan
Level 4

I'm preparing to submit my Quest app but as usual, I'm dealing with getting through Android permission.

 

I get the usual external storage and microphone permissions but those are somewhat easy to find the source by searching for "Microphone." fields in Unity. In fact, most seem to come from Oculus' Platform scripts.

 

The permission that I can't seem to figure out the source is ACCESS_MEDIA_LOCATION.

My project doesn't include any external packages nor is attempting to access photos or file metadata.

 

I'm aware that I'm able to remove permissions by hand through Android studio but the issue with this solution is that since I'm not sure where the source of the permission comes from, I'd be open to getting a bug on the app at some point by simply removing this permission.

 

Does anyone know what sorts of classes prompt Unity to add this permission or its source?

Are there any solutions other than to simply remove the permission request from the manifest after building the project?

Are you having the same issue? 

4 REPLIES 4

justin_welch
Level 2

I recently came across this as well. As far as I can tell, this must be a bug with `ovr-platform-util`. I've checked the APK manually with both Android Studio and `aapt` and neither show the `android.permissions.ACCESS_MEDIA_LOCATION`. It looks like some users in the Unreal engine forum came to the same conclusion last May. Can someone at Oculus/FB confirm if this is a bug and if they are aware of it?

 

It's possible that it is misinterpreting the INTERNET permission as ACCESS_MEDIA_LOCATION, but, I haven't confirmed that yet.

I also believe the mislabeling of the INTERNET permission is what is happening.

We use this permission on our app and indeed ovr-platform-util doesn't seem to identify our INTERNET use.

 

We'll submit our app with the ACCESS_MEDIA_LOCATION flag and write about this issue on our "notes for reviewer" so hopefully Oculus will become aware of the issue.

MUVirsabi
Level 3

Following this video;
https://www.codetocreate.com/2019/05/23/how-to-remove-oculus-vr-android-permissions/
I added 
xmlns:tools="http://schemas.android.com/tools"
and 
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove"/>
To remove fine location which for some weird reason was being added by unity. Guessing this method can be used for removing any permission/feature.

I use this same technique to remove other permissions and just to be on the safe side I also have ACCESS_MEDIA_LOCATION in there to be removed. However, the ovr-platform-util still reports it - I still believe this is a bug with the tool. It does not exist in the manifest when inspected with android studio or aapt.