Merge "WindowOrientationListener: Check if proposed rotation is in range" am: eb97eab212

am: f40968bc1f

Change-Id: Ieb2f1efd467ebe5233acc05fef0d853dae0d62a6
This commit is contained in:
Luca Stefani
2019-09-13 12:23:43 -07:00
committed by android-build-merger

View File

@@ -1047,8 +1047,14 @@ public abstract class WindowOrientationListener {
@Override
public void onSensorChanged(SensorEvent event) {
int newRotation;
int reportedRotation = (int) event.values[0];
if (reportedRotation < 0 || reportedRotation > 3) {
return;
}
synchronized (mLock) {
mDesiredRotation = (int) event.values[0];
mDesiredRotation = reportedRotation;
newRotation = evaluateRotationChangeLocked();
}
if (newRotation >=0) {