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

Commit 78d41729 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Remove window replacement" into udc-dev am: 405fbab6

parents e7b66b9a 405fbab6
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -5840,26 +5840,6 @@ public final class ActivityThread extends ClientTransactionHandler

        r.activity.mChangingConfigurations = true;

        // If we are preserving the main window across relaunches we would also like to preserve
        // the children. However the client side view system does not support preserving
        // the child views so we notify the window manager to expect these windows to
        // be replaced and defer requests to destroy or hide them. This way we can achieve
        // visual continuity. It's important that we do this here prior to pause and destroy
        // as that is when we may hide or remove the child views.
        //
        // There is another scenario, if we have decided locally to relaunch the app from a
        // call to recreate, then none of the windows will be prepared for replacement or
        // preserved by the server, so we want to notify it that we are preparing to replace
        // everything
        try {
            if (r.mPreserveWindow) {
                WindowManagerGlobal.getWindowSession().prepareToReplaceWindows(
                        r.token, true /* childrenOnly */);
            }
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }

        handleRelaunchActivityInner(r, configChanges, tmp.pendingResults, tmp.pendingIntents,
                pendingActions, tmp.startsNotResumed, tmp.overrideConfig, "handleRelaunchActivity");
    }
+0 −10
Original line number Diff line number Diff line
@@ -110,16 +110,6 @@ interface IWindowSession {
            int requestedWidth, int requestedHeight, int viewVisibility, int flags, int seq,
            int lastSyncSeqId);

    /*
     * Notify the window manager that an application is relaunching and
     * windows should be prepared for replacement.
     *
     * @param appToken The application
     * @param childrenOnly Whether to only prepare child windows for replacement
     * (for example when main windows are being reused via preservation).
     */
    oneway void prepareToReplaceWindows(IBinder appToken, boolean childrenOnly);

    /**
     * Called by a client to report that it ran out of graphics memory.
     */
+29 −45
Original line number Diff line number Diff line
@@ -2812,7 +2812,7 @@ public interface WindowManager extends ViewManager {
         *
         * @hide
         */
        public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 0x00000002;
        public static final int PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED = 1 << 1;

        /**
         * By default, wallpapers are sent new offsets when the wallpaper is scrolled. Wallpapers
@@ -2823,7 +2823,7 @@ public interface WindowManager extends ViewManager {
         *
         * @hide
         */
        public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 0x00000004;
        public static final int PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS = 1 << 2;

        /**
         * When set {@link LayoutParams#TYPE_APPLICATION_OVERLAY} windows will stay visible, even if
@@ -2832,7 +2832,7 @@ public interface WindowManager extends ViewManager {
         * @hide
         */
        @RequiresPermission(permission.SYSTEM_APPLICATION_OVERLAY)
        public static final int PRIVATE_FLAG_SYSTEM_APPLICATION_OVERLAY = 0x00000008;
        public static final int PRIVATE_FLAG_SYSTEM_APPLICATION_OVERLAY = 1 << 3;

        /** In a multiuser system if this flag is set and the owner is a system process then this
         * window will appear on all user screens. This overrides the default behavior of window
@@ -2842,7 +2842,7 @@ public interface WindowManager extends ViewManager {
         * {@hide} */
        @SystemApi
        @RequiresPermission(permission.INTERNAL_SYSTEM_WINDOW)
        public static final int SYSTEM_FLAG_SHOW_FOR_ALL_USERS = 0x00000010;
        public static final int SYSTEM_FLAG_SHOW_FOR_ALL_USERS = 1 << 4;

        /**
         * Flag to allow this window to have unrestricted gesture exclusion.
@@ -2850,7 +2850,7 @@ public interface WindowManager extends ViewManager {
         * @see View#setSystemGestureExclusionRects(List)
         * @hide
         */
        public static final int PRIVATE_FLAG_UNRESTRICTED_GESTURE_EXCLUSION = 0x00000020;
        public static final int PRIVATE_FLAG_UNRESTRICTED_GESTURE_EXCLUSION = 1 << 5;

        /**
         * Never animate position changes of the window.
@@ -2859,20 +2859,20 @@ public interface WindowManager extends ViewManager {
         * {@hide}
         */
        @UnsupportedAppUsage
        public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 0x00000040;
        public static final int PRIVATE_FLAG_NO_MOVE_ANIMATION = 1 << 6;

        /** Window flag: special flag to limit the size of the window to be
         * original size ([320x480] x density). Used to create window for applications
         * running under compatibility mode.
         *
         * {@hide} */
        public static final int PRIVATE_FLAG_COMPATIBLE_WINDOW = 0x00000080;
        public static final int PRIVATE_FLAG_COMPATIBLE_WINDOW = 1 << 7;

        /** Window flag: a special option intended for system dialogs.  When
         * this flag is set, the window will demand focus unconditionally when
         * it is created.
         * {@hide} */
        public static final int PRIVATE_FLAG_SYSTEM_ERROR = 0x00000100;
        public static final int PRIVATE_FLAG_SYSTEM_ERROR = 1 << 8;

        /**
         * Flag to indicate that the view hierarchy of the window can only be measured when
@@ -2881,14 +2881,14 @@ public interface WindowManager extends ViewManager {
         * views. This reduces the chances to perform measure.
         * {@hide}
         */
        public static final int PRIVATE_FLAG_OPTIMIZE_MEASURE = 0x00000200;
        public static final int PRIVATE_FLAG_OPTIMIZE_MEASURE = 1 << 9;

        /**
         * Flag that prevents the wallpaper behind the current window from receiving touch events.
         *
         * {@hide}
         */
        public static final int PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS = 0x00000800;
        public static final int PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS = 1 << 10;

        /**
         * Flag to force the status bar window to be visible all the time. If the bar is hidden when
@@ -2897,7 +2897,7 @@ public interface WindowManager extends ViewManager {
         *
         * {@hide}
         */
        public static final int PRIVATE_FLAG_FORCE_SHOW_STATUS_BAR = 0x00001000;
        public static final int PRIVATE_FLAG_FORCE_SHOW_STATUS_BAR = 1 << 11;

        /**
         * Flag to indicate that the window frame should be the requested frame adding the display
@@ -2907,7 +2907,7 @@ public interface WindowManager extends ViewManager {
         *
         * {@hide}
         */
        public static final int PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT = 0x00002000;
        public static final int PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT = 1 << 12;

        /**
         * Flag that will make window ignore app visibility and instead depend purely on the decor
@@ -2915,39 +2915,28 @@ public interface WindowManager extends ViewManager {
         * drawing after it launches an app.
         * @hide
         */
        public static final int PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY = 0x00004000;

        /**
         * Flag to indicate that this window is not expected to be replaced across
         * configuration change triggered activity relaunches. In general the WindowManager
         * expects Windows to be replaced after relaunch, and thus it will preserve their surfaces
         * until the replacement is ready to show in order to prevent visual glitch. However
         * some windows, such as PopupWindows expect to be cleared across configuration change,
         * and thus should hint to the WindowManager that it should not wait for a replacement.
         * @hide
         */
        public static final int PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH = 0x00008000;
        public static final int PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY = 1 << 13;

        /**
         * Flag to indicate that this child window should always be laid-out in the parent
         * frame regardless of the current windowing mode configuration.
         * @hide
         */
        public static final int PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME = 0x00010000;
        public static final int PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME = 1 << 14;

        /**
         * Flag to indicate that this window is always drawing the status bar background, no matter
         * what the other flags are.
         * @hide
         */
        public static final int PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS = 0x00020000;
        public static final int PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS = 1 << 15;

        /**
         * Flag to indicate that this window needs Sustained Performance Mode if
         * the device supports it.
         * @hide
         */
        public static final int PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE = 0x00040000;
        public static final int PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE = 1 << 16;

        /**
         * Flag to indicate that any window added by an application process that is of type
@@ -2958,7 +2947,7 @@ public interface WindowManager extends ViewManager {
         */
        @SystemApi
        @RequiresPermission(permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS)
        public static final int SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS = 0x00080000;
        public static final int SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS = 1 << 19;

        /**
         * Indicates that this window is the rounded corners overlay present on some
@@ -2966,7 +2955,7 @@ public interface WindowManager extends ViewManager {
         * screen magnification, and mirroring.
         * @hide
         */
        public static final int PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY = 0x00100000;
        public static final int PRIVATE_FLAG_IS_ROUNDED_CORNERS_OVERLAY = 1 << 20;

        /**
         * Flag to indicate that this window will be excluded while computing the magnifiable region
@@ -2980,7 +2969,7 @@ public interface WindowManager extends ViewManager {
         * </p><p>
         * @hide
         */
        public static final int PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION = 0x00200000;
        public static final int PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION = 1 << 21;

        /**
         * Flag to prevent the window from being magnified by the accessibility magnifier.
@@ -2988,7 +2977,7 @@ public interface WindowManager extends ViewManager {
         * TODO(b/190623172): This is a temporary solution and need to find out another way instead.
         * @hide
         */
        public static final int PRIVATE_FLAG_NOT_MAGNIFIABLE = 0x00400000;
        public static final int PRIVATE_FLAG_NOT_MAGNIFIABLE = 1 << 22;

        /**
         * Flag to indicate that the status bar window is in a state such that it forces showing
@@ -2997,54 +2986,54 @@ public interface WindowManager extends ViewManager {
         * It only takes effects if this is set by {@link LayoutParams#TYPE_STATUS_BAR}.
         * @hide
         */
        public static final int PRIVATE_FLAG_STATUS_FORCE_SHOW_NAVIGATION = 0x00800000;
        public static final int PRIVATE_FLAG_STATUS_FORCE_SHOW_NAVIGATION = 1 << 23;

        /**
         * Flag to indicate that the window is color space agnostic, and the color can be
         * interpreted to any color space.
         * @hide
         */
        public static final int PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC = 0x01000000;
        public static final int PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC = 1 << 24;

        /**
         * Flag to request creation of a BLAST (Buffer as LayerState) Layer.
         * If not specified the client will receive a BufferQueue layer.
         * @hide
         */
        public static final int PRIVATE_FLAG_USE_BLAST = 0x02000000;
        public static final int PRIVATE_FLAG_USE_BLAST = 1 << 25;

        /**
         * Flag to indicate that the window is controlling the appearance of system bars. So we
         * don't need to adjust it by reading its system UI flags for compatibility.
         * @hide
         */
        public static final int PRIVATE_FLAG_APPEARANCE_CONTROLLED = 0x04000000;
        public static final int PRIVATE_FLAG_APPEARANCE_CONTROLLED = 1 << 26;

        /**
         * Flag to indicate that the window is controlling the behavior of system bars. So we don't
         * need to adjust it by reading its window flags or system UI flags for compatibility.
         * @hide
         */
        public static final int PRIVATE_FLAG_BEHAVIOR_CONTROLLED = 0x08000000;
        public static final int PRIVATE_FLAG_BEHAVIOR_CONTROLLED = 1 << 27;

        /**
         * Flag to indicate that the window is controlling how it fits window insets on its own.
         * So we don't need to adjust its attributes for fitting window insets.
         * @hide
         */
        public static final int PRIVATE_FLAG_FIT_INSETS_CONTROLLED = 0x10000000;
        public static final int PRIVATE_FLAG_FIT_INSETS_CONTROLLED = 1 << 28;

        /**
         * Flag to indicate that the window is a trusted overlay.
         * @hide
         */
        public static final int PRIVATE_FLAG_TRUSTED_OVERLAY = 0x20000000;
        public static final int PRIVATE_FLAG_TRUSTED_OVERLAY = 1 << 29;

        /**
         * Flag to indicate that the parent frame of a window should be inset by IME.
         * @hide
         */
        public static final int PRIVATE_FLAG_INSET_PARENT_FRAME_BY_IME = 0x40000000;
        public static final int PRIVATE_FLAG_INSET_PARENT_FRAME_BY_IME = 1 << 30;

        /**
         * Flag to indicate that we want to intercept and handle global drag and drop for all users.
@@ -3059,7 +3048,7 @@ public interface WindowManager extends ViewManager {
         * @hide
         */
        @RequiresPermission(permission.MANAGE_ACTIVITY_TASKS)
        public static final int PRIVATE_FLAG_INTERCEPT_GLOBAL_DRAG_AND_DROP = 0x80000000;
        public static final int PRIVATE_FLAG_INTERCEPT_GLOBAL_DRAG_AND_DROP = 1 << 31;

        /**
         * An internal annotation for flags that can be specified to {@link #softInputMode}.
@@ -3090,7 +3079,6 @@ public interface WindowManager extends ViewManager {
                PRIVATE_FLAG_FORCE_SHOW_STATUS_BAR,
                PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT,
                PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY,
                PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH,
                PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME,
                PRIVATE_FLAG_FORCE_DRAW_BAR_BACKGROUNDS,
                PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE,
@@ -3165,10 +3153,6 @@ public interface WindowManager extends ViewManager {
                        mask = PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY,
                        equals = PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY,
                        name = "FORCE_DECOR_VIEW_VISIBILITY"),
                @ViewDebug.FlagToString(
                        mask = PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH,
                        equals = PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH,
                        name = "WILL_NOT_REPLACE_ON_RELAUNCH"),
                @ViewDebug.FlagToString(
                        mask = PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME,
                        equals = PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME,
+0 −4
Original line number Diff line number Diff line
@@ -414,10 +414,6 @@ public class WindowlessWindowManager implements IWindowSession {
                null /* outActiveControls */, null /* outSyncSeqIdBundle */);
    }

    @Override
    public void prepareToReplaceWindows(android.os.IBinder appToken, boolean childrenOnly) {
    }

    @Override
    public boolean outOfMemory(android.view.IWindow window) {
        return false;
+1 −3
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package android.widget;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -1644,8 +1643,7 @@ public class PopupWindow {
            p.width = mLastWidth = mWidth;
        }

        p.privateFlags = PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH
                | PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME;
        p.privateFlags = PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME;

        // Used for debugging.
        p.setTitle("PopupWindow:" + Integer.toHexString(hashCode()));
Loading