BluetoothUtils

public class BluetoothUtils
extends Object

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


Các 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 công cộng

BluetoothUtils ()

Phương thức công khai

static void cleanLogFile ( ITestDevice device)

Xóa tệp nhật ký rình mò khỏi thiết bị

static boolean disable ( ITestDevice device)

Vô hiệu hóa 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 lệnh gọi sl4a

static boolean disableBtsnoopLogging ( ITestDevice device)

Vô hiệu hóa 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ỉ bluetooth mac của 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 tiện lợi để thực hiện lệnh thiết bị 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 xóa ghép nối BT với backoff tuyến tính

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

Tải lên tệp nhật ký rình mò để 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 công cộng

BluetoothUtils

public BluetoothUtils ()

Phương thức 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)

Vô hiệu hóa 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 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

vô hiệu hóaBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

Vô hiệu hóa 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

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

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

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

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

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

Bật 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

tải 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

getBondedDevices

public static  getBondedDevices (ITestDevice device)

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

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

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

runBluetoothCông cụ

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ị BT và trả về đầu ra

Thông số
command String : 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ối, 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

bật tắtBtsnoopĐăng nhập

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 xóa ghép nối BT với backoff tuyến tính

trả lại
boolean

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

tải lên LogFiles

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

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

Thông số
listener ITestInvocationListener

device ITestDevice

type String

iteration int

ném
DeviceNotAvailableException