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

Commit e4f90a96 authored by Tiger Huang's avatar Tiger Huang Committed by Android (Google) Code Review
Browse files

Merge "Create a private flag to control shouldOptimizeMeasure" into tm-qpr-dev

parents 5bdad5d5 eff38fb3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FIT_INSETS_CO
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_INSET_PARENT_FRAME_BY_IME;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
@@ -2766,7 +2767,7 @@ public final class ViewRootImpl implements ViewParent,
     * TODO(b/260382739): Apply this to all windows.
     */
    private static boolean shouldOptimizeMeasure(final WindowManager.LayoutParams lp) {
        return lp.type == TYPE_NOTIFICATION_SHADE;
        return (lp.privateFlags & PRIVATE_FLAG_OPTIMIZE_MEASURE) != 0;
    }

    private Rect getWindowBoundsInsetSystemBars() {
+14 −0
Original line number Diff line number Diff line
@@ -2579,6 +2579,15 @@ public interface WindowManager extends ViewManager {
         * {@hide} */
        public static final int PRIVATE_FLAG_SYSTEM_ERROR = 0x00000100;

        /**
         * Flag to indicate that the view hierarchy of the window can only be measured when
         * necessary. If a window size can be known by the LayoutParams, we can use the size to
         * relayout window, and we don't have to measure the view hierarchy before laying out the
         * views. This reduces the chances to perform measure.
         * {@hide}
         */
        public static final int PRIVATE_FLAG_OPTIMIZE_MEASURE = 0x00000200;

        /**
         * Flag that prevents the wallpaper behind the current window from receiving touch events.
         *
@@ -2781,6 +2790,7 @@ public interface WindowManager extends ViewManager {
                PRIVATE_FLAG_NO_MOVE_ANIMATION,
                PRIVATE_FLAG_COMPATIBLE_WINDOW,
                PRIVATE_FLAG_SYSTEM_ERROR,
                PRIVATE_FLAG_OPTIMIZE_MEASURE,
                PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS,
                PRIVATE_FLAG_FORCE_SHOW_STATUS_BAR,
                PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT,
@@ -2840,6 +2850,10 @@ public interface WindowManager extends ViewManager {
                        mask = PRIVATE_FLAG_SYSTEM_ERROR,
                        equals = PRIVATE_FLAG_SYSTEM_ERROR,
                        name = "SYSTEM_ERROR"),
                @ViewDebug.FlagToString(
                        mask = PRIVATE_FLAG_OPTIMIZE_MEASURE,
                        equals = PRIVATE_FLAG_OPTIMIZE_MEASURE,
                        name = "OPTIMIZE_MEASURE"),
                @ViewDebug.FlagToString(
                        mask = PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS,
                        equals = PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS,
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.shade;
import static android.view.WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_BEHAVIOR_CONTROLLED;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_OPTIMIZE_MEASURE;

import static com.android.systemui.DejankUtils.whitelistIpcs;
import static com.android.systemui.statusbar.NotificationRemoteInputManager.ENABLE_REMOTE_INPUT;
@@ -251,6 +252,7 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
        mLp.setTitle("NotificationShade");
        mLp.packageName = mContext.getPackageName();
        mLp.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
        mLp.privateFlags |= PRIVATE_FLAG_OPTIMIZE_MEASURE;

        // We use BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE here, however, there is special logic in
        // window manager which disables the transient show behavior.