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

Commit f8ee7198 authored by Robin Lee's avatar Robin Lee Committed by Automerger Merge Worker
Browse files

Merge "Report keyguard changes even with display changes" into udc-dev am:...

Merge "Report keyguard changes even with display changes" into udc-dev am: b0ed44a8 am: a3a43ebe

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22813618



Change-Id: I47714d20bb580d89389b2179cae71d71f5ef4175
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ab86903a a3a43ebe
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -94,9 +94,11 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler {
            @NonNull SurfaceControl.Transaction startTransaction,
            @NonNull SurfaceControl.Transaction startTransaction,
            @NonNull SurfaceControl.Transaction finishTransaction,
            @NonNull SurfaceControl.Transaction finishTransaction,
            @NonNull Transitions.TransitionFinishCallback finishCallback) {
            @NonNull Transitions.TransitionFinishCallback finishCallback) {
        if (!Transitions.SHELL_TRANSITIONS_ROTATION && TransitionUtil.hasDisplayChange(info)) {
        if (!Transitions.SHELL_TRANSITIONS_ROTATION && TransitionUtil.hasDisplayChange(info)
                && !TransitionUtil.alwaysReportToKeyguard(info)) {
            // Note that if the remote doesn't have permission ACCESS_SURFACE_FLINGER, some
            // Note that if the remote doesn't have permission ACCESS_SURFACE_FLINGER, some
            // operations of the start transaction may be ignored.
            // operations of the start transaction may be ignored.
            mRequestedRemotes.remove(transition);
            return false;
            return false;
        }
        }
        RemoteTransition pendingRemote = mRequestedRemotes.get(transition);
        RemoteTransition pendingRemote = mRequestedRemotes.get(transition);
+1 −18
Original line number Original line Diff line number Diff line
@@ -650,7 +650,7 @@ public class Transitions implements RemoteCallable<Transitions> {
                    active.mToken, info, active.mStartT, active.mFinishT);
                    active.mToken, info, active.mStartT, active.mFinishT);
        }
        }


        if (info.getRootCount() == 0 && !alwaysReportToKeyguard(info)) {
        if (info.getRootCount() == 0 && !TransitionUtil.alwaysReportToKeyguard(info)) {
            // No root-leashes implies that the transition is empty/no-op, so just do
            // No root-leashes implies that the transition is empty/no-op, so just do
            // housekeeping and return.
            // housekeeping and return.
            ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "No transition roots in %s so"
            ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, "No transition roots in %s so"
@@ -699,23 +699,6 @@ public class Transitions implements RemoteCallable<Transitions> {
        return true;
        return true;
    }
    }


    /**
     * Some transitions we always need to report to keyguard even if they are empty.
     * TODO (b/274954192): Remove this once keyguard dispatching moves to Shell.
     */
    private static boolean alwaysReportToKeyguard(TransitionInfo info) {
        // occlusion status of activities can change while screen is off so there will be no
        // visibility change but we still need keyguardservice to be notified.
        if (info.getType() == TRANSIT_KEYGUARD_UNOCCLUDE) return true;

        // It's possible for some activities to stop with bad timing (esp. since we can't yet
        // queue activity transitions initiated by apps) that results in an empty transition for
        // keyguard going-away. In general, we should should always report Keyguard-going-away.
        if ((info.getFlags() & TRANSIT_FLAG_KEYGUARD_GOING_AWAY) != 0) return true;

        return false;
    }

    private boolean areTracksIdle() {
    private boolean areTracksIdle() {
        for (int i = 0; i < mTracks.size(); ++i) {
        for (int i = 0; i < mTracks.size(); ++i) {
            if (!mTracks.get(i).isIdle()) return false;
            if (!mTracks.get(i).isIdle()) return false;
+19 −0
Original line number Original line Diff line number Diff line
@@ -24,7 +24,9 @@ import static android.view.WindowManager.LayoutParams.INVALID_WINDOW_TYPE;
import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
@@ -77,6 +79,23 @@ public class TransitionUtil {
        return false;
        return false;
    }
    }


    /**
     * Some transitions we always need to report to keyguard even if they are empty.
     * TODO (b/274954192): Remove this once keyguard dispatching moves to Shell.
     */
    public static boolean alwaysReportToKeyguard(TransitionInfo info) {
        // occlusion status of activities can change while screen is off so there will be no
        // visibility change but we still need keyguardservice to be notified.
        if (info.getType() == TRANSIT_KEYGUARD_UNOCCLUDE) return true;

        // It's possible for some activities to stop with bad timing (esp. since we can't yet
        // queue activity transitions initiated by apps) that results in an empty transition for
        // keyguard going-away. In general, we should should always report Keyguard-going-away.
        if ((info.getFlags() & TRANSIT_FLAG_KEYGUARD_GOING_AWAY) != 0) return true;

        return false;
    }

    /** Returns `true` if `change` is a wallpaper. */
    /** Returns `true` if `change` is a wallpaper. */
    public static boolean isWallpaper(TransitionInfo.Change change) {
    public static boolean isWallpaper(TransitionInfo.Change change) {
        return (change.getTaskInfo() == null)
        return (change.getTaskInfo() == null)