Do not run ethernet tethering tests if tethering is not supported
because Tethering APIs would fail. Also skip the test if
EthernetManager is not avaliable. EthernetManager would be null if
there are no FEATURE_ETHERNET and FEATURE_USB_HOST.
Bug: 159869957
Test: atest CtsTetheringTest
Change-Id: I2b9be6799c6edeefc8cd74897a8704dbe80dd061
This reverts commit cf86031c12.
Reason for revert: Breaks the build b/160390899
Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b
Change-Id: Ie10e66f61393602f17fbb61bf17230b176bf1f44
If the test run adb over network and ethernet is available, it is likely
that adb may run over ethernet. Then the test would fail because adb
would break when ethernet is switching from client mode to server mode.
Bug: 160389275
Test: atest CtsTetheringTest
Change-Id: I57d365d33316881c50c3bf7fd1c98926d10842d3
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.
Also refine comments in DhcpResults following feedback in previous
change.
(cherry-pick from internal branch skipping wifi classes; no other
conflict)
Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Merged-In: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
LocalLog is in android.util* instead of android.net*.
No crash happened because the methods used by tethering are
@UnsupportedAppUsage.
Bug: 160113128
Test: atest TetheringTests
Change-Id: I5f070b96f96aaabf7ec8da52a3d3444ed940fb56
LocalLog is in android.util* instead of android.net*.
No crash happen becaue the methods used by tethering are
@UnsupportedAppUsage.
Bug: 160113128
Test: atest TetheringTests
(cherry-pick from internal branch with conflicts)
Merged-In: I5f070b96f96aaabf7ec8da52a3d3444ed940fb56
Change-Id: I5f070b96f96aaabf7ec8da52a3d3444ed940fb56
Send netlink request over fd for offload config before
completing init sequence. Provides existing conntrack
entries to IPA. Resolves issue where there are NAT
misses in IPA due to IPA only having the conntrack
entries added after tethering starts.
Bug: 149109043
Test: OffloadHardwareInterfaceTest
Original-Change: https://android-review.googlesource.com/1290954
Merged-In: Iaf3e847e92f205b55f10fa85c17b9f3995d52099
Change-Id: Iaf3e847e92f205b55f10fa85c17b9f3995d52099
There is a protection in Settings that Settings would gray out if
tethering requires entitlement check but the entitlement app is
invalid. Tethering resource is moved from framework to tethering
module, so Settings can not fetch entitlement app name anymore.
In this change, tethering module would check whether entitltement app
package name is exsited if entitlement check is needed. Tethering would
be not supported (Settings tethering option would be hidded) if
entitlement app is not installed.
After moving the protection into tethering module,
TetherUtil#isProvisioningNeeded is no longer needed. Because The
only use case is Settings wants to gray out tethering setting
when entitltement check is needed but entitlement app is invalid.
Bug: 146918263
Test: atest TetheringCoverageTests
Change-Id: I9a5ff5dbc1db3f3be7fcd7146862a16b373507e6
Merged-In: I9a5ff5dbc1db3f3be7fcd7146862a16b373507e6
Tethering resource configuration is move from framwork to tethering
module. Since tethering resource would not be accessible from outside
of tethering module, EntitlementManager would tell Settings the
entitlement configuration via intent extra when run entitlement check.
Bug: 146918263
Test: atest TetheringTests
Change-Id: I6f23553bb1da5f0b767f920b32a86fafb9e00b9e
Merged-In: I6f23553bb1da5f0b767f920b32a86fafb9e00b9e
The applying data limit is based on the forwarding rule changes.
Add the tests for verifying their interactions with netd.
Bug: 150736748
Test: BpfCoordinatorTest
Original-Change: https://android-review.googlesource.com/1311659
Merged-In: I5a98c4cd74e2de6005ee05defa761f6af3fd4e75
Change-Id: I5a98c4cd74e2de6005ee05defa761f6af3fd4e75
There is a protection in Settings that Settings would gray out if
tethering requires entitlement check but the entitlement app is
invalid. Tethering resource is moved from framework to tethering
module, so Settings can not fetch entitlement app name anymore.
In this change, tethering module would check whether entitltement app
package name is exsited if entitlement check is needed. Tethering would
be not supported (Settings tethering option would be hidded) if
entitlement app is not installed.
After moving the protection into tethering module,
TetherUtil#isProvisioningNeeded is no longer needed. Because The
only use case is Settings wants to gray out tethering setting
when entitltement check is needed but entitlement app is invalid.
Bug: 146918263
Test: atest TetheringCoverageTests
Change-Id: I9a5ff5dbc1db3f3be7fcd7146862a16b373507e6
Add commit message here for reference:
Tethering resource configuration is move from framework to tethering
module. The resource would not be accessible from outside of tethering
module.
List the replacements of framework resources usage and intent extra:
1. R.string.config_mobile_hotspot_provision_response
--> android.net.extra.TETHER_PROVISIONING_RESPONSE.
2. R.string.config_mobile_hotspot_provision_app_no_ui
--> android.net.extra.TETHER_UI_PROVISIONING_APP_NAME
3. R.array.config_mobile_hotspot_provision_app
--> android.net.extra.TETHER_SILENT_PROVISIONING_ACTION
Besides, the current active subId would put in
android.net.extra.TETHER_SUBID
Note: They are not APIs because of API freeze. Now both tethering module
and Settings define these strings independently.
Bug: 146918263
Test: atest TetherServiceTest
atest TetherProvisioningActivityTest
This reverts commit 9988903174.
Reason for revert: Resume the CL and put this CL with settings part in the same topic to avoid break.
Change-Id: I114b4c258743661df51e5a969e150047a292e035
Original CL has dependencies with unmerged settings change: https://googleplex-android-review.git.corp.google.com/c/platform/packages/apps/Settings/+/11524847
They should be in the same topic, revert it first. Will resume it and put the same with settings part CL.
This reverts commit 217d7b01f8.
Reason for revert: This break hotspot because it should merged with settings part together.
Bug: 158836492
Change-Id: I94d3ee25168cfb3d125030654c4bb8ddd670abfc
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.
Also refine comments in DhcpResults following feedback in previous
change.
Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
The applying data limit is based on the forwarding rule changes.
Add the tests for verifying their interactions with netd.
Bug: 150736748
Test: BpfCoordinatorTest
Change-Id: I5a98c4cd74e2de6005ee05defa761f6af3fd4e75
Tethering resource configuration is move from framwork to tethering
module. Since tethering resource would not be accessible from outside
of tethering module, EntitlementManager would tell Settings the
entitlement configuration via intent extra when run entitlement check.
Bug: 146918263
Test: atest TetheringTests
Change-Id: I6f23553bb1da5f0b767f920b32a86fafb9e00b9e
Currently tethering notification is sending a pending intent for
redirecting user to tether settings page. However, this intent
is implicit that only create with
Settings.ACTION_TETHER_SETTINGS. For security reasons, this
intetnt should specify an explicit component to be delivered to.
Thus, specify the settings package name to this intent.
Test: atest TetheringTests
Bug: 156353008
Change-Id: I49187aee8a004caa890e2a73c0a28d280215c7d4
Merged-In: I49187aee8a004caa890e2a73c0a28d280215c7d4
The BPF tethering coordinator listens to the forwarding rule
changes for updating data limit which is applied in the following
conditions.
- After adding the first rule on a given upstream, add data limit.
- After removing the last rule on a given upstream, clear data limit.
- The service applies a new data limit on current upstream.
The reason for relying on rule changes is because the Tethering and
IpServer objects have multi-internal state machines. It is hard to
synchronize all of their states.
Note that the data limit cleanup for stopping or switching upstream
relies on offload rules are all removed as well.
Bug: 150736748
Test: manual
Original-Change: https://android-review.googlesource.com/1302436
Merged-In: I829d36339973f9473fe6b616c48aa288f18d1c46
Change-Id: I829d36339973f9473fe6b616c48aa288f18d1c46
Verify that the coordinator could fetch tether stats from BPF maps and
report the network stats to the service.
Bug: 150736748
Test: atest BpfCoordinatorTest
Original-Change: https://android-review.googlesource.com/1305574
Merged-In: Ib1756159a2047c5db7d31359b0f288f840bd1bb1
Change-Id: Ib1756159a2047c5db7d31359b0f288f840bd1bb1