Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.

BluetoothUtils

public class BluetoothUtils
extends Object

java.lang.Objek
com.android.tradefed.util.BluetoothUtils


Fungsi utilitas untuk memanggil BluetoothInstrumentation di perangkat

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

Ringkasan

Bidang

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)

Hapus file log pengintaian dari perangkat

static boolean disable ( ITestDevice device)

Menonaktifkan bluetooth pada perangkat tertentu

static boolean disableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

Nonaktifkan logging btsnoop dengan panggilan sl4a

static boolean disableBtsnoopLogging ( ITestDevice device)

Nonaktifkan logging btsnoop dengan panggilan sl4a

static boolean enable ( ITestDevice device)

Mengaktifkan bluetooth pada perangkat yang diberikan

static boolean enableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

Aktifkan logging btsnoop dengan panggilan sl4a

static boolean enableBtsnoopLogging ( ITestDevice device)

Aktifkan logging btsnoop dengan panggilan sl4a

static String getBluetoothMac ( ITestDevice device)

Mengambil BT mac dari perangkat yang diberikan

static getBondedDevices ( ITestDevice device)

Mengembalikan alamat mac bluetooth perangkat yang telah terikat dengan perangkat tertentu

static String getBtSnoopLogFilePath ( ITestDevice device)

Dapatkan path file log bt snoop dari file bt_stack.config

static String runBluetoothInstrumentation ( ITestDevice device, String command)

Metode kenyamanan untuk menjalankan perintah instrumentasi BT dan mengembalikan output

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

Mencoba lagi menghapus pasangan BT dengan backoff linier

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

Unggah file log pengintai untuk hasil tes

Bidang

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)

Hapus file log pengintaian dari perangkat

Parameter
device ITestDevice

Melempar
DeviceNotAvailableException

cacat

public static boolean disable (ITestDevice device)

Menonaktifkan bluetooth pada perangkat tertentu

Pengembalian
boolean Benar jika penonaktifan berhasil, salah jika sebaliknya

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

nonaktifkan BtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Nonaktifkan logging btsnoop dengan panggilan sl4a

Parameter
sl4aApkFile File : lokasi file sl4a.apk, null jika sudah terinstal

Pengembalian
boolean berhasil atau tidak

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

nonaktifkan BtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

Nonaktifkan logging btsnoop dengan panggilan sl4a

Pengembalian
boolean berhasil atau tidak

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

memungkinkan

public static boolean enable (ITestDevice device)

Mengaktifkan bluetooth pada perangkat yang diberikan

Pengembalian
boolean Benar jika pengaktifan berhasil, salah jika sebaliknya

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

aktifkanBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Aktifkan logging btsnoop dengan panggilan sl4a

Parameter
sl4aApkFile File : lokasi file sl4a.apk, null jika sudah terinstal

Pengembalian
boolean berhasil atau tidak

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

aktifkanBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

Aktifkan logging btsnoop dengan panggilan sl4a

Pengembalian
boolean berhasil atau tidak

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

Mengambil BT mac dari perangkat yang diberikan

Pengembalian
String BT mac atau null jika tidak ditemukan

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

Mengembalikan alamat mac bluetooth perangkat yang telah terikat dengan perangkat tertentu

Pengembalian
alamat mac bluetooth

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

Dapatkan path file log bt snoop dari file bt_stack.config

Pengembalian
String Nama file untuk bt_snoop_log atau null jika tidak ditemukan

Melempar
DeviceNotAvailableException

jalankan BluetoothInstrumentation

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

Metode kenyamanan untuk menjalankan perintah instrumentasi BT dan mengembalikan output

Parameter
command String : string perintah yang dikirim ke instrumentasi BT, saat ini didukung: aktifkan, nonaktifkan, unpairAll, getName, getAddress, getBondedDevices; lihat sumber AOSP untuk detail lebih lanjut

Pengembalian
String output dari BluetoothInstrumentation

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Parameter
device ITestDevice

command String

Pengembalian
boolean

Melempar
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Parameter
client Sl4aClient

onOff boolean

Pengembalian
boolean

Melempar
DeviceNotAvailableException

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

Mencoba lagi menghapus pasangan BT dengan backoff linier

Pengembalian
boolean

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

unggahLogFiles

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

Unggah file log pengintai untuk hasil tes

Parameter
listener ITestInvocationListener

device ITestDevice

type String

iteration int

Melempar
DeviceNotAvailableException