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

Commit 99ca9c02 authored by Antonio Kantek's avatar Antonio Kantek Committed by Automerger Merge Worker
Browse files

Merge "Deleting DisplayContent#reparentDisplayContent and related code" into sc-dev am: 1de80b1d

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

Change-Id: I21af7b134a92c6c4b14b96056d06cc393c87b0ce
parents 0f79c4da 1de80b1d
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -266,20 +266,6 @@ interface IWindowSession {

    oneway void updatePointerIcon(IWindow window);

    /**
     * Reparent the top layers for a display to the requested SurfaceControl. The display that is
     * going to be re-parented (the displayId passed in) needs to have been created by the same
     * process that is requesting the re-parent. This is to ensure clients can't just re-parent
     * display content info to any SurfaceControl, as this would be a security issue.
     *
     * @param window The window which owns the SurfaceControl. This indicates the z-order of the
     *               windows of this display against the windows on the parent display.
     * @param sc The SurfaceControl that the top level layers for the display should be re-parented
     *           to.
     * @param displayId The id of the display to be re-parented.
     */
    oneway void reparentDisplayContent(IWindow window, in SurfaceControl sc, int displayId);

    /**
     * Update the location of a child display in its parent window. This enables windows in the
     * child display to compute the global transformation matrix.
+0 −5
Original line number Diff line number Diff line
@@ -443,11 +443,6 @@ public class WindowlessWindowManager implements IWindowSession {
    public void updatePointerIcon(android.view.IWindow window) {
    }

    @Override
    public void reparentDisplayContent(android.view.IWindow window, android.view.SurfaceControl sc,
            int displayId) {
    }

    @Override
    public void updateDisplayContentLocation(android.view.IWindow window, int x, int y,
            int displayId) {
+0 −22
Original line number Diff line number Diff line
@@ -5014,28 +5014,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                && isTrusted();
    }

    /**
     * Re-parent the DisplayContent's top surface, {@link #mSurfaceControl} to the specified
     * SurfaceControl.
     *
     * @param win The window which owns the SurfaceControl. This indicates the z-order of the
     *            windows of this display against the windows on the parent display.
     * @param sc The new SurfaceControl, where the DisplayContent's surfaces will be re-parented to.
     */
    void reparentDisplayContent(WindowState win, SurfaceControl sc) {
        if (mParentWindow != null) {
            mParentWindow.removeEmbeddedDisplayContent(this);
        }
        mParentWindow = win;
        mParentWindow.addEmbeddedDisplayContent(this);
        mParentSurfaceControl = sc;
        if (mPortalWindowHandle == null) {
            mPortalWindowHandle = createPortalWindowHandle(sc.toString());
        }
        getPendingTransaction().setInputWindowInfo(sc, mPortalWindowHandle)
                .reparent(mSurfaceControl, sc);
    }

    /**
     * Get the window which owns the surface that this DisplayContent is re-parented to.
     *
+0 −5
Original line number Diff line number Diff line
@@ -608,11 +608,6 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
        }
    }

    @Override
    public void reparentDisplayContent(IWindow window, SurfaceControl sc, int displayId) {
        mService.reparentDisplayContent(window, sc, displayId);
    }

    @Override
    public void updateDisplayContentLocation(IWindow window, int x, int y, int displayId) {
        mService.updateDisplayContentLocation(window, x, y, displayId);
+0 −26
Original line number Diff line number Diff line
@@ -6971,32 +6971,6 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    /** @see Session#reparentDisplayContent(IWindow, SurfaceControl, int)  */
    void reparentDisplayContent(IWindow client, SurfaceControl sc, int displayId) {
        checkCallerOwnsDisplay(displayId);

        synchronized (mGlobalLock) {
            int uid = Binder.getCallingUid();
            final long token = Binder.clearCallingIdentity();
            try {
                final WindowState win = windowForClientLocked(null, client, false);
                if (win == null) {
                    ProtoLog.w(WM_ERROR, "Bad requesting window %s", client);
                    return;
                }
                getDisplayContentOrCreate(displayId, null).reparentDisplayContent(win, sc);
                // Notifies AccessibilityController to re-compute the window observer of
                // this embedded display
                if (mAccessibilityController != null) {
                    mAccessibilityController.handleWindowObserverOfEmbeddedDisplay(
                            displayId, win, uid);
                }
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        }
    }

    /** @see Session#updateDisplayContentLocation(IWindow, int, int, int)  */
    void updateDisplayContentLocation(IWindow client, int x, int y, int displayId) {
        checkCallerOwnsDisplay(displayId);
Loading