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

Commit f081f06a authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Kill overscan insets and outsets

Also remove WindowManagerStressTest because that has been replaced
with proper perf test.

Test: Boots
Bug: 143255833
Change-Id: I1d293cda7c82d0aa1c3a6cc694c74bf7d10cc974
parent 379f81b2
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -111,11 +111,9 @@ public class RelayoutPerfTest extends WindowManagerPerfTestBase {

    private static class RelayoutRunner {
        final Rect mOutFrame = new Rect();
        final Rect mOutOverscanInsets = new Rect();
        final Rect mOutContentInsets = new Rect();
        final Rect mOutVisibleInsets = new Rect();
        final Rect mOutStableInsets = new Rect();
        final Rect mOutOutsets = new Rect();
        final Rect mOutBackDropFrame = new Rect();
        final DisplayCutout.ParcelableWrapper mOutDisplayCutout =
                new DisplayCutout.ParcelableWrapper(DisplayCutout.NO_CUTOUT);
@@ -149,8 +147,8 @@ public class RelayoutPerfTest extends WindowManagerPerfTestBase {
            while (state.keepRunning()) {
                session.relayout(mWindow, mSeq, mParams, mWidth, mHeight,
                        mViewVisibility.getAsInt(), mFlags, mFrameNumber, mOutFrame,
                        mOutOverscanInsets, mOutContentInsets, mOutVisibleInsets, mOutStableInsets,
                        mOutOutsets, mOutBackDropFrame, mOutDisplayCutout, mOutMergedConfiguration,
                        mOutContentInsets, mOutVisibleInsets, mOutStableInsets,
                        mOutBackDropFrame, mOutDisplayCutout, mOutMergedConfiguration,
                        mOutSurfaceControl, mOutInsetsState);
            }
        }
+1 −2
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ public class WindowAddRemovePerfTest extends WindowManagerPerfTestBase {
        final Rect mOutFrame = new Rect();
        final Rect mOutContentInsets = new Rect();
        final Rect mOutStableInsets = new Rect();
        final Rect mOutOutsets = new Rect();
        final DisplayCutout.ParcelableWrapper mOutDisplayCutout =
                new DisplayCutout.ParcelableWrapper();
        final InsetsState mOutInsetsState = new InsetsState();
@@ -92,7 +91,7 @@ public class WindowAddRemovePerfTest extends WindowManagerPerfTestBase {
                long startTime = SystemClock.elapsedRealtimeNanos();
                session.addToDisplay(this, mSeq, mLayoutParams, View.VISIBLE,
                        Display.DEFAULT_DISPLAY, mOutFrame, mOutContentInsets, mOutStableInsets,
                        mOutOutsets, mOutDisplayCutout, inputChannel, mOutInsetsState);
                        mOutDisplayCutout, inputChannel, mOutInsetsState);
                final long elapsedTimeNsOfAdd = SystemClock.elapsedRealtimeNanos() - startTime;
                state.addExtraResult("add", elapsedTimeNsOfAdd);

+4 −4
Original line number Diff line number Diff line
@@ -1597,7 +1597,7 @@ package android {
    field public static final int windowMinWidthMinor = 16843607; // 0x1010357
    field public static final int windowNoDisplay = 16843294; // 0x101021e
    field public static final int windowNoTitle = 16842838; // 0x1010056
    field public static final int windowOverscan = 16843727; // 0x10103cf
    field @Deprecated public static final int windowOverscan = 16843727; // 0x10103cf
    field public static final int windowReenterTransition = 16843951; // 0x10104af
    field public static final int windowReturnTransition = 16843950; // 0x10104ae
    field public static final int windowSharedElementEnterTransition = 16843833; // 0x1010439
@@ -2324,13 +2324,13 @@ package android {
    field public static final int Theme_Material_Light_LightStatusBar = 16974549; // 0x10302d5
    field public static final int Theme_Material_Light_NoActionBar = 16974401; // 0x1030241
    field public static final int Theme_Material_Light_NoActionBar_Fullscreen = 16974402; // 0x1030242
    field public static final int Theme_Material_Light_NoActionBar_Overscan = 16974403; // 0x1030243
    field @Deprecated public static final int Theme_Material_Light_NoActionBar_Overscan = 16974403; // 0x1030243
    field public static final int Theme_Material_Light_NoActionBar_TranslucentDecor = 16974404; // 0x1030244
    field public static final int Theme_Material_Light_Panel = 16974405; // 0x1030245
    field public static final int Theme_Material_Light_Voice = 16974406; // 0x1030246
    field public static final int Theme_Material_NoActionBar = 16974382; // 0x103022e
    field public static final int Theme_Material_NoActionBar_Fullscreen = 16974383; // 0x103022f
    field public static final int Theme_Material_NoActionBar_Overscan = 16974384; // 0x1030230
    field @Deprecated public static final int Theme_Material_NoActionBar_Overscan = 16974384; // 0x1030230
    field public static final int Theme_Material_NoActionBar_TranslucentDecor = 16974385; // 0x1030231
    field public static final int Theme_Material_Panel = 16974386; // 0x1030232
    field public static final int Theme_Material_Settings = 16974387; // 0x1030233
@@ -52255,7 +52255,7 @@ package android.view {
    field public static final int FLAG_KEEP_SCREEN_ON = 128; // 0x80
    field public static final int FLAG_LAYOUT_ATTACHED_IN_DECOR = 1073741824; // 0x40000000
    field public static final int FLAG_LAYOUT_INSET_DECOR = 65536; // 0x10000
    field public static final int FLAG_LAYOUT_IN_OVERSCAN = 33554432; // 0x2000000
    field @Deprecated public static final int FLAG_LAYOUT_IN_OVERSCAN = 33554432; // 0x2000000
    field public static final int FLAG_LAYOUT_IN_SCREEN = 256; // 0x100
    field public static final int FLAG_LAYOUT_NO_LIMITS = 512; // 0x200
    field public static final int FLAG_LOCAL_FOCUS_MODE = 268435456; // 0x10000000
+9 −31
Original line number Diff line number Diff line
@@ -176,14 +176,10 @@ public abstract class WallpaperService extends Service {
        int mCurWindowPrivateFlags = mWindowPrivateFlags;
        final Rect mVisibleInsets = new Rect();
        final Rect mWinFrame = new Rect();
        final Rect mOverscanInsets = new Rect();
        final Rect mContentInsets = new Rect();
        final Rect mStableInsets = new Rect();
        final Rect mOutsets = new Rect();
        final Rect mDispatchedOverscanInsets = new Rect();
        final Rect mDispatchedContentInsets = new Rect();
        final Rect mDispatchedStableInsets = new Rect();
        final Rect mDispatchedOutsets = new Rect();
        final Rect mFinalSystemInsets = new Rect();
        final Rect mFinalStableInsets = new Rect();
        final Rect mBackdropFrame = new Rect();
@@ -317,13 +313,13 @@ public abstract class WallpaperService extends Service {

        final BaseIWindow mWindow = new BaseIWindow() {
            @Override
            public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                    Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
            public void resized(Rect frame, Rect contentInsets,
                    Rect visibleInsets, Rect stableInsets, boolean reportDraw,
                    MergedConfiguration mergedConfiguration, Rect backDropRect, boolean forceLayout,
                    boolean alwaysConsumeSystemBars, int displayId,
                    DisplayCutout.ParcelableWrapper displayCutout) {
                Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED,
                        reportDraw ? 1 : 0, outsets);
                Message msg = mCaller.obtainMessageI(MSG_WINDOW_RESIZED,
                        reportDraw ? 1 : 0);
                mCaller.sendMessage(msg);
            }

@@ -822,7 +818,7 @@ public abstract class WallpaperService extends Service {

                        if (mSession.addToDisplay(mWindow, mWindow.mSeq, mLayout, View.VISIBLE,
                                mDisplay.getDisplayId(), mWinFrame, mContentInsets, mStableInsets,
                                mOutsets, mDisplayCutout, inputChannel,
                                mDisplayCutout, inputChannel,
                                mInsetsState) < 0) {
                            Log.w(TAG, "Failed to add window while updating wallpaper surface.");
                            return;
@@ -838,17 +834,13 @@ public abstract class WallpaperService extends Service {

                    if (!fixedSize) {
                        mLayout.surfaceInsets.set(mIWallpaperEngine.mDisplayPadding);
                        mLayout.surfaceInsets.left += mOutsets.left;
                        mLayout.surfaceInsets.top += mOutsets.top;
                        mLayout.surfaceInsets.right += mOutsets.right;
                        mLayout.surfaceInsets.bottom += mOutsets.bottom;
                    } else {
                        mLayout.surfaceInsets.set(0, 0, 0, 0);
                    }
                    final int relayoutResult = mSession.relayout(
                        mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
                            View.VISIBLE, 0, -1, mWinFrame, mOverscanInsets, mContentInsets,
                            mVisibleInsets, mStableInsets, mOutsets, mBackdropFrame,
                            View.VISIBLE, 0, -1, mWinFrame, mContentInsets,
                            mVisibleInsets, mStableInsets, mBackdropFrame,
                            mDisplayCutout, mMergedConfiguration, mSurfaceControl,
                            mInsetsState);
                    if (mSurfaceControl.isValid()) {
@@ -864,12 +856,8 @@ public abstract class WallpaperService extends Service {

                    if (!fixedSize) {
                        final Rect padding = mIWallpaperEngine.mDisplayPadding;
                        w += padding.left + padding.right + mOutsets.left + mOutsets.right;
                        h += padding.top + padding.bottom + mOutsets.top + mOutsets.bottom;
                        mOverscanInsets.left += padding.left;
                        mOverscanInsets.top += padding.top;
                        mOverscanInsets.right += padding.right;
                        mOverscanInsets.bottom += padding.bottom;
                        w += padding.left + padding.right;
                        h += padding.top + padding.bottom;
                        mContentInsets.left += padding.left;
                        mContentInsets.top += padding.top;
                        mContentInsets.right += padding.right;
@@ -898,10 +886,8 @@ public abstract class WallpaperService extends Service {
                        Log.v(TAG, "Wallpaper size has changed: (" + mCurWidth + ", " + mCurHeight);
                    }

                    insetsChanged |= !mDispatchedOverscanInsets.equals(mOverscanInsets);
                    insetsChanged |= !mDispatchedContentInsets.equals(mContentInsets);
                    insetsChanged |= !mDispatchedStableInsets.equals(mStableInsets);
                    insetsChanged |= !mDispatchedOutsets.equals(mOutsets);
                    insetsChanged |= !mDispatchedDisplayCutout.equals(mDisplayCutout.get());

                    mSurfaceHolder.setSurfaceFrameSize(w, h);
@@ -961,16 +947,9 @@ public abstract class WallpaperService extends Service {
                        }

                        if (insetsChanged) {
                            mDispatchedOverscanInsets.set(mOverscanInsets);
                            mDispatchedOverscanInsets.left += mOutsets.left;
                            mDispatchedOverscanInsets.top += mOutsets.top;
                            mDispatchedOverscanInsets.right += mOutsets.right;
                            mDispatchedOverscanInsets.bottom += mOutsets.bottom;
                            mDispatchedContentInsets.set(mContentInsets);
                            mDispatchedStableInsets.set(mStableInsets);
                            mDispatchedOutsets.set(mOutsets);
                            mDispatchedDisplayCutout = mDisplayCutout.get();
                            mFinalSystemInsets.set(mDispatchedOverscanInsets);
                            mFinalStableInsets.set(mDispatchedStableInsets);
                            WindowInsets insets = new WindowInsets(mFinalSystemInsets,
                                    mFinalStableInsets,
@@ -1457,7 +1436,6 @@ public abstract class WallpaperService extends Service {
                } break;
                case MSG_WINDOW_RESIZED: {
                    final boolean reportDraw = message.arg1 != 0;
                    mEngine.mOutsets.set((Rect) message.obj);
                    mEngine.updateSurface(true, false, reportDraw);
                    mEngine.doOffsetsChanged(true);
                } break;
+0 −14
Original line number Diff line number Diff line
@@ -748,20 +748,6 @@ public final class Display {
        }
    }

    /**
     * @hide
     * Return a rectangle defining the insets of the overscan region of the display.
     * Each field of the rectangle is the number of pixels the overscan area extends
     * into the display on that side.
     */
    public void getOverscanInsets(Rect outRect) {
        synchronized (this) {
            updateDisplayInfoLocked();
            outRect.set(mDisplayInfo.overscanLeft, mDisplayInfo.overscanTop,
                    mDisplayInfo.overscanRight, mDisplayInfo.overscanBottom);
        }
    }

    /**
     * Returns the rotation of the screen from its "natural" orientation.
     * The returned value may be {@link Surface#ROTATION_0 Surface.ROTATION_0}
Loading