BluetoothUtils

public class BluetoothUtils
extends Object

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


פונקציות שירות לקריאה ל-BluetoothInstrumentation במכשיר

הקוד של BluetoothInstrumentation בצד המכשיר נמצא ב-AOSP בכתובת: frameworks/base/core/tests/bluetoothtests

סיכום

שדות

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

קונסטרוקטורים גלויים לכולם

BluetoothUtils()

שיטות ציבוריות

static void cleanLogFile(ITestDevice device)

מחיקת קובץ יומן הפריצה מהמכשיר

static boolean disable(ITestDevice device)

השבתת Bluetooth במכשיר הנתון

static boolean disableBtsnoopLogging(ITestDevice device, File sl4aApkFile)

השבתת הרישום ביומן של btsnoop באמצעות קריאה ל-sl4a

static boolean disableBtsnoopLogging(ITestDevice device)

השבתת הרישום ביומן של btsnoop באמצעות קריאה ל-sl4a

static boolean enable(ITestDevice device)

הפעלת Bluetooth במכשיר הנתון

static boolean enableBtsnoopLogging(ITestDevice device, File sl4aApkFile)

הפעלת רישום ביומן של btsnoop באמצעות קריאה ל-sl4a

static boolean enableBtsnoopLogging(ITestDevice device)

הפעלת רישום ביומן של btsnoop באמצעות קריאה ל-sl4a

static String getBluetoothMac(ITestDevice device)

אחזור ה-BT MAC של המכשיר הנתון

static getBondedDevices(ITestDevice device)

הפונקציה מחזירה את כתובות ה-MAC של מכשירי ה-Bluetooth שהמכשיר הנתון התחבר אליהם.

static String getBtSnoopLogFilePath(ITestDevice device)

אחזור הנתיב של קובץ היומן של bt snoop מקובץ bt_stack.config

static String runBluetoothInstrumentation(ITestDevice device, String command)

שיטה נוחה להרצת פקודת הטמעת ה-BT ולהחזרת פלט

static boolean runBluetoothInstrumentationWithRetry(ITestDevice device, String command)
static boolean toggleBtsnoopLogging(Sl4aClient client, boolean onOff)
static boolean unpairWithRetry(ITestDevice device)

ניסיון חוזר לניקוי ההתאמה ל-BT עם השהיה ליניארית לפני ניסיון חוזר

static void uploadLogFiles(ITestInvocationListener listener, ITestDevice device, String type, int iteration)

העלאת קובץ יומן של ניטור לקבלת תוצאות הבדיקה

שדות

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

קונסטרוקטורים גלויים לכולם

BluetoothUtils

public BluetoothUtils ()

שיטות ציבוריות

cleanLogFile

public static void cleanLogFile (ITestDevice device)

מחיקת קובץ יומן הפריצה מהמכשיר

פרמטרים
device ITestDevice

זריקות
DeviceNotAvailableException

השבתה

public static boolean disable (ITestDevice device)

השבתת Bluetooth במכשיר הנתון

החזרות
boolean True אם ההשבתה בוצעה, False אחרת

זריקות
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

השבתת הרישום ביומן של btsnoop באמצעות קריאה ל-sl4a

פרמטרים
sl4aApkFile File: המיקום של הקובץ sl4a.apk, null אם הוא הותקן

החזרות
boolean הצלחה או כישלון

זריקות
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

השבתת הרישום ביומן של btsnoop באמצעות קריאה ל-sl4a

החזרות
boolean הצלחה או כישלון

זריקות
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

הפעלה

public static boolean enable (ITestDevice device)

הפעלת Bluetooth במכשיר הנתון

החזרות
boolean True אם ההפעלה בוצעה בהצלחה, False אחרת

זריקות
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

הפעלת רישום ביומן של btsnoop באמצעות קריאה ל-sl4a

פרמטרים
sl4aApkFile File: המיקום של הקובץ sl4a.apk, null אם הוא הותקן

החזרות
boolean הצלחה או כישלון

זריקות
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

הפעלת רישום ביומן של btsnoop באמצעות קריאה ל-sl4a

החזרות
boolean הצלחה או כישלון

זריקות
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

אחזור ה-BT MAC של המכשיר הנתון

החזרות
String BT mac או null אם לא נמצא

זריקות
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

הפונקציה מחזירה את כתובות ה-MAC של מכשירי ה-Bluetooth שהמכשיר הנתון התחבר אליהם.

החזרות
כתובות MAC של Bluetooth

זריקות
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

אחזור הנתיב של קובץ היומן של bt snoop מקובץ bt_stack.config

החזרות
String שם הקובץ של bt_snoop_log או null אם הוא לא נמצא

זריקות
DeviceNotAvailableException

runBluetoothInstrumentation

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

שיטה נוחה להרצת פקודת הטמעת ה-BT ולהחזרת פלט

פרמטרים
command String: מחרוזת פקודות שנשלחת ל-BT instrumentation. בשלב הזה נתמכות הפקודות הבאות: enable,‏ disable,‏ unpairAll,‏ getName,‏ getAddress,‏ getBondedDevices. פרטים נוספים זמינים במקור AOSP.

החזרות
String הפלט של BluetoothInstrumentation

זריקות
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

פרמטרים
device ITestDevice

command String

החזרות
boolean

זריקות
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

פרמטרים
client Sl4aClient

onOff boolean

החזרות
boolean

זריקות
DeviceNotAvailableException

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

ניסיון חוזר לניקוי ההתאמה ל-BT עם השהיה ליניארית לפני ניסיון חוזר

החזרות
boolean

זריקות
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

uploadLogFiles

public static void uploadLogFiles (ITestInvocationListener listener, 
                ITestDevice device, 
                String type, 
                int iteration)

העלאת קובץ יומן של ניטור לקבלת תוצאות הבדיקה

פרמטרים
listener ITestInvocationListener

device ITestDevice

type String

iteration int

זריקות
DeviceNotAvailableException