Merge "AudioService: initialize sensors if head tracking supported" into sc-v2-dev am: ee5419c367
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16017457 Change-Id: I11a476bf1fed2913a8be5364483474010f1c89b1
This commit is contained in:
@@ -825,9 +825,18 @@ public class SpatializerHelper {
|
||||
}
|
||||
|
||||
synchronized void onInitSensors(boolean init) {
|
||||
final int[] modes = getSupportedHeadTrackingModes();
|
||||
if (modes.length == 0) {
|
||||
Log.i(TAG, "not initializing sensors, no headtracking supported");
|
||||
final String action = init ? "initializing" : "releasing";
|
||||
if (mSpat == null) {
|
||||
Log.e(TAG, "not " + action + " sensors, null spatializer");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (!mSpat.isHeadTrackingSupported()) {
|
||||
Log.e(TAG, "not " + action + " sensors, spatializer doesn't support headtracking");
|
||||
return;
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "not " + action + " sensors, error querying headtracking", e);
|
||||
return;
|
||||
}
|
||||
initSensors(init);
|
||||
|
||||
Reference in New Issue
Block a user