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

Commit 055bf375 authored by Khalid Zubair's avatar Khalid Zubair Committed by Gerrit Code Review
Browse files

gesture: fix possible race during initialization

It's possible for binder events to fire before mDisplayObserver is
setup. Take mLock during the setup phase to prevent access to
mDisplayObserver until setup completes.

SAMBAR-1121

Change-Id: I8c137ead7d0f956faca134be565b6db1da680f76
parent 9b446034
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class EdgeGestureService extends IEdgeGestureService.Stub {
    public void systemReady() {
        if (DEBUG) Slog.d(TAG, "Starting the edge gesture capture thread ...");

        synchronized (mLock) {
            mHandlerThread.start();
            mHandler = new H(mHandlerThread.getLooper());
            mHandler.post(new Runnable() {
@@ -199,6 +200,7 @@ public class EdgeGestureService extends IEdgeGestureService.Stub {
            // check if anyone registered during startup
            mHandler.sendEmptyMessage(MSG_UPDATE_SERVICE);
        }
    }


    private void updateMonitoring() {