SyncSM08: statically import tethering error code constant
This can make the code using error code not so easy to over 100
words line limit.
Test: m
Change-Id: I952c51f2e3508ed320744985193802454d07ccfe
diff --git a/Tethering/src/android/net/ip/IpServer.java b/Tethering/src/android/net/ip/IpServer.java
index 8cf13d3..65ea8e5 100644
--- a/Tethering/src/android/net/ip/IpServer.java
+++ b/Tethering/src/android/net/ip/IpServer.java
@@ -17,6 +17,13 @@
package android.net.ip;
import static android.net.RouteInfo.RTN_UNICAST;
+import static android.net.TetheringManager.TETHER_ERROR_DHCPSERVER_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_ENABLE_FORWARDING_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_IFACE_CFG_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_INTERNAL_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_NO_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_TETHER_IFACE_ERROR;
+import static android.net.TetheringManager.TETHER_ERROR_UNTETHER_IFACE_ERROR;
import static android.net.TetheringManager.TetheringRequest.checkStaticAddressConfiguration;
import static android.net.dhcp.IDhcpServer.STATUS_SUCCESS;
import static android.net.util.NetworkConstants.RFC7421_PREFIX_LENGTH;
@@ -310,7 +317,7 @@
mDeps = deps;
mTetheringMetrics = tetheringMetrics;
resetLinkProperties();
- mLastError = TetheringManager.TETHER_ERROR_NO_ERROR;
+ mLastError = TETHER_ERROR_NO_ERROR;
mServingMode = STATE_AVAILABLE;
mIpNeighborMonitor = mDeps.getIpNeighborMonitor(getHandler(), mLog,
@@ -475,7 +482,7 @@
}
private void handleError() {
- mLastError = TetheringManager.TETHER_ERROR_DHCPSERVER_ERROR;
+ mLastError = TETHER_ERROR_DHCPSERVER_ERROR;
transitionTo(mInitialState);
}
}
@@ -583,7 +590,7 @@
public void callback(int statusCode) {
if (statusCode != STATUS_SUCCESS) {
mLog.e("Error stopping DHCP server: " + statusCode);
- mLastError = TetheringManager.TETHER_ERROR_DHCPSERVER_ERROR;
+ mLastError = TETHER_ERROR_DHCPSERVER_ERROR;
// Not much more we can do here
}
mDhcpLeases.clear();
@@ -1134,7 +1141,7 @@
maybeLogMessage(this, message.what);
switch (message.what) {
case CMD_TETHER_REQUESTED:
- mLastError = TetheringManager.TETHER_ERROR_NO_ERROR;
+ mLastError = TETHER_ERROR_NO_ERROR;
switch (message.arg1) {
case STATE_LOCAL_ONLY:
maybeConfigureStaticIp((TetheringRequestParcel) message.obj);
@@ -1172,7 +1179,7 @@
startConntrackMonitoring();
if (!startIPv4()) {
- mLastError = TetheringManager.TETHER_ERROR_IFACE_CFG_ERROR;
+ mLastError = TETHER_ERROR_IFACE_CFG_ERROR;
return;
}
@@ -1180,7 +1187,7 @@
NetdUtils.tetherInterface(mNetd, mIfaceName, asIpPrefix(mIpv4Address));
} catch (RemoteException | ServiceSpecificException | IllegalStateException e) {
mLog.e("Error Tethering", e);
- mLastError = TetheringManager.TETHER_ERROR_TETHER_IFACE_ERROR;
+ mLastError = TETHER_ERROR_TETHER_IFACE_ERROR;
return;
}
@@ -1201,7 +1208,7 @@
try {
NetdUtils.untetherInterface(mNetd, mIfaceName);
} catch (RemoteException | ServiceSpecificException e) {
- mLastError = TetheringManager.TETHER_ERROR_UNTETHER_IFACE_ERROR;
+ mLastError = TETHER_ERROR_UNTETHER_IFACE_ERROR;
mLog.e("Failed to untether interface: " + e);
}
@@ -1234,7 +1241,7 @@
case CMD_START_TETHERING_ERROR:
case CMD_STOP_TETHERING_ERROR:
case CMD_SET_DNS_FORWARDERS_ERROR:
- mLastError = TetheringManager.TETHER_ERROR_INTERNAL_ERROR;
+ mLastError = TETHER_ERROR_INTERNAL_ERROR;
transitionTo(mInitialState);
break;
case CMD_NEW_PREFIX_REQUEST:
@@ -1261,7 +1268,7 @@
@Override
public void enter() {
super.enter();
- if (mLastError != TetheringManager.TETHER_ERROR_NO_ERROR) {
+ if (mLastError != TETHER_ERROR_NO_ERROR) {
transitionTo(mInitialState);
}
@@ -1297,7 +1304,7 @@
@Override
public void enter() {
super.enter();
- if (mLastError != TetheringManager.TETHER_ERROR_NO_ERROR) {
+ if (mLastError != TETHER_ERROR_NO_ERROR) {
transitionTo(mInitialState);
}
@@ -1405,7 +1412,7 @@
} catch (RemoteException | ServiceSpecificException e) {
mLog.e("Exception enabling NAT: " + e.toString());
cleanupUpstream();
- mLastError = TetheringManager.TETHER_ERROR_ENABLE_FORWARDING_ERROR;
+ mLastError = TETHER_ERROR_ENABLE_FORWARDING_ERROR;
transitionTo(mInitialState);
return true;
}
@@ -1454,7 +1461,7 @@
@Override
public void enter() {
mIpNeighborMonitor.stop();
- mLastError = TetheringManager.TETHER_ERROR_NO_ERROR;
+ mLastError = TETHER_ERROR_NO_ERROR;
sendInterfaceState(STATE_UNAVAILABLE);
}
}