From 7ef7812c7bfdc303a62ca24c841f78d52b3a4507 Mon Sep 17 00:00:00 2001 From: Petr Cermak Date: Fri, 23 Feb 2018 15:54:34 +0000 Subject: [PATCH] Tear down broadcast receiver in RemoteInputView and SmartReplyView tests Bug: 73803843 Test: atest RemoteInputViewTest SmartReplyViewTest Change-Id: Iea933874fd76d445971864c743dd02b20ff1e1e9 --- .../systemui/statusbar/policy/RemoteInputViewTest.java | 6 ++++++ .../systemui/statusbar/policy/SmartReplyViewTest.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java index 7ab69b043ade0..7e1aba57f87bf 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java @@ -34,6 +34,7 @@ import com.android.systemui.statusbar.ExpandableNotificationRow; import com.android.systemui.statusbar.NotificationTestHelper; import com.android.systemui.statusbar.RemoteInputController; +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -68,6 +69,11 @@ public class RemoteInputViewTest extends SysuiTestCase { mView = RemoteInputView.inflate(mContext, null, row.getEntry(), mController); } + @After + public void tearDown() { + mContext.unregisterReceiver(mReceiver); + } + @Test public void testSendRemoteInput_intentContainsResultsAndSource() throws InterruptedException { PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java index fc043c56845cd..a9b2c96d3ae17 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SmartReplyViewTest.java @@ -37,6 +37,7 @@ import android.widget.LinearLayout; import com.android.systemui.R; import com.android.systemui.SysuiTestCase; +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -76,6 +77,11 @@ public class SmartReplyViewTest extends SysuiTestCase { mSpacing = res.getDimensionPixelSize(R.dimen.smart_reply_button_spacing); } + @After + public void tearDown() { + mContext.unregisterReceiver(mReceiver); + } + @Test public void testSendSmartReply_intentContainsResultsAndSource() throws InterruptedException { setRepliesFromRemoteInput(TEST_CHOICES);