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

Commit 616fcd81 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Remove the input consumer surfaces when the consumer is disposed" into rvc-dev

parents f3d5e732 e963b4c5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -153,10 +153,11 @@ class InputConsumerImpl implements IBinder.DeathRecipient {
        t.reparent(mInputSurface, wc.getSurfaceControl());
    }

    void disposeChannelsLw() {
    void disposeChannelsLw(SurfaceControl.Transaction t) {
        mService.mInputManager.unregisterInputChannel(mServerChannel);
        mClientChannel.dispose();
        mServerChannel.dispose();
        t.remove(mInputSurface);
        unlinkFromDeathRecipient();
    }

+3 −3
Original line number Diff line number Diff line
@@ -112,8 +112,9 @@ final class InputMonitor {
        @Override
        public void dispose() {
            synchronized (mService.mGlobalLock) {
                disposeChannelsLw();
                disposeChannelsLw(mInputMonitor.mInputTransaction);
                mInputEventReceiver.dispose();
                mInputMonitor.updateInputWindowsLw(true /* force */);
            }
        }
    }
@@ -195,8 +196,7 @@ final class InputMonitor {

    private boolean disposeInputConsumer(InputConsumerImpl consumer) {
        if (consumer != null) {
            consumer.disposeChannelsLw();
            consumer.hide(mInputTransaction);
            consumer.disposeChannelsLw(mInputTransaction);
            return true;
        }
        return false;