BluetoothUtils

public class BluetoothUtils
extends Object

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


장치에서 BluetoothInstrumentation을 호출하기 위한 유틸리티 함수

기기 측 Bluetooth 계측 코드는 AOSP frameworks/base/core/tests/bluetoothtests 에서 찾을 수 있습니다.

요약

필드

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

공개 생성자

BluetoothUtils ()

공개 메소드

static void cleanLogFile ( ITestDevice device)

장치에서 스눕 로그 파일 삭제

static boolean disable ( ITestDevice device)

특정 장치에서 블루투스를 비활성화합니다.

static boolean disableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

sl4a 호출로 btsnoop 로깅 비활성화

static boolean disableBtsnoopLogging ( ITestDevice device)

sl4a 호출로 btsnoop 로깅 비활성화

static boolean enable ( ITestDevice device)

특정 장치에서 블루투스를 활성화합니다.

static boolean enableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

sl4a 호출로 btsnoop 로깅 활성화

static boolean enableBtsnoopLogging ( ITestDevice device)

sl4a 호출로 btsnoop 로깅 활성화

static String getBluetoothMac ( ITestDevice device)

해당 장치의 BT mac을 검색합니다.

static getBondedDevices ( ITestDevice device)

특정 장치가 결합된 장치의 블루투스 mac 주소를 반환합니다.

static String getBtSnoopLogFilePath ( ITestDevice device)

bt_stack.config 파일에서 bt snoop 로그 파일 경로 가져오기

static String runBluetoothInstrumentation ( ITestDevice device, String command)

BT 계측 명령을 실행하고 출력을 반환하는 편리한 방법

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

선형 백오프를 사용하여 BT 페어링 지우기를 재시도합니다.

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

테스트 결과를 위한 snoop 로그 파일 업로드

필드

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

공개 생성자

BluetoothUtils

public BluetoothUtils ()

공개 메소드

cleanLog파일

public static void cleanLogFile (ITestDevice device)

장치에서 스눕 로그 파일 삭제

매개변수
device ITestDevice

던지기
DeviceNotAvailableException

장애를 입히다

public static boolean disable (ITestDevice device)

특정 장치에서 블루투스를 비활성화합니다.

보고
boolean 비활성화에 성공하면 참, 그렇지 않으면 거짓

던지기
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

비활성화Btsnoop로깅

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a 호출로 btsnoop 로깅 비활성화

매개변수
sl4aApkFile File : sl4a.apk 파일 위치, 설치된 경우 null

보고
boolean 성공 여부

던지기
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

비활성화Btsnoop로깅

public static boolean disableBtsnoopLogging (ITestDevice device)

sl4a 호출로 btsnoop 로깅 비활성화

보고
boolean 성공 여부

던지기
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

~할 수 있게 하다

public static boolean enable (ITestDevice device)

특정 장치에서 블루투스를 활성화합니다.

보고
boolean 활성화에 성공하면 참, 그렇지 않으면 거짓

던지기
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

활성화Btsnoop로깅

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a 호출로 btsnoop 로깅 활성화

매개변수
sl4aApkFile File : sl4a.apk 파일 위치, 설치된 경우 null

보고
boolean 성공 여부

던지기
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

활성화Btsnoop로깅

public static boolean enableBtsnoopLogging (ITestDevice device)

sl4a 호출로 btsnoop 로깅 활성화

보고
boolean 성공 여부

던지기
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

get블루투스맥

public static String getBluetoothMac (ITestDevice device)

해당 장치의 BT mac을 검색합니다.

보고
String BT mac 또는 찾을 수 없는 경우 null

던지기
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

특정 장치가 결합된 장치의 블루투스 mac 주소를 반환합니다.

보고
블루투스 맥 주소

던지기
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

bt_stack.config 파일에서 bt snoop 로그 파일 경로 가져오기

보고
String bt_snoop_log의 파일 이름 또는 찾을 수 없는 경우 null

던지기
DeviceNotAvailableException

runBluetooth계측

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

BT 계측 명령을 실행하고 출력을 반환하는 편리한 방법

매개변수
command String : BT 계측으로 전송된 명령 문자열, 현재 지원됨: 활성화, 비활성화, unpairAll, getName, getAddress, getBondedDevices; 자세한 내용은 AOSP 소스를 참조하세요.

보고
String Bluetooth 계측 출력

던지기
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

매개변수
device ITestDevice

command String

보고
boolean

던지기
DeviceNotAvailableException

토글Btsnoop로깅

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

매개변수
client Sl4aClient

onOff boolean

보고
boolean

던지기
DeviceNotAvailableException

unpairWith재시도

public static boolean unpairWithRetry (ITestDevice device)

선형 백오프를 사용하여 BT 페어링 지우기를 재시도합니다.

보고
boolean

던지기
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

업로드로그파일

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

테스트 결과를 위한 snoop 로그 파일 업로드

매개변수
listener ITestInvocationListener

device ITestDevice

type String

iteration int

던지기
DeviceNotAvailableException