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

Commit 4b31870d authored by Charlie Boutier's avatar Charlie Boutier
Browse files

Remove minSdkVersion on AndroidManifest

* Order Rule in Tests
* Skip tests that depend on hidden APIs, as BumbleBluetoothTests
must remain accessible for CTS compliance

Test: atest BumbleBluetoothTests
Bug: 335677534
Bug: 343525982
Change-Id: Ib366eeea5d03f7625c06a635d878bb79f535df16
parent 305011db
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="android.bluetooth" >

    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21" />

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.LOCAL_MAC_ADDRESS" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application>
        <uses-library android:name="android.test.runner" />

        <receiver android:name="android.bluetooth.PendingIntentScanReceiver" >
        <receiver android:name="android.bluetooth.PendingIntentScanReceiver" android:exported="true">
            <intent-filter>
                <action android:name="android.bluetooth.test.ACTION_SCAN_RESULT" />
            </intent-filter>
+12 −6
Original line number Diff line number Diff line
@@ -42,17 +42,18 @@ import androidx.test.runner.AndroidJUnit4;
import com.android.bluetooth.flags.Flags;
import com.android.compatibility.common.util.AdoptShellPermissionsRule;

import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import pandora.HostProto.AdvertiseRequest;
import pandora.HostProto.OwnAddressType;

import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

import pandora.HostProto.AdvertiseRequest;
import pandora.HostProto.OwnAddressType;

/** Test cases for {@link BluetoothGattServer}. */
@RunWith(AndroidJUnit4.class)
public class GattServerConnectWithScanTest {
@@ -61,11 +62,13 @@ public class GattServerConnectWithScanTest {
    private static final int TIMEOUT_SCANNING_MS = 2_000;
    private static final int TIMEOUT_GATT_CONNECTION_MS = 2_000;

    @Rule public final AdoptShellPermissionsRule mPermissionRule = new AdoptShellPermissionsRule();
    @Rule(order = 2)
    public final AdoptShellPermissionsRule mPermissionRule = new AdoptShellPermissionsRule();

    @Rule public final PandoraDevice mBumble = new PandoraDevice();
    @Rule(order = 1)
    public final PandoraDevice mBumble = new PandoraDevice();

    @Rule
    @Rule(order = 0)
    public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();

    private final Context mContext = ApplicationProvider.getApplicationContext();
@@ -75,6 +78,7 @@ public class GattServerConnectWithScanTest {
    private final BluetoothLeScanner mLeScanner = mBluetoothAdapter.getBluetoothLeScanner();

    @Test
    @Ignore("b/343525982: Remove hidden api's dependencies to enable the test.")
    public void serverConnectToRandomAddress_withTransportAuto() throws Exception {
        advertiseWithBumble(OwnAddressType.RANDOM);
        assertThat(scanBumbleDevice(Utils.BUMBLE_RANDOM_ADDRESS)).isNotNull();
@@ -101,6 +105,7 @@ public class GattServerConnectWithScanTest {
    }

    @Test
    @Ignore("b/343525982: Remove hidden api's dependencies to enable the test.")
    public void serverConnectToRandomAddress_withTransportLE() throws Exception {
        advertiseWithBumble(OwnAddressType.RANDOM);
        assertThat(scanBumbleDevice(Utils.BUMBLE_RANDOM_ADDRESS)).isNotNull();
@@ -151,6 +156,7 @@ public class GattServerConnectWithScanTest {
    }

    @Test
    @Ignore("b/343525982: Remove hidden api's dependencies to enable the test.")
    public void serverConnectToPublicAddress_withTransportLE() throws Exception {
        String publicAddress = mBumble.getRemoteDevice().getAddress();
        advertiseWithBumble(OwnAddressType.PUBLIC);
+1 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ public class GattServerConnectWithoutScanTest {
    }

    @Test
    @Ignore("b/343525982: Remove hidden api's dependencies to enable the test.")
    public void serverConnectToPublicAddress_withTransportLE() throws Exception {
        advertiseWithBumble(OwnAddressType.PUBLIC);

+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.compatibility.common.util.AdoptShellPermissionsRule;

import io.grpc.Deadline;

import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -56,6 +57,7 @@ public class LeAdvertisingTest {
    @Rule public final PandoraDevice mBumble = new PandoraDevice();

    @Test
    @Ignore("b/343525982: Remove hidden api's dependencies to enable the test.")
    public void advertisingSet() throws Exception {
        Pair<String, Integer> addressPair = startAdvertising().join();
        ScanningResponse response = scanWithBumble(addressPair);