BluetoothUtils

public class BluetoothUtils
extends Object

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


Hilfsfunktionen zum Aufrufen von BluetoothInstrumentation auf dem Gerät

Der geräteseitige BluetoothInstrumentierungscode finden Sie in AOSP unter: frameworks/base/core/tests/bluetoothtests

Zusammenfassung

Felder

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

Öffentliche Bauträger

BluetoothUtils ()

Öffentliche Methoden

static void cleanLogFile ( ITestDevice device)

Snoop-Protokolldatei vom Gerät löschen

static boolean disable ( ITestDevice device)

Deaktiviert Bluetooth auf dem angegebenen Gerät

static boolean disableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

Deaktivieren Sie die BTSnoop-Protokollierung durch SL4A-Aufruf

static boolean disableBtsnoopLogging ( ITestDevice device)

Deaktivieren Sie die BTSnoop-Protokollierung durch SL4A-Aufruf

static boolean enable ( ITestDevice device)

Aktiviert Bluetooth auf dem angegebenen Gerät

static boolean enableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

Aktivieren Sie die BTSnoop-Protokollierung durch SL4A-Aufruf

static boolean enableBtsnoopLogging ( ITestDevice device)

Aktivieren Sie die BTSnoop-Protokollierung durch SL4A-Aufruf

static String getBluetoothMac ( ITestDevice device)

Ruft den BT-Mac des angegebenen Geräts ab

static getBondedDevices ( ITestDevice device)

Gibt Bluetooth-Mac-Adressen von Geräten zurück, mit denen das angegebene Gerät verbunden ist

static String getBtSnoopLogFilePath ( ITestDevice device)

Rufen Sie den Pfad der BT-Snoop-Protokolldatei aus der Datei bt_stack.config ab

static String runBluetoothInstrumentation ( ITestDevice device, String command)

Praktische Methode zum Ausführen eines BT-Instrumentierungsbefehls und zum Zurückgeben der Ausgabe

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

Versucht erneut, die BT-Kopplung mit linearem Backoff zu löschen

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

Laden Sie die Snoop-Protokolldatei für Testergebnisse hoch

Felder

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

Öffentliche Bauträger

BluetoothUtils

public BluetoothUtils ()

Öffentliche Methoden

cleanLogFile

public static void cleanLogFile (ITestDevice device)

Snoop-Protokolldatei vom Gerät löschen

Parameter
device ITestDevice

Würfe
DeviceNotAvailableException

deaktivieren

public static boolean disable (ITestDevice device)

Deaktiviert Bluetooth auf dem angegebenen Gerät

Kehrt zurück
boolean True, wenn die Deaktivierung erfolgreich war, andernfalls false

Würfe
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

BtsnoopLogging deaktivieren

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Deaktivieren Sie die BTSnoop-Protokollierung durch SL4A-Aufruf

Parameter
sl4aApkFile File : Speicherort der Datei sl4a.apk, null, wenn sie installiert wurde

Kehrt zurück
boolean Erfolg oder nicht

Würfe
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

BtsnoopLogging deaktivieren

public static boolean disableBtsnoopLogging (ITestDevice device)

Deaktivieren Sie die BTSnoop-Protokollierung durch SL4A-Aufruf

Kehrt zurück
boolean Erfolg oder nicht

Würfe
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

aktivieren

public static boolean enable (ITestDevice device)

Aktiviert Bluetooth auf dem angegebenen Gerät

Kehrt zurück
boolean True, wenn die Aktivierung erfolgreich ist, andernfalls false

Würfe
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Aktivieren Sie die BTSnoop-Protokollierung durch SL4A-Aufruf

Parameter
sl4aApkFile File : Speicherort der Datei sl4a.apk, null, wenn sie installiert wurde

Kehrt zurück
boolean Erfolg oder nicht

Würfe
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

Aktivieren Sie die BTSnoop-Protokollierung durch SL4A-Aufruf

Kehrt zurück
boolean Erfolg oder nicht

Würfe
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

Ruft den BT-Mac des angegebenen Geräts ab

Kehrt zurück
String BT mac oder null, wenn nicht gefunden

Würfe
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

Gibt Bluetooth-Mac-Adressen von Geräten zurück, mit denen das angegebene Gerät verbunden ist

Kehrt zurück
Bluetooth-Mac-Adressen

Würfe
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

Rufen Sie den Pfad der BT-Snoop-Protokolldatei aus der Datei bt_stack.config ab

Kehrt zurück
String Der Dateiname für bt_snoop_log oder null, wenn er nicht gefunden wird

Würfe
DeviceNotAvailableException

runBluetoothInstrumentation

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

Praktische Methode zum Ausführen eines BT-Instrumentierungsbefehls und zum Zurückgeben der Ausgabe

Parameter
command String : eine Befehlszeichenfolge, die an die BT-Instrumentierung gesendet wird, derzeit unterstützt: enable, disable, unpairAll, getName, getAddress, getBondedDevices; Weitere Einzelheiten finden Sie in der AOSP-Quelle

Kehrt zurück
String Ausgabe von BluetoothInstrumentation

Würfe
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Parameter
device ITestDevice

command String

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Parameter
client Sl4aClient

onOff boolean

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

Versucht erneut, die BT-Kopplung mit linearem Backoff zu löschen

Kehrt zurück
boolean

Würfe
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

UploadLogFiles

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

Laden Sie die Snoop-Protokolldatei für Testergebnisse hoch

Parameter
listener ITestInvocationListener

device ITestDevice

type String

iteration int

Würfe
DeviceNotAvailableException