Merge "AudioService: fix initial spatial audio enable state." into tm-qpr-dev
This commit is contained in:
@@ -751,34 +751,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