2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
BluetoothUtils
public
class
BluetoothUtils
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.BluetoothUtils
|
デバイスで BluetoothInstrumentation を呼び出すためのユーティリティ関数
デバイス側の BluetoothInstrumentation コードは、AOSP の frameworks/base/core/tests/bluetoothtests
にあります。
概要
フィールド
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)
デバイスからスヌープ ログファイルを削除する
例外 |
DeviceNotAvailableException |
|
無効にする
public static boolean disable (ITestDevice device)
指定したデバイスで Bluetooth を無効にする
戻り値 |
boolean |
無効化が成功した場合は true、それ以外の場合は false |
例外 |
DeviceNotAvailableException |
|
disableBtsnoopLogging
public static boolean disableBtsnoopLogging (ITestDevice device,
File sl4aApkFile)
sl4a 呼び出しによる btsnoop ロギングを無効化
パラメータ |
sl4aApkFile |
File : sl4a.apk ファイルの場所(インストールされている場合は null) |
例外 |
DeviceNotAvailableException |
|
disableBtsnoopLogging
public static boolean disableBtsnoopLogging (ITestDevice device)
sl4a 呼び出しによる btsnoop ロギングを無効化
例外 |
DeviceNotAvailableException |
|
有効にする
public static boolean enable (ITestDevice device)
指定したデバイスで Bluetooth を有効にする
戻り値 |
boolean |
有効化が成功した場合は true、それ以外の場合は false |
例外 |
DeviceNotAvailableException |
|
enableBtsnoopLogging
public static boolean enableBtsnoopLogging (ITestDevice device,
File sl4aApkFile)
sl4a 呼び出しによる btsnoop ロギングを有効にする
パラメータ |
sl4aApkFile |
File : sl4a.apk ファイルの場所(インストールされている場合は null) |
例外 |
DeviceNotAvailableException |
|
enableBtsnoopLogging
public static boolean enableBtsnoopLogging (ITestDevice device)
sl4a 呼び出しによる btsnoop ロギングを有効にする
例外 |
DeviceNotAvailableException |
|
getBluetoothMac
public static String getBluetoothMac (ITestDevice device)
指定されたデバイスの BT MAC を取得します。
戻り値 |
String |
BT MAC または見つからない場合は null |
例外 |
DeviceNotAvailableException |
|
getBondedDevices
public static getBondedDevices (ITestDevice device)
指定されたデバイスがボンディングしたデバイスの Bluetooth MAC アドレスを返します。
例外 |
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 の出力 |
例外 |
DeviceNotAvailableException |
|
runBluetoothInstrumentationWithRetry
public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device,
String command)
パラメータ |
device |
ITestDevice |
command |
String |
例外 |
DeviceNotAvailableException |
|
toggleBtsnoopLogging
public static boolean toggleBtsnoopLogging (Sl4aClient client,
boolean onOff)
パラメータ |
client |
Sl4aClient |
onOff |
boolean |
例外 |
DeviceNotAvailableException |
|
unpairWithRetry
public static boolean unpairWithRetry (ITestDevice device)
線形バックオフで BT ペアリングの消去を再試行
例外 |
DeviceNotAvailableException |
|
uploadLogFiles
public static void uploadLogFiles (ITestInvocationListener listener,
ITestDevice device,
String type,
int iteration)
テスト結果のスヌープ ログファイルをアップロードする
パラメータ |
listener |
ITestInvocationListener |
device |
ITestDevice |
type |
String |
iteration |
int |
例外 |
DeviceNotAvailableException |
|
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-26 UTC。"],[],[]]