From 45c06ec4ffad8f5a602db37b28537267f687c3ef Mon Sep 17 00:00:00 2001 From: Ralph Nathan Date: Fri, 9 Oct 2015 14:39:00 -0700 Subject: audio: Change the default init value for StreamDescriptor Currently, audio doesn't play on Brillo because the policy manager's default value for all streams is set to 0. In Android, this value is changed by calls from AudioService.java. If we set the default value to 1 in Brillo, then even if there are no calls, we will have audio. BUG=none TEST=manual Change-Id: I1418c9ecfb4f1c81c9c0946eee11deed3c65b358 --- .../audiopolicy/common/managerdefinitions/src/StreamDescriptor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/audiopolicy/common/managerdefinitions/src/StreamDescriptor.cpp b/services/audiopolicy/common/managerdefinitions/src/StreamDescriptor.cpp index b682e2c..4ca27c2 100644 --- a/services/audiopolicy/common/managerdefinitions/src/StreamDescriptor.cpp +++ b/services/audiopolicy/common/managerdefinitions/src/StreamDescriptor.cpp @@ -35,7 +35,10 @@ namespace android { StreamDescriptor::StreamDescriptor() : mIndexMin(0), mIndexMax(1), mCanBeMuted(true) { - mIndexCur.add(AUDIO_DEVICE_OUT_DEFAULT, 0); + // Initialize the current stream's index to mIndexMax so volume isn't 0 in + // cases where the Java layer doesn't call into the audio policy service to + // set the default volume. + mIndexCur.add(AUDIO_DEVICE_OUT_DEFAULT, mIndexMax); } int StreamDescriptor::getVolumeIndex(audio_devices_t device) const -- cgit v1.1