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

Commit 35d59141 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Removes default/movement PiP bounds from WM

Per discussion in go/pip-ctc-strategy, SysUI will not report
default/movements bounds to window manager.

Bug: 141200935
Test: atest PinnedStackTests
Change-Id: Ibdffe18640e167928285fb0efc5c88f82abe18e6
parent 80225546
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -53,9 +53,4 @@ interface IPinnedStackController {
     * {@param bounds} here is the final destination bounds.
     */
    void resetBoundsAnimation(in Rect bounds);

    /**
     * Reports the current default and movement bounds to controller.
     */
    void reportBounds(in Rect defaultBounds, in Rect movementBounds);
}
+4 −3
Original line number Diff line number Diff line
@@ -147,7 +147,8 @@ message DisplayContentProto {
    optional int32 id = 2;
    repeated StackProto stacks = 3;
    optional DockedStackDividerControllerProto docked_stack_divider_controller = 4;
    optional PinnedStackControllerProto pinned_stack_controller = 5;
    // Will be removed soon.
    optional PinnedStackControllerProto pinned_stack_controller = 5 [deprecated=true];
    /* non app windows */
    repeated WindowTokenProto above_app_windows = 6;
    repeated WindowTokenProto below_app_windows = 7;
@@ -184,8 +185,8 @@ message DockedStackDividerControllerProto {
message PinnedStackControllerProto {
    option (.android.msg_privacy).dest = DEST_AUTOMATIC;

    optional .android.graphics.RectProto default_bounds = 1;
    optional .android.graphics.RectProto movement_bounds = 2;
    optional .android.graphics.RectProto default_bounds = 1 [deprecated=true];
    optional .android.graphics.RectProto movement_bounds = 2 [deprecated=true];
}

/* represents TaskStack */
+0 −3
Original line number Diff line number Diff line
@@ -261,8 +261,6 @@ public class PipBoundsHandler {
            mPinnedStackController.startAnimation(destinationBounds, sourceRectHint,
                    -1 /* animationDuration */);
            mLastDestinationBounds.set(destinationBounds);
            mPinnedStackController.reportBounds(defaultBounds,
                    getMovementBounds(defaultBounds));
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to start PiP animation from SysUI", e);
        }
@@ -317,7 +315,6 @@ public class PipBoundsHandler {
            outBounds.set(postChangeStackBounds);
            mLastDestinationBounds.set(outBounds);
            mPinnedStackController.resetBoundsAnimation(outBounds);
            mPinnedStackController.reportBounds(outBounds, getMovementBounds(outBounds));
            t.setBounds(pinnedStackInfo.stackToken, outBounds);
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to resize PiP on display rotation", e);
+0 −2
Original line number Diff line number Diff line
@@ -112,7 +112,6 @@ import static com.android.server.wm.DisplayContentProto.ID;
import static com.android.server.wm.DisplayContentProto.IME_WINDOWS;
import static com.android.server.wm.DisplayContentProto.OPENING_APPS;
import static com.android.server.wm.DisplayContentProto.OVERLAY_WINDOWS;
import static com.android.server.wm.DisplayContentProto.PINNED_STACK_CONTROLLER;
import static com.android.server.wm.DisplayContentProto.ROTATION;
import static com.android.server.wm.DisplayContentProto.SCREEN_ROTATION_ANIMATION;
import static com.android.server.wm.DisplayContentProto.STACKS;
@@ -2779,7 +2778,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            stack.dumpDebugInnerStackOnly(proto, STACKS, logLevel);
        }
        mDividerControllerLocked.dumpDebug(proto, DOCKED_STACK_DIVIDER_CONTROLLER);
        mPinnedStackControllerLocked.dumpDebug(proto, PINNED_STACK_CONTROLLER);
        for (int i = mAboveAppWindowsContainers.getChildCount() - 1; i >= 0; --i) {
            final WindowToken windowToken = mAboveAppWindowsContainers.getChildAt(i);
            windowToken.dumpDebug(proto, ABOVE_APP_WINDOWS, logLevel);
+0 −25
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.server.wm;

import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;

import static com.android.server.wm.PinnedStackControllerProto.DEFAULT_BOUNDS;
import static com.android.server.wm.PinnedStackControllerProto.MOVEMENT_BOUNDS;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;

@@ -34,7 +32,6 @@ import android.os.RemoteException;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.Slog;
import android.util.proto.ProtoOutputStream;
import android.view.DisplayInfo;
import android.view.IPinnedStackController;
import android.view.IPinnedStackListener;
@@ -97,11 +94,6 @@ class PinnedStackController {
    // Temp vars for calculation
    private final DisplayMetrics mTmpMetrics = new DisplayMetrics();

    // TODO(b/141200935): remove this when we have default/movement bounds tests in SysUI.
    // Keep record of the default and movement bounds
    private final Rect mLastReportedDefaultBounds = new Rect();
    private final Rect mLastReportedMovementBounds = new Rect();

    /**
     * The callback object passed to listeners for them to notify the controller of state changes.
     */
@@ -143,14 +135,6 @@ class PinnedStackController {
                }
            }
        }

        @Override
        public void reportBounds(Rect defaultBounds, Rect movementBounds) {
            synchronized (mService.mGlobalLock) {
                mLastReportedDefaultBounds.set(defaultBounds);
                mLastReportedMovementBounds.set(movementBounds);
            }
        }
    }

    /**
@@ -421,8 +405,6 @@ class PinnedStackController {

    void dump(String prefix, PrintWriter pw) {
        pw.println(prefix + "PinnedStackController");
        pw.println(prefix + "  mLastReportedDefaultBounds=" + mLastReportedDefaultBounds);
        pw.println(prefix + "  mLastReportedMovementBounds=" + mLastReportedMovementBounds);
        pw.println(prefix + "  mDefaultAspectRatio=" + mDefaultAspectRatio);
        pw.println(prefix + "  mIsImeShowing=" + mIsImeShowing);
        pw.println(prefix + "  mImeHeight=" + mImeHeight);
@@ -443,11 +425,4 @@ class PinnedStackController {
        }
        pw.println(prefix + "  mDisplayInfo=" + mDisplayInfo);
    }

    void dumpDebug(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);
        mLastReportedDefaultBounds.dumpDebug(proto, DEFAULT_BOUNDS);
        mLastReportedMovementBounds.dumpDebug(proto, MOVEMENT_BOUNDS);
        proto.end(token);
    }
}