BluetoothUtils

public class BluetoothUtils
extends Object

java.lang.Nesne
com.android.tradefed.util.BluetoothUtils


Cihazda BluetoothInstrumentation'ı aramak için yardımcı işlevler

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

Özet

Alanlar

public static final String BTSNOOP_API

public static final String BTSNOOP_CMD

public static final String BTSNOOP_DISABLE_CMD

public static final String BTSNOOP_ENABLE_CMD

public static final String GOLD_BTSNOOP_LOG_PATH

public static final String O_BUILD

Kamu inşaatçıları

BluetoothUtils ()

Genel yöntemler

static void cleanLogFile ( ITestDevice device)

Snoop günlük dosyasını cihazdan sil

static boolean disable ( ITestDevice device)

Verilen cihazda bluetooth'u devre dışı bırakır

static boolean disableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

sl4a çağrısı ile btsnoop günlüğünü devre dışı bırakın

static boolean disableBtsnoopLogging ( ITestDevice device)

sl4a çağrısı ile btsnoop günlüğünü devre dışı bırakın

static boolean enable ( ITestDevice device)

Verilen cihazda bluetooth'u etkinleştirir

static boolean enableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

sl4a çağrısı ile btsnoop günlüğünü etkinleştir

static boolean enableBtsnoopLogging ( ITestDevice device)

sl4a çağrısı ile btsnoop günlüğünü etkinleştir

static String getBluetoothMac ( ITestDevice device)

Verilen cihazın BT mac'ini alır

static getBondedDevices ( ITestDevice device)

Verilen cihazın bağlı olduğu 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 alın

static String runBluetoothInstrumentation ( ITestDevice device, String command)

BT enstrümantasyon komutunu yürütmek ve çıktıyı 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 çekilme ile BT eşleştirmesini 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

Alanlar

BTSNOOP_API

public static final String BTSNOOP_API

BTSNOOP_CMD

public static final String BTSNOOP_CMD

BTSNOOP_DISABLE_CMD

public static final String BTSNOOP_DISABLE_CMD

BTSNOOP_ENABLE_CMD

public static final String BTSNOOP_ENABLE_CMD

GOLD_BTSNOOP_LOG_PATH

public static final String GOLD_BTSNOOP_LOG_PATH

O_BUILD

public static final String O_BUILD

Kamu inşaatçıları

BluetoothUtils

public BluetoothUtils ()

Genel yöntemler

temizGünlükDosyası

public static void cleanLogFile (ITestDevice device)

Snoop günlük dosyasını cihazdan sil

parametreler
device ITestDevice

atar
DeviceNotAvailableException

devre dışı bırakmak

public static boolean disable (ITestDevice device)

Verilen cihazda bluetooth'u devre dışı bırakır

İadeler
boolean Devre dışı bırakma başarılıysa true, aksi takdirde false

atar
DeviceNotAvailableException

devre dışıBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a çağrısı ile btsnoop günlüğünü devre dışı bırakın

parametreler
sl4aApkFile File : sl4a.apk dosya konumu, yüklüyse null

İadeler
boolean başarılı ya da değil

atar
DeviceNotAvailableException

devre dışıBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

sl4a çağrısı ile btsnoop günlüğünü devre dışı bırakın

İadeler
boolean başarılı ya da değil

atar
DeviceNotAvailableException

etkinleştirme

public static boolean enable (ITestDevice device)

Verilen cihazda bluetooth'u etkinleştirir

İadeler
boolean Etkinleştirme başarılıysa true, aksi takdirde false

atar
DeviceNotAvailableException

etkinleştirBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a çağrısı ile btsnoop günlüğünü etkinleştir

parametreler
sl4aApkFile File : sl4a.apk dosya konumu, yüklüyse null

İadeler
boolean başarılı ya da değil

atar
DeviceNotAvailableException

etkinleştirBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

sl4a çağrısı ile btsnoop günlüğünü etkinleştir

İadeler
boolean başarılı ya da değil

atar
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

Verilen cihazın BT mac'ini alır

İadeler
String BT mac veya bulunamazsa null

atar
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

Verilen cihazın bağlı olduğu cihazların bluetooth mac adreslerini döndürür

İadeler
bluetooth mac adresleri

atar
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

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

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

atar
DeviceNotAvailableException

runBluetoothEnstrümantasyon

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

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

parametreler
command String : BT enstrümantasyonuna gönderilen, şu anda desteklenen bir komut dizisi: etkinleştir, devre dışı bırak, unpairAll, getName, getAddress, getBondedDevices; daha fazla ayrıntı için AOSP kaynağına bakın

İadeler
String BluetoothInstrumentation çıkışı

atar
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

parametreler
device ITestDevice

command String

İadeler
boolean

atar
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

parametreler
client Sl4aClient

onOff boolean

İadeler
boolean

atar
DeviceNotAvailableException

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

Doğrusal geri çekilme ile BT eşleştirmesini temizlemeyi yeniden dener

İadeler
boolean

atar
DeviceNotAvailableException

Günlük Dosyalarını yükle

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

atar
DeviceNotAvailableException