Sl4aBluetoothUtil

public class Sl4aBluetoothUtil
extends Object

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


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

Özet

Herkese açık oluşturucular

Sl4aBluetoothUtil()

Herkese açık yöntemler

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

İkincil cihazın, belirtilen profilde birincil cihaza erişebilmesi için birincil cihazda ikincil cihazın Bluetooth profili erişim iznini değiştirin.

boolean connect(ITestDevice primary, ITestDevice secondary, Set<Sl4aBluetoothUtil.BluetoothProfile> profiles)

Birincil cihazı, belirli Bluetooth profillerinde ikincil cihaza bağlama

boolean disable(ITestDevice device)

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

boolean disableBluetoothSnoopLog(ITestDevice device)

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

boolean disconnect(ITestDevice primary, ITestDevice secondary, Set<Sl4aBluetoothUtil.BluetoothProfile> 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ştirme

String getAddress(ITestDevice device)

Hedef cihazın Bluetooth MAC adresini alma

Set<String> getBondedDevices(ITestDevice device)

Hedef cihazdaki bağlı (eşlenmiş) 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, Set<Sl4aBluetoothUtil.BluetoothProfile> profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority)

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

void startSl4a(ITestDevice device, File sl4aApkFile)

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

void stopSl4a()

Daha önce açılmış olan SL4A istemcilerini durdurun.

boolean unpairAll(ITestDevice device)

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

Korunan yöntemler

void finalize()

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

Herkese açık oluşturucular

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, belirtilen profilde birincil cihaza erişebilmesi için birincil cihazda ikincil cihazın Bluetooth profili erişim iznini değiştirin.

Parametreler
primary ITestDevice: İzni değiştirmek için kullanılan cihaz

secondary ITestDevice: Belirli bir profilde birincil cihaza erişen cihaz

profile Sl4aBluetoothUtil.BluetoothProfile: Erişilecek Bluetooth profili

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

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

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

bağlan

public boolean connect (ITestDevice primary, 
                ITestDevice secondary, 
                Set<Sl4aBluetoothUtil.BluetoothProfile> profiles)

Birincil cihazı, belirli Bluetooth profillerinde ikincil cihaza bağlama

Parametreler
primary ITestDevice: Bağlanılacak cihaz

secondary ITestDevice: bağlanılacak cihaz

profiles Set: Bir dizi Bluetooth profilinin bağlı olması gerekir.

İadeler
boolean Bağlantı başarılıysa doğru (true)

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disable

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

Verdiği hatalar
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: snoop günlüğünü devre dışı bırakmak için

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

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

bağlantıyı kes

public boolean disconnect (ITestDevice primary, 
                ITestDevice secondary, 
                Set<Sl4aBluetoothUtil.BluetoothProfile> profiles)

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

Parametreler
primary ITestDevice: bağlantı kesme işleminin gerçekleştirileceği cihaz

secondary ITestDevice: bağlantısı kesilecek cihaz

profiles Set: Belirli bir Bluetooth profilleri grubunun bağlantısının kesilmesi gerekir.

İadeler
boolean Bağlantı başarıyla kesildiyse doğru (true)

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enable

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

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBluetoothSnoopLog

public boolean enableBluetoothSnoopLog (ITestDevice device)

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

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

İadeler
boolean Başarıyla etkinleştirildiyse true

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getAddress

public String getAddress (ITestDevice device)

Hedef cihazın Bluetooth MAC adresini alma

Parametreler
device ITestDevice: hedef cihaz

İadeler
String MAC adresi dizesi

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public Set<String> getBondedDevices (ITestDevice device)

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

Parametreler
device ITestDevice: hedef cihaz

İadeler
Set<String> Bluetooth MAC adresleri kümesi

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

eşlemek

public boolean pair (ITestDevice primary, 
                ITestDevice secondary)

Birincil cihazı ikincil cihazla eşleme

Parametreler
primary ITestDevice: Eşleme yapılacak cihaz

secondary ITestDevice: eşlenecek cihaz

İadeler
boolean Eşleme başarılıysa true

Verdiği hatalar
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, 
                Set<Sl4aBluetoothUtil.BluetoothProfile> profiles, 
                Sl4aBluetoothUtil.BluetoothPriorityLevel priority)

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

Parametreler
primary ITestDevice: Öncelik verilecek cihaz

secondary ITestDevice: Öncelik ayarlanacak cihaz

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

priority Sl4aBluetoothUtil.BluetoothPriorityLevel: öncelik düzeyi

İadeler
boolean Öncelik başarıyla ayarlanırsa true

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

startSl4a

public void startSl4a (ITestDevice device, 
                File sl4aApkFile)

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

Parametreler
device ITestDevice: SL4A kullanılarak bağlanılacak cihaz

sl4aApkFile File: Yüklemek ve kullanmak için isteğe bağlı SL4A APK'sı.

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

stopSl4a

public void stopSl4a ()

Daha önce açılmış olan SL4A istemcilerini durdurun. Temel olarak, istemciler kullanılmadığında hemen temizlenmelerini sağlar.

unpairAll

public boolean unpairAll (ITestDevice device)

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

Parametreler
device ITestDevice: İşlemi gerçekleştirmek için kullanılan mevcut cihaz

İadeler
boolean Eşleme başarıyla kaldırıldıysa doğru

Verdiği hatalar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Korunan yöntemler

finalize

protected void finalize ()

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