Class ConnectionStateBuilder
java.lang.Object
io.appium.java_client.android.connection.ConnectionStateBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes connection state builder with the default value (all off).ConnectionStateBuilder(long bitMask) Initializes connection state builder with the the predefined bit mask.Initializes connection state builder with the the predefined bit mask. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds connection state instance, which is ready to be passed as Appium server parameter.Sets airplane mode to disabled state if it was enabled.Sets airplane mode to enabled state if it was disabled.Sets data connection mode to disabled state if it was enabled.Sets data connection mode to enabled state if it was disabled.Sets Wi-Fi connection mode to disabled state if it was enabled.Sets Wi-Fi connection mode to enabled state if it was disabled.
-
Constructor Details
-
ConnectionStateBuilder
public ConnectionStateBuilder()Initializes connection state builder with the default value (all off). -
ConnectionStateBuilder
public ConnectionStateBuilder(long bitMask) Initializes connection state builder with the the predefined bit mask. This constructor might be handy to change an existing connection state.- Parameters:
bitMask- the actual initial state bit mask to set
-
ConnectionStateBuilder
Initializes connection state builder with the the predefined bit mask. This constructor might be handy to change an existing connection state.- Parameters:
state- the actual initial state to set
-
-
Method Details
-
withAirplaneModeEnabled
Sets airplane mode to enabled state if it was disabled. This option only works up to Android 6. Enabling the airplane mode on the device will automatically disable Wi-Fi and data connections.- Returns:
- self instance for chaining
-
withAirplaneModeDisabled
Sets airplane mode to disabled state if it was enabled. This option only works up to Android 6.- Returns:
- self instance for chaining
-
withWiFiEnabled
Sets Wi-Fi connection mode to enabled state if it was disabled.- Returns:
- self instance for chaining
-
withWiFiDisabled
Sets Wi-Fi connection mode to disabled state if it was enabled.- Returns:
- self instance for chaining
-
withDataEnabled
Sets data connection mode to enabled state if it was disabled. This option only works on rooted devices or on emulators.- Returns:
- self instance for chaining
-
withDataDisabled
Sets data connection mode to disabled state if it was enabled. This option only works on rooted devices or on emulators.- Returns:
- self instance for chaining
-
build
Builds connection state instance, which is ready to be passed as Appium server parameter.- Returns:
- ConnectionState instance
-