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

Commit 08a746a0 authored by Jeff Brown's avatar Jeff Brown
Browse files

Don't enable input dispatch until display enabled.

Bug: 6263070
Change-Id: I05d036fc1d9ec06d164d6743d45bb3f199cfab47
parent 40a0376e
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -5285,6 +5285,9 @@ public class WindowManagerService extends IWindowManager.Stub
            } catch (RemoteException ex) {
            } catch (RemoteException ex) {
                Slog.e(TAG, "Boot completed: SurfaceFlinger is dead!");
                Slog.e(TAG, "Boot completed: SurfaceFlinger is dead!");
            }
            }

            // Enable input dispatch.
            mInputMonitor.setEventDispatchingLw(mEventDispatchingEnabled);
        }
        }


        mPolicy.enableScreenAfterBoot();
        mPolicy.enableScreenAfterBoot();
@@ -6636,6 +6639,7 @@ public class WindowManagerService extends IWindowManager.Stub
    // -------------------------------------------------------------
    // -------------------------------------------------------------
    
    
    final InputMonitor mInputMonitor = new InputMonitor(this);
    final InputMonitor mInputMonitor = new InputMonitor(this);
    private boolean mEventDispatchingEnabled;


    public void pauseKeyDispatching(IBinder _token) {
    public void pauseKeyDispatching(IBinder _token) {
        if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
        if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
@@ -6672,7 +6676,10 @@ public class WindowManagerService extends IWindowManager.Stub
        }
        }


        synchronized (mWindowMap) {
        synchronized (mWindowMap) {
            mEventDispatchingEnabled = enabled;
            if (mDisplayEnabled) {
                mInputMonitor.setEventDispatchingLw(enabled);
                mInputMonitor.setEventDispatchingLw(enabled);
            }
            sendScreenStatusToClientsLocked();
            sendScreenStatusToClientsLocked();
        }
        }
    }
    }