BluetoothUtils

public class BluetoothUtils
extends Object

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


Fungsi utilitas untuk memanggil BluetoothInstrumentation di perangkat

Kode BluetoothInstrumentation sisi perangkat dapat ditemukan di AOSP di: frameworks/base/core/tests/bluetoothtests

Ringkasan

Kolom

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

Konstruktor publik

BluetoothUtils()

Metode publik

static void cleanLogFile(ITestDevice device)

Menghapus file log snoop dari perangkat

static boolean disable(ITestDevice device)

Menonaktifkan bluetooth di perangkat yang ditentukan

static boolean disableBtsnoopLogging(ITestDevice device, File sl4aApkFile)

Menonaktifkan logging btsnoop oleh panggilan sl4a

static boolean disableBtsnoopLogging(ITestDevice device)

Menonaktifkan logging btsnoop oleh panggilan sl4a

static boolean enable(ITestDevice device)

Mengaktifkan bluetooth di perangkat tertentu

static boolean enableBtsnoopLogging(ITestDevice device, File sl4aApkFile)

Mengaktifkan logging btsnoop dengan panggilan sl4a

static boolean enableBtsnoopLogging(ITestDevice device)

Mengaktifkan logging btsnoop dengan panggilan sl4a

static String getBluetoothMac(ITestDevice device)

Mengambil mac BT perangkat yang ditentukan

static getBondedDevices(ITestDevice device)

Menampilkan alamat MAC bluetooth perangkat yang telah disambungkan dengan perangkat tertentu

static String getBtSnoopLogFilePath(ITestDevice device)

Mendapatkan jalur file log bt snoop dari file bt_stack.config

static String runBluetoothInstrumentation(ITestDevice device, String command)

Metode praktis untuk menjalankan perintah instrumentasi BT dan menampilkan output

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

Mencoba lagi penghapusan penyambungan BT dengan backoff linear

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

Mengupload file log snoop untuk hasil pengujian

Kolom

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

Konstruktor publik

BluetoothUtils

public BluetoothUtils ()

Metode publik

cleanLogFile

public static void cleanLogFile (ITestDevice device)

Menghapus file log snoop dari perangkat

Parameter
device ITestDevice

Menampilkan
DeviceNotAvailableException

nonaktifkan

public static boolean disable (ITestDevice device)

Menonaktifkan bluetooth di perangkat yang ditentukan

Hasil
boolean Benar jika penonaktifan berhasil, salah jika tidak

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Menonaktifkan logging btsnoop oleh panggilan sl4a

Parameter
sl4aApkFile File: Lokasi file sl4a.apk, null jika telah diinstal

Hasil
boolean berhasil atau tidak

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

Menonaktifkan logging btsnoop oleh panggilan sl4a

Hasil
boolean berhasil atau tidak

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

aktifkan

public static boolean enable (ITestDevice device)

Mengaktifkan bluetooth di perangkat tertentu

Hasil
boolean Benar jika pengaktifan berhasil, salah jika tidak

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Mengaktifkan logging btsnoop dengan panggilan sl4a

Parameter
sl4aApkFile File: Lokasi file sl4a.apk, null jika telah diinstal

Hasil
boolean berhasil atau tidak

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

Mengaktifkan logging btsnoop dengan panggilan sl4a

Hasil
boolean berhasil atau tidak

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

Mengambil mac BT perangkat yang ditentukan

Hasil
String BT mac atau null jika tidak ditemukan

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

Menampilkan alamat MAC bluetooth perangkat yang telah disambungkan dengan perangkat tertentu

Hasil
alamat mac bluetooth

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

Mendapatkan jalur file log bt snoop dari file bt_stack.config

Hasil
String Nama file untuk bt_snoop_log atau null jika tidak ditemukan

Menampilkan
DeviceNotAvailableException

runBluetoothInstrumentation

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

Metode praktis untuk menjalankan perintah instrumentasi BT dan menampilkan output

Parameter
command String: string perintah yang dikirim ke instrumentasi BT, saat ini didukung: enable, disable, unpairAll, getName, getAddress, getBondedDevices; lihat sumber AOSP untuk mengetahui detail selengkapnya

Hasil
String output BluetoothInstrumentation

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Parameter
device ITestDevice

command String

Hasil
boolean

Menampilkan
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Parameter
client Sl4aClient

onOff boolean

Hasil
boolean

Menampilkan
DeviceNotAvailableException

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

Mencoba lagi penghapusan penyambungan BT dengan backoff linear

Hasil
boolean

Menampilkan
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

uploadLogFiles

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

Mengupload file log snoop untuk hasil pengujian

Parameter
listener ITestInvocationListener

device ITestDevice

type String

iteration int

Menampilkan
DeviceNotAvailableException