From 3a8f2e017a56c0dfc1b840537b94ed9bfef75eef Mon Sep 17 00:00:00 2001 From: xialei6 Date: Mon, 6 May 2024 10:53:27 +0800 Subject: [Bugfix] Fix the issue where the spatializer available status could not be updated When a device (such as a projection device) is connected, the spatializer available status should be updated regardless of whether this feature is turned on or not. Because other functions (such as the spatializer UI switch) need to change according to the spatializer available status. Change-Id: I43d6d5d0ea4d69a0d4559390dcf34885b96bc488 Signed-off-by: xialei6 --- services/core/java/com/android/server/audio/SpatializerHelper.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/audio/SpatializerHelper.java b/services/core/java/com/android/server/audio/SpatializerHelper.java index 4f7f31dfa7dc..5be2291ff056 100644 --- a/services/core/java/com/android/server/audio/SpatializerHelper.java +++ b/services/core/java/com/android/server/audio/SpatializerHelper.java @@ -342,9 +342,6 @@ public class SpatializerHelper { //------------------------------------------------------ // routing monitoring synchronized void onRoutingUpdated() { - if (!mFeatureEnabled) { - return; - } switch (mState) { case STATE_UNINITIALIZED: case STATE_NOT_SUPPORTED: @@ -388,7 +385,7 @@ public class SpatializerHelper { setDispatchAvailableState(false); } - boolean enabled = able && enabledAvailable.first; + boolean enabled = mFeatureEnabled && able && enabledAvailable.first; if (enabled) { loglogi("Enabling Spatial Audio since enabled for media device:" + currentDevice); -- cgit v1.2.3-59-g8ed1b