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

Commit 9d08edd1 authored by Lyn's avatar Lyn
Browse files

Rename updateNotification param to shouldHeadsUpAgain

Bug: 320753095
Test: SystemUITests
Change-Id: I78fe9f19e05d139953102fefa0bdf707d3d65c3b
parent 7f3d5253
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -790,7 +790,7 @@ private fun <R> HeadsUpManager.modifyHuns(block: (HunMutator) -> R): R {

/** Mutates the HeadsUp state of notifications. */
private interface HunMutator {
    fun updateNotification(key: String, alert: Boolean)
    fun updateNotification(key: String, shouldHeadsUpAgain: Boolean)
    fun removeNotification(key: String, releaseImmediately: Boolean)
}

@@ -801,8 +801,8 @@ private interface HunMutator {
private class HunMutatorImpl(private val headsUpManager: HeadsUpManager) : HunMutator {
    private val deferred = mutableListOf<Pair<String, Boolean>>()

    override fun updateNotification(key: String, alert: Boolean) {
        headsUpManager.updateNotification(key, alert)
    override fun updateNotification(key: String, shouldHeadsUpAgain: Boolean) {
        headsUpManager.updateNotification(key, shouldHeadsUpAgain)
    }

    override fun removeNotification(key: String, releaseImmediately: Boolean) {
+6 −6
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
    public void showNotification(@NonNull NotificationEntry entry) {
        mLogger.logShowNotification(entry);
        addEntry(entry);
        updateNotification(entry.getKey(), true /* show */);
        updateNotification(entry.getKey(), true /* shouldHeadsUpAgain */);
        entry.setInterruption();
    }

@@ -190,12 +190,12 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {
    /**
     * Called when the notification state has been updated.
     * @param key the key of the entry that was updated
     * @param show whether the notification should show again and force reevaluation of
     *              removal time
     * @param shouldHeadsUpAgain whether the notification should show again and force reevaluation
     *                           of removal time
     */
    public void updateNotification(@NonNull String key, boolean show) {
    public void updateNotification(@NonNull String key, boolean shouldHeadsUpAgain) {
        HeadsUpEntry headsUpEntry = mHeadsUpEntryMap.get(key);
        mLogger.logUpdateNotification(key, show, headsUpEntry != null);
        mLogger.logUpdateNotification(key, shouldHeadsUpAgain, headsUpEntry != null);
        if (headsUpEntry == null) {
            // the entry was released before this update (i.e by a listener) This can happen
            // with the groupmanager
@@ -204,7 +204,7 @@ public abstract class BaseHeadsUpManager implements HeadsUpManager {

        headsUpEntry.mEntry.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED);

        if (show) {
        if (shouldHeadsUpAgain) {
            headsUpEntry.updateEntry(true /* updatePostTime */, "updateNotification");
            if (headsUpEntry != null) {
                setEntryPinned(headsUpEntry, shouldHeadsUpBecomePinned(headsUpEntry.mEntry));
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ interface HeadsUpManager : Dumpable {
     */
    fun unpinAll(userUnPinned: Boolean)

    fun updateNotification(key: String, alert: Boolean)
    fun updateNotification(key: String, shouldHeadsUpAgain: Boolean)
}

/** Sets the animation state of the HeadsUpManager. */