diff options
author | Xiao Ma <xiaom@google.com> | 2019-08-05 03:35:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-08-05 03:35:13 +0000 |
commit | e27aa0f91b2a6b7dedb887ab09336b099d7dec9a (patch) | |
tree | bfda6c898dbccbb1175c76e7a662e93e4191370a /src/android/net/ip/IpClient.java | |
parent | 6e5adbdcaecd257843ae3fe74386be960b9caa29 (diff) | |
parent | cf2245b0771480a40e400d13b52106c8282be6f1 (diff) |
Merge "Revert "Restore the default interface MTU when disconnecting from Wi-Fi AP.""
Diffstat (limited to 'src/android/net/ip/IpClient.java')
-rw-r--r-- | src/android/net/ip/IpClient.java | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/src/android/net/ip/IpClient.java b/src/android/net/ip/IpClient.java index bff30b6..799184e 100644 --- a/src/android/net/ip/IpClient.java +++ b/src/android/net/ip/IpClient.java @@ -19,7 +19,6 @@ package android.net.ip; import static android.net.RouteInfo.RTN_UNICAST; import static android.net.shared.IpConfigurationParcelableUtil.toStableParcelable; -import static com.android.server.util.NetworkStackConstants.ETHER_MTU; import static com.android.server.util.PermissionUtil.checkNetworkStackCallingPermission; import android.annotation.NonNull; @@ -49,7 +48,6 @@ import android.os.ConditionVariable; import android.os.IBinder; import android.os.Message; import android.os.RemoteException; -import android.os.ServiceSpecificException; import android.os.SystemClock; import android.text.TextUtils; import android.util.LocalLog; @@ -71,8 +69,6 @@ import com.android.server.NetworkStackService.NetworkStackServiceManager; import java.io.FileDescriptor; import java.io.PrintWriter; import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.SocketException; import java.util.Collection; import java.util.List; import java.util.Objects; @@ -384,8 +380,6 @@ public class IpClient extends StateMachine { private final ConditionVariable mApfDataSnapshotComplete = new ConditionVariable(); public static class Dependencies { - private static final String TAG = "IpClient.Dependencies"; - /** * Get interface parameters for the specified interface. */ @@ -394,18 +388,6 @@ public class IpClient extends StateMachine { } /** - * Get the current MTU for the specified interface. - */ - public int getInterfaceMtu(String ifname) { - try { - return NetworkInterface.getByName(ifname).getMTU(); - } catch (SocketException e) { - Log.e(TAG, "unexpected failure to get the interface MTU"); - return ETHER_MTU; - } - } - - /** * Get a INetd connector. */ public INetd getNetd(Context context) { @@ -868,14 +850,10 @@ public class IpClient extends StateMachine { return shouldLog; } - private void logError(String fmt, Throwable e, Object... args) { - final String msg = "ERROR " + String.format(fmt, args); - Log.e(mTag, msg, e); - mLog.e(msg, e); - } - private void logError(String fmt, Object... args) { - logError(fmt, null, args); + final String msg = "ERROR " + String.format(fmt, args); + Log.e(mTag, msg); + mLog.log(msg); } // This needs to be called with care to ensure that our LinkProperties @@ -1373,17 +1351,6 @@ public class IpClient extends StateMachine { // There's no DHCPv4 for which to wait; proceed to stopped. deferMessage(obtainMessage(CMD_JUMP_STOPPING_TO_STOPPED)); } - - // Restore the interface MTU to initial value if it has changed. - final int mtu = mDependencies.getInterfaceMtu(mInterfaceName); - try { - if (mtu != mInterfaceParams.defaultMtu) { - mNetd.interfaceSetMtu(mInterfaceName, mInterfaceParams.defaultMtu); - } - } catch (RemoteException | ServiceSpecificException e) { - logError("Couldn't reset MTU from " - + mtu + " to " + mInterfaceParams.defaultMtu + ": " + e); - } } @Override |