2026년부터 트렁크 안정 개발 모델과 일치하고 생태계의 플랫폼 안정성을 보장하기 위해 2분기와 4분기에 AOSP에 소스 코드를 게시합니다. AOSP를 빌드하고 기여하려면 android-latest-release를 사용하세요. android-latest-release 매니페스트 브랜치는 항상 AOSP에 푸시된 최신 버전을 참조합니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
Google은 AI 기술을 사용하여 콘텐츠를 사용자의 기본 언어로 번역합니다. AI 번역에는 오류가 있을 수 있습니다.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
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, Set<Sl4aBluetoothUtil.BluetoothProfile> profiles)
지정된 블루투스 프로필에서 기본 기기를 보조 기기에 연결
|
boolean
|
disable(ITestDevice device)
대상 기기에서 블루투스 사용 중지
|
boolean
|
disableBluetoothSnoopLog(ITestDevice device)
블루투스 스누프 로그 사용 중지
|
boolean
|
disconnect(ITestDevice primary, ITestDevice secondary, Set<Sl4aBluetoothUtil.BluetoothProfile> profiles)
보조 기기에서 기본 기기 연결 해제
|
boolean
|
enable(ITestDevice device)
대상 기기에서 블루투스 사용 설정
|
boolean
|
enableBluetoothSnoopLog(ITestDevice device)
블루투스 스누프 로그 사용 설정
|
String
|
getAddress(ITestDevice device)
대상 기기의 블루투스 MAC 주소 가져오기
|
Set<String>
|
getBondedDevices(ITestDevice device)
대상 기기에서 결합된 (페어링된) 기기의 블루투스 MAC 주소 집합 가져오기
|
boolean
|
pair(ITestDevice primary, ITestDevice secondary)
기본 기기를 보조 기기에 페어링
|
void
|
setBtConnectionTimeout(Duration timeout)
|
void
|
setBtPairTimeout(Duration timeout)
|
boolean
|
setProfilePriority(ITestDevice primary, ITestDevice secondary, Set<Sl4aBluetoothUtil.BluetoothProfile> 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 disable (ITestDevice device)
대상 기기에서 블루투스 사용 중지
| 매개변수 |
device |
ITestDevice: 대상 기기 |
| 반환 |
boolean |
블루투스가 사용 중지되면 true |
disableBluetoothSnoopLog
public boolean disableBluetoothSnoopLog (ITestDevice device)
블루투스 스누프 로그 사용 중지
| 매개변수 |
device |
ITestDevice: 스눕 로그를 사용 중지합니다. |
| 반환 |
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 Set<String> getBondedDevices (ITestDevice device)
대상 기기에서 결합된 (페어링된) 기기의 블루투스 MAC 주소 집합 가져오기
| 매개변수 |
device |
ITestDevice: 대상 기기 |
| 반환 |
Set<String> |
블루투스 MAC 주소 집합 |
페어링
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)
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 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2026-06-22(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"]],["최종 업데이트: 2026-06-22(UTC)"],[],[]]