Sl4aBluetoothUtil

public class Sl4aBluetoothUtil
extends Object

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


Yardımcı program sınıfı, SL4A kullanarak bir veya iki cihazda Bluetooth işlemleri sağlar

Özet

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şebilmesi 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ın

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 cihazla bağlantısını kesin

boolean enable ( ITestDevice device)

Hedef cihazda Bluetooth'u etkinleştirin

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 cihazdaki belirli profillerin öncelik ayarını ikincil cihaza doğru değiştirin

void startSl4a ( ITestDevice device, File sl4aApkFile)

SL4A istemcisini verilen cihaz ve SL4A apk dosyasıyla açıkça başlatın.

void stopSl4a ()

Zaten açık olan SL4A istemcilerini durdurun.

boolean unpairAll ( ITestDevice device)

Geçerli cihaz için eşleştirilmiş tüm cihazların eşleştirmesini 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

Profil Erişim İznini değiştir

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

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

Parametreler
primary ITestDevice : izni değiştirecek cihaz

secondary ITestDevice : verilen profildeki birincil cihaza erişen cihaz

profile Sl4aBluetoothUtil.BluetoothProfile : Erişilecek Bluetooth profili

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

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

Atar
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

devre dışı bırakmak

public boolean disable (ITestDevice device)

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

Parametreler
device ITestDevice : hedef cihaz

İadeler
boolean Bluetooth başarıyla devre dışı bırakıldıysa true

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Bluetooth'u devre dışı bırakSnoopLog

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
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

bağlantıyı kes

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

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

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

secondary ITestDevice : bağlantısı kesilecek cihazın

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

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

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

olanak vermek

public boolean enable (ITestDevice device)

Hedef cihazda Bluetooth'u etkinleştirin

Parametreler
device ITestDevice : hedef cihaz

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

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

etkinleştirmeBluetoothSnoopLog

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
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

çift

public boolean pair (ITestDevice primary, 
                ITestDevice secondary)

Birincil cihazı ikincil cihazla eşleştirin

Parametreler
primary ITestDevice : eşleşecek cihaz

secondary ITestDevice : eşleşecek cihaz

İadeler
boolean eşleştirme başarılı olursa true

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

setBtConnectionTimeout

public void setBtConnectionTimeout (Duration timeout)

Parametreler
timeout Duration

setBtPairTimeout

public void setBtPairTimeout (Duration timeout)

Parametreler
timeout Duration

setProfilÖnceliği

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

Birincil cihazdaki belirli profillerin öncelik ayarını ikincil cihaza doğru değiştirin

Parametreler
primary ITestDevice : öncelik ayarlanacak cihaz

secondary ITestDevice : öncelik 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
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

startSl4a

public void startSl4a (ITestDevice device, 
                File sl4aApkFile)

SL4A istemcisini verilen cihaz ve SL4A apk dosyasıyla 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'si.

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Sl4a'yı durdur

public void stopSl4a ()

Zaten açık olan SL4A istemcilerini durdurun. Temel olarak istemcileri artık kullanılmadıktan hemen sonra temizlemenin bir yolunu sağlar.

tümünün eşleştirmesini kaldır

public boolean unpairAll (ITestDevice device)

Geçerli cihaz için eşleştirilmiş tüm cihazların eşleştirmesini 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
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Korumalı yöntemler

Sonuçlandırmak

protected void finalize ()

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