Spatializer: update getSupportedHeadTrackingModes()
ISpatializer.getSupportedHeadTrackingModes() result is now
independent from actually connected sensors and reflects the
capabilities when sensors are available.
Also do not report screen relative mode as this is currently not
supported by the head tracking library implementation.
Bug: 231252067
Test: make
Change-Id: I0b8be86b5c720024c342911accc580c1aba4f82e
diff --git a/media/libaudioclient/aidl/android/media/ISpatializer.aidl b/media/libaudioclient/aidl/android/media/ISpatializer.aidl
index b871238..a61ad58 100644
--- a/media/libaudioclient/aidl/android/media/ISpatializer.aidl
+++ b/media/libaudioclient/aidl/android/media/ISpatializer.aidl
@@ -57,8 +57,10 @@
boolean isHeadTrackingSupported();
/** Reports the list of supported head tracking modes (see SpatializerHeadTrackingMode.aidl).
- * The list can be empty if the spatializer implementation does not support head tracking or if
- * no head tracking sensor is registered (see setHeadSensor() and setScreenSensor()).
+ * The list always contains SpatializerHeadTrackingMode.DISABLED and can include other modes
+ * if the spatializer effect implementation supports head tracking.
+ * The result does not depend on currently connected sensors but reflects the capabilities
+ * when sensors are available.
*/
SpatializerHeadTrackingMode[] getSupportedHeadTrackingModes();
diff --git a/services/audiopolicy/service/Spatializer.cpp b/services/audiopolicy/service/Spatializer.cpp
index 389233e..ef11072 100644
--- a/services/audiopolicy/service/Spatializer.cpp
+++ b/services/audiopolicy/service/Spatializer.cpp
@@ -342,12 +342,7 @@
modes->push_back(SpatializerHeadTrackingMode::DISABLED);
if (mSupportsHeadTracking) {
- if (mHeadSensor != SpatializerPoseController::INVALID_SENSOR) {
- modes->push_back(SpatializerHeadTrackingMode::RELATIVE_WORLD);
- if (mScreenSensor != SpatializerPoseController::INVALID_SENSOR) {
- modes->push_back(SpatializerHeadTrackingMode::RELATIVE_SCREEN);
- }
- }
+ modes->push_back(SpatializerHeadTrackingMode::RELATIVE_WORLD);
}
return Status::ok();
}