diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-10-01 13:52:40 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2014-10-01 13:52:40 +0900 |
commit | 74d270d167ed6c3a6fa28e426da80d51a44a2af0 (patch) | |
tree | da0aed76efa269c11fbd973ea8379cee90c50d39 | |
parent | e3cbf2e7349dd366f33905784595e2e3a1cec245 (diff) | |
download | android_frameworks_opt_net_ethernet-stable/cm-12.0-YNG4N.tar.gz android_frameworks_opt_net_ethernet-stable/cm-12.0-YNG4N.tar.bz2 android_frameworks_opt_net_ethernet-stable/cm-12.0-YNG4N.zip |
Clear all Ethernet state when our interface goes away.staging/cm-12.0-cafstable/cm-12.0-YNG4Nstable/cm-12.0-YNG3Cstable/cm-12.0-YNG1TAstable/cm-12.0-YNG1Tstable/cm-12.0-YNG1Icm-12.0
Previously we did not stop DHCP or try to force a disconnect.
This made it impossible to reconnect by unplugging and
replugging an USB Ethernet adapter.
Bug: 17736828
Change-Id: Idd8576a96b063b5ca726ee9149800bdcb0f62bd1
-rw-r--r-- | java/com/android/server/ethernet/EthernetNetworkFactory.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/java/com/android/server/ethernet/EthernetNetworkFactory.java b/java/com/android/server/ethernet/EthernetNetworkFactory.java index a471154..2d0a957 100644 --- a/java/com/android/server/ethernet/EthernetNetworkFactory.java +++ b/java/com/android/server/ethernet/EthernetNetworkFactory.java @@ -208,13 +208,18 @@ class EthernetNetworkFactory { return; Log.d(TAG, "Stopped tracking interface " + iface); + // TODO: Unify this codepath with stop(). synchronized (this) { + NetworkUtils.stopDhcp(mIface); mIface = ""; mHwAddr = null; mNetworkInfo.setExtraInfo(null); + mLinkUp = false; + mNetworkInfo.setDetailedState(DetailedState.DISCONNECTED, null, mHwAddr); + updateAgent(); + mNetworkAgent = null; mNetworkInfo = new NetworkInfo(ConnectivityManager.TYPE_ETHERNET, 0, NETWORK_TYPE, ""); mLinkProperties = new LinkProperties(); - updateAgent(); } } |