Sl4aBluetoothUtil

public class Sl4aBluetoothUtil
extends Object

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


Class utilitas menyediakan operasi Bluetooth di satu atau dua perangkat menggunakan SL4A

Ringkasan

Class bertingkat

enum Sl4aBluetoothUtil.BluetoothAccessLevel

Enums untuk tingkat akses perangkat Bluetooth yang didasarkan pada BluetoothDevice.java  

enum Sl4aBluetoothUtil.BluetoothConnectionState

Enum untuk status koneksi Bluetooth yang didasarkan pada BluetoothProfile.java  

enum Sl4aBluetoothUtil.BluetoothPriorityLevel

Enums untuk tingkat prioritas profil Bluetooth yang didasarkan pada BluetoothProfile.java  

enum Sl4aBluetoothUtil.BluetoothProfile

Enums untuk profil Bluetooth yang didasarkan pada BluetoothProfile.java  

Konstruktor publik

Sl4aBluetoothUtil()

Metode publik

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

Mengubah izin akses profil Bluetooth perangkat sekunder di perangkat utama agar perangkat sekunder dapat mengakses perangkat utama di profil yang diberikan

boolean connect(ITestDevice primary, ITestDevice secondary, profiles)

Menghubungkan perangkat utama ke perangkat sekunder pada profil Bluetooth tertentu

boolean disable(ITestDevice device)

Menonaktifkan Bluetooth di perangkat target

boolean disableBluetoothSnoopLog(ITestDevice device)

Menonaktifkan log pengintaian Bluetooth

boolean disconnect(ITestDevice primary, ITestDevice secondary, profiles)

Memutuskan hubungan perangkat utama dari perangkat sekunder

boolean enable(ITestDevice device)

Mengaktifkan Bluetooth di perangkat target

boolean enableBluetoothSnoopLog(ITestDevice device)

Mengaktifkan log pengintaian Bluetooth

String getAddress(ITestDevice device)

Mendapatkan Alamat MAC Bluetooth perangkat target

getBondedDevices(ITestDevice device)

Mendapatkan kumpulan alamat MAC Bluetooth perangkat yang terikat (dipasangkan) di perangkat target

boolean pair(ITestDevice primary, ITestDevice secondary)

Menyambungkan perangkat utama ke perangkat sekunder

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

Mengubah setelan prioritas profil tertentu di perangkat utama ke perangkat sekunder

void startSl4a(ITestDevice device, File sl4aApkFile)

Mulai klien SL4A secara eksplisit dengan perangkat yang diberikan dan file apk SL4A.

void stopSl4a()

Hentikan klien SL4A yang sudah dibuka.

boolean unpairAll(ITestDevice device)

Membatalkan penyambungan semua perangkat yang disambungkan untuk perangkat saat ini

Metode yang dilindungi

void finalize()

Membersihkan semua koneksi SL4A

Konstruktor publik

Sl4aBluetoothUtil

public Sl4aBluetoothUtil ()

Metode publik

changeProfileAccessPermission

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

Mengubah izin akses profil Bluetooth perangkat sekunder di perangkat utama agar perangkat sekunder dapat mengakses perangkat utama di profil yang diberikan

Parameter
primary ITestDevice: perangkat untuk mengubah izin

secondary ITestDevice: perangkat yang mengakses perangkat utama di profil tertentu

profile Sl4aBluetoothUtil.BluetoothProfile: Profil Bluetooth yang akan diakses

access Sl4aBluetoothUtil.BluetoothAccessLevel: tingkat akses, lihat BluetoothAccessLevel

Hasil
boolean true jika izin berhasil diubah

Menampilkan
DeviceNotAvailableException

hubungkan

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

Menghubungkan perangkat utama ke perangkat sekunder pada profil Bluetooth tertentu

Parameter
primary ITestDevice: perangkat yang akan dihubungkan

secondary ITestDevice: perangkat yang akan dihubungkan

profiles : Serangkaian profil Bluetooth harus terhubung

Hasil
boolean benar jika koneksi berhasil

Menampilkan
DeviceNotAvailableException

nonaktifkan

public boolean disable (ITestDevice device)

Menonaktifkan Bluetooth di perangkat target

Parameter
device ITestDevice: perangkat target

Hasil
boolean benar jika Bluetooth berhasil dinonaktifkan

Menampilkan
DeviceNotAvailableException

disableBluetoothSnoopLog

public boolean disableBluetoothSnoopLog (ITestDevice device)

Menonaktifkan log pengintaian Bluetooth

Parameter
device ITestDevice: untuk menonaktifkan log snoop

Hasil
boolean true jika berhasil dinonaktifkan

Menampilkan
DeviceNotAvailableException

berhenti hubungkan

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

Memutuskan hubungan perangkat utama dari perangkat sekunder

Parameter
primary ITestDevice: perangkat untuk melakukan operasi pemutusan

secondary ITestDevice: perangkat yang akan diputuskan koneksinya

profiles : Kumpulan profil Bluetooth tertentu yang harus diputuskan

Hasil
boolean benar jika berhasil diputus

Menampilkan
DeviceNotAvailableException

aktifkan

public boolean enable (ITestDevice device)

Mengaktifkan Bluetooth di perangkat target

Parameter
device ITestDevice: perangkat target

Hasil
boolean benar jika Bluetooth berhasil diaktifkan

Menampilkan
DeviceNotAvailableException

enableBluetoothSnoopLog

public boolean enableBluetoothSnoopLog (ITestDevice device)

Mengaktifkan log pengintaian Bluetooth

Parameter
device ITestDevice: untuk mengaktifkan log snoop

Hasil
boolean benar jika berhasil diaktifkan

Menampilkan
DeviceNotAvailableException

getAddress

public String getAddress (ITestDevice device)

Mendapatkan Alamat MAC Bluetooth perangkat target

Parameter
device ITestDevice: perangkat target

Hasil
String String Alamat MAC

Menampilkan
DeviceNotAvailableException

getBondedDevices

public  getBondedDevices (ITestDevice device)

Mendapatkan kumpulan alamat MAC Bluetooth perangkat yang terikat (dipasangkan) di perangkat target

Parameter
device ITestDevice: perangkat target

Hasil
Kumpulan alamat MAC Bluetooth

Menampilkan
DeviceNotAvailableException

hubungkan

public boolean pair (ITestDevice primary, 
                ITestDevice secondary)

Menyambungkan perangkat utama ke perangkat sekunder

Parameter
primary ITestDevice: perangkat yang akan disambungkan

secondary ITestDevice: perangkat yang akan disambungkan

Hasil
boolean benar jika penyambungan berhasil

Menampilkan
DeviceNotAvailableException

setBtConnectionTimeout

public void setBtConnectionTimeout (Duration timeout)

Parameter
timeout Duration

setBtPairTimeout

public void setBtPairTimeout (Duration timeout)

Parameter
timeout Duration

setProfilePriority

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

Mengubah setelan prioritas profil tertentu di perangkat utama ke perangkat sekunder

Parameter
primary ITestDevice: perangkat untuk menetapkan prioritas

secondary ITestDevice: perangkat yang akan ditetapkan prioritasnya

profiles : Profil Bluetooth untuk mengubah setelan prioritas

priority Sl4aBluetoothUtil.BluetoothPriorityLevel: tingkat prioritas

Hasil
boolean true jika berhasil menetapkan prioritas

Menampilkan
DeviceNotAvailableException

startSl4a

public void startSl4a (ITestDevice device, 
                File sl4aApkFile)

Mulai klien SL4A secara eksplisit dengan perangkat yang diberikan dan file apk SL4A. Biasanya metode ini tidak diperlukan, karena koneksi SL4A akan selalu dibuat sebelum operasi yang sebenarnya.

Parameter
device ITestDevice: perangkat yang akan dihubungkan menggunakan SL4A

sl4aApkFile File: apk SL4A opsional untuk diinstal dan digunakan.

Menampilkan
DeviceNotAvailableException

stopSl4a

public void stopSl4a ()

Hentikan klien SL4A yang sudah dibuka. Pada dasarnya, ini memberikan cara untuk membersihkan klien segera setelah tidak digunakan lagi

unpairAll

public boolean unpairAll (ITestDevice device)

Membatalkan penyambungan semua perangkat yang disambungkan untuk perangkat saat ini

Parameter
device ITestDevice: Perangkat saat ini untuk melakukan tindakan

Hasil
boolean true jika berhasil membatalkan penyambungan

Menampilkan
DeviceNotAvailableException

Metode yang dilindungi

finalize

protected void finalize ()

Membersihkan semua koneksi SL4A