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 gözetleme 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 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)

Doğrusal geri yükleme ile BT eşlemesini 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 gözetleme günlüğü dosyasını silme

Parametreler
device ITestDevice

Dekoratif yastıklar
DeviceNotAvailableException

devre dışı bırak

public static boolean disable (ITestDevice device)

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

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

Dekoratif yastıklar
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

İlerlemeler
boolean başarılı olup olmaması

Dekoratif yastıklar
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

İlerlemeler
boolean başarılı olup olmaması

Dekoratif yastıklar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

etkinleştir

public static boolean enable (ITestDevice device)

Belirtilen cihazda Bluetooth'u etkinleştirir.

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

Dekoratif yastıklar
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

İlerlemeler
boolean başarılı olup olmaması

Dekoratif yastıklar
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

İlerlemeler
boolean başarılı olup olmaması

Dekoratif yastıklar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

Belirtilen cihazın BT MAC adresini alır.

İlerlemeler
String Bulunamazsa BT mac veya null

Dekoratif yastıklar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

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

İlerlemeler
bluetooth MAC adresleri

Dekoratif yastıklar
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

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

Dekoratif yastıklar
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.

İlerlemeler
String BluetoothInstrumentation çıkışı

Dekoratif yastıklar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Parametreler
device ITestDevice

command String

İlerlemeler
boolean

Dekoratif yastıklar
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Parametreler
client Sl4aClient

onOff boolean

İlerlemeler
boolean

Dekoratif yastıklar
DeviceNotAvailableException

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

Doğrusal geri yükleme ile BT eşlemesini temizlemeyi yeniden dener.

İlerlemeler
boolean

Dekoratif yastıklar
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

Dekoratif yastıklar
DeviceNotAvailableException