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

Commit be3c0ef4 authored by Lyn Han's avatar Lyn Han
Browse files

Dedup onClickListener for clearing silent notifs

Removed code is no op;
NotificationSectionsManager #onClearSilentNotifsClickListener is unused.

NSSLC does what this means to do, via
    mSilentHeaderController.setOnClearAllClickListener

Bug: 175410557
Test: clear notifs in silent section; no regressions

Change-Id: I553196167c5d1f422086d55e079af65eeff8a8c2
parent 2928df12
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -73,7 +73,6 @@ class NotificationSectionsManager @Inject internal constructor(


    private lateinit var parent: NotificationStackScrollLayout
    private lateinit var parent: NotificationStackScrollLayout
    private var initialized = false
    private var initialized = false
    private var onClearSilentNotifsClickListener: View.OnClickListener? = null


    @VisibleForTesting
    @VisibleForTesting
    val silentHeaderView: SectionHeaderView?
    val silentHeaderView: SectionHeaderView?
@@ -441,11 +440,6 @@ class NotificationSectionsManager @Inject internal constructor(
        }
        }
    }
    }


    /** Listener for when the "clear all" button is clicked on the gentle notification header. */
    fun setOnClearSilentNotifsClickListener(listener: View.OnClickListener) {
        onClearSilentNotifsClickListener = listener
    }

    fun setHeaderForegroundColor(@ColorInt color: Int) {
    fun setHeaderForegroundColor(@ColorInt color: Int) {
        peopleHeaderView?.setForegroundColor(color)
        peopleHeaderView?.setForegroundColor(color)
        silentHeaderView?.setForegroundColor(color)
        silentHeaderView?.setForegroundColor(color)
+0 −6
Original line number Original line Diff line number Diff line
@@ -519,12 +519,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mSectionsManager = notificationSectionsManager;
        mSectionsManager = notificationSectionsManager;


        mSectionsManager.initialize(this, LayoutInflater.from(context));
        mSectionsManager.initialize(this, LayoutInflater.from(context));
        mSectionsManager.setOnClearSilentNotifsClickListener(v -> {
            // Leave the shade open if there will be other notifs left over to clear
            final boolean closeShade =
                    !mController.hasActiveClearableNotifications(ROWS_HIGH_PRIORITY);
            clearNotifications(ROWS_GENTLE, closeShade);
        });
        mSections = mSectionsManager.createSectionsForBuckets();
        mSections = mSectionsManager.createSectionsForBuckets();


        mAmbientState = new AmbientState(context, mSectionsManager);
        mAmbientState = new AmbientState(context, mSectionsManager);