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

Commit f0038e3e authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Ensure embedded window's channel is not disposed before being duped"...

Merge "Ensure embedded window's channel is not disposed before being duped" into udc-qpr-dev am: fd074620 am: 76985aed

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23494574



Change-Id: I589730fab7d214c6740bbd10eaadc56a228bdeac
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ad73e06f 76985aed
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowStateProto.IDENTIFIER;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.IBinder;
import android.os.RemoteException;
@@ -217,10 +218,10 @@ class EmbeddedWindowController {
                    mHostWindowState.mInputWindowHandle.getInputApplicationHandle());
        }

        InputChannel openInputChannel() {
        void openInputChannel(@NonNull InputChannel outInputChannel) {
            final String name = toString();
            mInputChannel = mWmService.mInputManager.createInputChannel(name);
            return mInputChannel;
            mInputChannel.copyTo(outInputChannel);
        }

        void onRemoved() {
+4 −6
Original line number Diff line number Diff line
@@ -8767,24 +8767,22 @@ public class WindowManagerService extends IWindowManager.Stub
        final int sanitizedType = sanitizeWindowType(session, displayId, windowToken, type);
        final InputApplicationHandle applicationHandle;
        final String name;
        final InputChannel clientChannel;
        Objects.requireNonNull(outInputChannel);
        synchronized (mGlobalLock) {
            EmbeddedWindowController.EmbeddedWindow win =
                    new EmbeddedWindowController.EmbeddedWindow(session, this, window,
                            mInputToWindowMap.get(hostInputToken), callingUid, callingPid,
                            sanitizedType, displayId, focusGrantToken, inputHandleName,
                            (flags & FLAG_NOT_FOCUSABLE) == 0);
            clientChannel = win.openInputChannel();
            mEmbeddedWindowController.add(clientChannel.getToken(), win);
            win.openInputChannel(outInputChannel);
            mEmbeddedWindowController.add(outInputChannel.getToken(), win);
            applicationHandle = win.getApplicationHandle();
            name = win.toString();
        }

        updateInputChannel(clientChannel.getToken(), callingUid, callingPid, displayId, surface,
        updateInputChannel(outInputChannel.getToken(), callingUid, callingPid, displayId, surface,
                name, applicationHandle, flags, privateFlags, inputFeatures, sanitizedType,
                null /* region */, window);

        clientChannel.copyTo(outInputChannel);
    }

    boolean transferEmbeddedTouchFocusToHost(IWindow embeddedWindow) {