Utilitas Bluetooth

public class BluetoothUtils
extends Object

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


Fungsi utilitas untuk memanggil Instrumen Bluetooth pada perangkat

Kode instrumentasi Bluetooth sisi perangkat 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 snoop 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 tertentu

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 dari perangkat yang telah terikat dengan perangkat tertentu

static String getBtSnoopLogFilePath ( ITestDevice device)

Dapatkan jalur file log bt snoop dari file bt_stack.config

static String runBluetoothInstrumentation ( ITestDevice device, String command)

Metode kemudahan untuk menjalankan perintah instrumentasi BT dan mengembalikan keluaran

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

Mencoba kembali menyelesaikan pemasangan BT dengan backoff linier

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

Unggah file log snoop 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

EMAS_BTSNOOP_LOG_PATH

public static final String GOLD_BTSNOOP_LOG_PATH

O_BANGUN

public static final String O_BUILD

Konstruktor publik

Utilitas Bluetooth

public BluetoothUtils ()

Metode publik

membersihkanLogFile

public static void cleanLogFile (ITestDevice device)

Hapus file log snoop dari perangkat

Parameter
device ITestDevice

Melempar
DeviceNotAvailableException

cacat

public static boolean disable (ITestDevice device)

Menonaktifkan bluetooth pada perangkat tertentu

Kembali
boolean Benar jika penonaktifan berhasil, salah jika sebaliknya

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

nonaktifkanBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Nonaktifkan logging btsnoop dengan panggilan sl4a

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

Kembali
boolean sukses atau tidak

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

nonaktifkanBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

Nonaktifkan logging btsnoop dengan panggilan sl4a

Kembali
boolean sukses atau tidak

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

memungkinkan

public static boolean enable (ITestDevice device)

Mengaktifkan bluetooth pada perangkat tertentu

Kembali
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 terinstall

Kembali
boolean sukses atau tidak

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

aktifkanBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

Aktifkan logging btsnoop dengan panggilan sl4a

Kembali
boolean sukses atau tidak

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

dapatkan BluetoothMac

public static String getBluetoothMac (ITestDevice device)

Mengambil BT mac dari perangkat yang diberikan

Kembali
String BT mac atau null jika tidak ditemukan

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

dapatkanPerangkat Berikat

public static  getBondedDevices (ITestDevice device)

Mengembalikan alamat mac bluetooth dari perangkat yang telah terikat dengan perangkat tertentu

Kembali
alamat mac bluetooth

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

dapatkanBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

Dapatkan jalur file log bt snoop dari file bt_stack.config

Kembali
String Nama filenya bt_snoop_log atau null jika tidak ditemukan

Melempar
DeviceNotAvailableException

jalankanBluetoothInstrumentation

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

Metode kemudahan untuk menjalankan perintah instrumentasi BT dan mengembalikan keluaran

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

Kembali
String keluaran instrumentasi Bluetooth

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

jalankanBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Parameter
device ITestDevice

command String

Kembali
boolean

Melempar
DeviceNotAvailableException

beralihBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Parameter
client Sl4aClient

onOff boolean

Kembali
boolean

Melempar
DeviceNotAvailableException

lepaskan pasanganDengan Coba Lagi

public static boolean unpairWithRetry (ITestDevice device)

Mencoba kembali menyelesaikan pemasangan BT dengan backoff linier

Kembali
boolean

Melempar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

unggahLogFiles

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

Unggah file log snoop untuk hasil tes

Parameter
listener ITestInvocationListener

device ITestDevice

type String

iteration int

Melempar
DeviceNotAvailableException