Stay organized with collections
Save and categorize content based on your preferences.
CarAudioManager.CarVolumeCallback
public
static
abstract
class
CarAudioManager.CarVolumeCallback
extends Object
java.lang.Object
|
↳ |
android.car.media.CarAudioManager.CarVolumeCallback
|
Callback interface to receive volume change events in a car.
Extend this class and register it with CarAudioManager.registerCarVolumeCallback(android.car.media.CarAudioManager.CarVolumeCallback)
and unregister it via CarAudioManager.unregisterCarVolumeCallback(android.car.media.CarAudioManager.CarVolumeCallback)
Summary
Public methods |
void
|
onGroupMuteChanged(int zoneId, int groupId, int flags)
This is called whenever a group mute state is changed.
|
void
|
onGroupVolumeChanged(int zoneId, int groupId, int flags)
This is called whenever a group volume is changed.
|
void
|
onMasterMuteChanged(int zoneId, int flags)
This is called whenever the global mute state is changed.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
CarVolumeCallback
public CarVolumeCallback ()
Public methods
onGroupMuteChanged
public void onGroupMuteChanged (int zoneId,
int groupId,
int flags)
This is called whenever a group mute state is changed.
The changed-to mute state is not included, the caller is encouraged to
get the current group mute state via CarAudioManager.
Notes:
Parameters |
zoneId |
int : Id of the audio zone that volume change happens |
groupId |
int : Id of the volume group that volume is changed |
flags |
int : see AudioManager for flag definitions |
onGroupVolumeChanged
public void onGroupVolumeChanged (int zoneId,
int groupId,
int flags)
This is called whenever a group volume is changed.
The changed-to volume index is not included, the caller is encouraged to
get the current group volume index via CarAudioManager.
Notes:
- If both
CarVolumeCallback
and CarVolumeGroupEventCallback
are registered by the same app, then volume group index changes are only
propagated through CarVolumeGroupEventCallback
(until it is unregistered)
- Apps are encouraged to migrate to the new callback
CarVolumeGroupEventCallback
Parameters |
zoneId |
int : Id of the audio zone that volume change happens |
groupId |
int : Id of the volume group that volume is changed |
flags |
int : see AudioManager for flag definitions |
onMasterMuteChanged
public void onMasterMuteChanged (int zoneId,
int flags)
This is called whenever the global mute state is changed.
The changed-to global mute state is not included, the caller is encouraged to
get the current global mute state via AudioManager.
Note: If CarAudioManager#AUDIO_FEATURE_VOLUME_GROUP_MUTING
is disabled
this will be triggered on mute changes. Otherwise, car audio mute changes will trigger
onGroupMuteChanged(int, int, int)
Parameters |
zoneId |
int : Id of the audio zone that global mute state change happens |
flags |
int : see AudioManager for flag definitions |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-17 UTC.
[null,null,["Last updated 2025-02-17 UTC."],[],[],null,["# CarAudioManager.CarVolumeCallback\n\nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nCarAudioManager.CarVolumeCallback\n=================================\n\n\n`\npublic\nstatic\n\nabstract\nclass\nCarAudioManager.CarVolumeCallback\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|-----------------------------------------------------|\n| java.lang.Object ||\n| ↳ | android.car.media.CarAudioManager.CarVolumeCallback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nCallback interface to receive volume change events in a car.\nExtend this class and register it with [CarAudioManager.registerCarVolumeCallback(android.car.media.CarAudioManager.CarVolumeCallback)](/reference/android/car/media/CarAudioManager#registerCarVolumeCallback(android.car.media.CarAudioManager.CarVolumeCallback))\nand unregister it via [CarAudioManager.unregisterCarVolumeCallback(android.car.media.CarAudioManager.CarVolumeCallback)](/reference/android/car/media/CarAudioManager#unregisterCarVolumeCallback(android.car.media.CarAudioManager.CarVolumeCallback))\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------|---|\n| ` `[CarVolumeCallback](/reference/android/car/media/CarAudioManager.CarVolumeCallback#CarVolumeCallback())`() ` |\n\n| ### Public methods ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[onGroupMuteChanged](/reference/android/car/media/CarAudioManager.CarVolumeCallback#onGroupMuteChanged(int,%20int,%20int))`(int zoneId, int groupId, int flags) ` This is called whenever a group mute state is changed. |\n| ` void` | ` `[onGroupVolumeChanged](/reference/android/car/media/CarAudioManager.CarVolumeCallback#onGroupVolumeChanged(int,%20int,%20int))`(int zoneId, int groupId, int flags) ` This is called whenever a group volume is changed. |\n| ` void` | ` `[onMasterMuteChanged](/reference/android/car/media/CarAudioManager.CarVolumeCallback#onMasterMuteChanged(int,%20int))`(int zoneId, int flags) ` This is called whenever the global mute state is changed. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic constructors\n-------------------\n\n### CarVolumeCallback\n\n```\npublic CarVolumeCallback ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### onGroupMuteChanged\n\n```\npublic void onGroupMuteChanged (int zoneId, \n int groupId, \n int flags)\n```\n\nThis is called whenever a group mute state is changed.\n\nThe changed-to mute state is not included, the caller is encouraged to\nget the current group mute state via CarAudioManager.\n\n**Notes:**\n\n- If [CarAudioManager#AUDIO_FEATURE_VOLUME_GROUP_MUTING](/reference/android/car/media/CarAudioManager#AUDIO_FEATURE_VOLUME_GROUP_MUTING) is enabled this will be triggered on mute changes. Otherwise, car audio mute changes will trigger [onMasterMuteChanged(int, int)](/reference/android/car/media/CarAudioManager.CarVolumeCallback#onMasterMuteChanged(int,%20int))\n- If both [CarVolumeCallback](/reference/android/car/media/CarAudioManager.CarVolumeCallback) and `CarVolumeGroupEventCallback` are registered by the same app, then volume group mute changes are **only** propagated through `CarVolumeGroupEventCallback` (until it is unregistered)\n- Apps are encouraged to migrate to the new callback `CarVolumeGroupEventCallback`\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|----------------------------------------------------------------------------------------------|\n| `zoneId` | `int`: Id of the audio zone that volume change happens \u003cbr /\u003e |\n| `groupId` | `int`: Id of the volume group that volume is changed \u003cbr /\u003e |\n| `flags` | `int`: see [AudioManager](/reference/android/media/AudioManager) for flag definitions \u003cbr /\u003e |\n\n### onGroupVolumeChanged\n\n```\npublic void onGroupVolumeChanged (int zoneId, \n int groupId, \n int flags)\n```\n\nThis is called whenever a group volume is changed.\n\nThe changed-to volume index is not included, the caller is encouraged to\nget the current group volume index via CarAudioManager.\n\n**Notes:**\n\n- If both [CarVolumeCallback](/reference/android/car/media/CarAudioManager.CarVolumeCallback) and `CarVolumeGroupEventCallback` are registered by the same app, then volume group index changes are **only** propagated through `CarVolumeGroupEventCallback` (until it is unregistered)\n- Apps are encouraged to migrate to the new callback `CarVolumeGroupEventCallback`\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|----------------------------------------------------------------------------------------------|\n| `zoneId` | `int`: Id of the audio zone that volume change happens \u003cbr /\u003e |\n| `groupId` | `int`: Id of the volume group that volume is changed \u003cbr /\u003e |\n| `flags` | `int`: see [AudioManager](/reference/android/media/AudioManager) for flag definitions \u003cbr /\u003e |\n\n### onMasterMuteChanged\n\n```\npublic void onMasterMuteChanged (int zoneId, \n int flags)\n```\n\nThis is called whenever the global mute state is changed.\nThe changed-to global mute state is not included, the caller is encouraged to\nget the current global mute state via AudioManager.\n\n**Note:** If [CarAudioManager#AUDIO_FEATURE_VOLUME_GROUP_MUTING](/reference/android/car/media/CarAudioManager#AUDIO_FEATURE_VOLUME_GROUP_MUTING) is disabled\nthis will be triggered on mute changes. Otherwise, car audio mute changes will trigger\n[onGroupMuteChanged(int, int, int)](/reference/android/car/media/CarAudioManager.CarVolumeCallback#onGroupMuteChanged(int,%20int,%20int))\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------------------|\n| `zoneId` | `int`: Id of the audio zone that global mute state change happens \u003cbr /\u003e |\n| `flags` | `int`: see [AudioManager](/reference/android/media/AudioManager) for flag definitions \u003cbr /\u003e |"]]