Merge "AudioService: fix initial spatial audio enable state." into tm-qpr-dev am: 5b0218abe5 am: f689360b69
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19497892 Change-Id: Iad32fe20c2989d5e2c727cd2d5d30419a62af2ab Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -751,33 +751,29 @@ public class SpatializerHelper {
|
||||
if (enabled) {
|
||||
throw (new IllegalStateException("Can't enable when uninitialized"));
|
||||
}
|
||||
return;
|
||||
break;
|
||||
case STATE_NOT_SUPPORTED:
|
||||
if (enabled) {
|
||||
Log.e(TAG, "Can't enable when unsupported");
|
||||
}
|
||||
return;
|
||||
break;
|
||||
case STATE_DISABLED_UNAVAILABLE:
|
||||
case STATE_DISABLED_AVAILABLE:
|
||||
if (enabled) {
|
||||
createSpat();
|
||||
onRoutingUpdated();
|
||||
break;
|
||||
} else {
|
||||
// already in disabled state
|
||||
return;
|
||||
}
|
||||
// onRoutingUpdated() can update the "enabled" state based on context
|
||||
// and will call setDispatchFeatureEnabledState().
|
||||
} // else { nothing to do as already disabled }
|
||||
break;
|
||||
case STATE_ENABLED_UNAVAILABLE:
|
||||
case STATE_ENABLED_AVAILABLE:
|
||||
if (!enabled) {
|
||||
releaseSpat();
|
||||
break;
|
||||
} else {
|
||||
// already in enabled state
|
||||
return;
|
||||
}
|
||||
setDispatchFeatureEnabledState(false, "setSpatializerEnabledInt");
|
||||
} // else { nothing to do as already enabled }
|
||||
break;
|
||||
}
|
||||
setDispatchFeatureEnabledState(enabled, "setSpatializerEnabledInt");
|
||||
}
|
||||
|
||||
synchronized int getCapableImmersiveAudioLevel() {
|
||||
|
||||
Reference in New Issue
Block a user