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

Commit fa10423f authored by Adrian Roos's avatar Adrian Roos
Browse files

Add stable insets for stable system windows

Adds a new kind of inset that only accounts for stable system
windows like the system or navigation bar.

Bug: 15457292
Change-Id: I681b711f6f40a94c25b7acd3a44eb3539486afab
parent f29131f7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ public abstract class WallpaperService extends Service {
        final Rect mWinFrame = new Rect();
        final Rect mOverscanInsets = new Rect();
        final Rect mContentInsets = new Rect();
        final Rect mStableInsets = new Rect();
        final Configuration mConfiguration = new Configuration();
        
        final WindowManager.LayoutParams mLayout
@@ -253,7 +254,8 @@ public abstract class WallpaperService extends Service {
        final BaseIWindow mWindow = new BaseIWindow() {
            @Override
            public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                    Rect visibleInsets, boolean reportDraw, Configuration newConfig) {
                    Rect visibleInsets, Rect stableInsets, boolean reportDraw,
                    Configuration newConfig) {
                Message msg = mCaller.obtainMessageI(MSG_WINDOW_RESIZED,
                        reportDraw ? 1 : 0);
                mCaller.sendMessage(msg);
@@ -628,7 +630,7 @@ public abstract class WallpaperService extends Service {
                    final int relayoutResult = mSession.relayout(
                        mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
                            View.VISIBLE, 0, mWinFrame, mOverscanInsets, mContentInsets,
                            mVisibleInsets, mConfiguration, mSurfaceHolder.mSurface);
                            mVisibleInsets, mStableInsets, mConfiguration, mSurfaceHolder.mSurface);

                    if (DEBUG) Log.v(TAG, "New surface: " + mSurfaceHolder.mSurface
                            + ", frame=" + mWinFrame);
+2 −1
Original line number Diff line number Diff line
@@ -46,7 +46,8 @@ oneway interface IWindow {
    void executeCommand(String command, String parameters, in ParcelFileDescriptor descriptor);

    void resized(in Rect frame, in Rect overscanInsets, in Rect contentInsets,
            in Rect visibleInsets, boolean reportDraw, in Configuration newConfig);
            in Rect visibleInsets, in Rect stableInsets, boolean reportDraw,
            in Configuration newConfig);
    void moved(int newX, int newY);
    void dispatchAppVisibility(boolean visible);
    void dispatchGetNewSurface();
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ interface IWindowSession {
    int relayout(IWindow window, int seq, in WindowManager.LayoutParams attrs,
            int requestedWidth, int requestedHeight, int viewVisibility,
            int flags, out Rect outFrame, out Rect outOverscanInsets,
            out Rect outContentInsets, out Rect outVisibleInsets,
            out Rect outContentInsets, out Rect outVisibleInsets, out Rect outStableInsets,
            out Configuration outConfig, out Surface outSurface);

    /**
+4 −2
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ public class SurfaceView extends View {
    final Rect mWinFrame = new Rect();
    final Rect mOverscanInsets = new Rect();
    final Rect mContentInsets = new Rect();
    final Rect mStableInsets = new Rect();
    final Configuration mConfiguration = new Configuration();

    static final int KEEP_SCREEN_ON_MSG = 1;
@@ -518,7 +519,7 @@ public class SurfaceView extends View {
                            visible ? VISIBLE : GONE,
                            WindowManagerGlobal.RELAYOUT_DEFER_SURFACE_DESTROY,
                            mWinFrame, mOverscanInsets, mContentInsets,
                            mVisibleInsets, mConfiguration, mNewSurface);
                            mVisibleInsets, mStableInsets, mConfiguration, mNewSurface);
                    if ((relayoutResult & WindowManagerGlobal.RELAYOUT_RES_FIRST_TIME) != 0) {
                        mReportDrawNeeded = true;
                    }
@@ -653,7 +654,8 @@ public class SurfaceView extends View {

        @Override
        public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                Rect visibleInsets, boolean reportDraw, Configuration newConfig) {
                Rect visibleInsets, Rect stableInsets, boolean reportDraw,
                Configuration newConfig) {
            SurfaceView surfaceView = mSurfaceView.get();
            if (surfaceView != null) {
                if (DEBUG) Log.v(
+7 −0
Original line number Diff line number Diff line
@@ -19804,6 +19804,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
         */
        final Rect mVisibleInsets = new Rect();
        /**
         * For windows that are full-screen but using insets to layout inside
         * of the screen decorations, these are the current insets for the
         * stable system windows.
         */
        final Rect mStableInsets = new Rect();
        /**
         * The internal insets given by this window.  This value is
         * supplied by the client (through
Loading