Methods Summary |
---|
public final int | getCurrentVolume()Get the current volume of the provider.
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 java.lang.Object | getVolumeProvider()Gets the underlying framework {@link android.media.VolumeProvider} object.
This method is only supported on API 21+.
if (mVolumeProviderObj != null || Build.VERSION.SDK_INT < 21) {
return mVolumeProviderObj;
}
mVolumeProviderObj = VolumeProviderCompatApi21.createVolumeProvider(
mControlType, mMaxVolume, mCurrentVolume, new VolumeProviderCompatApi21.Delegate() {
@Override
public void onSetVolumeTo(int volume) {
VolumeProviderCompat.this.onSetVolumeTo(volume);
}
@Override
public void onAdjustVolume(int direction) {
VolumeProviderCompat.this.onAdjustVolume(direction);
}
});
return mVolumeProviderObj;
|
public void | onAdjustVolume(int direction)Override to handle requests to adjust the volume of the current output.
|
public void | onSetVolumeTo(int volume)Override to handle requests to set the volume of the current output.
|
public void | setCallback(android.support.v4.media.VolumeProviderCompat$Callback callback)Sets a callback to receive volume changes.
Used internally by the support library.
mCallback = callback;
|
public final void | setCurrentVolume(int currentVolume)Set the current volume and notify the system that the volume has been
changed.
if (mCallback != null) {
mCallback.onVolumeChanged(this);
}
|