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

Commit 9001f14b authored by Filip Gruszczynski's avatar Filip Gruszczynski Committed by Android (Google) Code Review
Browse files

Merge "Don't use windowOutsetBottom for insets, depend on display padding...

Merge "Don't use windowOutsetBottom for insets, depend on display padding only." into lmp-mr1-modular-dev
parents eedf2fe0 d66ba06a
Loading
Loading
Loading
Loading
+2 −15
Original line number Original line Diff line number Diff line
@@ -155,7 +155,6 @@ public abstract class WallpaperService extends Service {
                WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS;
                WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS;
        int mCurWindowFlags = mWindowFlags;
        int mCurWindowFlags = mWindowFlags;
        int mCurWindowPrivateFlags = mWindowPrivateFlags;
        int mCurWindowPrivateFlags = mWindowPrivateFlags;
        int mOutsetBottomPx;
        final Rect mVisibleInsets = new Rect();
        final Rect mVisibleInsets = new Rect();
        final Rect mWinFrame = new Rect();
        final Rect mWinFrame = new Rect();
        final Rect mOverscanInsets = new Rect();
        final Rect mOverscanInsets = new Rect();
@@ -624,18 +623,9 @@ public abstract class WallpaperService extends Service {
                    mLayout.token = mWindowToken;
                    mLayout.token = mWindowToken;


                    if (!mCreated) {
                    if (!mCreated) {
                        // Retrieve watch round and outset info
                        // Retrieve watch round info
                        final WindowManager windowService = (WindowManager)getSystemService(
                                Context.WINDOW_SERVICE);
                        TypedArray windowStyle = obtainStyledAttributes(
                        TypedArray windowStyle = obtainStyledAttributes(
                                com.android.internal.R.styleable.Window);
                                com.android.internal.R.styleable.Window);
                        final Display display = windowService.getDefaultDisplay();
                        final boolean shouldUseBottomOutset =
                                display.getDisplayId() == Display.DEFAULT_DISPLAY;
                        if (shouldUseBottomOutset) {
                            mOutsetBottomPx = ScreenShapeHelper.getWindowOutsetBottomPx(
                                    getResources().getDisplayMetrics(), windowStyle);
                        }
                        mWindowIsRound = ScreenShapeHelper.getWindowIsRound(getResources());
                        mWindowIsRound = ScreenShapeHelper.getWindowIsRound(getResources());
                        windowStyle.recycle();
                        windowStyle.recycle();


@@ -770,10 +760,7 @@ public abstract class WallpaperService extends Service {
                            mDispatchedStableInsets.set(mStableInsets);
                            mDispatchedStableInsets.set(mStableInsets);
                            mFinalSystemInsets.set(mDispatchedOverscanInsets);
                            mFinalSystemInsets.set(mDispatchedOverscanInsets);
                            mFinalStableInsets.set(mDispatchedStableInsets);
                            mFinalStableInsets.set(mDispatchedStableInsets);
                            if (mOutsetBottomPx != 0) {
                            mFinalSystemInsets.bottom = mIWallpaperEngine.mDisplayPadding.bottom;
                                mFinalSystemInsets.bottom =
                                        mIWallpaperEngine.mDisplayPadding.bottom + mOutsetBottomPx;
                            }
                            WindowInsets insets = new WindowInsets(mFinalSystemInsets,
                            WindowInsets insets = new WindowInsets(mFinalSystemInsets,
                                    null, mFinalStableInsets, mWindowIsRound);
                                    null, mFinalStableInsets, mWindowIsRound);
                            onApplyWindowInsets(insets);
                            onApplyWindowInsets(insets);