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

Commit cc7796b4 authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Merge changes I35adedc8,I81a55941,I429e3f7c,Iac0d5bbf,Ic4ef21b9 into main

* changes:
  Rename NotificationEntry.isAlerting to isHeadsUpEntry
  Rename BaseHeadsUpManager runnables without reference to alerting
  Rename HeadsUpEntry add/removal without references to alerting
  Rename BaseHeadsUpManager.isAlerting to isHeadsUpEntry
  Rename BaseHeadsUpManager.mAlertEntries to mHeadsUpEntryMap
parents 0132c9a1 7f3d5253
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
@@ -171,7 +171,7 @@ public final class NotificationEntry extends ListEntry {
    private int mBucket = BUCKET_ALERTING;
    @Nullable private Long mPendingAnimationDuration;
    private boolean mIsMarkedForUserTriggeredMovement;
    private boolean mIsAlerting;
    private boolean mIsHeadsUpEntry;

    public boolean mRemoteEditImeAnimatingAway;
    public boolean mRemoteEditImeVisible;
@@ -965,12 +965,12 @@ public final class NotificationEntry extends ListEntry {
        mIsMarkedForUserTriggeredMovement = marked;
    }

    public void setIsAlerting(boolean isAlerting) {
        mIsAlerting = isAlerting;
    public void setIsHeadsUpEntry(boolean isHeadsUpEntry) {
        mIsHeadsUpEntry = isHeadsUpEntry;
    }

    public boolean isAlerting() {
        return mIsAlerting;
    public boolean isHeadsUpEntry() {
        return mIsHeadsUpEntry;
    }

    /** Set whether this notification is currently used to animate a launch. */
+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;
Loading