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

Commit 9461f08d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "[Ongoing Call] Remove #onEntryCleanUp override." into sc-v2-dev am: ea6e7bea

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15933236

Change-Id: I4ccbe6a86180b9d0a9dc605727cc95d23e0279f9
parents 9873b6bd ea6e7bea
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -108,16 +108,7 @@ class OngoingCallController @Inject constructor(
            }
        }

        // Fix for b/199600334
        override fun onEntryCleanUp(entry: NotificationEntry) {
            removeChipIfNeeded(entry)
        }

        override fun onEntryRemoved(entry: NotificationEntry, reason: Int) {
            removeChipIfNeeded(entry)
        }

        private fun removeChipIfNeeded(entry: NotificationEntry) {
            if (entry.sbn.key == callNotificationInfo?.key) {
                removeChip()
            }
+0 −12
Original line number Diff line number Diff line
@@ -224,18 +224,6 @@ class OngoingCallControllerTest : SysuiTestCase() {
        verify(mockOngoingCallListener).onOngoingCallStateChanged(anyBoolean())
    }

    /** Regression test for b/201097913. */
    @Test
    fun onEntryCleanUp_callNotifAddedThenRemoved_listenerNotified() {
        val ongoingCallNotifEntry = createOngoingCallNotifEntry()
        notifCollectionListener.onEntryAdded(ongoingCallNotifEntry)
        reset(mockOngoingCallListener)

        notifCollectionListener.onEntryCleanUp(ongoingCallNotifEntry)

        verify(mockOngoingCallListener).onOngoingCallStateChanged(anyBoolean())
    }

    /** Regression test for b/188491504. */
    @Test
    fun onEntryRemoved_removedNotifHasSameKeyAsAddedNotif_listenerNotified() {