Sl4aBluetoothUtil

public class Sl4aBluetoothUtil
extends Object

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


Bir yardımcı program sınıfı, SL4A kullanan bir veya iki cihazda Bluetooth işlemleri sağlar

Özet

iç içe sınıflar

enum Sl4aBluetoothUtil.BluetoothAccessLevel

BluetoothDevice.java tabanlı BluetoothDevice.java cihaz erişim düzeyi için numaralandırmalar

enum Sl4aBluetoothUtil.BluetoothConnectionState

BluetoothProfile.java tabanlı BluetoothProfile.java bağlantı durumları için numaralandırmalar

enum Sl4aBluetoothUtil.BluetoothPriorityLevel

BluetoothProfile.java'yı temel alan BluetoothProfile.java profili öncelik düzeyi için numaralandırmalar

enum Sl4aBluetoothUtil.BluetoothProfile

BluetoothProfile.java tabanlı BluetoothProfile.java profilleri için numaralandırmalar

Kamu inşaatçıları

Sl4aBluetoothUtil ()

Genel yöntemler

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

İkincil cihazın verilen profildeki birincil cihaza erişmesi için birincil cihazdaki ikincil cihazın Bluetooth profili erişim iznini değiştirin

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

Verilen Bluetooth profillerinde birincil cihazı ikincil cihaza bağlayın

boolean disable ( ITestDevice device)

Hedef cihazda Bluetooth'u devre dışı bırak

boolean disableBluetoothSnoopLog ( ITestDevice device)

Bluetooth gözetleme günlüğünü devre dışı bırak

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

Birincil cihazın ikincil cihazdan bağlantısını kesin

boolean enable ( ITestDevice device)

Hedef cihazda Bluetooth'u etkinleştir

boolean enableBluetoothSnoopLog ( ITestDevice device)

Bluetooth gözetleme günlüğünü etkinleştir

String getAddress ( ITestDevice device)

Hedef cihazın Bluetooth MAC Adresini alın

getBondedDevices ( ITestDevice device)

Hedef cihazdaki bağlı (eşleştirilmiş) cihazların Bluetooth MAC adreslerini alın

boolean pair ( ITestDevice primary, ITestDevice secondary)

Birincil cihazı ikincil cihazla eşleştirin

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)

Birincil cihazda verilen profillerin öncelik ayarını ikincil cihaza değiştir

void startSl4a ( ITestDevice device, File sl4aApkFile)

Verilen cihaz ve SL4A apk dosyası ile SL4A istemcisini açıkça başlatın.

void stopSl4a ()

Halihazırda açılmış olan SL4A istemcilerini durdurun.

boolean unpairAll ( ITestDevice device)

Geçerli cihaz için tüm eşleştirilmiş cihazların eşleşmesini kaldırın

Korumalı yöntemler

void finalize ()

Tüm SL4A bağlantılarını temizleyin

Kamu inşaatçıları

Sl4aBluetoothUtil

public Sl4aBluetoothUtil ()

Genel yöntemler

changeProfileAccessPermission

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

İkincil cihazın verilen profildeki birincil cihaza erişmesi için birincil cihazdaki ikincil cihazın Bluetooth profili erişim iznini değiştirin

parametreler
primary ITestDevice : izni değiştirmek için cihaz

secondary ITestDevice : verilen profildeki birincil cihaza erişen cihaz

profile Sl4aBluetoothUtil.BluetoothProfile : Erişim için Bluetooth profili

access Sl4aBluetoothUtil.BluetoothAccessLevel : erişim düzeyi, bkz. BluetoothAccessLevel

İadeler
boolean izin başarıyla değiştirildiyse doğru

atar
DeviceNotAvailableException

bağlamak

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

Verilen Bluetooth profillerinde birincil cihazı ikincil cihaza bağlayın

parametreler
primary ITestDevice : bağlanılacak cihaz

secondary ITestDevice : bağlanılacak cihaz

profiles : Bağlanmak için bir dizi Bluetooth profili gereklidir

İadeler
boolean bağlantı başarılıysa doğru

atar
DeviceNotAvailableException

devre dışı bırakmak

public boolean disable (ITestDevice device)

Hedef cihazda Bluetooth'u devre dışı bırak

parametreler
device ITestDevice : hedef cihaz

İadeler
boolean Bluetooth başarıyla devre dışı bırakıldıysa doğru

atar
DeviceNotAvailableException

BluetoothSnoopLog'u devre dışı bırak

public boolean disableBluetoothSnoopLog (ITestDevice device)

Bluetooth gözetleme günlüğünü devre dışı bırak

parametreler
device ITestDevice : gözetleme günlüğünü devre dışı bırakmak için

İadeler
boolean başarıyla devre dışı bırakılırsa doğru

atar
DeviceNotAvailableException

bağlantıyı kes

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

Birincil cihazın ikincil cihazdan bağlantısını kesin

parametreler
primary ITestDevice : bağlantı kesme işlemini gerçekleştirecek cihaz

secondary ITestDevice : bağlantısı kesilecek cihaz

profiles : Bağlantısının kesilmesi gereken Bluetooth profilleri seti

İadeler
boolean bağlantı başarıyla kesilirse doğru

atar
DeviceNotAvailableException

etkinleştirme

public boolean enable (ITestDevice device)

Hedef cihazda Bluetooth'u etkinleştir

parametreler
device ITestDevice : hedef cihaz

İadeler
boolean Bluetooth başarıyla etkinleştirildiyse doğru

atar
DeviceNotAvailableException

etkinleştirBluetoothSnoopLog

public boolean enableBluetoothSnoopLog (ITestDevice device)

Bluetooth gözetleme günlüğünü etkinleştir

parametreler
device ITestDevice : gözetleme günlüğünü etkinleştirmek için

İadeler
boolean başarıyla etkinleştirildiyse doğru

atar
DeviceNotAvailableException

getAddress

public String getAddress (ITestDevice device)

Hedef cihazın Bluetooth MAC Adresini alın

parametreler
device ITestDevice : hedef cihaz

İadeler
String MAC Adresi dizisi

atar
DeviceNotAvailableException

getBondedDevices

public  getBondedDevices (ITestDevice device)

Hedef cihazdaki bağlı (eşleştirilmiş) cihazların Bluetooth MAC adreslerini alın

parametreler
device ITestDevice : hedef cihaz

İadeler
Bluetooth MAC adresleri kümesi

atar
DeviceNotAvailableException

çift

public boolean pair (ITestDevice primary, 
                ITestDevice secondary)

Birincil cihazı ikincil cihazla eşleştirin

parametreler
primary ITestDevice : eşleştirilecek cihaz

secondary ITestDevice : eşleştirilecek cihaz

İadeler
boolean eşleştirme başarılıysa doğru

atar
DeviceNotAvailableException

setBtConnectionZaman aşımı

public void setBtConnectionTimeout (Duration timeout)

parametreler
timeout Duration

setBtPairZaman aşımı

public void setBtPairTimeout (Duration timeout)

parametreler
timeout Duration

setProfilePriority

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

Birincil cihazda verilen profillerin öncelik ayarını ikincil cihaza değiştir

parametreler
primary ITestDevice : önceliği ayarlanacak cihaz

secondary ITestDevice : önceliği ayarlanacak cihaz

profiles : Öncelik ayarını değiştirmek için Bluetooth profilleri

priority Sl4aBluetoothUtil.BluetoothPriorityLevel : öncelik düzeyi

İadeler
boolean öncelik başarıyla ayarlanırsa doğru

atar
DeviceNotAvailableException

startSl4a

public void startSl4a (ITestDevice device, 
                File sl4aApkFile)

Verilen cihaz ve SL4A apk dosyası ile SL4A istemcisini açıkça başlatın. Normalde bu yöntem gerekli değildir, çünkü SL4A bağlantısı her zaman fiili işlemlerden önce kurulacaktır.

parametreler
device ITestDevice : SL4A kullanılarak bağlanacak cihaz

sl4aApkFile File : yüklemek ve kullanmak için isteğe bağlı SL4A apk.

atar
DeviceNotAvailableException

durSl4a

public void stopSl4a ()

Halihazırda açılmış olan SL4A istemcilerini durdurun. Temel olarak, istemcileri artık kullanılmadıklarında hemen temizlemenin bir yolunu sunar.

unpairAll

public boolean unpairAll (ITestDevice device)

Geçerli cihaz için tüm eşleştirilmiş cihazların eşleşmesini kaldırın

parametreler
device ITestDevice : Eylemi gerçekleştirmek için geçerli cihaz

İadeler
boolean eşleştirme başarıyla kaldırılırsa true

atar
DeviceNotAvailableException

Korumalı yöntemler

Sonuçlandırmak

protected void finalize ()

Tüm SL4A bağlantılarını temizleyin