java.lang.Object | |
↳ | android.support.v4.media.VolumeProviderCompat |
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(VolumeProviderCompat)
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
VolumeProviderCompat.Callback | Listens for changes to the volume. |
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
onAdjustVolume(int) .
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new volume provider for handling volume events.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the current volume of the provider.
| |||||||||||
Get the maximum volume this provider allows.
| |||||||||||
Get the volume control type that this volume provider uses.
| |||||||||||
Gets the underlying framework
VolumeProvider object.
| |||||||||||
Override to handle requests to adjust the volume of the current output.
| |||||||||||
Override to handle requests to set the volume of the current output.
| |||||||||||
Sets a callback to receive volume changes.
| |||||||||||
Set the current volume and notify the system that the volume has been
changed.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The volume control uses an absolute value. It may be adjusted using
onAdjustVolume(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
onAdjustVolume(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. |
currentVolume | The current volume. |
Get the current volume of the provider.
Get the maximum volume this provider allows.
Get the volume control type that this volume provider uses.
Gets the underlying framework VolumeProvider
object.
This method is only supported on API 21+.
VolumeProvider
object, or null if none.
Override to handle requests to adjust the volume of the current output.
direction | The direction to adjust the volume in. |
---|
Override to handle requests to set the volume of the current output.
volume | The volume to set the output to. |
---|
Sets a callback to receive volume changes.
Used internally by the support library.
Set the current volume and notify the system that the volume has been changed.
currentVolume | The current volume of the output. |
---|