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 : 接続には一連の Bluetooth プロファイルが必要です

戻り値
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 : 切断する必要がある特定の Bluetooth プロファイルのセット

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

public  getBondedDevices (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 : 優先設定を変更するための Bluetooth プロファイル

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 : 接続には一連の Bluetooth プロファイルが必要です

戻り値
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 : 切断する必要がある特定の Bluetooth プロファイルのセット

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

public  getBondedDevices (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 : 優先設定を変更するための Bluetooth プロファイル

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 接続をクリーンアップする