Google cam kết thúc đẩy công bằng chủng tộc cho Cộng đồng người da đen. Xem cách thực hiện.

BluetoothUtils

public class BluetoothUtils
extends Object

java.lang.Object
com.android.tradefed.util.Bl BluetoothUtils


Các chức năng tiện ích để gọi Bluetooth

Có thể tìm thấy mã kinh nguyệt trong AOSP trong AOSP tại: frameworks/base/core/tests/bluetoothtests

Bản tóm tắt

Lĩnh vực

public static final String BTSNOOP_API

public static final String BTSNOOP_CMD

public static final String BTSNOOP_DISABLE_CMD

public static final String BTSNOOP_ENABLE_CMD

public static final String GOLD_BTSNOOP_LOG_PATH

public static final String O_BUILD

Các nhà xây dựng công cộng

BluetoothUtils ()

Phương pháp công khai

static void cleanLogFile ( ITestDevice device)

Xóa tệp nhật ký snoop khỏi thiết bị

static boolean disable ( ITestDevice device)

Tắt bluetooth trên thiết bị nhất định

static boolean disableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

Tắt tính năng ghi nhật ký btsnoop bằng lệnh gọi sl4a

static boolean disableBtsnoopLogging ( ITestDevice device)

Tắt tính năng ghi nhật ký btsnoop bằng lệnh gọi sl4a

static boolean enable ( ITestDevice device)

Bật bluetooth trên thiết bị nhất định

static boolean enableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

Bật ghi nhật ký btsnoop bằng lệnh gọi sl4a

static boolean enableBtsnoopLogging ( ITestDevice device)

Bật ghi nhật ký btsnoop bằng lệnh gọi sl4a

static String getBluetoothMac ( ITestDevice device)

Truy xuất BT mac của thiết bị đã cho

static getBondedDevices ( ITestDevice device)

Trả về địa chỉ mac bluetooth của các thiết bị mà thiết bị đã cho đã liên kết với

static String getBtSnoopLogFilePath ( ITestDevice device)

Nhận đường dẫn tệp nhật ký bt snoop từ tệp bt_stack.config

static String runBluetoothInstrumentation ( ITestDevice device, String command)

Phương pháp thuận tiện để thực hiện lệnh đo thiết bị BT và trả về kết quả đầu ra

static boolean runBluetoothInstrumentationWithRetry ( ITestDevice device, String command)
static boolean toggleBtsnoopLogging ( Sl4aClient client, boolean onOff)
static boolean unpairWithRetry ( ITestDevice device)

Thử lại việc xóa ghép nối BT có dự phòng tuyến tính

static void uploadLogFiles ( ITestInvocationListener listener, ITestDevice device, String type, int iteration)

Tải lên tệp nhật ký snoop để biết kết quả kiểm tra

Lĩnh vực

BTSNOOP_API

public static final String BTSNOOP_API

BTSNOOP_CMD

public static final String BTSNOOP_CMD

BTSNOOP_DISABLE_CMD

public static final String BTSNOOP_DISABLE_CMD

BTSNOOP_ENABLE_CMD

public static final String BTSNOOP_ENABLE_CMD

GOLD_BTSNOOP_LOG_PATH

public static final String GOLD_BTSNOOP_LOG_PATH

O_BUILD

public static final String O_BUILD

Các nhà xây dựng công cộng

BluetoothUtils

public BluetoothUtils ()

Phương pháp công khai

cleanLogFile

public static void cleanLogFile (ITestDevice device)

Xóa tệp nhật ký snoop khỏi thiết bị

Thông số
device ITestDevice

Ném
DeviceNotAvailableException

vô hiệu hóa

public static boolean disable (ITestDevice device)

Tắt bluetooth trên thiết bị nhất định

Lợi nhuận
boolean Đúng nếu vô hiệu hóa thành công, sai nếu không

Ném
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Tắt tính năng ghi nhật ký btsnoop bằng lệnh gọi sl4a

Thông số
sl4aApkFile File : vị trí tệp sl4a.apk, null nếu nó đã được cài đặt

Lợi nhuận
boolean thành công hay không

Ném
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

Tắt tính năng ghi nhật ký btsnoop bằng lệnh gọi sl4a

Lợi nhuận
boolean thành công hay không

Ném
DeviceNotAvailableException

cho phép

public static boolean enable (ITestDevice device)

Bật bluetooth trên thiết bị nhất định

Lợi nhuận
boolean Đúng nếu kích hoạt thành công, sai nếu không

Ném
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Bật ghi nhật ký btsnoop bằng lệnh gọi sl4a

Thông số
sl4aApkFile File : vị trí tệp sl4a.apk, null nếu nó đã được cài đặt

Lợi nhuận
boolean thành công hay không

Ném
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

Bật ghi nhật ký btsnoop bằng lệnh gọi sl4a

Lợi nhuận
boolean thành công hay không

Ném
DeviceNotAvailableException

getBl BluetoothMac

public static String getBluetoothMac (ITestDevice device)

Truy xuất BT mac của thiết bị đã cho

Lợi nhuận
String BT mac hoặc null nếu không tìm thấy

Ném
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

Trả về địa chỉ mac bluetooth của các thiết bị mà thiết bị đã cho đã liên kết với

Lợi nhuận
địa chỉ mac bluetooth

Ném
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

Nhận đường dẫn tệp nhật ký bt snoop từ tệp bt_stack.config

Lợi nhuận
String Tên tệp cho bt_snoop_log hoặc null nếu nó không được tìm thấy

Ném
DeviceNotAvailableException

runBl BluetoothI Kinh nguyệt

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

Phương pháp thuận tiện để thực hiện lệnh đo thiết bị BT và trả về kết quả đầu ra

Thông số
command String : một chuỗi lệnh được gửi đến thiết bị đo đạc BT, hiện được hỗ trợ: bật, tắt, hủy ghép nối, getName, getAddress, getBondedDevices; tham khảo nguồn AOSP để biết thêm chi tiết

Lợi nhuận
String đầu ra của Bluetooth

Ném
DeviceNotAvailableException

runBl BluetoothInticmentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Thông số
device ITestDevice

command String

Lợi nhuận
boolean

Ném
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Thông số
client Sl4aClient

onOff boolean

Lợi nhuận
boolean

Ném
DeviceNotAvailableException

unairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

Thử lại việc xóa ghép nối BT có dự phòng tuyến tính

Lợi nhuận
boolean

Ném
DeviceNotAvailableException

uploadLogFiles

public static void uploadLogFiles (ITestInvocationListener listener, 
                ITestDevice device, 
                String type, 
                int iteration)

Tải lên tệp nhật ký snoop để biết kết quả kiểm tra

Thông số
listener ITestInvocationListener

device ITestDevice

type String

iteration int

Ném
DeviceNotAvailableException