Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e3e6e99 authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge "Fix WindowOrientationListener crash if no sensor present"

parents edd33c8b 12741963
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -136,17 +136,21 @@ public abstract class WindowOrientationListener {

    public void onTouchStart() {
        synchronized (mLock) {
            if (mSensorEventListener != null) {
                mSensorEventListener.onTouchStartLocked();
            }
        }
    }

    public void onTouchEnd() {
        long whenElapsedNanos = SystemClock.elapsedRealtimeNanos();

        synchronized (mLock) {
            if (mSensorEventListener != null) {
                mSensorEventListener.onTouchEndLocked(whenElapsedNanos);
            }
        }
    }

    /**
     * Sets the current rotation.