summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hongwei Wang <hwwang@google.com> 2018-05-30 18:41:54 -0700
committer android-build-merger <android-build-merger@google.com> 2018-05-30 18:41:54 -0700
commit35802a8e2aba081577aab527b2be1ea49f58084c (patch)
tree37ca48b3453e2d30c9ea883cd2a62ae3e0454f94
parent836bfe5f74be7e46caf84ea7b3e7ad3006b3284a (diff)
parentc59f093cfb2c0fb6cb0107e9f1510745cf810091 (diff)
Merge "Master mute is valid when running fixed volume for automotive" into pi-dev am: 69ed99856b
am: c59f093cfb Change-Id: I6297b819721537c211af1e9f198dd747480589f3
-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 1c5dcce378da..9c0d4e00b3c3 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();
@@ -2380,8 +2384,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()) {