Bluetooth ユーティリティ

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)

sl4a 呼び出しによる btsnoop ロギングを無効化

static boolean disableBtsnoopLogging(ITestDevice device)

sl4a 呼び出しによる btsnoop ロギングを無効化

static boolean enable(ITestDevice device)

指定したデバイスで Bluetooth を有効にします

static boolean enableBtsnoopLogging(ITestDevice device, File sl4aApkFile)

sl4a 呼び出しによる btsnoop ロギングを有効にする

static boolean enableBtsnoopLogging(ITestDevice device)

sl4a 呼び出しによる btsnoop ロギングを有効にする

static String getBluetoothMac(ITestDevice device)

指定されたデバイスの BT MAC を取得します。

static getBondedDevices(ITestDevice device)

指定したデバイスがボンディングされているデバイスの Bluetooth MAC アドレスを返します

static String getBtSnoopLogFilePath(ITestDevice device)

bt_stack.config ファイルから bt スヌープログ ファイルのパスを取得する

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

パブリック コンストラクタ

Bluetooth ユーティリティ

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)

sl4a 呼び出しによる btsnoop ロギングを無効化

パラメータ
sl4aApkFile File: sl4a.apk ファイルの場所。インストール済みの場合は null

戻り値
boolean 成功か失敗か

例外
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

sl4a 呼び出しによる btsnoop ロギングを無効化

戻り値
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)

sl4a 呼び出しによる btsnoop ロギングを有効にする

パラメータ
sl4aApkFile File: sl4a.apk ファイルの場所。インストール済みの場合は null

戻り値
boolean 成功か失敗か

例外
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

sl4a 呼び出しによる btsnoop ロギングを有効にする

戻り値
boolean 成功か失敗か

例外
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Bluetooth Mac

public static String getBluetoothMac (ITestDevice device)

指定されたデバイスの BT MAC を取得します。

戻り値
String BT MAC または見つからない場合は null

例外
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

指定したデバイスがボンディングされているデバイスの Bluetooth MAC アドレスを返します

戻り値
Bluetooth MAC アドレス

例外
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

bt_stack.config ファイルから bt スヌープログ ファイルのパスを取得する

戻り値
String bt_snoop_log のファイル名、または見つからない場合は null

例外
DeviceNotAvailableException

runBluetoothInstrumentation

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

BT 計測コマンドを実行して出力を返すコンビニエンス メソッド

パラメータ
command String: BT 計測に送信されるコマンド文字列。現在サポートされています。 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

トグル BtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

パラメータ
client Sl4aClient

onOff boolean

戻り値
boolean

例外
DeviceNotAvailableException

再試行で接続解除

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