Sl4aBluetoothUtil

public class Sl4aBluetoothUtil
extends Object

java.lang.Object
com.android.tradefed.util.Sl4aBluetoothUtil


Eine Utility-Klasse stellt Bluetooth-Operationen auf einem oder zwei Geräten mit SL4A bereit

Zusammenfassung

Öffentliche Konstrukteure

Sl4aBluetoothUtil ()

Öffentliche Methoden

boolean changeProfileAccessPermission ( ITestDevice primary, ITestDevice secondary, Sl4aBluetoothUtil.BluetoothProfile profile, Sl4aBluetoothUtil.BluetoothAccessLevel access)

Ändern Sie die Zugriffsberechtigung für das Bluetooth-Profil des sekundären Geräts auf dem primären Gerät, damit das sekundäre Gerät auf das primäre Gerät mit dem angegebenen Profil zugreifen kann

boolean connect ( ITestDevice primary, ITestDevice secondary, profiles) connect ( ITestDevice primary, ITestDevice secondary, profiles)

Verbinden Sie das primäre Gerät mit dem sekundären Gerät auf bestimmten Bluetooth-Profilen

boolean disable ( ITestDevice device)

Deaktivieren Sie Bluetooth auf dem Zielgerät

boolean disableBluetoothSnoopLog ( ITestDevice device)

Deaktivieren Sie das Bluetooth-Snoop-Protokoll

boolean disconnect ( ITestDevice primary, ITestDevice secondary, profiles) disconnect ( ITestDevice primary, ITestDevice secondary, profiles)

Trennen Sie das primäre Gerät vom sekundären Gerät

boolean enable ( ITestDevice device)

Aktivieren Sie Bluetooth auf dem Zielgerät

boolean enableBluetoothSnoopLog ( ITestDevice device)

Aktivieren Sie das Bluetooth-Snoop-Protokoll

String getAddress ( ITestDevice device)

Rufen Sie die Bluetooth-MAC-Adresse des Zielgeräts ab

getBondedDevices ( ITestDevice device)

Rufen Sie die Bluetooth-MAC-Adressen der verbundenen (gekoppelten) Geräte auf dem Zielgerät ab

boolean pair ( ITestDevice primary, ITestDevice secondary)

Koppeln Sie das primäre Gerät mit dem sekundären Gerät

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)

Ändern Sie die Prioritätseinstellung bestimmter Profile auf dem primären Gerät in Richtung des sekundären Geräts

void startSl4a ( ITestDevice device, File sl4aApkFile)

Starten Sie den SL4A-Client explizit mit dem angegebenen Gerät und der SL4A-APK-Datei.

void stopSl4a ()

Stoppen Sie bereits geöffnete SL4A-Clients.

boolean unpairAll ( ITestDevice device)

Trennen Sie alle gekoppelten Geräte für das aktuelle Gerät

Geschützte Methoden

void finalize ()

Bereinigen Sie alle SL4A-Verbindungen

Öffentliche Konstrukteure

Sl4aBluetoothUtil

public Sl4aBluetoothUtil ()

Öffentliche Methoden

changeProfileAccessPermission

public boolean changeProfileAccessPermission (ITestDevice primary, 
                ITestDevice secondary, 
                Sl4aBluetoothUtil.BluetoothProfile profile, 
                Sl4aBluetoothUtil.BluetoothAccessLevel access)

Ändern Sie die Zugriffsberechtigung für das Bluetooth-Profil des sekundären Geräts auf dem primären Gerät, damit das sekundäre Gerät auf das primäre Gerät mit dem angegebenen Profil zugreifen kann

Parameter
primary ITestDevice : Gerät zum Ändern der Berechtigung

secondary ITestDevice : Gerät, das auf das primäre Gerät im angegebenen Profil zugreift

profile Sl4aBluetoothUtil.BluetoothProfile : Bluetooth-Profil für den Zugriff

access Sl4aBluetoothUtil.BluetoothAccessLevel : Zugriffsebene, siehe BluetoothAccessLevel

Kehrt zurück
boolean true, wenn die Berechtigung erfolgreich geändert wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

verbinden

public boolean connect (ITestDevice primary, 
                ITestDevice secondary, 
                 profiles)

Verbinden Sie das primäre Gerät mit dem sekundären Gerät auf bestimmten Bluetooth-Profilen

Parameter
primary ITestDevice : Gerät, von dem aus eine Verbindung hergestellt werden soll

secondary ITestDevice : Gerät, mit dem eine Verbindung hergestellt werden soll

profiles : Für die Verbindung ist eine Reihe von Bluetooth-Profilen erforderlich

Kehrt zurück
boolean wahr, wenn die Verbindung erfolgreich ist

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

deaktivieren

public boolean disable (ITestDevice device)

Deaktivieren Sie Bluetooth auf dem Zielgerät

Parameter
device ITestDevice : Zielgerät

Kehrt zurück
boolean true, wenn Bluetooth erfolgreich deaktiviert wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

deaktivierenBluetoothSnoopLog

public boolean disableBluetoothSnoopLog (ITestDevice device)

Deaktivieren Sie das Bluetooth-Snoop-Protokoll

Parameter
device ITestDevice : zum Deaktivieren des Snoop-Protokolls

Kehrt zurück
boolean wahr, wenn erfolgreich deaktiviert

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

trennen

public boolean disconnect (ITestDevice primary, 
                ITestDevice secondary, 
                 profiles)

Trennen Sie das primäre Gerät vom sekundären Gerät

Parameter
primary ITestDevice : Gerät zum Ausführen des Trennvorgangs

secondary ITestDevice : zu trennendes Gerät

profiles : Der angegebene Satz von Bluetooth-Profilen muss getrennt werden

Kehrt zurück
boolean wahr, wenn die Verbindung erfolgreich getrennt wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

ermöglichen

public boolean enable (ITestDevice device)

Aktivieren Sie Bluetooth auf dem Zielgerät

Parameter
device ITestDevice : Zielgerät

Kehrt zurück
boolean true, wenn Bluetooth erfolgreich aktiviert wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBluetoothSnoopLog

public boolean enableBluetoothSnoopLog (ITestDevice device)

Aktivieren Sie das Bluetooth-Snoop-Protokoll

Parameter
device ITestDevice : zum Aktivieren des Snoop-Protokolls

Kehrt zurück
boolean wahr, wenn erfolgreich aktiviert

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getAdresse

public String getAddress (ITestDevice device)

Rufen Sie die Bluetooth-MAC-Adresse des Zielgeräts ab

Parameter
device ITestDevice : Zielgerät

Kehrt zurück
String Zeichenfolge der MAC-Adresse

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public  getBondedDevices (ITestDevice device)

Rufen Sie die Bluetooth-MAC-Adressen der verbundenen (gekoppelten) Geräte auf dem Zielgerät ab

Parameter
device ITestDevice : Zielgerät

Kehrt zurück
Satz von Bluetooth-MAC-Adressen

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Paar

public boolean pair (ITestDevice primary, 
                ITestDevice secondary)

Koppeln Sie das primäre Gerät mit dem sekundären Gerät

Parameter
primary ITestDevice : Gerät zum Koppeln

secondary ITestDevice : Gerät zum Koppeln

Kehrt zurück
boolean wahr, wenn die Kopplung erfolgreich ist

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

setBtConnectionTimeout

public void setBtConnectionTimeout (Duration timeout)

Parameter
timeout Duration

setBtPairTimeout

public void setBtPairTimeout (Duration timeout)

Parameter
timeout Duration

setProfilePriority

public boolean setProfilePriority (ITestDevice primary, 
                ITestDevice secondary, 
                 profiles, 
                Sl4aBluetoothUtil.BluetoothPriorityLevel priority)

Ändern Sie die Prioritätseinstellung bestimmter Profile auf dem primären Gerät in Richtung des sekundären Geräts

Parameter
primary ITestDevice : Gerät, auf das Priorität gesetzt werden soll

secondary ITestDevice : Gerät, für das die Priorität festgelegt werden soll

profiles : Bluetooth-Profile zum Ändern der Prioritätseinstellung

priority Sl4aBluetoothUtil.BluetoothPriorityLevel : Prioritätsstufe

Kehrt zurück
boolean wahr, wenn die Priorität erfolgreich festgelegt wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

startSl4a

public void startSl4a (ITestDevice device, 
                File sl4aApkFile)

Starten Sie den SL4A-Client explizit mit dem angegebenen Gerät und der SL4A-APK-Datei. Normalerweise ist diese Methode nicht erforderlich, da die SL4A-Verbindung immer vor dem eigentlichen Betrieb hergestellt wird.

Parameter
device ITestDevice : das mit SL4A zu verbindende Gerät

sl4aApkFile File : die optionale SL4A apk, die installiert und verwendet werden soll.

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

stopSl4a

public void stopSl4a ()

Stoppen Sie bereits geöffnete SL4A-Clients. Es bietet im Grunde eine Möglichkeit, Clients sofort zu bereinigen, nachdem sie nicht mehr verwendet werden

unpairAll

public boolean unpairAll (ITestDevice device)

Trennen Sie alle gekoppelten Geräte für das aktuelle Gerät

Parameter
device ITestDevice : Aktuelles Gerät zum Ausführen der Aktion

Kehrt zurück
boolean wahr, wenn die Kopplung erfolgreich aufgehoben wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Geschützte Methoden

abschließen

protected void finalize ()

Bereinigen Sie alle SL4A-Verbindungen

,

Sl4aBluetoothUtil

public class Sl4aBluetoothUtil
extends Object

java.lang.Object
com.android.tradefed.util.Sl4aBluetoothUtil


Eine Utility-Klasse stellt Bluetooth-Operationen auf einem oder zwei Geräten mit SL4A bereit

Zusammenfassung

Öffentliche Konstrukteure

Sl4aBluetoothUtil ()

Öffentliche Methoden

boolean changeProfileAccessPermission ( ITestDevice primary, ITestDevice secondary, Sl4aBluetoothUtil.BluetoothProfile profile, Sl4aBluetoothUtil.BluetoothAccessLevel access)

Ändern Sie die Zugriffsberechtigung für das Bluetooth-Profil des sekundären Geräts auf dem primären Gerät, damit das sekundäre Gerät auf das primäre Gerät mit dem angegebenen Profil zugreifen kann

boolean connect ( ITestDevice primary, ITestDevice secondary, profiles) connect ( ITestDevice primary, ITestDevice secondary, profiles)

Verbinden Sie das primäre Gerät mit dem sekundären Gerät auf bestimmten Bluetooth-Profilen

boolean disable ( ITestDevice device)

Deaktivieren Sie Bluetooth auf dem Zielgerät

boolean disableBluetoothSnoopLog ( ITestDevice device)

Deaktivieren Sie das Bluetooth-Snoop-Protokoll

boolean disconnect ( ITestDevice primary, ITestDevice secondary, profiles) disconnect ( ITestDevice primary, ITestDevice secondary, profiles)

Trennen Sie das primäre Gerät vom sekundären Gerät

boolean enable ( ITestDevice device)

Aktivieren Sie Bluetooth auf dem Zielgerät

boolean enableBluetoothSnoopLog ( ITestDevice device)

Aktivieren Sie das Bluetooth-Snoop-Protokoll

String getAddress ( ITestDevice device)

Rufen Sie die Bluetooth-MAC-Adresse des Zielgeräts ab

getBondedDevices ( ITestDevice device)

Rufen Sie die Bluetooth-MAC-Adressen der verbundenen (gekoppelten) Geräte auf dem Zielgerät ab

boolean pair ( ITestDevice primary, ITestDevice secondary)

Koppeln Sie das primäre Gerät mit dem sekundären Gerät

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)

Ändern Sie die Prioritätseinstellung bestimmter Profile auf dem primären Gerät in Richtung des sekundären Geräts

void startSl4a ( ITestDevice device, File sl4aApkFile)

Starten Sie den SL4A-Client explizit mit dem angegebenen Gerät und der SL4A-APK-Datei.

void stopSl4a ()

Stoppen Sie bereits geöffnete SL4A-Clients.

boolean unpairAll ( ITestDevice device)

Trennen Sie alle gekoppelten Geräte für das aktuelle Gerät

Geschützte Methoden

void finalize ()

Bereinigen Sie alle SL4A-Verbindungen

Öffentliche Konstrukteure

Sl4aBluetoothUtil

public Sl4aBluetoothUtil ()

Öffentliche Methoden

changeProfileAccessPermission

public boolean changeProfileAccessPermission (ITestDevice primary, 
                ITestDevice secondary, 
                Sl4aBluetoothUtil.BluetoothProfile profile, 
                Sl4aBluetoothUtil.BluetoothAccessLevel access)

Ändern Sie die Zugriffsberechtigung für das Bluetooth-Profil des sekundären Geräts auf dem primären Gerät, damit das sekundäre Gerät auf das primäre Gerät mit dem angegebenen Profil zugreifen kann

Parameter
primary ITestDevice : Gerät zum Ändern der Berechtigung

secondary ITestDevice : Gerät, das auf das primäre Gerät im angegebenen Profil zugreift

profile Sl4aBluetoothUtil.BluetoothProfile : Bluetooth-Profil für den Zugriff

access Sl4aBluetoothUtil.BluetoothAccessLevel : Zugriffsebene, siehe BluetoothAccessLevel

Kehrt zurück
boolean true, wenn die Berechtigung erfolgreich geändert wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

verbinden

public boolean connect (ITestDevice primary, 
                ITestDevice secondary, 
                 profiles)

Verbinden Sie das primäre Gerät mit dem sekundären Gerät auf bestimmten Bluetooth-Profilen

Parameter
primary ITestDevice : Gerät, von dem aus eine Verbindung hergestellt werden soll

secondary ITestDevice : Gerät, mit dem eine Verbindung hergestellt werden soll

profiles : Für die Verbindung ist eine Reihe von Bluetooth-Profilen erforderlich

Kehrt zurück
boolean wahr, wenn die Verbindung erfolgreich ist

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

deaktivieren

public boolean disable (ITestDevice device)

Deaktivieren Sie Bluetooth auf dem Zielgerät

Parameter
device ITestDevice : Zielgerät

Kehrt zurück
boolean true, wenn Bluetooth erfolgreich deaktiviert wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

deaktivierenBluetoothSnoopLog

public boolean disableBluetoothSnoopLog (ITestDevice device)

Deaktivieren Sie das Bluetooth-Snoop-Protokoll

Parameter
device ITestDevice : zum Deaktivieren des Snoop-Protokolls

Kehrt zurück
boolean wahr, wenn erfolgreich deaktiviert

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

trennen

public boolean disconnect (ITestDevice primary, 
                ITestDevice secondary, 
                 profiles)

Trennen Sie das primäre Gerät vom sekundären Gerät

Parameter
primary ITestDevice : Gerät zum Ausführen des Trennvorgangs

secondary ITestDevice : zu trennendes Gerät

profiles : Der angegebene Satz von Bluetooth-Profilen muss getrennt werden

Kehrt zurück
boolean wahr, wenn die Verbindung erfolgreich getrennt wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

ermöglichen

public boolean enable (ITestDevice device)

Aktivieren Sie Bluetooth auf dem Zielgerät

Parameter
device ITestDevice : Zielgerät

Kehrt zurück
boolean true, wenn Bluetooth erfolgreich aktiviert wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBluetoothSnoopLog

public boolean enableBluetoothSnoopLog (ITestDevice device)

Aktivieren Sie das Bluetooth-Snoop-Protokoll

Parameter
device ITestDevice : zum Aktivieren des Snoop-Protokolls

Kehrt zurück
boolean wahr, wenn erfolgreich aktiviert

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getAdresse

public String getAddress (ITestDevice device)

Rufen Sie die Bluetooth-MAC-Adresse des Zielgeräts ab

Parameter
device ITestDevice : Zielgerät

Kehrt zurück
String Zeichenfolge der MAC-Adresse

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public  getBondedDevices (ITestDevice device)

Rufen Sie die Bluetooth-MAC-Adressen der verbundenen (gekoppelten) Geräte auf dem Zielgerät ab

Parameter
device ITestDevice : Zielgerät

Kehrt zurück
Satz von Bluetooth-MAC-Adressen

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Paar

public boolean pair (ITestDevice primary, 
                ITestDevice secondary)

Koppeln Sie das primäre Gerät mit dem sekundären Gerät

Parameter
primary ITestDevice : Gerät zum Koppeln

secondary ITestDevice : Gerät zum Koppeln

Kehrt zurück
boolean wahr, wenn die Kopplung erfolgreich ist

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

setBtConnectionTimeout

public void setBtConnectionTimeout (Duration timeout)

Parameter
timeout Duration

setBtPairTimeout

public void setBtPairTimeout (Duration timeout)

Parameter
timeout Duration

setProfilePriority

public boolean setProfilePriority (ITestDevice primary, 
                ITestDevice secondary, 
                 profiles, 
                Sl4aBluetoothUtil.BluetoothPriorityLevel priority)

Ändern Sie die Prioritätseinstellung bestimmter Profile auf dem primären Gerät in Richtung des sekundären Geräts

Parameter
primary ITestDevice : Gerät, auf das Priorität gesetzt werden soll

secondary ITestDevice : Gerät, für das die Priorität festgelegt werden soll

profiles : Bluetooth-Profile zum Ändern der Prioritätseinstellung

priority Sl4aBluetoothUtil.BluetoothPriorityLevel : Prioritätsstufe

Kehrt zurück
boolean wahr, wenn die Priorität erfolgreich festgelegt wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

startSl4a

public void startSl4a (ITestDevice device, 
                File sl4aApkFile)

Starten Sie den SL4A-Client explizit mit dem angegebenen Gerät und der SL4A-APK-Datei. Normalerweise ist diese Methode nicht erforderlich, da die SL4A-Verbindung immer vor dem eigentlichen Betrieb hergestellt wird.

Parameter
device ITestDevice : das mit SL4A zu verbindende Gerät

sl4aApkFile File : die optionale SL4A apk, die installiert und verwendet werden soll.

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

stopSl4a

public void stopSl4a ()

Stoppen Sie bereits geöffnete SL4A-Clients. Es bietet im Grunde eine Möglichkeit, Clients sofort zu bereinigen, nachdem sie nicht mehr verwendet werden

unpairAll

public boolean unpairAll (ITestDevice device)

Trennen Sie alle gekoppelten Geräte für das aktuelle Gerät

Parameter
device ITestDevice : Aktuelles Gerät zum Ausführen der Aktion

Kehrt zurück
boolean wahr, wenn die Kopplung erfolgreich aufgehoben wurde

Wirft
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Geschützte Methoden

abschließen

protected void finalize ()

Bereinigen Sie alle SL4A-Verbindungen