Android车机 监听音量变化方法,其中
媒体音量对应:zoneId:0 groupId:0 flags:0
蓝牙音量对应:zoneId:0 groupId:7 flags:0
语音音量对应:zoneId:0 groupId:3 flags:0
---监听代码如下
private CarAudioManager mCarAudioManager;
Car car = Car.createCar(context);
if (null != car) {
mCarAudioManager = (CarAudioManager) car.getCarManager(Car.AUDIO_SERVICE);
Logger.i(TAG, "MyAudioManager 11");
mCarAudioManager.registerCarVolumeCallback(new CarAudioManager.CarVolumeCallback() {
@Override
public void onGroupVolumeChanged(int zoneId, int groupId, int flags) {
super.onGroupVolumeChanged(zoneId, groupId, flags);
Logger.i(TAG, "MyAudioManager.onGroupVolumeChanged zoneId:" + zoneId
+ " groupId:" + groupId + " flags:" + flags);
}
});
}