BluetoothUtils

public class BluetoothUtils
extends Object

java.lang.객체
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)

장치에서 snoop 로그 파일 삭제

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_빌드

public static final String O_BUILD

공개 생성자

BluetoothUtils

public BluetoothUtils ()

공개 방법

cleanLogFile

public static void cleanLogFile (ITestDevice device)

장치에서 snoop 로그 파일 삭제

매개변수
device ITestDevice

던지기
DeviceNotAvailableException

장애를 입히다

public static boolean disable (ITestDevice device)

주어진 장치에서 블루투스 비활성화

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

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

disableBtsnoop로깅

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a 호출로 btsnoop 로깅 비활성화

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

보고
boolean 성공 여부

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

disableBtsnoop로깅

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

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a 호출로 btsnoop 로깅 활성화

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

보고
boolean 성공 여부

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

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

sl4a 호출로 btsnoop 로깅 활성화

보고
boolean 성공 여부

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

getBluetoothMac

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 BluetoothInstrumentation의 출력

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

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

매개변수
device ITestDevice

command String

보고
boolean

던지기
DeviceNotAvailableException

toggleBtsnoop로깅

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

매개변수
client Sl4aClient

onOff boolean

보고
boolean

던지기
DeviceNotAvailableException

unpairWithRetry

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