You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
have no parallax effect on Nexus 5 + Android M (6.0) because there is a bug when someone is trying to register to sensor manager with SENSOR_DELAY_FASTEST rate.
so my workaround at this moment is:
public void registerSensorManager() {
if (getContext() == null || mSensorManager != null) return;
mSensorManager = (SensorManager) getContext().getSystemService(Context.SENSOR_SERVICE);
if (mSensorManager != null) {
int sensorUpdateRate = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
? SensorManager.SENSOR_DELAY_GAME
: SensorManager.SENSOR_DELAY_FASTEST;
mSensorManager.registerListener(this,
mSensorManager.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR),
sensorUpdateRate);
}
}
Hi ZuZuK, thanks for bringing this issue to attention! For now, it doesn't look like there has been any confirmation that SENSOR_DELAY_GAME is the fastest supported rate on Android M, only that there are specific instances where it doesn't work. Because of this, I'd hate to hardcode something like the workaround into the library prematurely.
That being said, my plan for now is to:
Expose sensorDelay as an optional parameter to registerSensorManager, as discussed in Using SENSOR_DELAY_UI #11. This will at least allow the workaround you specified to be pushed out of the library for now.
Monitor the issue you linked to for future updates.
have no parallax effect on Nexus 5 + Android M (6.0) because there is a bug when someone is trying to register to sensor manager with SENSOR_DELAY_FASTEST rate.
so my workaround at this moment is:
P.S. guess this bug appeared in Android M because of battery optimizations so maybe they are deprecated this rate or so. can't find details. bug is described here: https://code.google.com/p/android/issues/detail?id=189681&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars
The text was updated successfully, but these errors were encountered: