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

Commit 088248a2 authored by William Escande's avatar William Escande
Browse files

Cts Tests: Moved adapter utils to kotlin

Test: atest CtsBluetoothTests
Flag: TEST_ONLY
Bug: 339585576
Change-Id: I93f3a72863d55862968d3f13de71f46dc8145436
parent 540af4be
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -26,7 +26,10 @@ java_library {
        "compatibility-device-util-axt",
        "junit",
    ],
    srcs: ["src/**/*.java"],
    srcs: [
        "src/**/*.java",
        "src/BlockingBluetoothAdapter.kt",
    ],
    sdk_version: "test_current",
    // Keep it public for now to avoid merge conflicts
    visibility: ["//visibility:public"],
+291 −0

File changed and moved.

Preview size limit exceeded, changes collapsed.

+51 −2
Original line number Diff line number Diff line
@@ -16,6 +16,55 @@

package android.bluetooth.cts;

import android.bluetooth.test_utils.BluetoothAdapterUtils;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.test_utils.BlockingBluetoothAdapter;
import android.content.Context;

public class BTAdapterUtils extends BluetoothAdapterUtils {}
/**
 * @deprecated see {@link android.bluetooth.test_utils.BlockingBluetoothAdapter}
 */
@Deprecated
public class BTAdapterUtils {
    private BTAdapterUtils() {}

    /**
     * @deprecated see {@link android.bluetooth.test_utils.BlockingBluetoothAdapter#enable}
     */
    @Deprecated
    public static final boolean enableAdapter(BluetoothAdapter adapter, Context ctx) {
        return BlockingBluetoothAdapter.enableAdapter(adapter, ctx);
    }

    /**
     * @deprecated see {@link android.bluetooth.test_utils.BlockingBluetoothAdapter#disable}
     */
    @Deprecated
    public static final boolean disableAdapter(BluetoothAdapter adapter, Context ctx) {
        return BlockingBluetoothAdapter.disableAdapter(adapter, ctx);
    }

    /**
     * @deprecated see {@link android.bluetooth.test_utils.BlockingBluetoothAdapter#disable}
     */
    @Deprecated
    public static final boolean disableAdapter(
            BluetoothAdapter adapter, boolean persist, Context ctx) {
        return BlockingBluetoothAdapter.disableAdapter(adapter, persist, ctx);
    }

    /**
     * @deprecated see {@link android.bluetooth.test_utils.BlockingBluetoothAdapter#enableBLE}
     */
    @Deprecated
    public static final boolean enableBLE(BluetoothAdapter adapter, Context ctx) {
        return BlockingBluetoothAdapter.enableBLE(adapter, ctx);
    }

    /**
     * @deprecated see {@link android.bluetooth.test_utils.BlockingBluetoothAdapter#disableBLE}
     */
    @Deprecated
    public static final boolean disableBLE(BluetoothAdapter adapter, Context ctx) {
        return BlockingBluetoothAdapter.disableBLE(adapter, ctx);
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -77,11 +77,11 @@ public class EnableBluetoothRule extends BeforeAfterRule {
    }

    private void enableBluetoothAdapter() {
        assertThat(BluetoothAdapterUtils.enableAdapter(mBluetoothAdapter, mContext)).isTrue();
        assertThat(BlockingBluetoothAdapter.enableAdapter(mBluetoothAdapter, mContext)).isTrue();
    }

    private void disableBluetoothAdapter() {
        assertThat(BluetoothAdapterUtils.disableAdapter(mBluetoothAdapter, mContext)).isTrue();
        assertThat(BlockingBluetoothAdapter.disableAdapter(mBluetoothAdapter, mContext)).isTrue();
    }

    private void enableBluetoothTestMode() {