Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt +9 −0 Original line number Original line Diff line number Diff line Loading @@ -104,7 +104,16 @@ class OngoingCallController @Inject constructor( } } } } // Fix for b/199600334 override fun onEntryCleanUp(entry: NotificationEntry) { removeChipIfNeeded(entry) } override fun onEntryRemoved(entry: NotificationEntry, reason: Int) { override fun onEntryRemoved(entry: NotificationEntry, reason: Int) { removeChipIfNeeded(entry) } private fun removeChipIfNeeded(entry: NotificationEntry) { if (entry.sbn.key == callNotificationInfo?.key) { if (entry.sbn.key == callNotificationInfo?.key) { removeChip() removeChip() } } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt +12 −0 Original line number Original line Diff line number Diff line Loading @@ -221,6 +221,18 @@ class OngoingCallControllerTest : SysuiTestCase() { verify(mockOngoingCallListener).onOngoingCallStateChanged(anyBoolean()) 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. */ /** Regression test for b/188491504. */ @Test @Test fun onEntryRemoved_removedNotifHasSameKeyAsAddedNotif_listenerNotified() { fun onEntryRemoved_removedNotifHasSameKeyAsAddedNotif_listenerNotified() { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt +9 −0 Original line number Original line Diff line number Diff line Loading @@ -104,7 +104,16 @@ class OngoingCallController @Inject constructor( } } } } // Fix for b/199600334 override fun onEntryCleanUp(entry: NotificationEntry) { removeChipIfNeeded(entry) } override fun onEntryRemoved(entry: NotificationEntry, reason: Int) { override fun onEntryRemoved(entry: NotificationEntry, reason: Int) { removeChipIfNeeded(entry) } private fun removeChipIfNeeded(entry: NotificationEntry) { if (entry.sbn.key == callNotificationInfo?.key) { if (entry.sbn.key == callNotificationInfo?.key) { removeChip() removeChip() } } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt +12 −0 Original line number Original line Diff line number Diff line Loading @@ -221,6 +221,18 @@ class OngoingCallControllerTest : SysuiTestCase() { verify(mockOngoingCallListener).onOngoingCallStateChanged(anyBoolean()) 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. */ /** Regression test for b/188491504. */ @Test @Test fun onEntryRemoved_removedNotifHasSameKeyAsAddedNotif_listenerNotified() { fun onEntryRemoved_removedNotifHasSameKeyAsAddedNotif_listenerNotified() { Loading