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

Commit 446e723c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "The big Keyguard transition refactor (8/n)"

parents 4bd26bef e69c9318
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -194,4 +194,9 @@ public abstract class ActivityManagerInternal {
     * @return {@code true} if system is ready, {@code false} otherwise.
     * @return {@code true} if system is ready, {@code false} otherwise.
     */
     */
    public abstract boolean isSystemReady();
    public abstract boolean isSystemReady();

    /**
     * Called when the trusted state of Keyguard has changed.
     */
    public abstract void notifyKeyguardTrustedChanged();
}
}
+5 −0
Original line number Original line Diff line number Diff line
@@ -509,6 +509,11 @@ public interface WindowManagerPolicy {
         * Notifies window manager that {@link #isShowingDreamLw} has changed.
         * Notifies window manager that {@link #isShowingDreamLw} has changed.
         */
         */
        void notifyShowingDreamChanged();
        void notifyShowingDreamChanged();

        /**
         * Notifies window manager that {@link #isKeyguardTrustedLw} has changed.
         */
        void notifyKeyguardTrustedChanged();
    }
    }


    public interface PointerEventListener {
    public interface PointerEventListener {
+9 −0
Original line number Original line Diff line number Diff line
@@ -22157,6 +22157,15 @@ public class ActivityManagerService extends IActivityManager.Stub
            // no need to synchronize(this) just to read & return the value
            // no need to synchronize(this) just to read & return the value
            return mSystemReady;
            return mSystemReady;
        }
        }
        @Override
        public void notifyKeyguardTrustedChanged() {
            synchronized (ActivityManagerService.this) {
                if (mKeyguardController.isKeyguardShowing()) {
                    mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
                }
            }
        }
    }
    }
    private final class SleepTokenImpl extends SleepToken {
    private final class SleepTokenImpl extends SleepToken {
+6 −3
Original line number Original line Diff line number Diff line
@@ -1806,8 +1806,9 @@ final class ActivityStack extends ConfigurationContainer {
        final boolean keyguardShowing = mStackSupervisor.mKeyguardController.isKeyguardShowing();
        final boolean keyguardShowing = mStackSupervisor.mKeyguardController.isKeyguardShowing();
        final boolean keyguardLocked = mStackSupervisor.mKeyguardController.isKeyguardLocked();
        final boolean keyguardLocked = mStackSupervisor.mKeyguardController.isKeyguardLocked();
        final boolean showWhenLocked = r.hasShowWhenLockedWindows();
        final boolean showWhenLocked = r.hasShowWhenLockedWindows();
        final boolean dismissKeyguard = r.hasDismissKeyguardWindows();
        if (shouldBeVisible) {
        if (shouldBeVisible) {
            if (r.hasDismissKeyguardWindows() && mTopDismissingKeyguardActivity == null) {
            if (dismissKeyguard && mTopDismissingKeyguardActivity == null) {
                mTopDismissingKeyguardActivity = r;
                mTopDismissingKeyguardActivity = r;
            }
            }


@@ -1819,8 +1820,10 @@ final class ActivityStack extends ConfigurationContainer {
        }
        }
        if (keyguardShowing) {
        if (keyguardShowing) {


            // If keyguard is showing, nothing is visible.
            // If keyguard is showing, nothing is visible, except if we are able to dismiss Keyguard
            return false;
            // right away.
            return shouldBeVisible && mStackSupervisor.mKeyguardController
                    .canShowActivityWhileKeyguardShowing(dismissKeyguard);
        } else if (keyguardLocked) {
        } else if (keyguardLocked) {


            // Show when locked windows above keyguard.
            // Show when locked windows above keyguard.
+8 −1
Original line number Original line Diff line number Diff line
@@ -154,6 +154,14 @@ class KeyguardController {
        }
        }
    }
    }


    /**
     * @return True if we may show an activity while Keyguard is showing because we are in the
     *         process of dismissing it anyways, false otherwise.
     */
    boolean canShowActivityWhileKeyguardShowing(boolean dismissKeyguard) {
        return dismissKeyguard && canDismissKeyguard();
    }

    private void visibilitiesUpdated() {
    private void visibilitiesUpdated() {
        final boolean lastOccluded = mOccluded;
        final boolean lastOccluded = mOccluded;
        final ActivityRecord lastDismissingKeyguardActivity = mDismissingKeyguardActivity;
        final ActivityRecord lastDismissingKeyguardActivity = mDismissingKeyguardActivity;
@@ -215,7 +223,6 @@ class KeyguardController {
                    && mWindowManager.getPendingAppTransition() == TRANSIT_KEYGUARD_UNOCCLUDE) {
                    && mWindowManager.getPendingAppTransition() == TRANSIT_KEYGUARD_UNOCCLUDE) {
                mWindowManager.prepareAppTransition(mBeforeUnoccludeTransit,
                mWindowManager.prepareAppTransition(mBeforeUnoccludeTransit,
                        false /* alwaysKeepCurrent */, 0 /* flags */, true /* forceOverride */);
                        false /* alwaysKeepCurrent */, 0 /* flags */, true /* forceOverride */);
                mKeyguardGoingAway = true;
                mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
                mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
                mWindowManager.executeAppTransition();
                mWindowManager.executeAppTransition();
            }
            }
Loading