From 6b66d70ba198054a4172e34703d201776185069c Mon Sep 17 00:00:00 2001 From: Chalard Jean Date: Thu, 2 Jul 2020 13:59:44 +0000 Subject: [PATCH] Revert "Move Inet[4]AddressUtils to libs/net" This reverts commit cf86031c12405ddb5817cf834c49a032480547b3. Reason for revert: Breaks the build b/160390899 Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b Change-Id: Ie10e66f61393602f17fbb61bf17230b176bf1f44 --- Tethering/jarjar-rules.txt | 15 ++++++++++++--- .../net/dhcp/DhcpServingParamsParcelExt.java | 2 +- Tethering/src/android/net/ip/IpServer.java | 3 +-- .../unit/src/android/net/ip/IpServerTest.java | 3 +-- .../networkstack/tethering/TetheringTest.java | 2 +- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Tethering/jarjar-rules.txt b/Tethering/jarjar-rules.txt index 591861f5b8..2c4059dda9 100644 --- a/Tethering/jarjar-rules.txt +++ b/Tethering/jarjar-rules.txt @@ -1,8 +1,17 @@ # These must be kept in sync with the framework-tethering-shared-srcs filegroup. -# Classes from the framework-tethering-shared-srcs filegroup. -# If there are files in that filegroup that are not covered below, the classes in the +# If there are files in that filegroup that do not appear here, the classes in the # module will be overwritten by the ones in the framework. -rule com.android.internal.util.** com.android.networkstack.tethering.util.@1 +# Don't jar-jar the entire package because tethering still use some internal classes +# (like TrafficStatsConstants in com.android.internal.util) +# TODO: simply these when tethering is built as system_current. +rule com.android.internal.util.BitUtils* com.android.networkstack.tethering.util.BitUtils@1 +rule com.android.internal.util.IndentingPrintWriter.java* com.android.networkstack.tethering.util.IndentingPrintWriter.java@1 +rule com.android.internal.util.IState.java* com.android.networkstack.tethering.util.IState.java@1 +rule com.android.internal.util.MessageUtils* com.android.networkstack.tethering.util.MessageUtils@1 +rule com.android.internal.util.State* com.android.networkstack.tethering.util.State@1 +rule com.android.internal.util.StateMachine* com.android.networkstack.tethering.util.StateMachine@1 +rule com.android.internal.util.TrafficStatsConstants* com.android.networkstack.tethering.util.TrafficStatsConstants@1 + rule android.util.LocalLog* com.android.networkstack.tethering.util.LocalLog@1 rule android.net.shared.Inet4AddressUtils* com.android.networkstack.tethering.shared.Inet4AddressUtils@1 diff --git a/Tethering/src/android/net/dhcp/DhcpServingParamsParcelExt.java b/Tethering/src/android/net/dhcp/DhcpServingParamsParcelExt.java index aaaec17bf9..4710a30b29 100644 --- a/Tethering/src/android/net/dhcp/DhcpServingParamsParcelExt.java +++ b/Tethering/src/android/net/dhcp/DhcpServingParamsParcelExt.java @@ -16,7 +16,7 @@ package android.net.dhcp; -import static com.android.net.module.util.Inet4AddressUtils.inet4AddressToIntHTH; +import static android.net.shared.Inet4AddressUtils.inet4AddressToIntHTH; import android.net.LinkAddress; import android.util.ArraySet; diff --git a/Tethering/src/android/net/ip/IpServer.java b/Tethering/src/android/net/ip/IpServer.java index 8af1797a9d..a61fcfb819 100644 --- a/Tethering/src/android/net/ip/IpServer.java +++ b/Tethering/src/android/net/ip/IpServer.java @@ -19,14 +19,13 @@ package android.net.ip; import static android.net.RouteInfo.RTN_UNICAST; import static android.net.TetheringManager.TetheringRequest.checkStaticAddressConfiguration; import static android.net.dhcp.IDhcpServer.STATUS_SUCCESS; +import static android.net.shared.Inet4AddressUtils.intToInet4AddressHTH; import static android.net.util.NetworkConstants.RFC7421_PREFIX_LENGTH; import static android.net.util.NetworkConstants.asByte; import static android.net.util.PrefixUtils.asIpPrefix; import static android.net.util.TetheringMessageBase.BASE_IPSERVER; import static android.system.OsConstants.RT_SCOPE_UNIVERSE; -import static com.android.net.module.util.Inet4AddressUtils.intToInet4AddressHTH; - import android.net.INetd; import android.net.INetworkStackStatusCallback; import android.net.IpPrefix; diff --git a/Tethering/tests/unit/src/android/net/ip/IpServerTest.java b/Tethering/tests/unit/src/android/net/ip/IpServerTest.java index 30a9d2252e..05cf58ab84 100644 --- a/Tethering/tests/unit/src/android/net/ip/IpServerTest.java +++ b/Tethering/tests/unit/src/android/net/ip/IpServerTest.java @@ -36,8 +36,7 @@ import static android.net.netlink.NetlinkConstants.RTM_NEWNEIGH; import static android.net.netlink.StructNdMsg.NUD_FAILED; import static android.net.netlink.StructNdMsg.NUD_REACHABLE; import static android.net.netlink.StructNdMsg.NUD_STALE; - -import static com.android.net.module.util.Inet4AddressUtils.intToInet4AddressHTH; +import static android.net.shared.Inet4AddressUtils.intToInet4AddressHTH; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java index f1da1c7225..d37aad26d1 100644 --- a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java +++ b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java @@ -40,6 +40,7 @@ import static android.net.TetheringManager.TETHER_HARDWARE_OFFLOAD_FAILED; import static android.net.TetheringManager.TETHER_HARDWARE_OFFLOAD_STARTED; import static android.net.TetheringManager.TETHER_HARDWARE_OFFLOAD_STOPPED; import static android.net.dhcp.IDhcpServer.STATUS_SUCCESS; +import static android.net.shared.Inet4AddressUtils.intToInet4AddressHTH; import static android.net.wifi.WifiManager.EXTRA_WIFI_AP_INTERFACE_NAME; import static android.net.wifi.WifiManager.EXTRA_WIFI_AP_MODE; import static android.net.wifi.WifiManager.EXTRA_WIFI_AP_STATE; @@ -48,7 +49,6 @@ import static android.net.wifi.WifiManager.IFACE_IP_MODE_TETHERED; import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLED; import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID; -import static com.android.net.module.util.Inet4AddressUtils.intToInet4AddressHTH; import static com.android.networkstack.tethering.TetheringNotificationUpdater.DOWNSTREAM_NONE; import static com.android.networkstack.tethering.UpstreamNetworkMonitor.EVENT_ON_CAPABILITIES;