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

Commit 12741963 authored by Adrian Roos's avatar Adrian Roos
Browse files

Fix WindowOrientationListener crash if no sensor present

Bug: 19999145
Change-Id: Ie0c2a2f9ff337a6538e85dc9bd0ef108dd468d28
parent b929d658
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.