BluetoothUtils

public class BluetoothUtils
extends Object

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


Utility-Funktionen zum Aufrufen von BluetoothInstrumentation auf dem Gerät

Geräteseitiger Bluetooth-Instrumentierungscode 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 Konstrukteure

BluetoothUtils ()

Öffentliche Methoden

static void cleanLogFile ( ITestDevice device)

Löschen Sie die Snoop-Protokolldatei vom Gerät

static boolean disable ( ITestDevice device)

Deaktiviert Bluetooth auf dem angegebenen Gerät

static boolean disableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

Btsnoop-Protokollierung durch sl4a-Aufruf deaktivieren

static boolean disableBtsnoopLogging ( ITestDevice device)

Btsnoop-Protokollierung durch sl4a-Aufruf deaktivieren

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 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)

Komfortmethode zum Ausführen von BT-Instrumentierungsbefehlen und 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_BAU

public static final String O_BUILD

Öffentliche Konstrukteure

BluetoothUtils

public BluetoothUtils ()

Öffentliche Methoden

cleanLogFile

public static void cleanLogFile (ITestDevice device)

Löschen Sie die Snoop-Protokolldatei vom Gerät

Parameter
device ITestDevice

Wirft
DeviceNotAvailableException

deaktivieren

public static boolean disable (ITestDevice device)

Deaktiviert Bluetooth auf dem angegebenen Gerät

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

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Btsnoop-Protokollierung durch sl4a-Aufruf deaktivieren

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

Kehrt zurück
boolean Erfolg oder nicht

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

Btsnoop-Protokollierung durch sl4a-Aufruf deaktivieren

Kehrt zurück
boolean Erfolg oder nicht

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

ermöglichen

public static boolean enable (ITestDevice device)

Aktiviert Bluetooth auf dem angegebenen Gerät

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

Wirft
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

Wirft
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

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

Ruft BT mac des angegebenen Geräts ab

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

Wirft
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

Wirft
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

Wirft
DeviceNotAvailableException

Führen Sie BluetoothInstrumentation aus

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

Komfortmethode zum Ausführen von BT-Instrumentierungsbefehlen und 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 der BluetoothInstrumentation

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Parameter
device ITestDevice

command String

Kehrt zurück
boolean

Wirft
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Parameter
client Sl4aClient

onOff boolean

Kehrt zurück
boolean

Wirft
DeviceNotAvailableException

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

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

Kehrt zurück
boolean

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Protokolldateien hochladen

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

Wirft
DeviceNotAvailableException