Sl4aBluetoothUtil
public class Sl4aBluetoothUtil
extends Object
java.lang.Object | |
↳ | com.android.tradefed.util.Sl4aBluetoothUtil |
ユーティリティ クラスは、SL4A を使用して 1 つまたは 2 つのデバイスで Bluetooth 操作を提供します。
まとめ
パブリック コンストラクター | |
---|---|
Sl4aBluetoothUtil () |
公開メソッド | |
---|---|
boolean | changeProfileAccessPermission ( ITestDevice primary, ITestDevice secondary, Sl4aBluetoothUtil.BluetoothProfile profile, Sl4aBluetoothUtil.BluetoothAccessLevel access) セカンダリ デバイスが特定のプロファイルのプライマリ デバイスにアクセスできるように、プライマリ デバイスのセカンダリ デバイスの Bluetooth プロファイル アクセス許可を変更します。 |
boolean | connect ( ITestDevice primary, ITestDevice secondary, profiles) connect ( ITestDevice primary, ITestDevice secondary, profiles) 特定の Bluetooth プロファイルでプライマリ デバイスをセカンダリ デバイスに接続する |
boolean | disable ( ITestDevice device) ターゲット デバイスで Bluetooth を無効にする |
boolean | disableBluetoothSnoopLog ( ITestDevice device) Bluetooth スヌープ ログを無効にする |
boolean | disconnect ( ITestDevice primary, ITestDevice secondary, profiles) disconnect ( ITestDevice primary, ITestDevice secondary, profiles) プライマリ デバイスをセカンダリ デバイスから切断する |
boolean | enable ( ITestDevice device) ターゲット デバイスで Bluetooth を有効にする |
boolean | enableBluetoothSnoopLog ( ITestDevice device) Bluetooth スヌープ ログを有効にする |
String | getAddress ( ITestDevice device) ターゲット デバイスの Bluetooth MAC アドレスを取得する |
getBondedDevices ( ITestDevice device) ターゲット デバイス上のボンディングされた (ペアリングされた) デバイスの Bluetooth MAC アドレスのセットを取得します | |
boolean | pair ( ITestDevice primary, ITestDevice secondary) プライマリ デバイスをセカンダリ デバイスにペアリングする |
void | setBtConnectionTimeout (Duration timeout) |
void | setBtPairTimeout (Duration timeout) |
boolean | setProfilePriority ( ITestDevice primary, ITestDevice secondary, profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority) setProfilePriority ( ITestDevice primary, ITestDevice secondary, profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority) プライマリ デバイスの特定のプロファイルの優先度設定をセカンダリ デバイスに変更する |
void | startSl4a ( ITestDevice device, File sl4aApkFile) 指定されたデバイスと SL4A apk ファイルを使用して SL4A クライアントを明示的に開始します。 |
void | stopSl4a () すでに開いている SL4A クライアントを停止します。 |
boolean | unpairAll ( ITestDevice device) 現在のデバイスとペアリングされているすべてのデバイスのペアリングを解除します |
保護されたメソッド | |
---|---|
void | finalize () すべての SL4A 接続をクリーンアップする |
パブリック コンストラクター
Sl4aBluetoothUtil
public Sl4aBluetoothUtil ()
公開メソッド
changeProfileAccessPermission
public boolean changeProfileAccessPermission (ITestDevice primary, ITestDevice secondary, Sl4aBluetoothUtil.BluetoothProfile profile, Sl4aBluetoothUtil.BluetoothAccessLevel access)
セカンダリ デバイスが特定のプロファイルのプライマリ デバイスにアクセスできるように、プライマリ デバイスのセカンダリ デバイスの Bluetooth プロファイル アクセス許可を変更します。
パラメーター | |
---|---|
primary | ITestDevice : 権限を変更するデバイス |
secondary | ITestDevice : 指定されたプロファイルでプライマリ デバイスにアクセスするデバイス |
profile | Sl4aBluetoothUtil.BluetoothProfile : アクセスする Bluetooth プロファイル |
access | Sl4aBluetoothUtil.BluetoothAccessLevel : アクセスのレベル、 BluetoothAccessLevel を参照 |
戻り値 | |
---|---|
boolean | 権限が正常に変更された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
接続
public boolean connect (ITestDevice primary, ITestDevice secondary,profiles)
特定の Bluetooth プロファイルでプライマリ デバイスをセカンダリ デバイスに接続する
パラメーター | |
---|---|
primary | ITestDevice : 接続元のデバイス |
secondary | ITestDevice : 接続するデバイス |
profiles |
戻り値 | |
---|---|
boolean | 接続が成功した場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
無効にする
public boolean disable (ITestDevice device)
ターゲット デバイスで Bluetooth を無効にする
パラメーター | |
---|---|
device | ITestDevice : ターゲット デバイス |
戻り値 | |
---|---|
boolean | Bluetooth が正常に無効化された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
disableBluetoothSnoopLog
public boolean disableBluetoothSnoopLog (ITestDevice device)
Bluetooth スヌープ ログを無効にする
パラメーター | |
---|---|
device | ITestDevice : スヌープ ログを無効にする |
戻り値 | |
---|---|
boolean | 正常に無効化された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
切断する
public boolean disconnect (ITestDevice primary, ITestDevice secondary,profiles)
プライマリ デバイスをセカンダリ デバイスから切断する
パラメーター | |
---|---|
primary | ITestDevice : 切断操作を実行するデバイス |
secondary | ITestDevice : 切断するデバイス |
profiles |
戻り値 | |
---|---|
boolean | 切断に成功した場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
有効
public boolean enable (ITestDevice device)
ターゲット デバイスで Bluetooth を有効にする
パラメーター | |
---|---|
device | ITestDevice : ターゲット デバイス |
戻り値 | |
---|---|
boolean | Bluetooth が正常に有効化された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
enableBluetoothSnoopLog
public boolean enableBluetoothSnoopLog (ITestDevice device)
Bluetooth スヌープ ログを有効にする
パラメーター | |
---|---|
device | ITestDevice : スヌープ ログを有効にする |
戻り値 | |
---|---|
boolean | 正常に有効化された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getAddress
public String getAddress (ITestDevice device)
ターゲット デバイスの Bluetooth MAC アドレスを取得する
パラメーター | |
---|---|
device | ITestDevice : ターゲット デバイス |
戻り値 | |
---|---|
String | MAC アドレス文字列 |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getBondedDevices
publicgetBondedDevices (ITestDevice device)
ターゲット デバイス上のボンディングされた (ペアリングされた) デバイスの Bluetooth MAC アドレスのセットを取得します
パラメーター | |
---|---|
device | ITestDevice : ターゲット デバイス |
戻り値 | |
---|---|
Bluetooth MAC アドレスのセット |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
ペア
public boolean pair (ITestDevice primary, ITestDevice secondary)
プライマリ デバイスをセカンダリ デバイスにペアリングする
パラメーター | |
---|---|
primary | ITestDevice : ペアリング元のデバイス |
secondary | ITestDevice : ペアリングするデバイス |
戻り値 | |
---|---|
boolean | ペアリングが成功した場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
setBtConnectionTimeout
public void setBtConnectionTimeout (Duration timeout)
パラメーター | |
---|---|
timeout | Duration |
setBtPairTimeout
public void setBtPairTimeout (Duration timeout)
パラメーター | |
---|---|
timeout | Duration |
setProfilePriority
public boolean setProfilePriority (ITestDevice primary, ITestDevice secondary,profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority)
プライマリ デバイスの特定のプロファイルの優先度設定をセカンダリ デバイスに変更する
パラメーター | |
---|---|
primary | ITestDevice : 優先度を設定するデバイス |
secondary | ITestDevice : 優先度を設定するデバイス |
profiles | |
priority | Sl4aBluetoothUtil.BluetoothPriorityLevel : 優先度のレベル |
戻り値 | |
---|---|
boolean | 優先度が正常に設定された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
startSl4a
public void startSl4a (ITestDevice device, File sl4aApkFile)
指定されたデバイスと SL4A apk ファイルを使用して SL4A クライアントを明示的に開始します。実際の操作の前に必ず SL4A 接続が確立されるため、通常、この方法は必要ありません。
パラメーター | |
---|---|
device | ITestDevice : SL4A を使用して接続するデバイス |
sl4aApkFile | File : インストールして使用するオプションの SL4A apk。 |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
stopSl4a
public void stopSl4a ()
すでに開いている SL4A クライアントを停止します。基本的に、クライアントが使用されなくなった直後にクライアントをクリーンアップする方法を提供します
unpairAll
public boolean unpairAll (ITestDevice device)
現在のデバイスとペアリングされているすべてのデバイスのペアリングを解除します
パラメーター | |
---|---|
device | ITestDevice : アクションを実行する現在のデバイス |
戻り値 | |
---|---|
boolean | ペアリングの解除に成功した場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
保護されたメソッド
ファイナライズ
protected void finalize ()
すべての SL4A 接続をクリーンアップする
Sl4aBluetoothUtil
public class Sl4aBluetoothUtil
extends Object
java.lang.Object | |
↳ | com.android.tradefed.util.Sl4aBluetoothUtil |
ユーティリティ クラスは、SL4A を使用して 1 つまたは 2 つのデバイスで Bluetooth 操作を提供します。
まとめ
パブリック コンストラクター | |
---|---|
Sl4aBluetoothUtil () |
公開メソッド | |
---|---|
boolean | changeProfileAccessPermission ( ITestDevice primary, ITestDevice secondary, Sl4aBluetoothUtil.BluetoothProfile profile, Sl4aBluetoothUtil.BluetoothAccessLevel access) セカンダリ デバイスが特定のプロファイルのプライマリ デバイスにアクセスできるように、プライマリ デバイスのセカンダリ デバイスの Bluetooth プロファイル アクセス許可を変更します。 |
boolean | connect ( ITestDevice primary, ITestDevice secondary, profiles) connect ( ITestDevice primary, ITestDevice secondary, profiles) 特定の Bluetooth プロファイルでプライマリ デバイスをセカンダリ デバイスに接続する |
boolean | disable ( ITestDevice device) ターゲット デバイスで Bluetooth を無効にする |
boolean | disableBluetoothSnoopLog ( ITestDevice device) Bluetooth スヌープ ログを無効にする |
boolean | disconnect ( ITestDevice primary, ITestDevice secondary, profiles) disconnect ( ITestDevice primary, ITestDevice secondary, profiles) プライマリ デバイスをセカンダリ デバイスから切断する |
boolean | enable ( ITestDevice device) ターゲット デバイスで Bluetooth を有効にする |
boolean | enableBluetoothSnoopLog ( ITestDevice device) Bluetooth スヌープ ログを有効にする |
String | getAddress ( ITestDevice device) ターゲット デバイスの Bluetooth MAC アドレスを取得する |
getBondedDevices ( ITestDevice device) ターゲット デバイス上のボンディングされた (ペアリングされた) デバイスの Bluetooth MAC アドレスのセットを取得します | |
boolean | pair ( ITestDevice primary, ITestDevice secondary) プライマリ デバイスをセカンダリ デバイスにペアリングする |
void | setBtConnectionTimeout (Duration timeout) |
void | setBtPairTimeout (Duration timeout) |
boolean | setProfilePriority ( ITestDevice primary, ITestDevice secondary, profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority) setProfilePriority ( ITestDevice primary, ITestDevice secondary, profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority) プライマリ デバイスの特定のプロファイルの優先度設定をセカンダリ デバイスに変更する |
void | startSl4a ( ITestDevice device, File sl4aApkFile) 指定されたデバイスと SL4A apk ファイルを使用して SL4A クライアントを明示的に開始します。 |
void | stopSl4a () すでに開いている SL4A クライアントを停止します。 |
boolean | unpairAll ( ITestDevice device) 現在のデバイスとペアリングされているすべてのデバイスのペアリングを解除します |
保護されたメソッド | |
---|---|
void | finalize () すべての SL4A 接続をクリーンアップする |
パブリック コンストラクター
Sl4aBluetoothUtil
public Sl4aBluetoothUtil ()
公開メソッド
changeProfileAccessPermission
public boolean changeProfileAccessPermission (ITestDevice primary, ITestDevice secondary, Sl4aBluetoothUtil.BluetoothProfile profile, Sl4aBluetoothUtil.BluetoothAccessLevel access)
セカンダリ デバイスが特定のプロファイルのプライマリ デバイスにアクセスできるように、プライマリ デバイスのセカンダリ デバイスの Bluetooth プロファイル アクセス許可を変更します。
パラメーター | |
---|---|
primary | ITestDevice : 権限を変更するデバイス |
secondary | ITestDevice : 指定されたプロファイルでプライマリ デバイスにアクセスするデバイス |
profile | Sl4aBluetoothUtil.BluetoothProfile : アクセスする Bluetooth プロファイル |
access | Sl4aBluetoothUtil.BluetoothAccessLevel : アクセスのレベル、 BluetoothAccessLevel を参照 |
戻り値 | |
---|---|
boolean | 権限が正常に変更された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
接続
public boolean connect (ITestDevice primary, ITestDevice secondary,profiles)
特定の Bluetooth プロファイルでプライマリ デバイスをセカンダリ デバイスに接続する
パラメーター | |
---|---|
primary | ITestDevice : 接続元のデバイス |
secondary | ITestDevice : 接続するデバイス |
profiles |
戻り値 | |
---|---|
boolean | 接続が成功した場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
無効にする
public boolean disable (ITestDevice device)
ターゲット デバイスで Bluetooth を無効にする
パラメーター | |
---|---|
device | ITestDevice : ターゲット デバイス |
戻り値 | |
---|---|
boolean | Bluetooth が正常に無効化された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
disableBluetoothSnoopLog
public boolean disableBluetoothSnoopLog (ITestDevice device)
Bluetooth スヌープ ログを無効にする
パラメーター | |
---|---|
device | ITestDevice : スヌープ ログを無効にする |
戻り値 | |
---|---|
boolean | 正常に無効化された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
切断する
public boolean disconnect (ITestDevice primary, ITestDevice secondary,profiles)
プライマリ デバイスをセカンダリ デバイスから切断する
パラメーター | |
---|---|
primary | ITestDevice : 切断操作を実行するデバイス |
secondary | ITestDevice : 切断するデバイス |
profiles |
戻り値 | |
---|---|
boolean | 切断に成功した場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
有効
public boolean enable (ITestDevice device)
ターゲット デバイスで Bluetooth を有効にする
パラメーター | |
---|---|
device | ITestDevice : ターゲット デバイス |
戻り値 | |
---|---|
boolean | Bluetooth が正常に有効化された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
enableBluetoothSnoopLog
public boolean enableBluetoothSnoopLog (ITestDevice device)
Bluetooth スヌープ ログを有効にする
パラメーター | |
---|---|
device | ITestDevice : スヌープ ログを有効にする |
戻り値 | |
---|---|
boolean | 正常に有効化された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getAddress
public String getAddress (ITestDevice device)
ターゲット デバイスの Bluetooth MAC アドレスを取得する
パラメーター | |
---|---|
device | ITestDevice : ターゲット デバイス |
戻り値 | |
---|---|
String | MAC アドレス文字列 |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
getBondedDevices
publicgetBondedDevices (ITestDevice device)
ターゲット デバイス上のボンディングされた (ペアリングされた) デバイスの Bluetooth MAC アドレスのセットを取得します
パラメーター | |
---|---|
device | ITestDevice : ターゲット デバイス |
戻り値 | |
---|---|
Bluetooth MAC アドレスのセット |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
ペア
public boolean pair (ITestDevice primary, ITestDevice secondary)
プライマリ デバイスをセカンダリ デバイスにペアリングする
パラメーター | |
---|---|
primary | ITestDevice : ペアリング元のデバイス |
secondary | ITestDevice : ペアリングするデバイス |
戻り値 | |
---|---|
boolean | ペアリングが成功した場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
setBtConnectionTimeout
public void setBtConnectionTimeout (Duration timeout)
パラメーター | |
---|---|
timeout | Duration |
setBtPairTimeout
public void setBtPairTimeout (Duration timeout)
パラメーター | |
---|---|
timeout | Duration |
setProfilePriority
public boolean setProfilePriority (ITestDevice primary, ITestDevice secondary,profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority)
プライマリ デバイスの特定のプロファイルの優先度設定をセカンダリ デバイスに変更する
パラメーター | |
---|---|
primary | ITestDevice : 優先度を設定するデバイス |
secondary | ITestDevice : 優先度を設定するデバイス |
profiles | |
priority | Sl4aBluetoothUtil.BluetoothPriorityLevel : 優先度のレベル |
戻り値 | |
---|---|
boolean | 優先度が正常に設定された場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
startSl4a
public void startSl4a (ITestDevice device, File sl4aApkFile)
指定されたデバイスと SL4A apk ファイルを使用して SL4A クライアントを明示的に開始します。実際の操作の前に必ず SL4A 接続が確立されるため、通常、この方法は必要ありません。
パラメーター | |
---|---|
device | ITestDevice : SL4A を使用して接続するデバイス |
sl4aApkFile | File : インストールして使用するオプションの SL4A apk。 |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
stopSl4a
public void stopSl4a ()
すでに開いている SL4A クライアントを停止します。基本的に、クライアントが使用されなくなった直後にクライアントをクリーンアップする方法を提供します
unpairAll
public boolean unpairAll (ITestDevice device)
現在のデバイスとペアリングされているすべてのデバイスのペアリングを解除します
パラメーター | |
---|---|
device | ITestDevice : アクションを実行する現在のデバイス |
戻り値 | |
---|---|
boolean | ペアリングの解除に成功した場合は true |
スロー | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
保護されたメソッド
ファイナライズ
protected void finalize ()
すべての SL4A 接続をクリーンアップする