summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Remi NGUYEN VAN <reminv@google.com> 2021-02-15 18:52:06 +0900
committer Remi NGUYEN VAN <reminv@google.com> 2021-02-17 12:04:10 +0900
commit5cb4470b588020dba854ff20c047fc56dafc3c20 (patch)
treefb19e3c399576e3f7eaacf298ce7699ff1ac5c2a
parent0ae1b444ca220af7b01fc17c60cc86cab23dcfc5 (diff)
Do not depend on Tethering stubs in CM consts
Tethering API stubs depend on connectivity stubs for classes like MacAddress or LinkAddress, so connectivity stubs cannot depend on Tethering stubs or there would be a circular dependency. This means ConnectivityManager API surface cannot reference Tethering API constants. Instead, use the literal in ConnectivityManager. This means that both ConnectivityManager and TetheringManager specify the constant value. An alternative considered was to have TetheringManager depend on the ConnectivityManager constants, but considering that ConnectivityManager only has some of the constants, this would be more confusing. Breaking the constants by mistake is unlikely as their values are part of the API surface, so will always be in sync. Bug: 171540887 Test: m Change-Id: I16b6e1912fffc5ff8b3b392901d2357ffd213c72
-rw-r--r--packages/Connectivity/framework/src/android/net/ConnectivityManager.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/packages/Connectivity/framework/src/android/net/ConnectivityManager.java b/packages/Connectivity/framework/src/android/net/ConnectivityManager.java
index 4213f8af95fc..c7bb2a75dba0 100644
--- a/packages/Connectivity/framework/src/android/net/ConnectivityManager.java
+++ b/packages/Connectivity/framework/src/android/net/ConnectivityManager.java
@@ -456,7 +456,7 @@ public class ConnectivityManager {
* @hide
*/
@SystemApi
- public static final int TETHERING_WIFI = TetheringManager.TETHERING_WIFI;
+ public static final int TETHERING_WIFI = 0;
/**
* USB tethering type.
@@ -464,7 +464,7 @@ public class ConnectivityManager {
* @hide
*/
@SystemApi
- public static final int TETHERING_USB = TetheringManager.TETHERING_USB;
+ public static final int TETHERING_USB = 1;
/**
* Bluetooth tethering type.
@@ -472,7 +472,7 @@ public class ConnectivityManager {
* @hide
*/
@SystemApi
- public static final int TETHERING_BLUETOOTH = TetheringManager.TETHERING_BLUETOOTH;
+ public static final int TETHERING_BLUETOOTH = 2;
/**
* Wifi P2p tethering type.
@@ -2799,7 +2799,7 @@ public class ConnectivityManager {
*/
@SystemApi
@Deprecated
- public static final int TETHER_ERROR_NO_ERROR = TetheringManager.TETHER_ERROR_NO_ERROR;
+ public static final int TETHER_ERROR_NO_ERROR = 0;
/**
* @deprecated Use {@link TetheringManager#TETHER_ERROR_UNKNOWN_IFACE}.
* {@hide}
@@ -2875,8 +2875,7 @@ public class ConnectivityManager {
*/
@SystemApi
@Deprecated
- public static final int TETHER_ERROR_PROVISION_FAILED =
- TetheringManager.TETHER_ERROR_PROVISIONING_FAILED;
+ public static final int TETHER_ERROR_PROVISION_FAILED = 11;
/**
* @deprecated Use {@link TetheringManager#TETHER_ERROR_DHCPSERVER_ERROR}.
* {@hide}
@@ -2890,8 +2889,7 @@ public class ConnectivityManager {
*/
@SystemApi
@Deprecated
- public static final int TETHER_ERROR_ENTITLEMENT_UNKONWN =
- TetheringManager.TETHER_ERROR_ENTITLEMENT_UNKNOWN;
+ public static final int TETHER_ERROR_ENTITLEMENT_UNKONWN = 13;
/**
* Get a more detailed error code after a Tethering or Untethering