Merge "AudioService: fix initial spatial audio enable state."
This commit is contained in:
commit
4dc6c54ddf
@ -748,33 +748,29 @@ 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();
|
||||||
break;
|
// onRoutingUpdated() can update the "enabled" state based on context
|
||||||
} else {
|
// and will call setDispatchFeatureEnabledState().
|
||||||
// already in disabled state
|
} // else { nothing to do as already disabled }
|
||||||
return;
|
break;
|
||||||
}
|
|
||||||
case STATE_ENABLED_UNAVAILABLE:
|
case STATE_ENABLED_UNAVAILABLE:
|
||||||
case STATE_ENABLED_AVAILABLE:
|
case STATE_ENABLED_AVAILABLE:
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
releaseSpat();
|
releaseSpat();
|
||||||
break;
|
setDispatchFeatureEnabledState(false, "setSpatializerEnabledInt");
|
||||||
} else {
|
} // else { nothing to do as already enabled }
|
||||||
// already in enabled state
|
break;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
setDispatchFeatureEnabledState(enabled, "setSpatializerEnabledInt");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized int getCapableImmersiveAudioLevel() {
|
synchronized int getCapableImmersiveAudioLevel() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user