BluetoothUtils

public class BluetoothUtils
extends Object

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


Cihazda BluetoothInstrumentation'ı çağırmak için yardımcı işlevler

Cihaz tarafındaki BluetoothInstrumentation kodu, AOSP'de şu konumda bulunabilir: frameworks/base/core/tests/bluetoothtests

Özet

Sabitler

String BTSNOOP_API

String BTSNOOP_CMD

String BTSNOOP_DISABLE_CMD

String BTSNOOP_ENABLE_CMD

String GOLD_BTSNOOP_LOG_PATH

String O_BUILD

Herkese açık oluşturucular

BluetoothUtils()

Herkese açık yöntemler

static void cleanLogFile(ITestDevice device)

Cihazdaki snoop günlüğü dosyasını silme

static boolean disable(ITestDevice device)

Belirtilen cihazda Bluetooth'u devre dışı bırakır.

static boolean disableBtsnoopLogging(ITestDevice device, File sl4aApkFile)

sl4a çağrısıyla btsnoop günlük kaydını devre dışı bırakma

static boolean disableBtsnoopLogging(ITestDevice device)

sl4a çağrısıyla btsnoop günlük kaydını devre dışı bırakma

static boolean enable(ITestDevice device)

Belirtilen cihazda Bluetooth'u etkinleştirir.

static boolean enableBtsnoopLogging(ITestDevice device, File sl4aApkFile)

sl4a çağrısıyla btsnoop günlük kaydını etkinleştirme

static boolean enableBtsnoopLogging(ITestDevice device)

sl4a çağrısıyla btsnoop günlük kaydını etkinleştirme

static String getBluetoothMac(ITestDevice device)

Belirtilen cihazın BT MAC adresini alır.

static Set<String> getBondedDevices(ITestDevice device)

Belirtilen cihazın eşlendiği cihazların Bluetooth MAC adreslerini döndürür.

static String getBtSnoopLogFilePath(ITestDevice device)

bt_stack.config dosyasından bt snoop günlük dosyası yolunu alma

static String runBluetoothInstrumentation(ITestDevice device, String command)

BT enstrümantasyon komutunu yürütmek ve çıkışı döndürmek için kolaylık yöntemi

static boolean runBluetoothInstrumentationWithRetry(ITestDevice device, String command)
static boolean toggleBtsnoopLogging(Sl4aClient client, boolean onOff)
static boolean unpairWithRetry(ITestDevice device)

BT eşlemesini doğrusal geri yükleme aralığıyla temizlemeyi yeniden dener.

static void uploadLogFiles(ITestInvocationListener listener, ITestDevice device, String type, int iteration)

Test sonuçları için snoop günlük dosyasını yükleyin

Sabitler

BTSNOOP_API

public static final String BTSNOOP_API

Sabit Değer: "bluetoothConfigHciSnoopLog"

BTSNOOP_CMD

public static final String BTSNOOP_CMD

Sabit Değer: "setprop persist.bluetooth.btsnoopenable "

BTSNOOP_DISABLE_CMD

public static final String BTSNOOP_DISABLE_CMD

Sabit Değer: "setprop persist.bluetooth.btsnoopenable false"

BTSNOOP_ENABLE_CMD

public static final String BTSNOOP_ENABLE_CMD

Sabit Değer: "setprop persist.bluetooth.btsnoopenable true"

GOLD_BTSNOOP_LOG_PATH

public static final String GOLD_BTSNOOP_LOG_PATH

Sabit Değer: "/data/misc/bluetooth/logs/btsnoop_hci.log"

O_BUILD

public static final String O_BUILD

Sabit Değer: "O"

Herkese açık oluşturucular

BluetoothUtils

public BluetoothUtils ()

Herkese açık yöntemler

cleanLogFile

public static void cleanLogFile (ITestDevice device)

Cihazdaki snoop günlüğü dosyasını silme

Parametreler
device ITestDevice

Verdiği hatalar
DeviceNotAvailableException

disable

public static boolean disable (ITestDevice device)

Belirtilen cihazda Bluetooth'u devre dışı bırakır.

İadeler
boolean Devre dışı bırakma işlemi başarılıysa doğru, aksi takdirde yanlış değerini döndürür.

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

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a çağrısıyla btsnoop günlük kaydını devre dışı bırakma

Parametreler
sl4aApkFile File: sl4a.apk dosya konumu, yüklendiyse null

İadeler
boolean başarılı olup olmadığı

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

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

sl4a çağrısıyla btsnoop günlük kaydını devre dışı bırakma

İadeler
boolean başarılı olup olmadığı

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

enable

public static boolean enable (ITestDevice device)

Belirtilen cihazda Bluetooth'u etkinleştirir.

İadeler
boolean Etkinleştirme başarılıysa doğru, aksi takdirde yanlış

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

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a çağrısıyla btsnoop günlük kaydını etkinleştirme

Parametreler
sl4aApkFile File: sl4a.apk dosya konumu, yüklendiyse null

İadeler
boolean başarılı olup olmadığı

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

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

sl4a çağrısıyla btsnoop günlük kaydını etkinleştirme

İadeler
boolean başarılı olup olmadığı

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

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

Belirtilen cihazın BT MAC adresini alır.

İadeler
String BT mac veya bulunamadıysa null

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

getBondedDevices

public static Set<String> getBondedDevices (ITestDevice device)

Belirtilen cihazın eşlendiği cihazların Bluetooth MAC adreslerini döndürür.

İadeler
Set<String> bluetooth MAC adresleri

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

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

bt_stack.config dosyasından bt snoop günlük dosyası yolunu alma

İadeler
String bt_snoop_log için dosya adı veya bulunamazsa null

Verdiği hatalar
DeviceNotAvailableException

runBluetoothInstrumentation

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

BT enstrümantasyon komutunu yürütmek ve çıkışı döndürmek için kolaylık yöntemi

Parametreler
command String: BT enstrümanına gönderilen bir komut dizesi. Şu anda desteklenenler: enable, disable, unpairAll, getName, getAddress, getBondedDevices. Daha fazla bilgi için AOSP kaynağına bakın.

İadeler
String output of BluetoothInstrumentation

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

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Parametreler
device ITestDevice

command String

Döndürülenler
boolean

Verdiği hatalar
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Parametreler
client Sl4aClient

onOff boolean

Döndürülenler
boolean

Verdiği hatalar
DeviceNotAvailableException

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

BT eşlemesini doğrusal geri yükleme aralığıyla temizlemeyi yeniden dener.

İadeler
boolean

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

uploadLogFiles

public static void uploadLogFiles (ITestInvocationListener listener, 
                ITestDevice device, 
                String type, 
                int iteration)

Test sonuçları için snoop günlük dosyasını yükleyin

Parametreler
listener ITestInvocationListener

device ITestDevice

type String

iteration int

Verdiği hatalar
DeviceNotAvailableException