From 0321e62b0640a1f50a3e8320b9715c3f5dd8d5f0 Mon Sep 17 00:00:00 2001 From: Caitlin Cassidy Date: Tue, 28 Sep 2021 15:29:44 +0000 Subject: [PATCH] [Ongoing Call] Remove #onEntryCleanUp override. With ag/15924211 submitted, #onEntryRemoved should be correctly called for both pending and active entries, so we no longer need to care about #onEntryCleanUp. See https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/15924211/comments/d96f2662_c42f3b88. This effectively reverts commit cd755525c4f172862d27466f06f5d4230b57ade5. Test: Tested with test app referenced in ag/15909288 and confirmed that b/199600334 still does not occur. Bug: 199600334 Change-Id: I31a0c805f05ca9b00be68fe3e30b2d249c16a7ab --- .../phone/ongoingcall/OngoingCallController.kt | 9 --------- .../phone/ongoingcall/OngoingCallControllerTest.kt | 12 ------------ 2 files changed, 21 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt index eeff010e0bdf8..62ba56ab2077c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallController.kt @@ -103,16 +103,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() } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt index efe2c1774b088..4476fd879e246 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt @@ -221,18 +221,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() {