BluetoothUtils
public class BluetoothUtils
extends Object
java.lang.Object |
↳ | com.android.tradefed.util.BluetoothUtils |
Fonctions utilitaires pour appeler BluetoothInstrumentation sur l'appareil
Le code BluetoothInstrumentation côté appareil peut être trouvé dans AOSP à: frameworks/base/core/tests/bluetoothtests
Résumé
Des champs
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
Constructeurs publics
BluetoothUtils
public BluetoothUtils ()
Méthodes publiques
cleanLogFile
public static void cleanLogFile (ITestDevice device)
Supprimer le fichier journal snoop de l'appareil
Paramètres |
---|
device | ITestDevice |
désactiver
public static boolean disable (ITestDevice device)
Désactive le Bluetooth sur l'appareil donné
Retour |
---|
boolean | Vrai si la désactivation réussit, faux sinon |
désactiverBtsnoopLogging
public static boolean disableBtsnoopLogging (ITestDevice device,
File sl4aApkFile)
Désactiver la journalisation btsnoop par appel sl4a
Paramètres |
---|
sl4aApkFile | File : emplacement du fichier sl4a.apk, nul s'il a été installé |
Retour |
---|
boolean | succès ou pas |
désactiverBtsnoopLogging
public static boolean disableBtsnoopLogging (ITestDevice device)
Désactiver la journalisation btsnoop par appel sl4a
Retour |
---|
boolean | succès ou pas |
activer
public static boolean enable (ITestDevice device)
Active le Bluetooth sur l'appareil donné
Retour |
---|
boolean | Vrai si l'activation réussit, faux sinon |
activerBtsnoopLogging
public static boolean enableBtsnoopLogging (ITestDevice device,
File sl4aApkFile)
Activer la journalisation btsnoop par appel sl4a
Paramètres |
---|
sl4aApkFile | File : emplacement du fichier sl4a.apk, nul s'il a été installé |
Retour |
---|
boolean | succès ou pas |
activerBtsnoopLogging
public static boolean enableBtsnoopLogging (ITestDevice device)
Activer la journalisation btsnoop par appel sl4a
Retour |
---|
boolean | succès ou pas |
obtenirBluetoothMac
public static String getBluetoothMac (ITestDevice device)
Récupère BT mac de l'appareil donné
Retour |
---|
String | BT mac ou null si introuvable |
getBondedDevices
public static getBondedDevices (ITestDevice device)
Renvoie les adresses mac Bluetooth des appareils avec lesquels l'appareil donné s'est lié
Retour |
---|
| adresses mac bluetooth |
getBtSnoopLogFilePath
public static String getBtSnoopLogFilePath (ITestDevice device)
Obtenir le chemin du fichier journal bt snoop à partir du fichier bt_stack.config
Retour |
---|
String | Le nom du fichier pour bt_snoop_log ou null s'il n'est pas trouvé |
runBluetoothInstrumentation
public static String runBluetoothInstrumentation (ITestDevice device,
String command)
Méthode pratique pour exécuter la commande d'instrumentation BT et renvoyer la sortie
Paramètres |
---|
command | String : une chaîne de commande envoyée à l'instrumentation BT, actuellement prise en charge : enable, disable, unpairAll, getName, getAddress, getBondedDevices ; se référer à la source AOSP pour plus de détails |
Retour |
---|
String | sortie de BluetoothInstrumentation |
runBluetoothInstrumentationWithRetry
public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device,
String command)
Paramètres |
---|
device | ITestDevice |
command | String |
toggleBtsnoopLogging
public static boolean toggleBtsnoopLogging (Sl4aClient client,
boolean onOff)
Paramètres |
---|
client | Sl4aClient |
onOff | boolean |
unpairWithRetry
public static boolean unpairWithRetry (ITestDevice device)
Nouvelles tentatives d'effacement de l'appairage BT avec attente linéaire
uploadLogFiles
public static void uploadLogFiles (ITestInvocationListener listener,
ITestDevice device,
String type,
int iteration)
Télécharger le fichier journal snoop pour les résultats des tests
Paramètres |
---|
listener | ITestInvocationListener |
device | ITestDevice |
type | String |
iteration | int |