Merge "Master mute is valid when running fixed volume for automotive" into pi-dev
am: 69ed99856b
Change-Id: I2f67dc85b7bdcff3753f6d97b8e4a3ad63afb58e
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index a36d3ca..0b9832d 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 @@
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 @@
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()) {