Loading core/java/android/service/wallpaper/WallpaperService.java +1 −1 Original line number Diff line number Diff line Loading @@ -392,7 +392,7 @@ public abstract class WallpaperService extends Service { @Override public void resized(ClientWindowFrames frames, boolean reportDraw, MergedConfiguration mergedConfiguration, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int syncSeqId) { boolean alwaysConsumeSystemBars, int displayId, int syncSeqId, int resizeMode) { Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED, reportDraw ? 1 : 0, mergedConfiguration); Loading core/java/android/view/IWindow.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ oneway interface IWindow { void resized(in ClientWindowFrames frames, boolean reportDraw, in MergedConfiguration newMergedConfiguration, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int syncSeqId); int syncSeqId, int resizeMode); /** * Called when the window insets configuration has changed. Loading core/java/android/view/ViewRootImpl.java +16 −20 Original line number Diff line number Diff line Loading @@ -53,8 +53,8 @@ import static android.view.ViewRootImplProto.WIDTH; import static android.view.ViewRootImplProto.WINDOW_ATTRIBUTES; import static android.view.ViewRootImplProto.WIN_FRAME; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION; import static android.view.WindowCallbacks.RESIZE_MODE_DOCKED_DIVIDER; import static android.view.WindowCallbacks.RESIZE_MODE_FREEFORM; import static android.view.WindowCallbacks.RESIZE_MODE_INVALID; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; Loading Loading @@ -85,8 +85,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_ADDITIONAL import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ALERT; import static android.view.WindowManager.LayoutParams.TYPE_TOAST; import static android.view.WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY; import static android.view.WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_DOCKED; import static android.view.WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_FREEFORM; import static android.view.WindowManagerGlobal.RELAYOUT_RES_SURFACE_CHANGED; import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.IME_FOCUS_CONTROLLER; import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.INSETS_CONTROLLER; Loading Loading @@ -503,9 +501,10 @@ public final class ViewRootImpl implements ViewParent, public boolean mIsAnimating; private boolean mUseMTRenderer; private boolean mPendingDragResizing; private boolean mDragResizing; private boolean mInvalidateRootRequested; private int mResizeMode; private int mResizeMode = RESIZE_MODE_INVALID; private int mCanvasOffsetX; private int mCanvasOffsetY; private boolean mActivityRelaunched; Loading Loading @@ -1711,17 +1710,22 @@ public final class ViewRootImpl implements ViewParent, final MergedConfiguration mergedConfiguration = (MergedConfiguration) args.arg2; final boolean forceNextWindowRelayout = args.argi1 != 0; final int displayId = args.argi3; final int resizeMode = args.argi5; final Rect backdropFrame = frames.backdropFrame; final boolean frameChanged = !mWinFrame.equals(frames.frame); final boolean backdropFrameChanged = !mPendingBackDropFrame.equals(backdropFrame); final boolean configChanged = !mLastReportedMergedConfiguration.equals(mergedConfiguration); final boolean displayChanged = mDisplay.getDisplayId() != displayId; final boolean resizeModeChanged = mResizeMode != resizeMode; if (msg == MSG_RESIZED && !frameChanged && !backdropFrameChanged && !configChanged && !displayChanged && !forceNextWindowRelayout) { && !displayChanged && !resizeModeChanged && !forceNextWindowRelayout) { return; } mPendingDragResizing = resizeMode != RESIZE_MODE_INVALID; mResizeMode = resizeMode; if (configChanged) { // If configuration changed - notify about that and, maybe, about move to display. performConfigurationChange(mergedConfiguration, false /* force */, Loading Loading @@ -2920,11 +2924,7 @@ public final class ViewRootImpl implements ViewParent, mViewFrameInfo.flags |= FrameInfo.FLAG_WINDOW_VISIBILITY_CHANGED; } relayoutResult = relayoutWindow(params, viewVisibility, insetsPending); final boolean freeformResizing = (relayoutResult & RELAYOUT_RES_DRAG_RESIZING_FREEFORM) != 0; final boolean dockedResizing = (relayoutResult & RELAYOUT_RES_DRAG_RESIZING_DOCKED) != 0; final boolean dragResizing = freeformResizing || dockedResizing; final boolean dragResizing = mPendingDragResizing; if (mSyncSeqId > mLastSyncSeqId) { mLastSyncSeqId = mSyncSeqId; if (DEBUG_BLAST) { Loading Loading @@ -3065,9 +3065,6 @@ public final class ViewRootImpl implements ViewParent, if (mDragResizing != dragResizing) { if (dragResizing) { mResizeMode = freeformResizing ? RESIZE_MODE_FREEFORM : RESIZE_MODE_DOCKED_DIVIDER; final boolean backdropSizeMatchesFrame = mWinFrame.width() == mPendingBackDropFrame.width() && mWinFrame.height() == mPendingBackDropFrame.height(); Loading Loading @@ -7982,10 +7979,8 @@ public final class ViewRootImpl implements ViewParent, (mDisplayInstallOrientation + mDisplay.getRotation()) % 4); final WindowConfiguration winConfig = getConfiguration().windowConfiguration; final boolean dragResizing = (relayoutResult & (RELAYOUT_RES_DRAG_RESIZING_DOCKED | RELAYOUT_RES_DRAG_RESIZING_FREEFORM)) != 0; WindowLayout.computeSurfaceSize(mWindowAttributes, winConfig.getMaxBounds(), requestedWidth, requestedHeight, mTmpFrames.frame, dragResizing, mSurfaceSize); requestedHeight, mTmpFrames.frame, mPendingDragResizing, mSurfaceSize); final boolean transformHintChanged = transformHint != mLastTransformHint; final boolean sizeChanged = !mLastSurfaceSize.equals(mSurfaceSize); Loading Loading @@ -8476,7 +8471,7 @@ public final class ViewRootImpl implements ViewParent, @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) private void dispatchResized(ClientWindowFrames frames, boolean reportDraw, MergedConfiguration mergedConfiguration, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int seqId) { boolean alwaysConsumeSystemBars, int displayId, int seqId, int resizeMode) { final Rect frame = frames.frame; final Rect backDropFrame = frames.backdropFrame; if (DEBUG_LAYOUT) Log.v(mTag, "Resizing " + this + ": frame=" + frame.toShortString() Loading Loading @@ -8508,6 +8503,7 @@ public final class ViewRootImpl implements ViewParent, args.argi2 = alwaysConsumeSystemBars ? 1 : 0; args.argi3 = displayId; args.argi4 = seqId; args.argi5 = resizeMode; msg.obj = args; mHandler.sendMessage(msg); } Loading Loading @@ -9897,11 +9893,11 @@ public final class ViewRootImpl implements ViewParent, @Override public void resized(ClientWindowFrames frames, boolean reportDraw, MergedConfiguration mergedConfiguration, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int seqId) { boolean alwaysConsumeSystemBars, int displayId, int seqId, int resizeMode) { final ViewRootImpl viewAncestor = mViewAncestor.get(); if (viewAncestor != null) { viewAncestor.dispatchResized(frames, reportDraw, mergedConfiguration, forceLayout, alwaysConsumeSystemBars, displayId, seqId); alwaysConsumeSystemBars, displayId, seqId, resizeMode); } } Loading core/java/android/view/WindowCallbacks.java +15 −3 Original line number Diff line number Diff line Loading @@ -28,9 +28,21 @@ import android.graphics.Rect; */ public interface WindowCallbacks { public static final int RESIZE_MODE_INVALID = -1; public static final int RESIZE_MODE_FREEFORM = 0; public static final int RESIZE_MODE_DOCKED_DIVIDER = 1; int RESIZE_MODE_INVALID = -1; /** * The window is being resized by dragging one of the window corners, * in this case the surface would be fullscreen-sized. The client should * render to the actual frame location (instead of (0,curScrollY)). */ int RESIZE_MODE_FREEFORM = 0; /** * The window is being resized by dragging on the docked divider. The client should render * at (0, 0) and extend its background to the background frame passed into * {@link IWindow#resized}. */ int RESIZE_MODE_DOCKED_DIVIDER = 1; /** * Called by the system when the window got changed by the user, before the layouter got called. Loading core/java/android/view/WindowManagerGlobal.java +2 −16 Original line number Diff line number Diff line Loading @@ -70,31 +70,17 @@ public final class WindowManagerGlobal { */ public static final int RELAYOUT_RES_SURFACE_CHANGED = 1 << 1; /** * The window is being resized by dragging on the docked divider. The client should render * at (0, 0) and extend its background to the background frame passed into * {@link IWindow#resized}. */ public static final int RELAYOUT_RES_DRAG_RESIZING_DOCKED = 1 << 2; /** * The window is being resized by dragging one of the window corners, * in this case the surface would be fullscreen-sized. The client should * render to the actual frame location (instead of (0,curScrollY)). */ public static final int RELAYOUT_RES_DRAG_RESIZING_FREEFORM = 1 << 3; /** * The window manager has changed the size of the surface from the last call. */ public static final int RELAYOUT_RES_SURFACE_RESIZED = 1 << 4; public static final int RELAYOUT_RES_SURFACE_RESIZED = 1 << 2; /** * In multi-window we force show the system bars. Because we don't want that the surface size * changes in this mode, we instead have a flag whether the system bar sizes should always be * consumed, so the app is treated like there is no virtual system bars at all. */ public static final int RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS = 1 << 5; public static final int RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS = 1 << 3; /** * Flag for relayout: the client will be later giving Loading Loading
core/java/android/service/wallpaper/WallpaperService.java +1 −1 Original line number Diff line number Diff line Loading @@ -392,7 +392,7 @@ public abstract class WallpaperService extends Service { @Override public void resized(ClientWindowFrames frames, boolean reportDraw, MergedConfiguration mergedConfiguration, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int syncSeqId) { boolean alwaysConsumeSystemBars, int displayId, int syncSeqId, int resizeMode) { Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED, reportDraw ? 1 : 0, mergedConfiguration); Loading
core/java/android/view/IWindow.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ oneway interface IWindow { void resized(in ClientWindowFrames frames, boolean reportDraw, in MergedConfiguration newMergedConfiguration, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int syncSeqId); int syncSeqId, int resizeMode); /** * Called when the window insets configuration has changed. Loading
core/java/android/view/ViewRootImpl.java +16 −20 Original line number Diff line number Diff line Loading @@ -53,8 +53,8 @@ import static android.view.ViewRootImplProto.WIDTH; import static android.view.ViewRootImplProto.WINDOW_ATTRIBUTES; import static android.view.ViewRootImplProto.WIN_FRAME; import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION; import static android.view.WindowCallbacks.RESIZE_MODE_DOCKED_DIVIDER; import static android.view.WindowCallbacks.RESIZE_MODE_FREEFORM; import static android.view.WindowCallbacks.RESIZE_MODE_INVALID; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; Loading Loading @@ -85,8 +85,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_ADDITIONAL import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ALERT; import static android.view.WindowManager.LayoutParams.TYPE_TOAST; import static android.view.WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY; import static android.view.WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_DOCKED; import static android.view.WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING_FREEFORM; import static android.view.WindowManagerGlobal.RELAYOUT_RES_SURFACE_CHANGED; import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.IME_FOCUS_CONTROLLER; import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.INSETS_CONTROLLER; Loading Loading @@ -503,9 +501,10 @@ public final class ViewRootImpl implements ViewParent, public boolean mIsAnimating; private boolean mUseMTRenderer; private boolean mPendingDragResizing; private boolean mDragResizing; private boolean mInvalidateRootRequested; private int mResizeMode; private int mResizeMode = RESIZE_MODE_INVALID; private int mCanvasOffsetX; private int mCanvasOffsetY; private boolean mActivityRelaunched; Loading Loading @@ -1711,17 +1710,22 @@ public final class ViewRootImpl implements ViewParent, final MergedConfiguration mergedConfiguration = (MergedConfiguration) args.arg2; final boolean forceNextWindowRelayout = args.argi1 != 0; final int displayId = args.argi3; final int resizeMode = args.argi5; final Rect backdropFrame = frames.backdropFrame; final boolean frameChanged = !mWinFrame.equals(frames.frame); final boolean backdropFrameChanged = !mPendingBackDropFrame.equals(backdropFrame); final boolean configChanged = !mLastReportedMergedConfiguration.equals(mergedConfiguration); final boolean displayChanged = mDisplay.getDisplayId() != displayId; final boolean resizeModeChanged = mResizeMode != resizeMode; if (msg == MSG_RESIZED && !frameChanged && !backdropFrameChanged && !configChanged && !displayChanged && !forceNextWindowRelayout) { && !displayChanged && !resizeModeChanged && !forceNextWindowRelayout) { return; } mPendingDragResizing = resizeMode != RESIZE_MODE_INVALID; mResizeMode = resizeMode; if (configChanged) { // If configuration changed - notify about that and, maybe, about move to display. performConfigurationChange(mergedConfiguration, false /* force */, Loading Loading @@ -2920,11 +2924,7 @@ public final class ViewRootImpl implements ViewParent, mViewFrameInfo.flags |= FrameInfo.FLAG_WINDOW_VISIBILITY_CHANGED; } relayoutResult = relayoutWindow(params, viewVisibility, insetsPending); final boolean freeformResizing = (relayoutResult & RELAYOUT_RES_DRAG_RESIZING_FREEFORM) != 0; final boolean dockedResizing = (relayoutResult & RELAYOUT_RES_DRAG_RESIZING_DOCKED) != 0; final boolean dragResizing = freeformResizing || dockedResizing; final boolean dragResizing = mPendingDragResizing; if (mSyncSeqId > mLastSyncSeqId) { mLastSyncSeqId = mSyncSeqId; if (DEBUG_BLAST) { Loading Loading @@ -3065,9 +3065,6 @@ public final class ViewRootImpl implements ViewParent, if (mDragResizing != dragResizing) { if (dragResizing) { mResizeMode = freeformResizing ? RESIZE_MODE_FREEFORM : RESIZE_MODE_DOCKED_DIVIDER; final boolean backdropSizeMatchesFrame = mWinFrame.width() == mPendingBackDropFrame.width() && mWinFrame.height() == mPendingBackDropFrame.height(); Loading Loading @@ -7982,10 +7979,8 @@ public final class ViewRootImpl implements ViewParent, (mDisplayInstallOrientation + mDisplay.getRotation()) % 4); final WindowConfiguration winConfig = getConfiguration().windowConfiguration; final boolean dragResizing = (relayoutResult & (RELAYOUT_RES_DRAG_RESIZING_DOCKED | RELAYOUT_RES_DRAG_RESIZING_FREEFORM)) != 0; WindowLayout.computeSurfaceSize(mWindowAttributes, winConfig.getMaxBounds(), requestedWidth, requestedHeight, mTmpFrames.frame, dragResizing, mSurfaceSize); requestedHeight, mTmpFrames.frame, mPendingDragResizing, mSurfaceSize); final boolean transformHintChanged = transformHint != mLastTransformHint; final boolean sizeChanged = !mLastSurfaceSize.equals(mSurfaceSize); Loading Loading @@ -8476,7 +8471,7 @@ public final class ViewRootImpl implements ViewParent, @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) private void dispatchResized(ClientWindowFrames frames, boolean reportDraw, MergedConfiguration mergedConfiguration, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int seqId) { boolean alwaysConsumeSystemBars, int displayId, int seqId, int resizeMode) { final Rect frame = frames.frame; final Rect backDropFrame = frames.backdropFrame; if (DEBUG_LAYOUT) Log.v(mTag, "Resizing " + this + ": frame=" + frame.toShortString() Loading Loading @@ -8508,6 +8503,7 @@ public final class ViewRootImpl implements ViewParent, args.argi2 = alwaysConsumeSystemBars ? 1 : 0; args.argi3 = displayId; args.argi4 = seqId; args.argi5 = resizeMode; msg.obj = args; mHandler.sendMessage(msg); } Loading Loading @@ -9897,11 +9893,11 @@ public final class ViewRootImpl implements ViewParent, @Override public void resized(ClientWindowFrames frames, boolean reportDraw, MergedConfiguration mergedConfiguration, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int seqId) { boolean alwaysConsumeSystemBars, int displayId, int seqId, int resizeMode) { final ViewRootImpl viewAncestor = mViewAncestor.get(); if (viewAncestor != null) { viewAncestor.dispatchResized(frames, reportDraw, mergedConfiguration, forceLayout, alwaysConsumeSystemBars, displayId, seqId); alwaysConsumeSystemBars, displayId, seqId, resizeMode); } } Loading
core/java/android/view/WindowCallbacks.java +15 −3 Original line number Diff line number Diff line Loading @@ -28,9 +28,21 @@ import android.graphics.Rect; */ public interface WindowCallbacks { public static final int RESIZE_MODE_INVALID = -1; public static final int RESIZE_MODE_FREEFORM = 0; public static final int RESIZE_MODE_DOCKED_DIVIDER = 1; int RESIZE_MODE_INVALID = -1; /** * The window is being resized by dragging one of the window corners, * in this case the surface would be fullscreen-sized. The client should * render to the actual frame location (instead of (0,curScrollY)). */ int RESIZE_MODE_FREEFORM = 0; /** * The window is being resized by dragging on the docked divider. The client should render * at (0, 0) and extend its background to the background frame passed into * {@link IWindow#resized}. */ int RESIZE_MODE_DOCKED_DIVIDER = 1; /** * Called by the system when the window got changed by the user, before the layouter got called. Loading
core/java/android/view/WindowManagerGlobal.java +2 −16 Original line number Diff line number Diff line Loading @@ -70,31 +70,17 @@ public final class WindowManagerGlobal { */ public static final int RELAYOUT_RES_SURFACE_CHANGED = 1 << 1; /** * The window is being resized by dragging on the docked divider. The client should render * at (0, 0) and extend its background to the background frame passed into * {@link IWindow#resized}. */ public static final int RELAYOUT_RES_DRAG_RESIZING_DOCKED = 1 << 2; /** * The window is being resized by dragging one of the window corners, * in this case the surface would be fullscreen-sized. The client should * render to the actual frame location (instead of (0,curScrollY)). */ public static final int RELAYOUT_RES_DRAG_RESIZING_FREEFORM = 1 << 3; /** * The window manager has changed the size of the surface from the last call. */ public static final int RELAYOUT_RES_SURFACE_RESIZED = 1 << 4; public static final int RELAYOUT_RES_SURFACE_RESIZED = 1 << 2; /** * In multi-window we force show the system bars. Because we don't want that the surface size * changes in this mode, we instead have a flag whether the system bar sizes should always be * consumed, so the app is treated like there is no virtual system bars at all. */ public static final int RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS = 1 << 5; public static final int RELAYOUT_RES_CONSUME_ALWAYS_SYSTEM_BARS = 1 << 3; /** * Flag for relayout: the client will be later giving Loading