java.lang.Object | |
↳ | android.media.session.RemoteVolumeProvider |
Handles requests to adjust or set the volume on a session. This is also used
to push volume updates back to the session after a request has been handled.
You can set a volume provider on a session by calling
setPlaybackToRemote(RemoteVolumeProvider)
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | VOLUME_CONTROL_ABSOLUTE | The volume control uses an absolute value. | |||||||||
int | VOLUME_CONTROL_FIXED | The volume is fixed and can not be modified. | |||||||||
int | VOLUME_CONTROL_RELATIVE | The volume control uses relative adjustment via
onAdjustVolumeBy(int) . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new volume provider for handling volume events.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the maximum volume this provider allows.
| |||||||||||
Get the volume control type that this volume provider uses.
| |||||||||||
Notify the system that the remote playback's volume has been changed.
| |||||||||||
Override to handle requests to adjust the volume of the current
output.
| |||||||||||
Get the current volume of the remote playback.
| |||||||||||
Override to handle requests to set the volume of the current output.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The volume control uses an absolute value. It may be adjusted using
onAdjustVolumeBy(int)
or set directly using
onSetVolumeTo(int)
.
The volume is fixed and can not be modified. Requests to change volume should be ignored.
The volume control uses relative adjustment via
onAdjustVolumeBy(int)
. Attempts to set the volume to a specific
value should be ignored.
Create a new volume provider for handling volume events. You must specify the type of volume control and the maximum volume that can be used.
volumeControl | The method for controlling volume that is used by this provider. |
---|---|
maxVolume | The maximum allowed volume. |
Get the maximum volume this provider allows.
Get the volume control type that this volume provider uses.
Notify the system that the remote playback's volume has been changed.
Override to handle requests to adjust the volume of the current output.
delta | The amount to change the volume |
---|
Get the current volume of the remote playback.
Override to handle requests to set the volume of the current output.
volume | The volume to set the output to. |
---|