BluetoothUtils

public class BluetoothUtils
extends Object

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


Chức năng tiện ích gọi BluetoothInstrumentation trên thiết bị

Mã BluetoothInstrumentation phía thiết bị có thể được tìm thấy 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

Nhà thầu 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)

Vô hiệu hóa ghi nhật ký btsnoop bằng cuộc gọi sl4a

static boolean disableBtsnoopLogging ( ITestDevice device)

Vô hiệu hóa ghi nhật ký btsnoop bằng cuộc 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)

Cho phép ghi nhật ký btsnoop bằng lệnh gọi sl4a

static boolean enableBtsnoopLogging ( ITestDevice device)

Cho phép 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ỉ bluetooth mac của thiết bị mà thiết bị đã cho đã liên kết

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 thiết bị đo BT và trả về đầ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 với độ trễ 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

Nhà thầu xây dựng công cộng

BluetoothUtils

public BluetoothUtils ()

Phương pháp công khai

sạchLogFile

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

Trả lại
boolean Đúng nếu vô hiệu hóa thành công, sai nếu không

Ném
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

vô hiệu hóaBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Vô hiệu hóa ghi nhật ký btsnoop bằng cuộc gọi sl4a

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

Trả lại
boolean thành công hay không

Ném
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

vô hiệu hóaBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

Vô hiệu hóa ghi nhật ký btsnoop bằng cuộc gọi sl4a

Trả lại
boolean thành công hay không

Ném
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

cho phép

public static boolean enable (ITestDevice device)

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

Trả lại
boolean Đúng nếu kích hoạt thành công, sai nếu không

Ném
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

kích hoạtBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Cho phép 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

Trả lại
boolean thành công hay không

Ném
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

kích hoạtBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

Cho phép ghi nhật ký btsnoop bằng lệnh gọi sl4a

Trả lại
boolean thành công hay không

Ném
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

nhận được BluetoothMac

public static String getBluetoothMac (ITestDevice device)

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

Trả lại
String BT mac hoặc null nếu không tìm thấy

Ném
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedThiết bị

public static  getBondedDevices (ITestDevice device)

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

Trả lại
địa chỉ mac bluetooth

Ném
com.android.tradefed.device.DeviceNotAvailableException
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

Trả lại
String Tên tệp cho bt_snoop_log hoặc null nếu không tìm thấy

Ném
DeviceNotAvailableException

runBluetoothThiết bị đo

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

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

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

Trả lại
String đầu ra của BluetoothInstrumentation

Ném
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Thông số
device ITestDevice

command String

Trả lại
boolean

Ném
DeviceNotAvailableException

chuyển đổiBtsnoopGhi nhật ký

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Thông số
client Sl4aClient

onOff boolean

Trả lại
boolean

Ném
DeviceNotAvailableException

hủy ghép nốiWithRetry

public static boolean unpairWithRetry (ITestDevice device)

Thử lại việc xóa ghép nối BT với độ trễ tuyến tính

Trả lại
boolean

Ném
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

tải lênLogFiles

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