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

Commit 72ac0f10 authored by Lyn's avatar Lyn
Browse files

Rename BaseHeadsUpManager.isAlerting to isHeadsUpEntry

Bug: 320753095
Test: SystemUITests
Flag: none

Change-Id: Iac0d5bbf65d6d7b3ce6f754f609c7b9607c37fcd
parent 30ed93d4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -157,9 +157,9 @@ class NotificationLaunchAnimatorController(
            val summaryEntry = notificationEntry.parent?.summary

            return when {
                headsUpManager.isAlerting(notificationKey) -> notification
                headsUpManager.isHeadsUpEntry(notificationKey) -> notification
                summaryEntry == null -> null
                headsUpManager.isAlerting(summaryEntry.key) -> summaryEntry.row
                headsUpManager.isHeadsUpEntry(summaryEntry.key) -> summaryEntry.row
                else -> null
            }
        }
+5 −5
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ class HeadsUpCoordinator @Inject constructor(
                        wasUpdated = false,
                        shouldHeadsUpEver = false,
                        shouldHeadsUpAgain = false,
                        isAlerting = mHeadsUpManager.isAlerting(logicalSummary.key),
                        isAlerting = mHeadsUpManager.isHeadsUpEntry(logicalSummary.key),
                        isBinding = isEntryBinding(logicalSummary),
                )
                // If we transfer the alert and the summary isn't even attached, that means we
@@ -268,7 +268,7 @@ class HeadsUpCoordinator @Inject constructor(
                        wasUpdated = false,
                        shouldHeadsUpEver = true,
                        shouldHeadsUpAgain = true,
                        isAlerting = mHeadsUpManager.isAlerting(childToReceiveParentAlert.key),
                        isAlerting = mHeadsUpManager.isHeadsUpEntry(childToReceiveParentAlert.key),
                        isBinding = isEntryBinding(childToReceiveParentAlert),
                )
                handlePostedEntry(
@@ -425,7 +425,7 @@ class HeadsUpCoordinator @Inject constructor(
            val shouldHeadsUpEver =
                mVisualInterruptionDecisionProvider.makeAndLogHeadsUpDecision(entry).shouldInterrupt
            val shouldHeadsUpAgain = shouldHunAgain(entry)
            val isAlerting = mHeadsUpManager.isAlerting(entry.key)
            val isAlerting = mHeadsUpManager.isHeadsUpEntry(entry.key)
            val isBinding = isEntryBinding(entry)
            val posted = mPostedEntries.compute(entry.key) { _, value ->
                value?.also { update ->
@@ -469,7 +469,7 @@ class HeadsUpCoordinator @Inject constructor(
            mEntriesUpdateTimes.remove(entry.key)
            cancelHeadsUpBind(entry)
            val entryKey = entry.key
            if (mHeadsUpManager.isAlerting(entryKey)) {
            if (mHeadsUpManager.isHeadsUpEntry(entryKey)) {
                // TODO: This should probably know the RemoteInputCoordinator's conditions,
                //  or otherwise reference that coordinator's state, rather than replicate its logic
                val removeImmediatelyForRemoteInput = (mRemoteInputManager.isSpinning(entryKey) &&
@@ -719,7 +719,7 @@ class HeadsUpCoordinator @Inject constructor(
     * Whether the notification is already alerting or binding so that it can imminently alert
     */
    private fun isAttemptingToShowHun(entry: ListEntry) =
        mHeadsUpManager.isAlerting(entry.key) || isEntryBinding(entry)
        mHeadsUpManager.isHeadsUpEntry(entry.key) || isEntryBinding(entry)

    /**
     * Whether the notification is already alerting/binding per [isAttemptingToShowHun] OR if it
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ public class VisualStabilityCoordinator implements Coordinator, Dumpable {
    private final NotifStabilityManager mNotifStabilityManager =
            new NotifStabilityManager("VisualStabilityCoordinator") {
                private boolean canMoveForHeadsUp(NotificationEntry entry) {
                    return entry != null && mHeadsUpManager.isAlerting(entry.getKey())
                    return entry != null && mHeadsUpManager.isHeadsUpEntry(entry.getKey())
                            && !mVisibilityLocationProvider.isInVisibleLocation(entry);
                }

+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public class OnUserInteractionCallbackImpl implements OnUserInteractionCallback
    @NonNull
    private DismissedByUserStats getDismissedByUserStats(NotificationEntry entry) {
        int dismissalSurface = NotificationStats.DISMISSAL_SHADE;
        if (mHeadsUpManager.isAlerting(entry.getKey())) {
        if (mHeadsUpManager.isHeadsUpEntry(entry.getKey())) {
            dismissalSurface = NotificationStats.DISMISSAL_PEEK;
        } else if (mStatusBarStateController.isDozing()) {
            dismissalSurface = NotificationStats.DISMISSAL_AOD;
+2 −2
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ public class HeadsUpManagerPhone extends BaseHeadsUpManager implements OnHeadsUp
            mReleaseOnExpandFinish = false;
        } else {
            for (NotificationEntry entry : mEntriesToRemoveAfterExpand) {
                if (isAlerting(entry.getKey())) {
                if (isHeadsUpEntry(entry.getKey())) {
                    // Maybe the heads-up was removed already
                    removeAlertEntry(entry.getKey());
                }
@@ -357,7 +357,7 @@ public class HeadsUpManagerPhone extends BaseHeadsUpManager implements OnHeadsUp
    private final OnReorderingAllowedListener mOnReorderingAllowedListener = () -> {
        mAnimationStateHandler.setHeadsUpGoingAwayAnimationsAllowed(false);
        for (NotificationEntry entry : mEntriesToRemoveWhenReorderingAllowed) {
            if (isAlerting(entry.getKey())) {
            if (isHeadsUpEntry(entry.getKey())) {
                // Maybe the heads-up was removed already
                removeAlertEntry(entry.getKey());
            }
Loading