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

Commit 48c3ac8e authored by Vaibhav Devmurari's avatar Vaibhav Devmurari
Browse files

Shift configuration change policy call out of reader thread

On low end devices, configuration change processing can take upto
~150-250ms and we should not block reader thread for it.

Bug: 427669692
Test: manual
Flag: EXEMPT bugfix
Change-Id: I3b5f3fdd69c79e54adf257eecb00d6d4872d7c28
parent bc24b511
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2402,6 +2402,12 @@ public class InputManagerService extends IInputManager.Stub
    // Native callback.
    @SuppressWarnings("unused")
    private void notifyInputDevicesChanged(InputDevice[] inputDevices) {
        mHandler.post(() -> {
            // Input device change can possibly change configuration, so notify window manager to
            // update its configuration.
            // Shift to main thread and release InputReader thread.
            mWindowManagerCallbacks.notifyConfigurationChanged();
        });
        synchronized (mInputDevicesLock) {
            if (!mInputDevicesChangedPending) {
                mInputDevicesChangedPending = true;
@@ -2411,9 +2417,6 @@ public class InputManagerService extends IInputManager.Stub

            mInputDevices = inputDevices;
        }
        // Input device change can possibly change configuration, so notify window manager to update
        // its configuration.
        mWindowManagerCallbacks.notifyConfigurationChanged();
    }

    // Native callback.