How do I disable the Volume Display?

Hi Guys,

I recently submitted my app to oculus store and the rejected it.
One of their reason is "Your volume buttons must adjust the volume using the VR volume UI provided by the Oculus Mobile SDK. ".

For some reason, if I were to increase of decrease volume. When this UI appear, it will freeze the GearVR screen.

I couldn’t find any code in Unity Documentation though, or I missed it somewhere.
Any way to disable the Volume UI of Android or to solve this issue?

Regards,
Gibbie

You have to override the onKeyDown and onKeyLongPress handlers in the Activity.

Hi Jeo joe could you please provide me with a code example.

If you look here (Unity - Manual: Create and use plug-ins in Android) you’ll find information on how to override the standard Unity activity. From there you can override the two methods mentioned and handle the volume up/down as outlined here: How to override the behavior of the volume buttons in an Android application? - Stack Overflow.

Hmm I am not sure if I would like to override them though. As if i were to override them I will not be able to decrease/increase volume. Would like to disable the “Android Volume Display” As in VR if were to adjust volume, it will freeze the screen when “Android Volume Display” appears. That’s why I have an in-game volume display. Just need to disable the “Android Volume Display”.

I can’t really help you there other than to tell you to override the keys, do your own volume handling and return true from the handler. Other than that I know of no way to just make the system volume ui go away.

Hello , you have to check the script called " OVRVolumeControl " , the code must be equal to the following

using UnityEngine;
using System.Collections;

public class OVRVolumeControl : MonoBehaviour
{
    private const float         showPopupTime = 3;
    private const float            popupOffsetY = 64.0f / 500.0f;
    private const float            popupDepth = 1.8f;
    private const int             maxVolume = 15;
    private const int             numVolumeImages = maxVolume + 1;
   
    private Transform            myTransform = null;
   
    void Start()
    {
        DontDestroyOnLoad( gameObject );
        myTransform = transform;
        GetComponent<Renderer>().enabled = false;
       
    }
   
    /// <summary>
    /// Updates the position of the volume popup.
    /// </summary>
    public virtual void UpdatePosition(Transform cameraTransform)
    {
        // OVRDevice.GetTimeSinceLastVolumeChange() will return -1 if the volume listener hasn't initialized yet,
        // which sometimes takes place after a frame has run in Unity.
        double timeSinceLastVolumeChange = OVRManager.timeSinceLastVolumeChange;
        if ((timeSinceLastVolumeChange != -1) && (timeSinceLastVolumeChange < showPopupTime))
        {
            GetComponent<Renderer>().enabled = true;
            GetComponent<Renderer>().material.mainTextureOffset = new Vector2(0.0f, (float)(maxVolume - OVRManager.volumeLevel) / (float)numVolumeImages);
            if (myTransform != null && cameraTransform != null)
            {
                // place in front of camera
                myTransform.rotation = cameraTransform.rotation;
                myTransform.position = cameraTransform.position + (myTransform.forward * popupDepth) + (myTransform.up * popupOffsetY);
            }
        }
        else
        {
            GetComponent<Renderer>().enabled = false;
        }
    }
}

I am using Oculus Utilities 1.8.0 I couldn’t find OVRVolumeControl.