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

Commit df6b16ae authored by Charlie Boutier's avatar Charlie Boutier
Browse files

SdpClientTests: unregister broadcastReceiver

Bug: 355414748
Test: atest BumbleBluetoothTests
Change-Id: I50ecdf34b411a258533f5afa85104290f5758061
parent 2a596abf
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ import com.android.compatibility.common.util.AdoptShellPermissionsRule;
import com.google.common.util.concurrent.SettableFuture;
import com.google.protobuf.ByteString;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -68,11 +70,19 @@ public class SdpClientTest {
                }
            };

    @Test
    public void remoteConnectServiceDiscoveryTest() throws Exception {
    @Before
    public void setup() {
        IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_UUID);
        mContext.registerReceiver(mConnectionStateReceiver, filter);
    }

    @After
    public void tearDown() {
        mContext.unregisterReceiver(mConnectionStateReceiver);
    }

    @Test
    public void remoteConnectServiceDiscoveryTest() throws Exception {
        mFutureIntent = SettableFuture.create();

        String local_addr = mAdapter.getAddress();
@@ -94,7 +104,5 @@ public class SdpClientTest {
                        BluetoothUuid.A2DP_SOURCE,
                        BluetoothUuid.A2DP_SINK,
                        BluetoothUuid.AVRCP);

        mContext.unregisterReceiver(mConnectionStateReceiver);
    }
}