Methods Summary |
---|
public final int | getCurrentVolume()Gets the current volume. This will be the last value set by
{@link #setCurrentVolume(int)}.
return mCurrentVolume;
|
public final int | getMaxVolume()Get the maximum volume this provider allows.
return mMaxVolume;
|
public final int | getVolumeControl()Get the volume control type that this volume provider uses.
return mControlType;
|
public void | onAdjustVolume(int direction)Override to handle requests to adjust the volume of the current output.
Direction will be one of {@link AudioManager#ADJUST_LOWER},
{@link AudioManager#ADJUST_RAISE}, {@link AudioManager#ADJUST_SAME}.
After the volume has been modified {@link #setCurrentVolume} must be
called to notify the system.
|
public void | onSetVolumeTo(int volume)Override to handle requests to set the volume of the current output.
After the volume has been modified {@link #setCurrentVolume} must be
called to notify the system.
|
public void | setCallback(android.media.VolumeProvider$Callback callback)Sets a callback to receive volume changes.
mCallback = callback;
|
public final void | setCurrentVolume(int currentVolume)Notify the system that the current volume has been changed. This must be
called every time the volume changes to ensure it is displayed properly.
mCurrentVolume = currentVolume;
if (mCallback != null) {
mCallback.onVolumeChanged(this);
}
|