Sl4aBluetoothUtil

public class Sl4aBluetoothUtil
extends Object

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


유틸리티 클래스는 SL4A를 사용하여 하나 또는 두 대의 기기에서 블루투스 작업을 제공합니다.

요약

공개 생성자

Sl4aBluetoothUtil()

공개 메서드

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

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

boolean connect(ITestDevice primary, ITestDevice secondary, profiles)

지정된 블루투스 프로필에서 기본 기기를 보조 기기에 연결

boolean disable(ITestDevice device)

대상 기기에서 블루투스 사용 중지

boolean disableBluetoothSnoopLog(ITestDevice device)

블루투스 스누프 로그 사용 중지

boolean disconnect(ITestDevice primary, ITestDevice secondary, profiles)

보조 기기에서 기본 기기 연결 해제하기

boolean enable(ITestDevice device)

대상 기기에서 블루투스 사용 설정

boolean enableBluetoothSnoopLog(ITestDevice device)

블루투스 스누프 로그 사용 설정

String getAddress(ITestDevice device)

대상 기기의 블루투스 MAC 주소 가져오기

getBondedDevices(ITestDevice device)

대상 기기에서 결합된 (페어링된) 기기의 블루투스 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)

기본 기기에서 특정 프로필의 우선순위 설정을 보조 기기로 변경

void startSl4a(ITestDevice device, File sl4aApkFile)

지정된 기기와 SL4A APK 파일로 SL4A 클라이언트를 명시적으로 시작합니다.

void stopSl4a()

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

boolean unpairAll(ITestDevice device)

현재 기기의 페어링된 모든 기기 페어링 해제

보호된 메서드

void finalize()

모든 SL4A 연결 정리

공개 생성자

Sl4aBluetoothUtil

public Sl4aBluetoothUtil ()

공개 메서드

changeProfileAccessPermission

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

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

매개변수
primary ITestDevice: 권한을 변경할 기기

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

profile Sl4aBluetoothUtil.BluetoothProfile: 액세스할 블루투스 프로필

access Sl4aBluetoothUtil.BluetoothAccessLevel: 액세스 수준입니다. BluetoothAccessLevel를 참고하세요.

반환 값
boolean 권한이 변경된 경우 true

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

연결

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

지정된 블루투스 프로필에서 기본 기기를 보조 기기에 연결

매개변수
primary ITestDevice: 연결할 기기

secondary ITestDevice: 연결할 기기

profiles : 연결하려면 블루투스 프로필 세트가 필요합니다.

반환 값
boolean 연결이 성공하면 true

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

사용 중지

public boolean disable (ITestDevice device)

대상 기기에서 블루투스 사용 중지

매개변수
device ITestDevice: 대상 기기

반환 값
boolean 블루투스가 사용 중지된 경우 true

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBluetoothSnoopLog

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 : 연결 해제해야 하는 블루투스 프로필 집합

반환 값
boolean 연결이 해제되면 true

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

사용 설정

public boolean enable (ITestDevice device)

대상 기기에서 블루투스 사용 설정

매개변수
device ITestDevice: 대상 기기

반환 값
boolean 블루투스가 사용 설정된 경우 true

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBluetoothSnoopLog

public boolean enableBluetoothSnoopLog (ITestDevice device)

블루투스 스누프 로그 사용 설정

매개변수
device ITestDevice: 스누프 로그를 사용 설정합니다.

반환 값
boolean 사용 설정된 경우 true

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getAddress

public String getAddress (ITestDevice device)

대상 기기의 블루투스 MAC 주소 가져오기

매개변수
device ITestDevice: 대상 기기

반환 값
String MAC 주소 문자열

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public  getBondedDevices (ITestDevice device)

대상 기기에서 결합된 (페어링된) 기기의 블루투스 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

setProfilePriority

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

startSl4a

public void startSl4a (ITestDevice device, 
                File sl4aApkFile)

지정된 기기와 SL4A APK 파일로 SL4A 클라이언트를 명시적으로 시작합니다. 일반적으로 이 메서드는 필요하지 않습니다. 실제 작업 전에 항상 SL4A 연결이 설정되기 때문입니다.

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

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

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

stopSl4a

public void stopSl4a ()

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

unpairAll

public boolean unpairAll (ITestDevice device)

현재 기기의 페어링된 모든 기기 페어링 해제

매개변수
device ITestDevice: 작업을 실행할 현재 기기

반환 값
boolean 페어링 해제에 성공하면 true

생성 값
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

보호된 메서드

finalize

protected void finalize ()

모든 SL4A 연결 정리