Merge "AudioService: logs for volume behavior and absolute volume on A2DP" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
189ce28929
@@ -298,6 +298,28 @@ public class AudioDeviceVolumeManager {
|
|||||||
"removeOnDeviceVolumeBehaviorChangedListener");
|
"removeOnDeviceVolumeBehaviorChangedListener");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return human-readable name for volume behavior
|
||||||
|
* @param behavior one of the volume behaviors defined in AudioManager
|
||||||
|
* @return a string for the given behavior
|
||||||
|
*/
|
||||||
|
public static String volumeBehaviorName(@AudioManager.DeviceVolumeBehavior int behavior) {
|
||||||
|
switch (behavior) {
|
||||||
|
case AudioManager.DEVICE_VOLUME_BEHAVIOR_VARIABLE:
|
||||||
|
return "DEVICE_VOLUME_BEHAVIOR_VARIABLE";
|
||||||
|
case AudioManager.DEVICE_VOLUME_BEHAVIOR_FULL:
|
||||||
|
return "DEVICE_VOLUME_BEHAVIOR_FULL";
|
||||||
|
case AudioManager.DEVICE_VOLUME_BEHAVIOR_FIXED:
|
||||||
|
return "DEVICE_VOLUME_BEHAVIOR_FIXED";
|
||||||
|
case AudioManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE:
|
||||||
|
return "DEVICE_VOLUME_BEHAVIOR_ABSOLUTE";
|
||||||
|
case AudioManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE_MULTI_MODE:
|
||||||
|
return "DEVICE_VOLUME_BEHAVIOR_ABSOLUTE_MULTI_MODE";
|
||||||
|
default:
|
||||||
|
return "invalid volume behavior " + behavior;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private final class DeviceVolumeBehaviorDispatcherStub
|
private final class DeviceVolumeBehaviorDispatcherStub
|
||||||
extends IDeviceVolumeBehaviorDispatcher.Stub implements CallbackUtil.DispatcherStub {
|
extends IDeviceVolumeBehaviorDispatcher.Stub implements CallbackUtil.DispatcherStub {
|
||||||
public void register(boolean register) {
|
public void register(boolean register) {
|
||||||
|
|||||||
@@ -6637,6 +6637,11 @@ public class AudioService extends IAudioService.Stub
|
|||||||
// verify arguments
|
// verify arguments
|
||||||
Objects.requireNonNull(device);
|
Objects.requireNonNull(device);
|
||||||
AudioManager.enforceValidVolumeBehavior(deviceVolumeBehavior);
|
AudioManager.enforceValidVolumeBehavior(deviceVolumeBehavior);
|
||||||
|
sVolumeLogger.log(new AudioEventLogger.StringEvent("setDeviceVolumeBehavior: dev:"
|
||||||
|
+ AudioSystem.getOutputDeviceName(device.getInternalType()) + " addr:"
|
||||||
|
+ device.getAddress() + " behavior:"
|
||||||
|
+ AudioDeviceVolumeManager.volumeBehaviorName(deviceVolumeBehavior)
|
||||||
|
+ " pack:" + pkgName).printLog(TAG));
|
||||||
if (pkgName == null) {
|
if (pkgName == null) {
|
||||||
pkgName = "";
|
pkgName = "";
|
||||||
}
|
}
|
||||||
@@ -8352,7 +8357,7 @@ public class AudioService extends IAudioService.Stub
|
|||||||
private void avrcpSupportsAbsoluteVolume(String address, boolean support) {
|
private void avrcpSupportsAbsoluteVolume(String address, boolean support) {
|
||||||
// address is not used for now, but may be used when multiple a2dp devices are supported
|
// address is not used for now, but may be used when multiple a2dp devices are supported
|
||||||
sVolumeLogger.log(new AudioEventLogger.StringEvent("avrcpSupportsAbsoluteVolume addr="
|
sVolumeLogger.log(new AudioEventLogger.StringEvent("avrcpSupportsAbsoluteVolume addr="
|
||||||
+ address + " support=" + support));
|
+ address + " support=" + support).printLog(TAG));
|
||||||
mDeviceBroker.setAvrcpAbsoluteVolumeSupported(support);
|
mDeviceBroker.setAvrcpAbsoluteVolumeSupported(support);
|
||||||
setAvrcpAbsoluteVolumeSupported(support);
|
setAvrcpAbsoluteVolumeSupported(support);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user