컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Sl4aBluetoothUtil
public
class
Sl4aBluetoothUtil
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.Sl4aBluetoothUtil
|
유틸리티 클래스는 SL4A를 사용하여 하나 또는 두 대의 기기에서 블루투스 작업을 제공합니다.
요약
공개 메서드 |
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)
현재 기기의 페어링된 모든 기기 페어링 해제
|
공개 생성자
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 |
연결
public boolean connect (ITestDevice primary,
ITestDevice secondary,
profiles)
지정된 블루투스 프로필에서 기본 기기를 보조 기기에 연결
매개변수 |
primary |
ITestDevice : 연결할 기기 |
secondary |
ITestDevice : 연결할 기기 |
profiles |
: 연결하려면 블루투스 프로필 세트가 필요합니다. |
반환 값 |
boolean |
연결이 성공하면 true |
사용 중지
public boolean disable (ITestDevice device)
대상 기기에서 블루투스 사용 중지
매개변수 |
device |
ITestDevice : 대상 기기 |
반환 값 |
boolean |
블루투스가 사용 중지된 경우 true |
disableBluetoothSnoopLog
public boolean disableBluetoothSnoopLog (ITestDevice device)
블루투스 스누프 로그 사용 중지
매개변수 |
device |
ITestDevice : 스누프 로그를 사용 중지합니다. |
반환 값 |
boolean |
사용 중지된 경우 true |
연결 해제
public boolean disconnect (ITestDevice primary,
ITestDevice secondary,
profiles)
보조 기기에서 기본 기기 연결 해제하기
매개변수 |
primary |
ITestDevice : 연결 해제 작업을 실행할 기기 |
secondary |
ITestDevice : 연결 해제할 기기 |
profiles |
: 연결 해제해야 하는 블루투스 프로필 집합 |
반환 값 |
boolean |
연결이 해제되면 true |
사용 설정
public boolean enable (ITestDevice device)
대상 기기에서 블루투스 사용 설정
매개변수 |
device |
ITestDevice : 대상 기기 |
반환 값 |
boolean |
블루투스가 사용 설정된 경우 true |
enableBluetoothSnoopLog
public boolean enableBluetoothSnoopLog (ITestDevice device)
블루투스 스누프 로그 사용 설정
매개변수 |
device |
ITestDevice : 스누프 로그를 사용 설정합니다. |
반환 값 |
boolean |
사용 설정된 경우 true |
getAddress
public String getAddress (ITestDevice device)
대상 기기의 블루투스 MAC 주소 가져오기
매개변수 |
device |
ITestDevice : 대상 기기 |
getBondedDevices
public getBondedDevices (ITestDevice device)
대상 기기에서 결합된 (페어링된) 기기의 블루투스 MAC 주소 집합 가져오기
매개변수 |
device |
ITestDevice : 대상 기기 |
페어링
public boolean pair (ITestDevice primary,
ITestDevice secondary)
기본 기기를 보조 기기에 페어링
매개변수 |
primary |
ITestDevice : 페어링할 기기 |
secondary |
ITestDevice : 페어링할 기기 |
반환 값 |
boolean |
페어링이 성공하면 true |
setBtConnectionTimeout
public void setBtConnectionTimeout (Duration timeout)
setBtPairTimeout
public void setBtPairTimeout (Duration timeout)
setProfilePriority
public boolean setProfilePriority (ITestDevice primary,
ITestDevice secondary,
profiles,
Sl4aBluetoothUtil.BluetoothPriorityLevel priority)
기본 기기에서 특정 프로필의 우선순위 설정을 보조 기기로 변경
매개변수 |
primary |
ITestDevice : 우선순위를 설정할 기기 |
secondary |
ITestDevice : 우선순위를 설정할 기기 |
profiles |
: 우선순위 설정을 변경할 블루투스 프로필 |
priority |
Sl4aBluetoothUtil.BluetoothPriorityLevel : 우선순위 수준 |
반환 값 |
boolean |
우선순위 설정이 성공하면 true |
startSl4a
public void startSl4a (ITestDevice device,
File sl4aApkFile)
지정된 기기와 SL4A APK 파일로 SL4A 클라이언트를 명시적으로 시작합니다. 일반적으로 이 메서드는 필요하지 않습니다. 실제 작업 전에 항상 SL4A 연결이 설정되기 때문입니다.
매개변수 |
device |
ITestDevice : SL4A를 사용하여 연결할 기기 |
sl4aApkFile |
File : 설치하고 사용할 선택적 SL4A APK입니다. |
stopSl4a
public void stopSl4a ()
이미 열려 있는 SL4A 클라이언트를 중지합니다. 기본적으로 더 이상 사용되지 않는 즉시 클라이언트를 정리하는 방법을 제공합니다.
unpairAll
public boolean unpairAll (ITestDevice device)
현재 기기의 페어링된 모든 기기 페어링 해제
매개변수 |
device |
ITestDevice : 작업을 실행할 현재 기기 |
반환 값 |
boolean |
페어링 해제에 성공하면 true |
보호된 메서드
finalize
protected void finalize ()
모든 SL4A 연결 정리
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-03-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-26(UTC)"],[],[]]