Sl4a블루투스유틸

public class Sl4aBluetoothUtil
extends Object

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


유틸리티 클래스는 SL4A를 사용하여 하나 또는 두 개의 장치에서 Bluetooth 작업을 제공합니다.

요약

공개 생성자

Sl4aBluetoothUtil ()

공개 메소드

boolean changeProfileAccessPermission ( ITestDevice primary, ITestDevice secondary, Sl4aBluetoothUtil.BluetoothProfile profile, Sl4aBluetoothUtil.BluetoothAccessLevel access)

보조 장치가 지정된 프로필의 기본 장치에 액세스할 수 있도록 기본 장치에서 보조 장치의 Bluetooth 프로필 액세스 권한을 변경합니다.

boolean connect ( ITestDevice primary, ITestDevice secondary, profiles) connect ( ITestDevice primary, ITestDevice secondary, profiles)

지정된 Bluetooth 프로필을 사용하여 기본 장치를 보조 장치에 연결

boolean disable ( ITestDevice device)

대상 장치에서 Bluetooth 비활성화

boolean disableBluetoothSnoopLog ( ITestDevice device)

블루투스 스누프 로그 비활성화

boolean disconnect ( ITestDevice primary, ITestDevice secondary, profiles) disconnect ( ITestDevice primary, ITestDevice secondary, profiles)

보조 장치에서 기본 장치 연결 끊기

boolean enable ( ITestDevice device)

대상 장치에서 Bluetooth 활성화

boolean enableBluetoothSnoopLog ( ITestDevice device)

블루투스 스누프 로그 활성화

String getAddress ( ITestDevice device)

대상 장치의 Bluetooth MAC 주소 가져오기

getBondedDevices ( ITestDevice device)

대상 장치에 결합된(페어링된) 장치의 Bluetooth MAC 주소 세트 가져오기

boolean pair ( ITestDevice primary, ITestDevice secondary)

기본 장치를 보조 장치에 페어링

void setBtConnectionTimeout (Duration timeout)
void setBtPairTimeout (Duration timeout)
boolean setProfilePriority ( ITestDevice primary, ITestDevice secondary, profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority) setProfilePriority ( ITestDevice primary, ITestDevice secondary, profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority)

기본 장치에 지정된 프로필의 우선 순위 설정을 보조 장치로 변경

void startSl4a ( ITestDevice device, File sl4aApkFile)

지정된 장치 및 SL4A apk 파일을 사용하여 SL4A 클라이언트를 명시적으로 시작합니다.

void stopSl4a ()

이미 열려 있는 SL4A 클라이언트를 중지합니다.

boolean unpairAll ( ITestDevice device)

현재 장치에 대해 페어링된 모든 장치의 페어링을 해제합니다.

보호된 방법

void finalize ()

모든 SL4A 연결 정리

공개 생성자

Sl4a블루투스유틸

public Sl4aBluetoothUtil ()

공개 메소드

프로필액세스권한 변경

public boolean changeProfileAccessPermission (ITestDevice primary, 
                ITestDevice secondary, 
                Sl4aBluetoothUtil.BluetoothProfile profile, 
                Sl4aBluetoothUtil.BluetoothAccessLevel access)

보조 장치가 지정된 프로필의 기본 장치에 액세스할 수 있도록 기본 장치에서 보조 장치의 Bluetooth 프로필 액세스 권한을 변경합니다.

매개변수
primary ITestDevice : 권한을 변경하는 장치

secondary ITestDevice : 지정된 프로필의 기본 장치에 액세스하는 장치

profile Sl4aBluetoothUtil.BluetoothProfile : 액세스할 Bluetooth 프로필

access Sl4aBluetoothUtil.BluetoothAccessLevel : 액세스 수준, BluetoothAccessLevel 참조

보고
boolean 권한이 성공적으로 변경된 경우 true

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

연결하다

public boolean connect (ITestDevice primary, 
                ITestDevice secondary, 
                 profiles)

지정된 Bluetooth 프로필을 사용하여 기본 장치를 보조 장치에 연결

매개변수
primary ITestDevice : 연결할 장치

secondary ITestDevice : 연결할 장치

profiles : 연결하려면 일련의 Bluetooth 프로필이 필요합니다.

보고
boolean 연결이 성공하면 true

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

장애를 입히다

public boolean disable (ITestDevice device)

대상 장치에서 Bluetooth 비활성화

매개변수
device ITestDevice : 대상 장치

보고
boolean Bluetooth가 성공적으로 비활성화된 경우 true

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

비활성화블루투스스눕로그

public boolean disableBluetoothSnoopLog (ITestDevice device)

블루투스 스누프 로그 비활성화

매개변수
device ITestDevice : 스눕 로그를 비활성화합니다.

보고
boolean 성공적으로 비활성화된 경우 true

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

연결을 끊다

public boolean disconnect (ITestDevice primary, 
                ITestDevice secondary, 
                 profiles)

보조 장치에서 기본 장치 연결 끊기

매개변수
primary ITestDevice : 연결 해제 작업을 수행하는 장치

secondary ITestDevice : 연결을 끊을 장치

profiles : 연결을 끊기 위해 필요한 Bluetooth 프로필 세트 제공

보고
boolean 연결이 성공적으로 끊어지면 true

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

~할 수 있게 하다

public boolean enable (ITestDevice device)

대상 장치에서 Bluetooth 활성화

매개변수
device ITestDevice : 대상 장치

보고
boolean Bluetooth가 성공적으로 활성화된 경우 true

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

활성화BluetoothSnoopLog

public boolean enableBluetoothSnoopLog (ITestDevice device)

블루투스 스누프 로그 활성화

매개변수
device ITestDevice : 스누프 로그를 활성화합니다.

보고
boolean 성공적으로 활성화되면 true

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

getAddress

public String getAddress (ITestDevice device)

대상 장치의 Bluetooth MAC 주소 가져오기

매개변수
device ITestDevice : 대상 장치

보고
String MAC 주소 문자열

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

getBondedDevices

public  getBondedDevices (ITestDevice device)

대상 장치에 결합된(페어링된) 장치의 Bluetooth MAC 주소 세트 가져오기

매개변수
device ITestDevice : 대상 장치

보고
블루투스 MAC 주소 세트

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

public boolean pair (ITestDevice primary, 
                ITestDevice secondary)

기본 장치를 보조 장치에 페어링

매개변수
primary ITestDevice : 페어링할 장치

secondary ITestDevice : 페어링할 장치

보고
boolean 페어링에 성공하면 true

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

setBtConnectionTimeout

public void setBtConnectionTimeout (Duration timeout)

매개변수
timeout Duration

setBtPairTimeout

public void setBtPairTimeout (Duration timeout)

매개변수
timeout Duration

프로필 우선순위 설정

public boolean setProfilePriority (ITestDevice primary, 
                ITestDevice secondary, 
                 profiles, 
                Sl4aBluetoothUtil.BluetoothPriorityLevel priority)

기본 장치에 지정된 프로필의 우선 순위 설정을 보조 장치로 변경

매개변수
primary ITestDevice : 우선순위를 설정할 장치

secondary ITestDevice : 우선순위를 설정할 장치

profiles : 우선순위 설정을 변경하기 위한 블루투스 프로필

priority Sl4aBluetoothUtil.BluetoothPriorityLevel : 우선순위 수준

보고
boolean 우선순위가 성공적으로 설정되면 true

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

시작Sl4a

public void startSl4a (ITestDevice device, 
                File sl4aApkFile)

지정된 장치 및 SL4A apk 파일을 사용하여 SL4A 클라이언트를 명시적으로 시작합니다. SL4A 연결은 항상 실제 작업 전에 설정되므로 일반적으로 이 방법은 필요하지 않습니다.

매개변수
device ITestDevice : SL4A를 사용하여 연결할 장치

sl4aApkFile File : 설치하고 사용할 선택적 SL4A APK입니다.

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

중지Sl4a

public void stopSl4a ()

이미 열려 있는 SL4A 클라이언트를 중지합니다. 기본적으로 더 이상 사용되지 않는 클라이언트를 즉시 정리하는 방법을 제공합니다.

모두 페어링 해제

public boolean unpairAll (ITestDevice device)

현재 장치에 대해 페어링된 모든 장치의 페어링을 해제합니다.

매개변수
device ITestDevice : 작업을 수행할 현재 장치

보고
boolean 페어링 해제에 성공하면 true

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

보호된 방법

마무리하다

protected void finalize ()

모든 SL4A 연결 정리