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