Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Unnecessary permission RECORD_AUDIO in Platform SDK for Unity

Recently my app got rejected with note:

Your app is asking for excessive user permissions or using user permissions inappropriately.


Here are all the permissions appearing in build info:


android.permission.READ_EXTERNAL_STORAGE

android.permission.INTERNET

android.permission.WAKE_LOCK

android.permission.ACCESS_NETWORK_STATE

android.permission.RECORD_AUDIO

android.permission.WRITE_EXTERNAL_STORAGE

android.permission.READ_EXTERNAL_STORAGE


At this point, RECORD_AUDIO permission is not required but its included because of MicrophoneInput.cs script under OculusPlatform/Scripts. If I remove this file and related files which use Unity's Microphone class and build the app, RECORD_AUDIO permission is gone. It makes sense to include this file in a project which actually uses Microphone at some point. But I am never gonna need it. Shall I remove this file and related files (IMicrophone.cs, MicrophoneInputNative.cs)? Are there any other files in Platform SDK which should be removed to avoid bugs due to code dependency?

Please advice me how to fix this

Thanks

Comments

  • FulbyFulby Posts: 184
    Art3mis
    I removed the microphone cs files (maybe a voip one too) and don't remember any problems regarding dependencies.
  • TruthveyorTruthveyor Posts: 35 Oculus Start Member
    I'm using Oculus Platform SDK 1.20.0.  I had the same problem, and I removed the following files from the Oculus Platform SDK:

    OculusPlatform\Scripts\IMicrophone.cs
    OculusPlatform\Scripts\LivestreamingMicrophoneStatus.cs
    OculusPlatform\Scripts\MicrophoneInput.cs
    OculusPlatform\Scripts\MicrophoneInputNative.cs

    Then I got errors from OculusPlatform\Scripts\CAPI.cs for missing LivestreamingMicrophoneStatus, so I commented out references to LivestreamingMicrophoneStatus in CAPI.cs.  There are no more errors, everything worked fine, and the "record audio permission" went away.


  • AnneLantingAnneLanting Posts: 10
    NerveGear
    Hi there,

    Is this still the proper way to do this?

    Greet, Anne.
  • m4lummm4lumm Posts: 11 Oculus Start Member
    edited May 2018
    I am wondering the same thing. My Android app is asking for permission to record audio. I can remove the files no problem, however that is a messy solution. 
  • seatedmechseatedmech Posts: 95 Oculus Start Member
    I'm struggling with this at the moment. So in the three months since the last person posted in this thread, I take it there hasn't been any non-messy solution?
  • seatedmechseatedmech Posts: 95 Oculus Start Member
    I'm using Oculus Platform SDK 1.20.0.  I had the same problem, and I removed the following files from the Oculus Platform SDK:

    OculusPlatform\Scripts\IMicrophone.cs
    OculusPlatform\Scripts\LivestreamingMicrophoneStatus.cs
    OculusPlatform\Scripts\MicrophoneInput.cs
    OculusPlatform\Scripts\MicrophoneInputNative.cs

    Then I got errors from OculusPlatform\Scripts\CAPI.cs for missing LivestreamingMicrophoneStatus, so I commented out references to LivestreamingMicrophoneStatus in CAPI.cs.  There are no more errors, everything worked fine, and the "record audio permission" went away.


    I did this as well, but my app is still requesting to use the microphone upon installation. 
  • TruthveyorTruthveyor Posts: 35 Oculus Start Member
    seatedmech, notice I was using Oculus Platform SDK 1.20.0.  If you use a different version of Oculus Platform SDK, there may be other files requesting the use of the microphone.

    I am guessing that you should look for any file with the word "microphone" in the file name and see if they were causing the problem.  In fact, I would suspect any audio related files in your project you didn't write yourself.
  • NyroNyro Posts: 13
    NerveGear
    I'm using Oculus Platform SDK 1.20.0.  I had the same problem, and I removed the following files from the Oculus Platform SDK:

    OculusPlatform\Scripts\IMicrophone.cs
    OculusPlatform\Scripts\LivestreamingMicrophoneStatus.cs
    OculusPlatform\Scripts\MicrophoneInput.cs
    OculusPlatform\Scripts\MicrophoneInputNative.cs

    Then I got errors from OculusPlatform\Scripts\CAPI.cs for missing LivestreamingMicrophoneStatus, so I commented out references to LivestreamingMicrophoneStatus in CAPI.cs.  There are no more errors, everything worked fine, and the "record audio permission" went away.


    I did this as well, but my app is still requesting to use the microphone upon installation. 
    I am also having this problem.
  • cmdr2cmdr2 Posts: 7
    NerveGear
    Along with the files mentioned earlier in this thread, I had to delete the 'Oculus/VoiceMod/Scripts/Helpers/OVRMicInput.cs' and 'Oculus/LipSync/Scripts/OVRLipSyncMicInput.cs' files as well for the RECORD_AUDIO permission to stop showing up.

    I do wish there was a more robust way to manage this.
  • DevClever1DevClever1 Posts: 3
    NerveGear
    Thanks, i got it working by removing the scripts listed below and commenting out the errors (2 of them) inside of CAPI.cs.

    OculusPlatform\Scripts\IMicrophone.cs

    OculusPlatform\Scripts\LivestreamingMicrophoneStatus.cs

    OculusPlatform\Scripts\MicrophoneInput.cs

    OculusPlatform\Scripts\MicrophoneInputNative.cs

    Oculus\LipSync\Scripts\OVRLipSyncMicInput.cs

    Oculus\VoiceMod\Scripts\Helpers\OVRMicInput.cs


  • MikeSwansonMikeSwanson Posts: 26
    Brain Burst
    Thank you for the full list, @DevClever1. Like @cmdr2, I also wish that there was a more robust way to manage this, especially since app review will likely flag this as an issue.

    @imperativity...is there any more official way to do this?
  • NinjaGaijinNinjaGaijin Posts: 121 Oculus Staff
    @MikeSwanson Let me inquire to see if there's a better way of handling this.
    If you need immediate help or want additional support/context on an issue you are having with our platform or integrations:

    1. Gather any and all logs, screenshots, and version numbers of relevant software (Oculus SDK, engine, etc.)
    2. Please submit a ticket here (include what you've gathered in step 1).
    3. Tag me @NinjaGaijin once you have done so!
  • MikeSwansonMikeSwanson Posts: 26
    Brain Burst
    Thanks! I upgraded to the latest Oculus Integration and the permission requests were back (of course), because the files were back.
  • remiludwigremiludwig Posts: 3
    NerveGear
    Hello, same problem here, is there a more proper way to handle this issue ? Like editting the androidmanifest so that it doesn't ask for this permission anymore ?
  • timokorkalainentimokorkalainen Posts: 2
    NerveGear
    edited January 23
    I added <uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove"/> to Android Manifest to make sure the permission is not asked for.
  • InnovaeInnovae Posts: 7
    NerveGear
    I added <uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove"/> to Android Manifest to make sure the permission is not asked for.
    that didn't work for me, it still asks for the mic permission
  • InnovaeInnovae Posts: 7
    NerveGear
    As of version 1.32, you can fix this by commenting these scripts:
    OVRMicInput.cs
    OVRLipSyncMicInput.cs
    These two scripts contain references to the Microphone class, which if called seems to trigger the mic permission request, so commenting the bits of code that reference it solves the issue.
Sign In or Register to comment.