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

Commit 8fb0b987 authored by Charlie Boutier's avatar Charlie Boutier
Browse files

BumbleBluetoothTests: Add custom annotations to skip physical tests

Bug: 375478591
Test: atest BumbleBluetoothTests
Change-Id: If866025caea4ef5c129f2aa9a128d277dd9b8b6e
parent b93aed61
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ public class DckL2capTest() : Closeable {
    }

    @Test
    @VirtualOnly
    fun testSend() {
        Log.d(TAG, "testSend")
        val remoteDevice =
@@ -189,6 +190,7 @@ public class DckL2capTest() : Closeable {
    }

    @Test
    @VirtualOnly
    fun testReceive() {
        Log.d(TAG, "testReceive: Connect L2CAP")
        var bluetoothSocket: BluetoothSocket?
+1 −0
Original line number Diff line number Diff line
@@ -354,6 +354,7 @@ public class LeScanningTest {
    }

    @Test
    @VirtualOnly
    public void startBleScan_withServiceData() {
        advertiseWithBumbleWithServiceData();

+28 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.bluetooth;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface VirtualOnly {
    String value() default "";
}
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothUuid;
import android.bluetooth.PandoraDevice;
import android.bluetooth.VirtualOnly;
import android.bluetooth.test_utils.EnableBluetoothRule;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -92,6 +93,7 @@ import java.util.Arrays;
/** Test cases for {@link BluetoothHidHost}. */
@SuppressLint("MissingPermission")
@RunWith(AndroidJUnit4.class)
@VirtualOnly
public class HidHostDualModeTest {
    private static final String TAG = HidHostDualModeTest.class.getSimpleName();
    private static final String BUMBLE_DEVICE_NAME = "Bumble";
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.bluetooth.BluetoothHidHost;
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.PandoraDevice;
import android.bluetooth.VirtualOnly;
import android.bluetooth.cts.EnableBluetoothRule;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -91,6 +92,7 @@ import java.util.concurrent.TimeUnit;

/** Test cases for {@link BluetoothHidHost}. */
@RunWith(AndroidJUnit4.class)
@VirtualOnly
public class HidHostTest {
    private static final String TAG = HidHostTest.class.getSimpleName();
    private static final Duration INTENT_TIMEOUT = Duration.ofSeconds(10);
Loading