summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongwei Wang <hwwang@google.com>2018-05-30 18:33:06 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-05-30 18:33:06 -0700
commitc59f093cfb2c0fb6cb0107e9f1510745cf810091 (patch)
tree46245d8f57f6b4ad13daaab5d78ab5154d1a3e46
parent25d4bb84bda1406280c132aee1f53bbc9f6a7375 (diff)
parent69ed99856be479c3a721bb138bc15cb5d594fe42 (diff)
Merge "Master mute is valid when running fixed volume for automotive" into pi-dev
am: 69ed99856b Change-Id: I2f67dc85b7bdcff3753f6d97b8e4a3ad63afb58e
-rw-r--r--services/core/java/com/android/server/audio/AudioService.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index a36d3caeb22b..0b9832d90f7d 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -215,6 +215,10 @@ public class AudioService extends IAudioService.Stub
return mPlatformType == AudioSystem.PLATFORM_TELEVISION;
}
+ private boolean isPlatformAutomotive() {
+ return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
+ }
+
/** The controller for the volume UI. */
private final VolumeController mVolumeController = new VolumeController();
@@ -2376,8 +2380,11 @@ public class AudioService extends IAudioService.Stub
if (DEBUG_VOL) {
Log.d(TAG, String.format("Master mute %s, %d, user=%d", mute, flags, userId));
}
- if (mUseFixedVolume) {
- return; // If using fixed volume, we don't mute.
+ if (!isPlatformAutomotive() && mUseFixedVolume) {
+ // If using fixed volume, we don't mute.
+ // TODO: remove the isPlatformAutomotive check here.
+ // The isPlatformAutomotive check is added for safety but may not be necessary.
+ return;
}
if (getCurrentUserId() == userId) {
if (mute != AudioSystem.getMasterMute()) {