Sl4aBluetoothUtil

public class Sl4aBluetoothUtil
extends Object

Java.lang.Nesne
🎃 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()

Herkese açık yöntemler

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

Aşağıdaki işlemleri yapmak için birincil cihazdaki ikincil cihazın Bluetooth profili erişim iznini değiştirin belirtilen profildeki birincil cihaza erişmek için ikincil cihaz

boolean connect(ITestDevice primary, ITestDevice secondary, profiles)

Belirtilen Bluetooth profillerindeki birincil cihazı ikincil cihaza bağlayın

boolean disable(ITestDevice device)

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

boolean disableBluetoothSnoopLog(ITestDevice device)

Bluetooth araştırma günlüğünü devre dışı bırak

boolean 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ştir

boolean enableBluetoothSnoopLog(ITestDevice device)

Bluetooth araştırma 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şlenmiş) cihazların Bluetooth MAC adreslerini ayarla

boolean pair(ITestDevice primary, ITestDevice secondary)

Birincil cihazı ikincil cihazla eşle

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

Birincil cihazda belirtilen profillerin öncelik ayarını ikincil cihazla değiştirin

void startSl4a(ITestDevice device, File sl4aApkFile)

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

void stopSl4a()

Açılmakta olan SL4A istemcilerini durdurun.

boolean unpairAll(ITestDevice device)

Mevcut cihaz için eşlenen tüm cihazların eşlemesini kaldır

Korunan yöntemler

void finalize()

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

Kamu inşaatçıları

Sl4aBluetoothUtil

public Sl4aBluetoothUtil ()

Herkese açık yöntemler

ChangeProfileAccessPermission

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

Aşağıdaki işlemleri yapmak için birincil cihazdaki ikincil cihazın Bluetooth profili erişim iznini değiştirin belirtilen profildeki birincil cihaza erişmek için ikincil cihaz

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

secondary ITestDevice: İlgili profildeki birincil cihaza erişen cihaz

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

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

İlerlemeler
boolean İzin başarıyla değiştirildiyse true

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

bağlan

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

Belirtilen Bluetooth profillerindeki 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 gerekir

İlerlemeler
boolean bağlantı başarılı olursa true

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

devre dışı bırak

public boolean disable (ITestDevice device)

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

Parametreler
device ITestDevice: hedef cihaz

İlerlemeler
boolean Bluetooth başarıyla devre dışı bırakılırsa true

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

BluetoothSnoopLog'u devre dışı bırak

public boolean disableBluetoothSnoopLog (ITestDevice device)

Bluetooth araştırma günlüğünü devre dışı bırak

Parametreler
device ITestDevice: araştırma günlüğünü devre dışı bırakmak için

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

Fırlatma
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: Cihazın bağlantısı kesilecek

profiles : Bir grup Bluetooth profilinin bağlantısının kesilmesi gerekir

İlerlemeler
boolean bağlantı başarıyla kesildiyse true

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

etkinleştir

public boolean enable (ITestDevice device)

Hedef cihazda Bluetooth'u etkinleştir

Parametreler
device ITestDevice: hedef cihaz

İlerlemeler
boolean Bluetooth başarıyla etkinleştirilirse true

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

allowBluetoothSnoopLog

public boolean enableBluetoothSnoopLog (ITestDevice device)

Bluetooth araştırma günlüğünü etkinleştir

Parametreler
device ITestDevice: araştırma günlüğünü etkinleştirmek için

İlerlemeler
boolean başarılı bir şekilde etkinleştirildiyse true

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

alAdresi

public String getAddress (ITestDevice device)

Hedef cihazın Bluetooth MAC adresini alın

Parametreler
device ITestDevice: hedef cihaz

İlerlemeler
String MAC adresi dizesi

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public  getBondedDevices (ITestDevice device)

Hedef cihazdaki bağlı (eşlenmiş) cihazların Bluetooth MAC adreslerini ayarla

Parametreler
device ITestDevice: hedef cihaz

İlerlemeler
Bluetooth MAC adresleri grubu

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

eşle

public boolean pair (ITestDevice primary, 
                ITestDevice secondary)

Birincil cihazı ikincil cihazla eşle

Parametreler
primary ITestDevice: eşlenecek cihaz

secondary ITestDevice: eşlenecek cihaz

İlerlemeler
boolean eşleme başarılı olursa doğru

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
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 belirtilen profillerin öncelik ayarını ikincil cihazla değiştirin

Parametreler
primary ITestDevice: önceliğin ayarlanacağı cihaz

secondary ITestDevice: öncelik ayarlanacak cihaz

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

priority Sl4aBluetoothUtil.BluetoothPriorityLevel: öncelik düzeyi

İlerlemeler
boolean öncelik başarıyla ayarlanmışsa true

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

başlangıçSl4a

public void startSl4a (ITestDevice device, 
                File sl4aApkFile)

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

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

sl4aApkFile File: Yüklenecek ve kullanılacak isteğe bağlı SL4A apk.

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

durSl4a

public void stopSl4a ()

Açılmakta olan SL4A istemcilerini durdurun. Bu çözüm temelde, müşterilerin temizlenmesi için kullanımdan kaldırıldıktan hemen sonra

Tümünün eşlemesini kaldır

public boolean unpairAll (ITestDevice device)

Mevcut cihaz için eşlenen tüm cihazların eşlemesini kaldır

Parametreler
device ITestDevice: İşlemi gerçekleştirecek mevcut cihaz

İlerlemeler
boolean Eşleme başarıyla kaldırılırsa true

Fırlatma
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Korunan yöntemler

sonlandır

protected void finalize ()

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