Example usage: - * - *
- * NetworkConnection mobileDriver = (NetworkConnection) driver;
- * if (mobileDriver.getNetworkConnection() != ConnectionType.AIRPLANE_MODE) {
- * // enabling Airplane mode
- * mobileDriver.setNetworkConnection(ConnectionType.AIRPLANE_MODE);
- * }
- *
- */
-@Deprecated
-public interface NetworkConnection {
-
- /**
- * ConnectionType is a bitmask to represent a device's network connection
- *
- * - * Data | WIFI | Airplane - * 0 0 1 == 1 - * 1 1 0 == 6 - * 1 0 0 == 4 - * 0 1 0 == 2 - * 0 0 0 == 0 - *- * - *
Giving "Data" the first bit positions in order to give room for the future of enabling
- * specific types of data (Edge / 2G, 3G, 4G, LTE, etc) if the device allows it.
- */
- class ConnectionType {
-
- public static final ConnectionType WIFI = new ConnectionType(2);
- public static final ConnectionType DATA = new ConnectionType(4);
- public static final ConnectionType AIRPLANE_MODE = new ConnectionType(1);
- public static final ConnectionType ALL = new ConnectionType(6);
- public static final ConnectionType NONE = new ConnectionType(0);
-
- /*
- Future for Network Data types. With a new constructor accepting this enum.
- public enum DataType {
- _2G, _3G, _4G, LTE
- }
- */
-
- private int mask = 0;
-
- public ConnectionType(Boolean wifi, Boolean data, Boolean airplaneMode) {
- if (wifi) {
- mask += WIFI.mask;
- }
- if (data) {
- mask += DATA.mask;
- }
- if (airplaneMode) {
- mask += AIRPLANE_MODE.mask;
- }
- }
-
- public ConnectionType(int mask) {
- // must be a positive number
- this.mask = Math.max(mask, 0);
- }
-
- public Boolean isAirplaneMode() {
- return mask % 2 == 1;
- }
-
- public Boolean isWifiEnabled() {
- // shift right 1 bit, check last bit
- return (mask / 2) % 2 == 1;
- }
-
- public Boolean isDataEnabled() {
- // shift right 2 bits, check if any bits set
- return (mask / 4) > 0;
- }
-
- @Override
- public boolean equals(Object type) {
- return type instanceof ConnectionType && this.mask == ((ConnectionType) type).mask;
- }
-
- @Override
- public int hashCode() {
- return mask;
- }
-
- @Override
- public String toString() {
- return Integer.toString(mask);
- }
-
- public Integer toJson() {
- return mask;
- }
- }
-
- /**
- * Query the driver for the Airplane Mode setting state
- *
- * @return {@link org.openqa.selenium.mobile.NetworkConnection.ConnectionType} indicating if the
- * device is in Airplane Mode
- */
- ConnectionType getNetworkConnection();
-
- /**
- * Set the Connection type Not all connection type combinations are valid for an individual type
- * of device and the remote endpoint will make a best effort to set the type as requested
- *
- * @param type ConnectionType of what the network connection should be
- * @return {@link org.openqa.selenium.mobile.NetworkConnection.ConnectionType} of what the
- * device's network connection is
- */
- ConnectionType setNetworkConnection(ConnectionType type);
-}
diff --git a/java/src/org/openqa/selenium/remote/DriverCommand.java b/java/src/org/openqa/selenium/remote/DriverCommand.java
index 18da731775c1a..5ee279bfc747a 100644
--- a/java/src/org/openqa/selenium/remote/DriverCommand.java
+++ b/java/src/org/openqa/selenium/remote/DriverCommand.java
@@ -136,9 +136,6 @@ public interface DriverCommand {
// Logging API
String GET_AVAILABLE_LOG_TYPES = "getAvailableLogTypes";
String GET_LOG = "getLog";
- // Mobile API
- String GET_NETWORK_CONNECTION = "getNetworkConnection";
- String SET_NETWORK_CONNECTION = "setNetworkConnection";
// Virtual Authenticator API
// http://w3c.github.io/webauthn#sctn-automation
String ADD_VIRTUAL_AUTHENTICATOR = "addVirtualAuthenticator";
diff --git a/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java b/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java
index 1f73cbca58b46..df6318a11ed14 100644
--- a/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java
+++ b/java/src/org/openqa/selenium/remote/codec/AbstractHttpCommandCodec.java
@@ -53,7 +53,6 @@
import static org.openqa.selenium.remote.DriverCommand.GET_FEDCM_DIALOG_TYPE;
import static org.openqa.selenium.remote.DriverCommand.GET_FEDCM_TITLE;
import static org.openqa.selenium.remote.DriverCommand.GET_LOCATION;
-import static org.openqa.selenium.remote.DriverCommand.GET_NETWORK_CONNECTION;
import static org.openqa.selenium.remote.DriverCommand.GET_TIMEOUTS;
import static org.openqa.selenium.remote.DriverCommand.GET_TITLE;
import static org.openqa.selenium.remote.DriverCommand.GO_BACK;
@@ -73,7 +72,6 @@
import static org.openqa.selenium.remote.DriverCommand.SEND_KEYS_TO_ELEMENT;
import static org.openqa.selenium.remote.DriverCommand.SET_DELAY_ENABLED;
import static org.openqa.selenium.remote.DriverCommand.SET_LOCATION;
-import static org.openqa.selenium.remote.DriverCommand.SET_NETWORK_CONNECTION;
import static org.openqa.selenium.remote.DriverCommand.SET_SCRIPT_TIMEOUT;
import static org.openqa.selenium.remote.DriverCommand.SET_TIMEOUT;
import static org.openqa.selenium.remote.DriverCommand.SET_USER_VERIFIED;
@@ -177,14 +175,6 @@ public AbstractHttpCommandCodec() {
defineCommand(
SET_LOCATION, post(sessionId + "/location")); // Not w3c; used in RemoteLocationContext
- // Mobile Spec
- defineCommand(
- GET_NETWORK_CONNECTION,
- get(sessionId + "/network_connection")); // Not w3c; used in RemoteNetworkConnection
- defineCommand(
- SET_NETWORK_CONNECTION,
- post(sessionId + "/network_connection")); // Not w3c; used in RemoteNetworkConnection
-
// Virtual Authenticator API
String webauthn = sessionId + "/webauthn/authenticator";
String webauthnId = webauthn + "/:authenticatorId";
diff --git a/java/src/org/openqa/selenium/remote/mobile/RemoteNetworkConnection.java b/java/src/org/openqa/selenium/remote/mobile/RemoteNetworkConnection.java
deleted file mode 100644
index c4efa117931fd..0000000000000
--- a/java/src/org/openqa/selenium/remote/mobile/RemoteNetworkConnection.java
+++ /dev/null
@@ -1,54 +0,0 @@
-// Licensed to the Software Freedom Conservancy (SFC) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The SFC licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package org.openqa.selenium.remote.mobile;
-
-import java.util.Map;
-import org.openqa.selenium.mobile.NetworkConnection;
-import org.openqa.selenium.remote.DriverCommand;
-import org.openqa.selenium.remote.ExecuteMethod;
-
-/**
- * @deprecated This functionality is no longer supported
- */
-@Deprecated
-public class RemoteNetworkConnection implements NetworkConnection {
-
- private final ExecuteMethod executeMethod;
-
- public RemoteNetworkConnection(ExecuteMethod executeMethod) {
- this.executeMethod = executeMethod;
- }
-
- @Override
- @Deprecated
- public ConnectionType getNetworkConnection() {
- return new ConnectionType(
- ((Number) executeMethod.execute(DriverCommand.GET_NETWORK_CONNECTION, null)).intValue());
- }
-
- @Override
- @Deprecated
- public ConnectionType setNetworkConnection(ConnectionType type) {
- Map