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

Commit c73e0e50 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge "Change session.remove to take an IBinder instead of an IWindow" into main

parents 059aecd8 64ea5eaa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ public class WindowAddRemovePerfTest extends WindowManagerPerfTestBase
                state.addExtraResult("add", elapsedTimeNsOfAdd);

                startTime = SystemClock.elapsedRealtimeNanos();
                session.remove(this);
                session.remove(asBinder());
                final long elapsedTimeNsOfRemove = SystemClock.elapsedRealtimeNanos() - startTime;
                state.addExtraResult("remove", elapsedTimeNsOfRemove);

+1 −1
Original line number Diff line number Diff line
@@ -2289,7 +2289,7 @@ public abstract class WallpaperService extends Service {
                        mInputEventReceiver = null;
                    }

                    mSession.remove(mWindow);
                    mSession.remove(mWindow.asBinder());
                } catch (RemoteException e) {
                }
                mSurfaceHolder.mSurface.release();
+9 −2
Original line number Diff line number Diff line
@@ -59,8 +59,15 @@ interface IWindowSession {
    int addToDisplayWithoutInputChannel(IWindow window, in WindowManager.LayoutParams attrs,
            in int viewVisibility, in int layerStackId, out InsetsState insetsState,
            out Rect attachedFrame, out float[] sizeCompatScale);
    @UnsupportedAppUsage
    void remove(IWindow window);

    /**
     * Removes a clientToken from WMS, which includes unlinking the input channel.
     *
     * @param clientToken The token that should be removed. This will normally be the IWindow token
     * for a standard window. It can also be the generic clientToken that was used when calling
     * grantInputChannel
     */
    void remove(IBinder clientToken);

    /**
     * Change the parameters of a window.  You supply the
+1 −1
Original line number Diff line number Diff line
@@ -5881,7 +5881,7 @@ public final class ViewRootImpl implements ViewParent,
            mInputQueue = null;
        }
        try {
            mWindowSession.remove(mWindow);
            mWindowSession.remove(mWindow.asBinder());
        } catch (RemoteException e) {
        }
        // Dispose receiver would dispose client InputChannel, too. That could send out a socket
+3 −3
Original line number Diff line number Diff line
@@ -276,11 +276,11 @@ public class WindowlessWindowManager implements IWindowSession {
    }

    @Override
    public void remove(android.view.IWindow window) throws RemoteException {
        mRealWm.remove(window);
    public void remove(IBinder clientToken) throws RemoteException {
        mRealWm.remove(clientToken);
        State state;
        synchronized (this) {
            state = mStateForWindow.remove(window.asBinder());
            state = mStateForWindow.remove(clientToken);
        }
        if (state == null) {
            throw new IllegalArgumentException(
Loading