[automerger skipped] Merge "Change tethering file structure to respect its package name" into rvc-dev am: ee6107e51c -s ours
am skip reason: Change-Id I7401c550fbafd17a5ed2d925b5d0e17e358af467 with SHA-1 d995566700 is in history
Change-Id: I0994b834ff0af2ebee3cd7e5bc9c73c4b08a4c99
diff --git a/Tethering/AndroidManifest.xml b/Tethering/AndroidManifest.xml
index 1dc8227..ab25747 100644
--- a/Tethering/AndroidManifest.xml
+++ b/Tethering/AndroidManifest.xml
@@ -43,7 +43,7 @@
android:process="com.android.networkstack.process"
android:extractNativeLibs="false"
android:persistent="true">
- <service android:name="com.android.networkstack.tethering.TetheringService"
+ <service android:name="com.android.server.connectivity.tethering.TetheringService"
android:permission="android.permission.MAINLINE_NETWORK_STACK"
android:exported="true">
<intent-filter>
diff --git a/Tethering/AndroidManifest_InProcess.xml b/Tethering/AndroidManifest_InProcess.xml
index b1f1240..bf1f001 100644
--- a/Tethering/AndroidManifest_InProcess.xml
+++ b/Tethering/AndroidManifest_InProcess.xml
@@ -22,7 +22,7 @@
android:process="system">
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="29" />
<application>
- <service android:name="com.android.networkstack.tethering.TetheringService"
+ <service android:name="com.android.server.connectivity.tethering.TetheringService"
android:process="system"
android:permission="android.permission.MAINLINE_NETWORK_STACK"
android:exported="true">
diff --git a/Tethering/proguard.flags b/Tethering/proguard.flags
index 051fbd1..1f83a66 100644
--- a/Tethering/proguard.flags
+++ b/Tethering/proguard.flags
@@ -1,5 +1,5 @@
# Keep class's integer static field for MessageUtils to parsing their name.
--keep class com.android.networkstack.tethering.Tethering$TetherMasterSM {
+-keep class com.android.server.connectivity.tethering.Tethering$TetherMasterSM {
static final int CMD_*;
static final int EVENT_*;
}
diff --git a/Tethering/res/values-mcc204-mnc04/strings.xml b/Tethering/res/values-mcc204-mnc04/strings.xml
index a996b42..9dadd49 100644
--- a/Tethering/res/values-mcc204-mnc04/strings.xml
+++ b/Tethering/res/values-mcc204-mnc04/strings.xml
@@ -15,16 +15,16 @@
-->
<resources>
<!-- String for no upstream notification title [CHAR LIMIT=200] -->
- <string name="no_upstream_notification_title">Hotspot has no internet</string>
+ <string name="no_upstream_notification_title">Tethering has no internet</string>
<!-- String for no upstream notification title [CHAR LIMIT=200] -->
- <string name="no_upstream_notification_message">Devices can\u2019t connect to internet</string>
- <!-- String for cellular roaming notification disable button [CHAR LIMIT=200] -->
- <string name="no_upstream_notification_disable_button">Turn off hotspot</string>
+ <string name="no_upstream_notification_message">Devices can\u2019t connect</string>
+ <!-- String for no upstream notification disable button [CHAR LIMIT=200] -->
+ <string name="no_upstream_notification_disable_button">Turn off tethering</string>
- <!-- String for cellular roaming notification title [CHAR LIMIT=200] -->
- <string name="upstream_roaming_notification_title">Hotspot is on</string>
- <!-- String for cellular roaming notification message [CHAR LIMIT=500] -->
+ <!-- String for cellular roaming notification title [CHAR LIMIT=200] -->
+ <string name="upstream_roaming_notification_title">Hotspot or tethering is on</string>
+ <!-- String for cellular roaming notification message [CHAR LIMIT=500] -->
<string name="upstream_roaming_notification_message">Additional charges may apply while roaming</string>
- <!-- String for cellular roaming notification continue button [CHAR LIMIT=200] -->
+ <!-- String for cellular roaming notification continue button [CHAR LIMIT=200] -->
<string name="upstream_roaming_notification_continue_button">Continue</string>
</resources>
diff --git a/Tethering/res/values-mcc310-mnc004/strings.xml b/Tethering/res/values-mcc310-mnc004/strings.xml
index a996b42..9dadd49 100644
--- a/Tethering/res/values-mcc310-mnc004/strings.xml
+++ b/Tethering/res/values-mcc310-mnc004/strings.xml
@@ -15,16 +15,16 @@
-->
<resources>
<!-- String for no upstream notification title [CHAR LIMIT=200] -->
- <string name="no_upstream_notification_title">Hotspot has no internet</string>
+ <string name="no_upstream_notification_title">Tethering has no internet</string>
<!-- String for no upstream notification title [CHAR LIMIT=200] -->
- <string name="no_upstream_notification_message">Devices can\u2019t connect to internet</string>
- <!-- String for cellular roaming notification disable button [CHAR LIMIT=200] -->
- <string name="no_upstream_notification_disable_button">Turn off hotspot</string>
+ <string name="no_upstream_notification_message">Devices can\u2019t connect</string>
+ <!-- String for no upstream notification disable button [CHAR LIMIT=200] -->
+ <string name="no_upstream_notification_disable_button">Turn off tethering</string>
- <!-- String for cellular roaming notification title [CHAR LIMIT=200] -->
- <string name="upstream_roaming_notification_title">Hotspot is on</string>
- <!-- String for cellular roaming notification message [CHAR LIMIT=500] -->
+ <!-- String for cellular roaming notification title [CHAR LIMIT=200] -->
+ <string name="upstream_roaming_notification_title">Hotspot or tethering is on</string>
+ <!-- String for cellular roaming notification message [CHAR LIMIT=500] -->
<string name="upstream_roaming_notification_message">Additional charges may apply while roaming</string>
- <!-- String for cellular roaming notification continue button [CHAR LIMIT=200] -->
+ <!-- String for cellular roaming notification continue button [CHAR LIMIT=200] -->
<string name="upstream_roaming_notification_continue_button">Continue</string>
</resources>
diff --git a/Tethering/res/values-mcc311-mnc480/strings.xml b/Tethering/res/values-mcc311-mnc480/strings.xml
index a996b42..9dadd49 100644
--- a/Tethering/res/values-mcc311-mnc480/strings.xml
+++ b/Tethering/res/values-mcc311-mnc480/strings.xml
@@ -15,16 +15,16 @@
-->
<resources>
<!-- String for no upstream notification title [CHAR LIMIT=200] -->
- <string name="no_upstream_notification_title">Hotspot has no internet</string>
+ <string name="no_upstream_notification_title">Tethering has no internet</string>
<!-- String for no upstream notification title [CHAR LIMIT=200] -->
- <string name="no_upstream_notification_message">Devices can\u2019t connect to internet</string>
- <!-- String for cellular roaming notification disable button [CHAR LIMIT=200] -->
- <string name="no_upstream_notification_disable_button">Turn off hotspot</string>
+ <string name="no_upstream_notification_message">Devices can\u2019t connect</string>
+ <!-- String for no upstream notification disable button [CHAR LIMIT=200] -->
+ <string name="no_upstream_notification_disable_button">Turn off tethering</string>
- <!-- String for cellular roaming notification title [CHAR LIMIT=200] -->
- <string name="upstream_roaming_notification_title">Hotspot is on</string>
- <!-- String for cellular roaming notification message [CHAR LIMIT=500] -->
+ <!-- String for cellular roaming notification title [CHAR LIMIT=200] -->
+ <string name="upstream_roaming_notification_title">Hotspot or tethering is on</string>
+ <!-- String for cellular roaming notification message [CHAR LIMIT=500] -->
<string name="upstream_roaming_notification_message">Additional charges may apply while roaming</string>
- <!-- String for cellular roaming notification continue button [CHAR LIMIT=200] -->
+ <!-- String for cellular roaming notification continue button [CHAR LIMIT=200] -->
<string name="upstream_roaming_notification_continue_button">Continue</string>
</resources>
diff --git a/Tethering/res/values/config.xml b/Tethering/res/values/config.xml
index 430fdc4..04d6215 100644
--- a/Tethering/res/values/config.xml
+++ b/Tethering/res/values/config.xml
@@ -89,7 +89,7 @@
TYPE_MOBILE_HIPRI is appended.
For other changes applied to this list, now and in the future, see
- com.android.networkstack.tethering.TetheringConfiguration.
+ com.android.server.connectivity.tethering.TetheringConfiguration.
Note also: the order of this is important. The first upstream type
for which a satisfying network exists is used.
diff --git a/Tethering/res/values/strings.xml b/Tethering/res/values/strings.xml
index 52a1654..4fa60d4 100644
--- a/Tethering/res/values/strings.xml
+++ b/Tethering/res/values/strings.xml
@@ -40,13 +40,13 @@
<string name="no_upstream_notification_title"></string>
<!-- String for no upstream notification message [CHAR LIMIT=200] -->
<string name="no_upstream_notification_message"></string>
- <!-- String for cellular roaming notification disable button [CHAR LIMIT=200] -->
+ <!-- String for no upstream notification disable button [CHAR LIMIT=200] -->
<string name="no_upstream_notification_disable_button"></string>
- <!-- String for cellular roaming notification title [CHAR LIMIT=200] -->
+ <!-- String for cellular roaming notification title [CHAR LIMIT=200] -->
<string name="upstream_roaming_notification_title"></string>
- <!-- String for cellular roaming notification message [CHAR LIMIT=500] -->
+ <!-- String for cellular roaming notification message [CHAR LIMIT=500] -->
<string name="upstream_roaming_notification_message"></string>
- <!-- String for cellular roaming notification continue button [CHAR LIMIT=200] -->
+ <!-- String for cellular roaming notification continue button [CHAR LIMIT=200] -->
<string name="upstream_roaming_notification_continue_button"></string>
</resources>
diff --git a/Tethering/src/android/net/ip/IpServer.java b/Tethering/src/android/net/ip/IpServer.java
index 1dac5b7..83727bc 100644
--- a/Tethering/src/android/net/ip/IpServer.java
+++ b/Tethering/src/android/net/ip/IpServer.java
@@ -122,6 +122,8 @@
// TODO: have this configurable
private static final int DHCP_LEASE_TIME_SECS = 3600;
+ private static final MacAddress NULL_MAC_ADDRESS = MacAddress.fromString("00:00:00:00:00:00");
+
private static final String TAG = "IpServer";
private static final boolean DBG = false;
private static final boolean VDBG = false;
@@ -902,9 +904,12 @@
return;
}
+ // When deleting rules, we still need to pass a non-null MAC, even though it's ignored.
+ // Do this here instead of in the Ipv6ForwardingRule constructor to ensure that we never
+ // add rules with a null MAC, only delete them.
+ MacAddress dstMac = e.isValid() ? e.macAddr : NULL_MAC_ADDRESS;
Ipv6ForwardingRule rule = new Ipv6ForwardingRule(upstreamIfindex,
- mInterfaceParams.index, (Inet6Address) e.ip, mInterfaceParams.macAddr,
- e.macAddr);
+ mInterfaceParams.index, (Inet6Address) e.ip, mInterfaceParams.macAddr, dstMac);
if (e.isValid()) {
addIpv6ForwardingRule(rule);
} else {
diff --git a/Tethering/src/com/android/networkstack/tethering/ConnectedClientsTracker.java b/Tethering/src/com/android/server/connectivity/tethering/ConnectedClientsTracker.java
similarity index 98%
rename from Tethering/src/com/android/networkstack/tethering/ConnectedClientsTracker.java
rename to Tethering/src/com/android/server/connectivity/tethering/ConnectedClientsTracker.java
index 8a96988..cdd1a5d 100644
--- a/Tethering/src/com/android/networkstack/tethering/ConnectedClientsTracker.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/ConnectedClientsTracker.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.TetheringManager.TETHERING_WIFI;
diff --git a/Tethering/src/com/android/networkstack/tethering/EntitlementManager.java b/Tethering/src/com/android/server/connectivity/tethering/EntitlementManager.java
similarity index 99%
rename from Tethering/src/com/android/networkstack/tethering/EntitlementManager.java
rename to Tethering/src/com/android/server/connectivity/tethering/EntitlementManager.java
index 4c7b2d4..639cf65 100644
--- a/Tethering/src/com/android/networkstack/tethering/EntitlementManager.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/EntitlementManager.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.TetheringConstants.EXTRA_ADD_TETHER_TYPE;
import static android.net.TetheringConstants.EXTRA_PROVISION_CALLBACK;
@@ -52,6 +52,7 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.StateMachine;
+import com.android.networkstack.tethering.R;
import java.io.PrintWriter;
@@ -70,7 +71,7 @@
@VisibleForTesting
protected static final String DISABLE_PROVISIONING_SYSPROP_KEY = "net.tethering.noprovisioning";
private static final String ACTION_PROVISIONING_ALARM =
- "com.android.networkstack.tethering.PROVISIONING_RECHECK_ALARM";
+ "com.android.server.connectivity.tethering.PROVISIONING_RECHECK_ALARM";
private static final String EXTRA_SUBID = "subId";
private final ComponentName mSilentProvisioningService;
diff --git a/Tethering/src/com/android/networkstack/tethering/IPv6TetheringCoordinator.java b/Tethering/src/com/android/server/connectivity/tethering/IPv6TetheringCoordinator.java
similarity index 99%
rename from Tethering/src/com/android/networkstack/tethering/IPv6TetheringCoordinator.java
rename to Tethering/src/com/android/server/connectivity/tethering/IPv6TetheringCoordinator.java
index d450c46..66b9ade 100644
--- a/Tethering/src/com/android/networkstack/tethering/IPv6TetheringCoordinator.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/IPv6TetheringCoordinator.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import android.net.IpPrefix;
import android.net.LinkAddress;
diff --git a/Tethering/src/com/android/networkstack/tethering/OffloadController.java b/Tethering/src/com/android/server/connectivity/tethering/OffloadController.java
similarity index 99%
rename from Tethering/src/com/android/networkstack/tethering/OffloadController.java
rename to Tethering/src/com/android/server/connectivity/tethering/OffloadController.java
index c007c17..15cdb6a 100644
--- a/Tethering/src/com/android/networkstack/tethering/OffloadController.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/OffloadController.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
import static android.net.NetworkStats.METERED_NO;
@@ -50,7 +50,7 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.IndentingPrintWriter;
-import com.android.networkstack.tethering.OffloadHardwareInterface.ForwardedStats;
+import com.android.server.connectivity.tethering.OffloadHardwareInterface.ForwardedStats;
import java.net.Inet4Address;
import java.net.Inet6Address;
diff --git a/Tethering/src/com/android/networkstack/tethering/OffloadHardwareInterface.java b/Tethering/src/com/android/server/connectivity/tethering/OffloadHardwareInterface.java
similarity index 99%
rename from Tethering/src/com/android/networkstack/tethering/OffloadHardwareInterface.java
rename to Tethering/src/com/android/server/connectivity/tethering/OffloadHardwareInterface.java
index 85a23fb..b545717 100644
--- a/Tethering/src/com/android/networkstack/tethering/OffloadHardwareInterface.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/OffloadHardwareInterface.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.util.TetheringUtils.uint16;
diff --git a/Tethering/src/com/android/networkstack/tethering/Tethering.java b/Tethering/src/com/android/server/connectivity/tethering/Tethering.java
similarity index 99%
rename from Tethering/src/com/android/networkstack/tethering/Tethering.java
rename to Tethering/src/com/android/server/connectivity/tethering/Tethering.java
index f3cead9..4b2c921 100644
--- a/Tethering/src/com/android/networkstack/tethering/Tethering.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/Tethering.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.Manifest.permission.NETWORK_SETTINGS;
import static android.Manifest.permission.NETWORK_STACK;
@@ -60,7 +60,7 @@
import static android.telephony.CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED;
import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
-import static com.android.networkstack.tethering.TetheringNotificationUpdater.DOWNSTREAM_NONE;
+import static com.android.server.connectivity.tethering.TetheringNotificationUpdater.DOWNSTREAM_NONE;
import android.app.usage.NetworkStatsManager;
import android.bluetooth.BluetoothAdapter;
diff --git a/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java b/Tethering/src/com/android/server/connectivity/tethering/TetheringConfiguration.java
similarity index 99%
rename from Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java
rename to Tethering/src/com/android/server/connectivity/tethering/TetheringConfiguration.java
index aeac437..7e9e26f 100644
--- a/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/TetheringConfiguration.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.content.Context.TELEPHONY_SERVICE;
import static android.net.ConnectivityManager.TYPE_ETHERNET;
@@ -33,6 +33,7 @@
import android.text.TextUtils;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.networkstack.tethering.R;
import java.io.PrintWriter;
import java.util.ArrayList;
diff --git a/Tethering/src/com/android/networkstack/tethering/TetheringDependencies.java b/Tethering/src/com/android/server/connectivity/tethering/TetheringDependencies.java
similarity index 98%
rename from Tethering/src/com/android/networkstack/tethering/TetheringDependencies.java
rename to Tethering/src/com/android/server/connectivity/tethering/TetheringDependencies.java
index 893c582..0330dad 100644
--- a/Tethering/src/com/android/networkstack/tethering/TetheringDependencies.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/TetheringDependencies.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
diff --git a/Tethering/src/com/android/networkstack/tethering/TetheringInterfaceUtils.java b/Tethering/src/com/android/server/connectivity/tethering/TetheringInterfaceUtils.java
similarity index 98%
rename from Tethering/src/com/android/networkstack/tethering/TetheringInterfaceUtils.java
rename to Tethering/src/com/android/server/connectivity/tethering/TetheringInterfaceUtils.java
index ff38f71..4dd6830 100644
--- a/Tethering/src/com/android/networkstack/tethering/TetheringInterfaceUtils.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/TetheringInterfaceUtils.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import android.annotation.Nullable;
import android.net.LinkProperties;
diff --git a/Tethering/src/com/android/networkstack/tethering/TetheringNotificationUpdater.java b/Tethering/src/com/android/server/connectivity/tethering/TetheringNotificationUpdater.java
similarity index 98%
rename from Tethering/src/com/android/networkstack/tethering/TetheringNotificationUpdater.java
rename to Tethering/src/com/android/server/connectivity/tethering/TetheringNotificationUpdater.java
index 4287056..992cdd8 100644
--- a/Tethering/src/com/android/networkstack/tethering/TetheringNotificationUpdater.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/TetheringNotificationUpdater.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.TetheringManager.TETHERING_BLUETOOTH;
import static android.net.TetheringManager.TETHERING_USB;
@@ -41,6 +41,7 @@
import androidx.annotation.NonNull;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.networkstack.tethering.R;
/**
* A class to display tethering-related notifications.
diff --git a/Tethering/src/com/android/networkstack/tethering/TetheringService.java b/Tethering/src/com/android/server/connectivity/tethering/TetheringService.java
similarity index 99%
rename from Tethering/src/com/android/networkstack/tethering/TetheringService.java
rename to Tethering/src/com/android/server/connectivity/tethering/TetheringService.java
index 3ed2115..c30be25 100644
--- a/Tethering/src/com/android/networkstack/tethering/TetheringService.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/TetheringService.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.net.TetheringManager.TETHER_ERROR_NO_ACCESS_TETHERING_PERMISSION;
diff --git a/Tethering/src/com/android/networkstack/tethering/UpstreamNetworkMonitor.java b/Tethering/src/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java
similarity index 99%
rename from Tethering/src/com/android/networkstack/tethering/UpstreamNetworkMonitor.java
rename to Tethering/src/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java
index 25ddce4..45bb4ab 100644
--- a/Tethering/src/com/android/networkstack/tethering/UpstreamNetworkMonitor.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/UpstreamNetworkMonitor.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.ConnectivityManager.TYPE_BLUETOOTH;
import static android.net.ConnectivityManager.TYPE_ETHERNET;
diff --git a/Tethering/src/com/android/networkstack/tethering/UpstreamNetworkState.java b/Tethering/src/com/android/server/connectivity/tethering/UpstreamNetworkState.java
similarity index 96%
rename from Tethering/src/com/android/networkstack/tethering/UpstreamNetworkState.java
rename to Tethering/src/com/android/server/connectivity/tethering/UpstreamNetworkState.java
index bab9f84..68bb837 100644
--- a/Tethering/src/com/android/networkstack/tethering/UpstreamNetworkState.java
+++ b/Tethering/src/com/android/server/connectivity/tethering/UpstreamNetworkState.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import android.net.LinkProperties;
import android.net.Network;
diff --git a/Tethering/tests/unit/AndroidManifest.xml b/Tethering/tests/unit/AndroidManifest.xml
index 55640db..4ff1d37 100644
--- a/Tethering/tests/unit/AndroidManifest.xml
+++ b/Tethering/tests/unit/AndroidManifest.xml
@@ -21,11 +21,11 @@
<application android:debuggable="true">
<uses-library android:name="android.test.runner" />
<service
- android:name="com.android.networkstack.tethering.MockTetheringService"
+ android:name="com.android.server.connectivity.tethering.MockTetheringService"
android:permission="android.permission.TETHER_PRIVILEGED"
android:exported="true">
<intent-filter>
- <action android:name="com.android.networkstack.tethering.TetheringService"/>
+ <action android:name="com.android.server.connectivity.tethering.TetheringService"/>
</intent-filter>
</service>
</application>
diff --git a/Tethering/tests/unit/src/android/net/ip/IpServerTest.java b/Tethering/tests/unit/src/android/net/ip/IpServerTest.java
index fdfdae8..f9be7b9 100644
--- a/Tethering/tests/unit/src/android/net/ip/IpServerTest.java
+++ b/Tethering/tests/unit/src/android/net/ip/IpServerTest.java
@@ -587,6 +587,7 @@
final InetAddress neighB = InetAddresses.parseNumericAddress("2001:db8::2");
final InetAddress neighLL = InetAddresses.parseNumericAddress("fe80::1");
final InetAddress neighMC = InetAddresses.parseNumericAddress("ff02::1234");
+ final MacAddress macNull = MacAddress.fromString("00:00:00:00:00:00");
final MacAddress macA = MacAddress.fromString("00:00:00:00:00:0a");
final MacAddress macB = MacAddress.fromString("11:22:33:00:00:0b");
@@ -612,13 +613,14 @@
verifyNoMoreInteractions(mNetd);
// A neighbor that is no longer valid causes the rule to be removed.
- recvNewNeigh(myIfindex, neighA, NUD_FAILED, macA);
- verify(mNetd).tetherOffloadRuleRemove(matches(UPSTREAM_IFINDEX, neighA, macA));
+ // NUD_FAILED events do not have a MAC address.
+ recvNewNeigh(myIfindex, neighA, NUD_FAILED, null);
+ verify(mNetd).tetherOffloadRuleRemove(matches(UPSTREAM_IFINDEX, neighA, macNull));
reset(mNetd);
// A neighbor that is deleted causes the rule to be removed.
recvDelNeigh(myIfindex, neighB, NUD_STALE, macB);
- verify(mNetd).tetherOffloadRuleRemove(matches(UPSTREAM_IFINDEX, neighB, macB));
+ verify(mNetd).tetherOffloadRuleRemove(matches(UPSTREAM_IFINDEX, neighB, macNull));
reset(mNetd);
// Upstream changes result in deleting and re-adding the rules.
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/ConnectedClientsTrackerTest.kt b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/ConnectedClientsTrackerTest.kt
similarity index 98%
rename from Tethering/tests/unit/src/com/android/networkstack/tethering/ConnectedClientsTrackerTest.kt
rename to Tethering/tests/unit/src/com/android/server/connectivity/tethering/ConnectedClientsTrackerTest.kt
index d915354..1cdc3bb 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/ConnectedClientsTrackerTest.kt
+++ b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/ConnectedClientsTrackerTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering
+package com.android.server.connectivity.tethering
import android.net.LinkAddress
import android.net.MacAddress
@@ -159,4 +159,4 @@
return time
}
}
-}
+}
\ No newline at end of file
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/EntitlementManagerTest.java b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/EntitlementManagerTest.java
similarity index 99%
rename from Tethering/tests/unit/src/com/android/networkstack/tethering/EntitlementManagerTest.java
rename to Tethering/tests/unit/src/com/android/server/connectivity/tethering/EntitlementManagerTest.java
index 8bd0edc..6695eed 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/EntitlementManagerTest.java
+++ b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/EntitlementManagerTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.TetheringManager.TETHERING_BLUETOOTH;
import static android.net.TetheringManager.TETHERING_ETHERNET;
@@ -59,6 +59,7 @@
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
import com.android.internal.util.test.BroadcastInterceptingContext;
+import com.android.networkstack.tethering.R;
import org.junit.After;
import org.junit.Before;
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/IPv6TetheringCoordinatorTest.java b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/IPv6TetheringCoordinatorTest.java
similarity index 98%
rename from Tethering/tests/unit/src/com/android/networkstack/tethering/IPv6TetheringCoordinatorTest.java
rename to Tethering/tests/unit/src/com/android/server/connectivity/tethering/IPv6TetheringCoordinatorTest.java
index 820f255..9121243 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/IPv6TetheringCoordinatorTest.java
+++ b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/IPv6TetheringCoordinatorTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
import static android.net.RouteInfo.RTN_UNICAST;
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/MockTetheringService.java b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/MockTetheringService.java
similarity index 96%
rename from Tethering/tests/unit/src/com/android/networkstack/tethering/MockTetheringService.java
rename to Tethering/tests/unit/src/com/android/server/connectivity/tethering/MockTetheringService.java
index 1c81c12..355ece9 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/MockTetheringService.java
+++ b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/MockTetheringService.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static org.mockito.Mockito.mock;
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/OffloadControllerTest.java b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/OffloadControllerTest.java
similarity index 98%
rename from Tethering/tests/unit/src/com/android/networkstack/tethering/OffloadControllerTest.java
rename to Tethering/tests/unit/src/com/android/server/connectivity/tethering/OffloadControllerTest.java
index 6579720..fe84086 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/OffloadControllerTest.java
+++ b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/OffloadControllerTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
import static android.net.NetworkStats.METERED_NO;
@@ -26,9 +26,9 @@
import static android.net.RouteInfo.RTN_UNICAST;
import static android.provider.Settings.Global.TETHER_OFFLOAD_DISABLED;
-import static com.android.networkstack.tethering.OffloadController.StatsType.STATS_PER_IFACE;
-import static com.android.networkstack.tethering.OffloadController.StatsType.STATS_PER_UID;
-import static com.android.networkstack.tethering.OffloadHardwareInterface.ForwardedStats;
+import static com.android.server.connectivity.tethering.OffloadController.StatsType.STATS_PER_IFACE;
+import static com.android.server.connectivity.tethering.OffloadController.StatsType.STATS_PER_UID;
+import static com.android.server.connectivity.tethering.OffloadHardwareInterface.ForwardedStats;
import static com.android.testutils.MiscAssertsKt.assertContainsAll;
import static com.android.testutils.MiscAssertsKt.assertThrows;
import static com.android.testutils.NetworkStatsUtilsKt.orderInsensitiveEquals;
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringConfigurationTest.java
similarity index 99%
rename from Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java
rename to Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringConfigurationTest.java
index 07ddea4..3635964 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java
+++ b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringConfigurationTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.ConnectivityManager.TYPE_ETHERNET;
import static android.net.ConnectivityManager.TYPE_MOBILE;
@@ -44,6 +44,7 @@
import androidx.test.runner.AndroidJUnit4;
import com.android.internal.util.test.BroadcastInterceptingContext;
+import com.android.networkstack.tethering.R;
import org.junit.After;
import org.junit.Before;
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringNotificationUpdaterTest.kt b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringNotificationUpdaterTest.kt
similarity index 98%
rename from Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringNotificationUpdaterTest.kt
rename to Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringNotificationUpdaterTest.kt
index 7bff74b..b869491 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringNotificationUpdaterTest.kt
+++ b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringNotificationUpdaterTest.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering
+package com.android.server.connectivity.tethering
import android.app.Notification
import android.app.NotificationManager
@@ -29,7 +29,8 @@
import androidx.test.filters.SmallTest
import androidx.test.runner.AndroidJUnit4
import com.android.internal.util.test.BroadcastInterceptingContext
-import com.android.networkstack.tethering.TetheringNotificationUpdater.DOWNSTREAM_NONE
+import com.android.networkstack.tethering.R
+import com.android.server.connectivity.tethering.TetheringNotificationUpdater.DOWNSTREAM_NONE
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
@@ -258,4 +259,4 @@
notificationUpdater.notifyTetheringDisabledByRestriction()
verifyNotification(R.drawable.stat_sys_tether_general, disallowTitle, disallowMessage)
}
-}
+}
\ No newline at end of file
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringServiceTest.java b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringServiceTest.java
similarity index 97%
rename from Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringServiceTest.java
rename to Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringServiceTest.java
index 51bad9a..d9d3e73 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringServiceTest.java
+++ b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringServiceTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.TetheringManager.TETHERING_WIFI;
import static android.net.TetheringManager.TETHER_ERROR_NO_ERROR;
@@ -37,7 +37,7 @@
import androidx.test.rule.ServiceTestRule;
import androidx.test.runner.AndroidJUnit4;
-import com.android.networkstack.tethering.MockTetheringService.MockTetheringConnector;
+import com.android.server.connectivity.tethering.MockTetheringService.MockTetheringConnector;
import org.junit.After;
import org.junit.Before;
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringTest.java
similarity index 99%
rename from Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java
rename to Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringTest.java
index d4be3a2..2955903 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java
+++ b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/TetheringTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.hardware.usb.UsbManager.USB_CONFIGURED;
import static android.hardware.usb.UsbManager.USB_CONNECTED;
@@ -47,7 +47,7 @@
import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLED;
import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
-import static com.android.networkstack.tethering.TetheringNotificationUpdater.DOWNSTREAM_NONE;
+import static com.android.server.connectivity.tethering.TetheringNotificationUpdater.DOWNSTREAM_NONE;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
@@ -137,6 +137,7 @@
import com.android.internal.util.StateMachine;
import com.android.internal.util.test.BroadcastInterceptingContext;
import com.android.internal.util.test.FakeSettingsProvider;
+import com.android.networkstack.tethering.R;
import com.android.testutils.MiscAssertsKt;
import org.junit.After;
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/UpstreamNetworkMonitorTest.java b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/UpstreamNetworkMonitorTest.java
similarity index 99%
rename from Tethering/tests/unit/src/com/android/networkstack/tethering/UpstreamNetworkMonitorTest.java
rename to Tethering/tests/unit/src/com/android/server/connectivity/tethering/UpstreamNetworkMonitorTest.java
index 232588c..7c98f62 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/UpstreamNetworkMonitorTest.java
+++ b/Tethering/tests/unit/src/com/android/server/connectivity/tethering/UpstreamNetworkMonitorTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.networkstack.tethering;
+package com.android.server.connectivity.tethering;
import static android.net.ConnectivityManager.TYPE_MOBILE_DUN;
import static android.net.ConnectivityManager.TYPE_MOBILE_HIPRI;
@@ -24,7 +24,7 @@
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
-import static com.android.networkstack.tethering.UpstreamNetworkMonitor.TYPE_NONE;
+import static com.android.server.connectivity.tethering.UpstreamNetworkMonitor.TYPE_NONE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;