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

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

Merge "notifyKeyguardFlagsChanged in setShowWhenLocked" into main

parents 38ae6341 6575de35
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -272,6 +272,17 @@ flag {
  is_fixed_read_only: true
}

flag {
  name: "fix_show_when_locked_sync_timeout"
  namespace: "windowing_frontend"
  description: "Prevent sync timeout from setShowWhenLocked(false) by setting the DisplayContent ready"
  bug: "411544184"
  is_fixed_read_only: true
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
    name: "predictive_back_priority_system_navigation_observer"
    namespace: "systemui"
+19 −7
Original line number Diff line number Diff line
@@ -685,7 +685,7 @@ final class ActivityRecord extends WindowToken {
    long mInputDispatchingTimeoutMillis = DEFAULT_DISPATCHING_TIMEOUT_MILLIS;

    private boolean mShowWhenLocked;
    private boolean mInheritShownWhenLocked;
    private boolean mInheritShowWhenLocked;
    private boolean mTurnScreenOn;

    /**
@@ -1880,7 +1880,7 @@ final class ActivityRecord extends WindowToken {
        mRotationAnimationHint = info.rotationAnimation;

        mShowWhenLocked = (aInfo.flags & ActivityInfo.FLAG_SHOW_WHEN_LOCKED) != 0;
        mInheritShownWhenLocked = (aInfo.privateFlags & FLAG_INHERIT_SHOW_WHEN_LOCKED) != 0;
        mInheritShowWhenLocked = (aInfo.privateFlags & FLAG_INHERIT_SHOW_WHEN_LOCKED) != 0;
        mTurnScreenOn = (aInfo.flags & FLAG_TURN_SCREEN_ON) != 0;

        int realTheme = info.getThemeResource();
@@ -4687,13 +4687,25 @@ final class ActivityRecord extends WindowToken {
    }

    void setShowWhenLocked(boolean showWhenLocked) {
        final boolean changed = (mShowWhenLocked != showWhenLocked);
        mShowWhenLocked = showWhenLocked;

        if (!Flags.fixShowWhenLockedSyncTimeout()) {
            mAtmService.mRootWindowContainer.ensureActivitiesVisible();
        } else if (changed) {
            mDisplayContent.notifyKeyguardFlagsChanged();
        }
    }

    void setInheritShowWhenLocked(boolean inheritShowWhenLocked) {
        mInheritShownWhenLocked = inheritShowWhenLocked;
        final boolean changed = (mInheritShowWhenLocked != inheritShowWhenLocked);
        mInheritShowWhenLocked = inheritShowWhenLocked;

        if (!Flags.fixShowWhenLockedSyncTimeout()) {
            mAtmService.mRootWindowContainer.ensureActivitiesVisible();
        } else if (changed) {
            mDisplayContent.notifyKeyguardFlagsChanged();
        }
    }

    /**
@@ -4702,7 +4714,7 @@ final class ActivityRecord extends WindowToken {
     *         contains windows that have {@link LayoutParams#FLAG_SHOW_WHEN_LOCKED} set or if the
     *         activity has set {@link #mShowWhenLocked}, or if its user
     *         is {@link #mIsUserAlwaysVisible always-visible} or b) if the activity has set
     *         {@link #mInheritShownWhenLocked} and the activity behind this satisfies the
     *         {@link #mInheritShowWhenLocked} and the activity behind this satisfies the
     *         conditions a) above.
     *         Multi-windowing mode will be exited if {@code true} is returned.
     */
@@ -4712,7 +4724,7 @@ final class ActivityRecord extends WindowToken {
        }
        if (canShowWhenLockedInner(r)) {
            return true;
        } else if (r.mInheritShownWhenLocked) {
        } else if (r.mInheritShowWhenLocked) {
            final ActivityRecord activity = r.getTaskFragment().getActivityBelow(r);
            return activity != null && canShowWhenLockedInner(activity);
        } else {