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

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

Merge "resolved conflicts for merge of 47249f2a to mnc-dev" into mnc-dev

parents e4b47614 c7becb7e
Loading
Loading
Loading
Loading
+26 −8
Original line number Original line Diff line number Diff line
@@ -18,7 +18,6 @@ package android.service.wallpaper;


import android.content.res.TypedArray;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Canvas;
import android.os.SystemProperties;
import android.view.WindowInsets;
import android.view.WindowInsets;


import com.android.internal.R;
import com.android.internal.R;
@@ -161,9 +160,11 @@ public abstract class WallpaperService extends Service {
        final Rect mOverscanInsets = new Rect();
        final Rect mOverscanInsets = new Rect();
        final Rect mContentInsets = new Rect();
        final Rect mContentInsets = new Rect();
        final Rect mStableInsets = new Rect();
        final Rect mStableInsets = new Rect();
        final Rect mOutsets = new Rect();
        final Rect mDispatchedOverscanInsets = new Rect();
        final Rect mDispatchedOverscanInsets = new Rect();
        final Rect mDispatchedContentInsets = new Rect();
        final Rect mDispatchedContentInsets = new Rect();
        final Rect mDispatchedStableInsets = new Rect();
        final Rect mDispatchedStableInsets = new Rect();
        final Rect mDispatchedOutsets = new Rect();
        final Rect mFinalSystemInsets = new Rect();
        final Rect mFinalSystemInsets = new Rect();
        final Rect mFinalStableInsets = new Rect();
        final Rect mFinalStableInsets = new Rect();
        final Configuration mConfiguration = new Configuration();
        final Configuration mConfiguration = new Configuration();
@@ -268,7 +269,7 @@ public abstract class WallpaperService extends Service {
        final BaseIWindow mWindow = new BaseIWindow() {
        final BaseIWindow mWindow = new BaseIWindow() {
            @Override
            @Override
            public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
            public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                    Rect visibleInsets, Rect stableInsets, boolean reportDraw,
                    Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
                    Configuration newConfig) {
                    Configuration newConfig) {
                Message msg = mCaller.obtainMessageI(MSG_WINDOW_RESIZED,
                Message msg = mCaller.obtainMessageI(MSG_WINDOW_RESIZED,
                        reportDraw ? 1 : 0);
                        reportDraw ? 1 : 0);
@@ -664,13 +665,18 @@ public abstract class WallpaperService extends Service {


                    if (!fixedSize) {
                    if (!fixedSize) {
                        mLayout.surfaceInsets.set(mIWallpaperEngine.mDisplayPadding);
                        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 {
                    } else {
                        mLayout.surfaceInsets.set(0, 0, 0, 0);
                        mLayout.surfaceInsets.set(0, 0, 0, 0);
                    }
                    }
                    final int relayoutResult = mSession.relayout(
                    final int relayoutResult = mSession.relayout(
                        mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
                        mWindow, mWindow.mSeq, mLayout, mWidth, mHeight,
                            View.VISIBLE, 0, mWinFrame, mOverscanInsets, mContentInsets,
                            View.VISIBLE, 0, mWinFrame, mOverscanInsets, mContentInsets,
                            mVisibleInsets, mStableInsets, mConfiguration, mSurfaceHolder.mSurface);
                            mVisibleInsets, mStableInsets, mOutsets, mConfiguration,
                            mSurfaceHolder.mSurface);


                    if (DEBUG) Log.v(TAG, "New surface: " + mSurfaceHolder.mSurface
                    if (DEBUG) Log.v(TAG, "New surface: " + mSurfaceHolder.mSurface
                            + ", frame=" + mWinFrame);
                            + ", frame=" + mWinFrame);
@@ -680,8 +686,8 @@ public abstract class WallpaperService extends Service {


                    if (!fixedSize) {
                    if (!fixedSize) {
                        final Rect padding = mIWallpaperEngine.mDisplayPadding;
                        final Rect padding = mIWallpaperEngine.mDisplayPadding;
                        w += padding.left + padding.right;
                        w += padding.left + padding.right + mOutsets.left + mOutsets.right;
                        h += padding.top + padding.bottom;
                        h += padding.top + padding.bottom + mOutsets.top + mOutsets.bottom;
                        mOverscanInsets.left += padding.left;
                        mOverscanInsets.left += padding.left;
                        mOverscanInsets.top += padding.top;
                        mOverscanInsets.top += padding.top;
                        mOverscanInsets.right += padding.right;
                        mOverscanInsets.right += padding.right;
@@ -705,9 +711,14 @@ public abstract class WallpaperService extends Service {
                        mCurHeight = h;
                        mCurHeight = h;
                    }
                    }


                    if (DEBUG) {
                        Log.v(TAG, "Wallpaper size has changed: (" + mCurWidth + ", " + mCurHeight);
                    }

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


                    mSurfaceHolder.setSurfaceFrameSize(w, h);
                    mSurfaceHolder.setSurfaceFrameSize(w, h);
                    mSurfaceHolder.mSurfaceLock.unlock();
                    mSurfaceHolder.mSurfaceLock.unlock();
@@ -767,14 +778,21 @@ public abstract class WallpaperService extends Service {


                        if (insetsChanged) {
                        if (insetsChanged) {
                            mDispatchedOverscanInsets.set(mOverscanInsets);
                            mDispatchedOverscanInsets.set(mOverscanInsets);
                            mDispatchedOverscanInsets.left += mOutsets.left;
                            mDispatchedOverscanInsets.top += mOutsets.top;
                            mDispatchedOverscanInsets.right += mOutsets.right;
                            mDispatchedOverscanInsets.bottom += mOutsets.bottom;
                            mDispatchedContentInsets.set(mContentInsets);
                            mDispatchedContentInsets.set(mContentInsets);
                            mDispatchedStableInsets.set(mStableInsets);
                            mDispatchedStableInsets.set(mStableInsets);
                            mDispatchedOutsets.set(mOutsets);
                            mFinalSystemInsets.set(mDispatchedOverscanInsets);
                            mFinalSystemInsets.set(mDispatchedOverscanInsets);
                            mFinalStableInsets.set(mDispatchedStableInsets);
                            mFinalStableInsets.set(mDispatchedStableInsets);
                            mFinalSystemInsets.bottom = mIWallpaperEngine.mDisplayPadding.bottom;
                            WindowInsets insets = new WindowInsets(mFinalSystemInsets,
                            WindowInsets insets = new WindowInsets(mFinalSystemInsets,
                                    null, mFinalStableInsets,
                                    null, mFinalStableInsets,
                                    getResources().getConfiguration().isScreenRound());
                                    getResources().getConfiguration().isScreenRound());
                            if (DEBUG) {
                                Log.v(TAG, "dispatching insets=" + insets);
                            }
                            onApplyWindowInsets(insets);
                            onApplyWindowInsets(insets);
                        }
                        }


+1 −1
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@ oneway interface IWindow {
    void executeCommand(String command, String parameters, in ParcelFileDescriptor descriptor);
    void executeCommand(String command, String parameters, in ParcelFileDescriptor descriptor);


    void resized(in Rect frame, in Rect overscanInsets, in Rect contentInsets,
    void resized(in Rect frame, in Rect overscanInsets, in Rect contentInsets,
            in Rect visibleInsets, in Rect stableInsets, boolean reportDraw,
            in Rect visibleInsets, in Rect stableInsets, in Rect outsets, boolean reportDraw,
            in Configuration newConfig);
            in Configuration newConfig);
    void moved(int newX, int newY);
    void moved(int newX, int newY);
    void dispatchAppVisibility(boolean visible);
    void dispatchAppVisibility(boolean visible);
+4 −2
Original line number Original line Diff line number Diff line
@@ -79,6 +79,8 @@ interface IWindowSession {
     * contents to make sure the user can see it.  This is different than
     * contents to make sure the user can see it.  This is different than
     * <var>outContentInsets</var> in that these insets change transiently,
     * <var>outContentInsets</var> in that these insets change transiently,
     * so complex relayout of the window should not happen based on them.
     * so complex relayout of the window should not happen based on them.
     * @param outOutsets Rect in which is placed the dead area of the screen that we would like to
     * treat as real display. Example of such area is a chin in some models of wearable devices.
     * @param outConfiguration New configuration of window, if it is now
     * @param outConfiguration New configuration of window, if it is now
     * becoming visible and the global configuration has changed since it
     * becoming visible and the global configuration has changed since it
     * was last displayed.
     * was last displayed.
@@ -91,7 +93,7 @@ interface IWindowSession {
            int requestedWidth, int requestedHeight, int viewVisibility,
            int requestedWidth, int requestedHeight, int viewVisibility,
            int flags, out Rect outFrame, out Rect outOverscanInsets,
            int flags, out Rect outFrame, out Rect outOverscanInsets,
            out Rect outContentInsets, out Rect outVisibleInsets, out Rect outStableInsets,
            out Rect outContentInsets, out Rect outVisibleInsets, out Rect outStableInsets,
            out Configuration outConfig, out Surface outSurface);
            out Rect outOutsets, out Configuration outConfig, out Surface outSurface);


    /**
    /**
     * If a call to relayout() asked to have the surface destroy deferred,
     * If a call to relayout() asked to have the surface destroy deferred,
+4 −2
Original line number Original line Diff line number Diff line
@@ -106,6 +106,7 @@ public class SurfaceView extends View {
    final Rect mOverscanInsets = new Rect();
    final Rect mOverscanInsets = new Rect();
    final Rect mContentInsets = new Rect();
    final Rect mContentInsets = new Rect();
    final Rect mStableInsets = new Rect();
    final Rect mStableInsets = new Rect();
    final Rect mOutsets = new Rect();
    final Configuration mConfiguration = new Configuration();
    final Configuration mConfiguration = new Configuration();


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


        @Override
        @Override
        public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
        public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                Rect visibleInsets, Rect stableInsets, boolean reportDraw,
                Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
                Configuration newConfig) {
                Configuration newConfig) {
            SurfaceView surfaceView = mSurfaceView.get();
            SurfaceView surfaceView = mSurfaceView.get();
            if (surfaceView != null) {
            if (surfaceView != null) {
+15 −0
Original line number Original line Diff line number Diff line
@@ -7359,6 +7359,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        setFlags(OPTIONAL_FITS_SYSTEM_WINDOWS, OPTIONAL_FITS_SYSTEM_WINDOWS);
        setFlags(OPTIONAL_FITS_SYSTEM_WINDOWS, OPTIONAL_FITS_SYSTEM_WINDOWS);
    }
    }
    /**
     * Returns the outsets, which areas of the device that aren't a surface, but we would like to
     * treat them as such.
     * @hide
     */
    public void getOutsets(Rect outOutsetRect) {
        outOutsetRect.set(mAttachInfo.mOutsets);
    }
    /**
    /**
     * Returns the visibility status for this view.
     * Returns the visibility status for this view.
     *
     *
@@ -21537,6 +21546,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
         */
         */
        final Rect mStableInsets = new Rect();
        final Rect mStableInsets = new Rect();
        /**
         * For windows that include areas that are not covered by real surface these are the outsets
         * for real surface.
         */
        final Rect mOutsets = new Rect();
        /**
        /**
         * The internal insets given by this window.  This value is
         * The internal insets given by this window.  This value is
         * supplied by the client (through
         * supplied by the client (through
Loading