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 se trouve dans AOSP à l'adresse :
frameworks/base/core/tests/bluetoothtests
Résumé
Méthodes publiques |
static
void
|
cleanLogFile(ITestDevice device)
Supprimer le fichier journal de surveillance de l'appareil
|
static
boolean
|
disable(ITestDevice device)
Désactive le Bluetooth sur l'appareil donné.
|
static
boolean
|
disableBtsnoopLogging(ITestDevice device, File sl4aApkFile)
Désactiver la journalisation btsnoop par appel sl4a
|
static
boolean
|
disableBtsnoopLogging(ITestDevice device)
Désactiver la journalisation btsnoop par appel sl4a
|
static
boolean
|
enable(ITestDevice device)
Active le Bluetooth sur l'appareil donné.
|
static
boolean
|
enableBtsnoopLogging(ITestDevice device, File sl4aApkFile)
Activer la journalisation btsnoop par appel sl4a
|
static
boolean
|
enableBtsnoopLogging(ITestDevice device)
Activer la journalisation btsnoop par appel sl4a
|
static
String
|
getBluetoothMac(ITestDevice device)
Récupère l'adresse MAC Bluetooth de l'appareil donné
|
static
|
getBondedDevices(ITestDevice device)
Renvoie les adresses MAC Bluetooth des appareils avec lesquels l'appareil donné a été associé.
|
static
String
|
getBtSnoopLogFilePath(ITestDevice device)
Obtenir le chemin d'accès au fichier journal de surveillance bt à partir du fichier bt_stack.config
|
static
String
|
runBluetoothInstrumentation(ITestDevice device, String command)
Méthode pratique pour exécuter la commande d'instrumentation BT et renvoyer la sortie
|
static
boolean
|
runBluetoothInstrumentationWithRetry(ITestDevice device, String command)
|
static
boolean
|
toggleBtsnoopLogging(Sl4aClient client, boolean onOff)
|
static
boolean
|
unpairWithRetry(ITestDevice device)
Réessaie la suppression de l'association Bluetooth avec un intervalle linéaire entre les tentatives
|
static
void
|
uploadLogFiles(ITestInvocationListener listener, ITestDevice device, String type, int iteration)
Importer le fichier journal de surveillance pour les résultats des tests
|
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 de surveillance de l'appareil
| Paramètres |
device |
ITestDevice |
| Génère |
DeviceNotAvailableException |
|
désactiver
public static boolean disable (ITestDevice device)
Désactive le Bluetooth sur l'appareil donné.
| Renvoie |
boolean |
"True" si la désactivation aboutit, "false" dans le cas contraire |
| Génère |
DeviceNotAvailableException |
|
disableBtsnoopLogging
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é |
| Renvoie |
boolean |
qu'il ait réussi ou non |
| Génère |
DeviceNotAvailableException |
|
disableBtsnoopLogging
public static boolean disableBtsnoopLogging (ITestDevice device)
Désactiver la journalisation btsnoop par appel sl4a
| Renvoie |
boolean |
qu'il ait réussi ou non |
| Génère |
DeviceNotAvailableException |
|
activer
public static boolean enable (ITestDevice device)
Active le Bluetooth sur l'appareil donné.
| Renvoie |
boolean |
"True" si l'activation aboutit, "false" dans le cas contraire |
| Génère |
DeviceNotAvailableException |
|
enableBtsnoopLogging
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é |
| Renvoie |
boolean |
qu'il ait réussi ou non |
| Génère |
DeviceNotAvailableException |
|
enableBtsnoopLogging
public static boolean enableBtsnoopLogging (ITestDevice device)
Activer la journalisation btsnoop par appel sl4a
| Renvoie |
boolean |
qu'il ait réussi ou non |
| Génère |
DeviceNotAvailableException |
|
getBluetoothMac
public static String getBluetoothMac (ITestDevice device)
Récupère l'adresse MAC Bluetooth de l'appareil donné
| Renvoie |
String |
Adresse MAC BT ou nulle si elle n'est pas trouvée |
| Génère |
DeviceNotAvailableException |
|
getBondedDevices
public static getBondedDevices (ITestDevice device)
Renvoie les adresses MAC Bluetooth des appareils avec lesquels l'appareil donné a été associé.
| Renvoie |
|
adresses MAC Bluetooth |
| Génère |
DeviceNotAvailableException |
|
getBtSnoopLogFilePath
public static String getBtSnoopLogFilePath (ITestDevice device)
Obtenir le chemin d'accès au fichier journal de surveillance bt à partir du fichier bt_stack.config
| Renvoie |
String |
Nom du fichier pour bt_snoop_log ou valeur "null" s'il n'est pas trouvé
|
| Génère |
DeviceNotAvailableException |
|
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: chaîne de commande envoyée à l'instrumentation BT, actuellement prise en charge : enable, disable, unpairAll, getName, getAddress, getBondedDevices. Pour en savoir plus, consultez la source AOSP. |
| Renvoie |
String |
sortie de BluetoothInstrumentation |
| Génère |
DeviceNotAvailableException |
|
runBluetoothInstrumentationWithRetry
public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device,
String command)
| Paramètres |
device |
ITestDevice |
command |
String |
| Génère |
DeviceNotAvailableException |
|
toggleBtsnoopLogging
public static boolean toggleBtsnoopLogging (Sl4aClient client,
boolean onOff)
| Paramètres |
client |
Sl4aClient |
onOff |
boolean |
| Génère |
DeviceNotAvailableException |
|
unpairWithRetry
public static boolean unpairWithRetry (ITestDevice device)
Réessaie la suppression de l'association Bluetooth avec un intervalle linéaire entre les tentatives
| Génère |
DeviceNotAvailableException |
|
uploadLogFiles
public static void uploadLogFiles (ITestInvocationListener listener,
ITestDevice device,
String type,
int iteration)
Importer le fichier journal de surveillance pour les résultats des tests
| Paramètres |
listener |
ITestInvocationListener |
device |
ITestDevice |
type |
String |
iteration |
int |
| Génère |
DeviceNotAvailableException |
|