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
Ö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 |
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 |
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 |
disableBtsnoopLogging
public static boolean disableBtsnoopLogging (ITestDevice device)
Btsnoop-Protokollierung durch sl4a-Aufruf deaktivieren
Kehrt zurück |
---|
boolean | Erfolg oder nicht |
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 |
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 |
enableBtsnoopLogging
public static boolean enableBtsnoopLogging (ITestDevice device)
Aktivieren Sie die btsnoop-Protokollierung durch sl4a-Aufruf
Kehrt zurück |
---|
boolean | Erfolg oder nicht |
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 |
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 |
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 |
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 |
runBluetoothInstrumentationWithRetry
public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device,
String command)
Parameter |
---|
device | ITestDevice |
command | String |
toggleBtsnoopLogging
public static boolean toggleBtsnoopLogging (Sl4aClient client,
boolean onOff)
Parameter |
---|
client | Sl4aClient |
onOff | boolean |
unpairWithRetry
public static boolean unpairWithRetry (ITestDevice device)
Versucht erneut, die BT-Kopplung mit linearem Backoff zu löschen
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 |