Sl4aBluetoothUtil

public class Sl4aBluetoothUtil
extends Object

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


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

Özet

Herkese açık kurucular

Sl4aBluetoothUtil()

Herkese açık yöntemler

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

İkincil cihazın, belirli bir profilde birincil cihaza erişebilmesi için birincil cihazda ikincil cihazın Bluetooth profili erişim iznini değiştirme

boolean connect(ITestDevice primary, ITestDevice secondary, profiles)

Belirli Bluetooth profillerinde birincil cihazı ikincil cihaza bağlama

boolean disable(ITestDevice device)

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

boolean disableBluetoothSnoopLog(ITestDevice device)

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

boolean disconnect(ITestDevice primary, ITestDevice secondary, profiles)

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

boolean enable(ITestDevice device)

Hedef cihazda Bluetooth'u etkinleştirin.

boolean enableBluetoothSnoopLog(ITestDevice device)

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

String getAddress(ITestDevice device)

Hedef cihazın Bluetooth MAC adresini alma

getBondedDevices(ITestDevice device)

Hedef cihazdaki bağlı (eşlenen) cihazların Bluetooth MAC adreslerini alma

boolean pair(ITestDevice primary, ITestDevice secondary)

Birincil cihazı ikincil cihazla eşleme

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

Birincil cihazdaki belirli profillerin öncelik ayarını ikincil cihaza göre değiştirme

void startSl4a(ITestDevice device, File sl4aApkFile)

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

void stopSl4a()

Halihazırda açılmakta olan SL4A istemcilerini durdurun.

boolean unpairAll(ITestDevice device)

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

Korunan yöntemler

void finalize()

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

Herkese açık kurucular

Sl4aBluetoothUtil

public Sl4aBluetoothUtil ()

Herkese açık yöntemler

changeProfileAccessPermission

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

İkincil cihazın, belirli bir profilde birincil cihaza erişebilmesi için birincil cihazda ikincil cihazın Bluetooth profili erişim iznini değiştirme

Parametreler
primary ITestDevice: İzin değişikliği yapılacak cihaz

secondary ITestDevice: Belirtilen profilde birincil cihaza erişen cihaz

profile Sl4aBluetoothUtil.BluetoothProfile: Erişim istenen Bluetooth profili

access Sl4aBluetoothUtil.BluetoothAccessLevel: erişim düzeyi, BluetoothAccessLevel bölümüne bakın

İlerlemeler
boolean İzin başarıyla değiştirildiyse doğru değerini döndürür.

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

bağlan

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

Belirli Bluetooth profillerinde birincil cihazı ikincil cihaza bağlama

Parametreler
primary ITestDevice: bağlanılacak cihaz

secondary ITestDevice: bağlanılacak cihaz

profiles : Bağlantı için bir dizi Bluetooth profili gerekir

İlerlemeler
boolean Bağlantı başarılıysa doğru değerini döndürür.

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

devre dışı bırak

public boolean disable (ITestDevice device)

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

Parametreler
device ITestDevice: hedef cihaz

İlerlemeler
boolean Bluetooth başarıyla devre dışı bırakıldıysa doğru değerini döndürür.

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBluetoothSnoopLog

public boolean disableBluetoothSnoopLog (ITestDevice device)

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

Parametreler
device ITestDevice: İzleme günlüğünü devre dışı bırakmak için

İlerlemeler
boolean Başarıyla devre dışı bırakıldıysa doğru değerini alır.

Atışlar
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ı kesme

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

secondary ITestDevice: bağlantısı kesilen cihaz

profiles : Bağlantısı kesilmesi gereken Bluetooth profilleri grubu

İlerlemeler
boolean Bağlantı başarıyla kesildiyse doğru değerini döndürür.

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

etkinleştir

public boolean enable (ITestDevice device)

Hedef cihazda Bluetooth'u etkinleştirme

Parametreler
device ITestDevice: hedef cihaz

İlerlemeler
boolean Bluetooth başarıyla etkinleştirildiyse doğru değerini döndürür.

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBluetoothSnoopLog

public boolean enableBluetoothSnoopLog (ITestDevice device)

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

Parametreler
device ITestDevice: Gözlem günlüklerini etkinleştirmek için

İlerlemeler
boolean Başarıyla etkinleştirildiyse doğru değerini alır.

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getAddress

public String getAddress (ITestDevice device)

Hedef cihazın Bluetooth MAC adresini alma

Parametreler
device ITestDevice: hedef cihaz

İlerlemeler
String MAC adresi dizesi

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public  getBondedDevices (ITestDevice device)

Hedef cihazdaki bağlı (eşlenen) cihazların Bluetooth MAC adreslerini alma

Parametreler
device ITestDevice: hedef cihaz

İlerlemeler
Bluetooth MAC adresi grubu

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

eşle

public boolean pair (ITestDevice primary, 
                ITestDevice secondary)

Birincil cihazı ikincil cihazla eşleme

Parametreler
primary ITestDevice: Eşlenecek cihaz

secondary ITestDevice: Eşlenecek cihaz

İlerlemeler
boolean Eşleme başarılıysa doğru değerini döndürür.

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

setBtConnectionTimeout

public void setBtConnectionTimeout (Duration timeout)

Parametreler
timeout Duration

setBtPairTimeout

public void setBtPairTimeout (Duration timeout)

Parametreler
timeout Duration

setProfilePriority

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

Birincil cihazdaki belirli profillerin öncelik ayarını ikincil cihaza göre değiştirme

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

İlerlemeler
boolean Öncelik başarıyla ayarlandıysa doğru değerini döndürür.

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

startSl4a

public void startSl4a (ITestDevice device, 
                File sl4aApkFile)

Belirtilen cihaz ve SL4A apk dosyasıyla SL4A istemcisini açıkça başlatın. SL4A bağlantısı her zaman gerçek işlemlerden önce kurulacağı için normalde bu yöntem gerekli değildir.

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

sl4aApkFile File: Yüklenip kullanılacak isteğe bağlı SL4A apk'sı.

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

stopSl4a

public void stopSl4a ()

Halihazırda açılmakta olan SL4A istemcilerini durdurun. Temel olarak, artık kullanılmayan istemcileri hemen temizlemenin bir yolunu sağlar.

unpairAll

public boolean unpairAll (ITestDevice device)

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

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

İlerlemeler
boolean Eşleme başarıyla kaldırıldıysa doğru değerini döndürür.

Atışlar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Korunan yöntemler

finalize

protected void finalize ()

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