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

Commit fd3893de authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Implements the aod appearing transition" into main

parents 7c106245 649a78d2
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -624,6 +624,12 @@ public interface WindowManager extends ViewManager {
     */
    int TRANSIT_FLAG_PHYSICAL_DISPLAY_SWITCH = (1 << 14); // 0x4000

    /**
     * Transition flag: Indicates that aod is showing hidden by entering doze
     * @hide
     */
    int TRANSIT_FLAG_AOD_APPEARING = (1 << 15); // 0x8000

    /**
     * @hide
     */
@@ -643,6 +649,7 @@ public interface WindowManager extends ViewManager {
            TRANSIT_FLAG_KEYGUARD_OCCLUDING,
            TRANSIT_FLAG_KEYGUARD_UNOCCLUDING,
            TRANSIT_FLAG_PHYSICAL_DISPLAY_SWITCH,
            TRANSIT_FLAG_AOD_APPEARING,
    })
    @Retention(RetentionPolicy.SOURCE)
    @interface TransitionFlags {}
@@ -659,7 +666,8 @@ public interface WindowManager extends ViewManager {
            (TRANSIT_FLAG_KEYGUARD_GOING_AWAY
            | TRANSIT_FLAG_KEYGUARD_APPEARING
            | TRANSIT_FLAG_KEYGUARD_OCCLUDING
            | TRANSIT_FLAG_KEYGUARD_UNOCCLUDING);
            | TRANSIT_FLAG_KEYGUARD_UNOCCLUDING
            | TRANSIT_FLAG_AOD_APPEARING);

    /**
     * Remove content mode: Indicates remove content mode is currently not defined.
+3 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import static android.view.Display.INVALID_DISPLAY;
import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_UNSPECIFIED;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_AOD_APPEARING;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_APPEARING;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_NONE;
@@ -405,7 +406,8 @@ public final class TransitionInfo implements Parcelable {
     */
    public boolean hasChangesOrSideEffects() {
        return !mChanges.isEmpty() || isKeyguardGoingAway()
                || (mFlags & TRANSIT_FLAG_KEYGUARD_APPEARING) != 0;
                || (mFlags & TRANSIT_FLAG_KEYGUARD_APPEARING) != 0
                || (mFlags & TRANSIT_FLAG_AOD_APPEARING) != 0;
    }

    /**
+3 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.service.dreams.Flags.dismissDreamOnKeyguardDismiss;
import static android.view.WindowManager.KEYGUARD_VISIBILITY_TRANSIT_FLAGS;
import static android.view.WindowManager.TRANSIT_FLAG_AOD_APPEARING;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_APPEARING;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_LOCKED;
@@ -200,7 +201,8 @@ public class KeyguardTransitionHandler
                    transition, info, startTransaction, finishTransaction, finishCallback);
        }

        if ((info.getFlags() & TRANSIT_FLAG_KEYGUARD_APPEARING) != 0) {
        if ((info.getFlags() & TRANSIT_FLAG_KEYGUARD_APPEARING) != 0
                || (info.getFlags() & TRANSIT_FLAG_AOD_APPEARING) != 0) {
            return startAnimation(mAppearTransition, "appearing",
                    transition, info, startTransaction, finishTransaction, finishCallback);
        }
+16 −0
Original line number Diff line number Diff line
@@ -6635,6 +6635,22 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                .getKeyguardController().isKeyguardLocked(mDisplayId);
    }

    boolean isKeyguardLockedOrAodShowing() {
        return isKeyguardLocked() || isAodShowing();
    }

    /**
     * @return whether aod is showing for this display
     */
    boolean isAodShowing() {
        final boolean isAodShowing = mRootWindowContainer.mTaskSupervisor
                .getKeyguardController().isAodShowing(mDisplayId);
        if (mDisplayId == DEFAULT_DISPLAY && isAodShowing) {
            return !isKeyguardGoingAway();
        }
        return isAodShowing;
    }

    /**
     * @return whether keyguard is going away on this display
     */
+18 −6
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.wm;

import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManager.TRANSIT_FLAG_AOD_APPEARING;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_APPEARING;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION;
@@ -216,6 +217,9 @@ class KeyguardController {
                } else if (keyguardShowing && !state.mKeyguardShowing) {
                    transition.addFlag(TRANSIT_FLAG_KEYGUARD_APPEARING);
                }
                if (mWindowManager.mFlags.mAodTransition && aodShowing && !state.mAodShowing) {
                    transition.addFlag(TRANSIT_FLAG_AOD_APPEARING);
                }
            }
        }
        // Update the task snapshot if the screen will not be turned off. To make sure that the
@@ -238,19 +242,27 @@ class KeyguardController {
        state.mAodShowing = aodShowing;
        state.writeEventLog("setKeyguardShown");

        if (keyguardChanged || aodChanged) {
            if (keyguardChanged) {
                // Irrelevant to AOD.
                state.mKeyguardGoingAway = false;
                if (keyguardShowing) {
                    state.mDismissalRequested = false;
                }
            }
            if (goingAwayRemoved
                    || (keyguardShowing && !Display.isOffState(dc.getDisplayInfo().state))) {
                    || (keyguardShowing && !Display.isOffState(dc.getDisplayInfo().state))
                    || (mWindowManager.mFlags.mAodTransition && aodShowing)) {
                // Keyguard decided to show or stopped going away. Send a transition to animate back
                // to the locked state before holding the sleep token again
                if (!ENABLE_NEW_KEYGUARD_SHELL_TRANSITIONS) {
                    dc.requestTransitionAndLegacyPrepare(
                            TRANSIT_TO_FRONT, TRANSIT_FLAG_KEYGUARD_APPEARING);
                    if (mWindowManager.mFlags.mAodTransition && aodShowing
                            && dc.mTransitionController.isCollecting()) {
                        dc.mTransitionController.getCollectingTransition().addFlag(
                                TRANSIT_FLAG_AOD_APPEARING);
                    }
                }
                dc.mWallpaperController.adjustWallpaperWindows();
                dc.executeAppTransition();
Loading