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é

Champs

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

Constructeurs publics

BluetoothUtils()

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
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
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
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Paramètres
device ITestDevice

command String

Renvoie
boolean

Génère
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Paramètres
client Sl4aClient

onOff boolean

Renvoie
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

Renvoie
boolean

Génère
com.android.tradefed.device.DeviceNotAvailableException
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