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

Commit 24f87111 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Do not consider finishing dream activity as occluded" into sc-dev am: 59d56137

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9d893f8a13bb93d94a73a1e84ebe86925da2e946
parents fcbbf992 59d56137
Loading
Loading
Loading
Loading
+29 −32
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.wm;

import static android.app.WindowConfiguration.ACTIVITY_TYPE_DREAM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.Display.DEFAULT_DISPLAY;
@@ -524,20 +525,18 @@ class KeyguardController {

            boolean occludedByActivity = false;
            final Task task = getRootTaskForControllingOccluding(display);
            if (task != null) {
                final ActivityRecord r = task.getTopNonFinishingActivity();
                if (r != null) {
                    final boolean showWhenLocked = r.canShowWhenLocked();
                    if (r.containsDismissKeyguardWindow()) {
                        mDismissingKeyguardActivity = r;
            final ActivityRecord top = task != null ? task.getTopNonFinishingActivity() : null;
            if (top != null) {
                if (top.containsDismissKeyguardWindow()) {
                    mDismissingKeyguardActivity = top;
                }
                    if (r.getTurnScreenOnFlag()
                            && r.currentLaunchCanTurnScreenOn()) {
                        mTopTurnScreenOnActivity = r;
                if (top.getTurnScreenOnFlag() && top.currentLaunchCanTurnScreenOn()) {
                    mTopTurnScreenOnActivity = top;
                }

                final boolean showWhenLocked = top.canShowWhenLocked();
                if (showWhenLocked) {
                        mTopOccludesActivity = r;
                    mTopOccludesActivity = top;
                }

                // Only the top activity may control occluded, as we can't occlude the Keyguard
@@ -547,17 +546,15 @@ class KeyguardController {
                        && controller.canShowWhileOccluded(
                                true /* dismissKeyguard */, false /* showWhenLocked */));
                // FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD only apply for secondary display.
                    if (mDisplayId != DEFAULT_DISPLAY && task.mDisplayContent != null) {
                        occludedByActivity |=
                                task.mDisplayContent.canShowWithInsecureKeyguard()
                if (mDisplayId != DEFAULT_DISPLAY) {
                    occludedByActivity |= display.canShowWithInsecureKeyguard()
                            && controller.canDismissKeyguard();
                }
            }
            }
            // TODO(b/123372519): isShowingDream can only works on default display.
            mOccluded = occludedByActivity || (mDisplayId == DEFAULT_DISPLAY
                    && mService.mRootWindowContainer.getDefaultDisplay()
                    .getDisplayPolicy().isShowingDreamLw());

            final boolean dreaming = display.getDisplayPolicy().isShowingDreamLw() && (top != null
                    && top.getActivityType() == ACTIVITY_TYPE_DREAM);
            mOccluded = dreaming || occludedByActivity;
            mRequestDismissKeyguard = lastDismissKeyguardActivity != mDismissingKeyguardActivity
                    && !mOccluded
                    && mDismissingKeyguardActivity != null