Commit Graph

662 Commits

Author SHA1 Message Date
Treehugger Robot
218040ca26 Merge "Fix EthernetTetheringTest failure if tethering is not supported" am: dace79b0ac am: 8b74fe1c8b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1352244

Change-Id: I6763589a3af8cd78efc53e0637ff4f9d6ebcef88
2020-07-13 09:35:07 +00:00
Treehugger Robot
dace79b0ac Merge "Fix EthernetTetheringTest failure if tethering is not supported" 2020-07-13 09:05:00 +00:00
markchien
45fb1aae66 Fix EthernetTetheringTest failure if tethering is not supported
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
2020-07-13 15:24:45 +08:00
Treehugger Robot
c8f45d6350 Merge "Skip testPhysicalEthernet if the test run adb over network" am: b68d322521 am: 10daa1daae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354445

Change-Id: I5e91a05d90f5f05cdbe7e7b30945d80832759bd2
2020-07-08 05:06:20 +00:00
Treehugger Robot
b68d322521 Merge "Skip testPhysicalEthernet if the test run adb over network" 2020-07-08 04:41:34 +00:00
Chalard Jean
6b66d70ba1 Revert "Move Inet[4]AddressUtils to libs/net"
This reverts commit cf86031c12.

Reason for revert: Breaks the build b/160390899

Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b
Change-Id: Ie10e66f61393602f17fbb61bf17230b176bf1f44
2020-07-02 23:47:35 +00:00
markchien
37ad92e058 Skip testPhysicalEthernet if the test run adb over network
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
2020-07-02 23:26:46 +08:00
Remi NGUYEN VAN
cf86031c12 Move Inet[4]AddressUtils to libs/net
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
2020-07-02 10:52:31 +09:00
TreeHugger Robot
422c0ddfe6 Merge "Fix tethering jarjar rule for LocalLog" into rvc-dev am: 6127ca43d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12040945

Change-Id: I8eec902878e34cb6a4ee7989d45cc0c7149c791c
2020-07-01 07:58:32 +00:00
markchien
683932315b Fix tethering jarjar rule for LocalLog
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
2020-07-01 03:40:50 +00:00
markchien
a8ac97cf22 Fix tethering jarjar rule for LocalLog
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
2020-06-30 15:30:55 +00:00
Lorenzo Colitti
e8141aa9c3 tethering: offload: Netlink Req
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
2020-06-24 04:21:47 +00:00
Lorenzo Colitti
4d2944cda4 Merge "tethering: offload: Netlink Req" am: b90c974174 am: d45fd82ad0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1290954

Change-Id: I5f976d70d87ef25ebb8e1483532781ac3d42425b
2020-06-24 03:44:31 +00:00
Lorenzo Colitti
b90c974174 Merge "tethering: offload: Netlink Req" 2020-06-24 03:11:26 +00:00
markchien
4c9428a135 Protect invalid entitlement app configuration
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
2020-06-20 10:19:25 +08:00
markchien
902043f5c3 Pass entitlement configuration to Settings for entitlement check
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
2020-06-20 10:19:21 +08:00
Treehugger Robot
9644bc01dd Test that IpNeighborMonitor is stopped when IpServer stops.
Bug: 159097215
Test: test-only change
Original-Change: https://android-review.googlesource.com/1343441
Merged-In: I2292c1cbff06a304f70191b88d833b19af2b8b92
Change-Id: I2292c1cbff06a304f70191b88d833b19af2b8b92
2020-06-19 03:06:05 +00:00
Treehugger Robot
57c16390af Merge "Test that IpNeighborMonitor is stopped when IpServer stops." am: 3fd7eb2154 am: a5edc98546
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1343441

Change-Id: Iddcf13599efd093b2cf2d2228a3f7be69178e5fc
2020-06-19 03:04:46 +00:00
Remi NGUYEN VAN
2e342b8676 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: e7afe55beb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11846903

Change-Id: Icd141a992c46290c74929785e261a1cd57bc001b
2020-06-19 01:08:48 +00:00
Remi NGUYEN VAN
e7afe55beb Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev 2020-06-19 00:49:29 +00:00
Lorenzo Colitti
00ea6cecd8 Test that IpNeighborMonitor is stopped when IpServer stops.
Bug: 159097215
Test: test-only change
Change-Id: I2292c1cbff06a304f70191b88d833b19af2b8b92
2020-06-18 23:51:56 +09:00
Nucca Chen
1c0d8487b4 [BOT.13] Make offload coordinator poll interval configurable
Bug: 150736748
Test: BpfCoordinatorTest

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1315576
Merged-In: I7f8dde3b57ee14eb33edbe2fd383df33cccc231c
Change-Id: I70a6e5c8e765daf40cb738feb7fd70cf3c8f052d
(cherry picked from commit bb61893406)
2020-06-17 07:45:57 +00:00
Nucca Chen
0a0d4e156d [BOT.12] Add unit test for disabling BpfCoordinator by config
Bug: 150736748
Test: BpfCoordinatorTest
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1313802
Merged-In: Iedb936b7592b6be773d1b84a2498bfc5a440a198
Change-Id: I298ae39a1fa61b2cf97752aa908aa2d7d0f9783d
(cherry picked from commit 3aba923ce2)
2020-06-17 07:43:41 +00:00
Nucca Chen
d105961e58 [BOT.11] BpfCoordinator could be disabled by device config
Bug: 150736748
Test: BpfCoordinatorTest
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1313955
Merged-In: Id413b7f2f7edb2e5c3e02d5677fe536ed52fbbcb
Change-Id: I48a8de478c9200b8c9f88e785340fc7973e4a13f
(cherry picked from commit fe737bc2b2)
2020-06-17 07:40:40 +00:00
Nucca Chen
2fbc671d4a [BOT.10] Add unit test for data limit and rule change in BpfCoordinator
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
2020-06-17 06:35:43 +00:00
Nucca Chen
c2be69eff8 Merge "[BOT.13] Make offload coordinator poll interval configurable" am: 8b7c9a2f87 am: 558d3e3ad2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1315576

Change-Id: Ia1befc327f71df979bd60cb4fcb96a0ed69afbef
2020-06-17 06:33:42 +00:00
Nucca Chen
4a87f05849 Merge "[BOT.12] Add unit test for disabling BpfCoordinator by config" am: 6241525504 am: d36e818816
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1313802

Change-Id: Ica3e4752091c3460296f7d06ccb1e0827aec29f6
2020-06-17 06:33:31 +00:00
Nucca Chen
d7f13cb23b Merge "[BOT.11] BpfCoordinator could be disabled by device config" am: e8c985be78 am: 36e37ff125
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1313955

Change-Id: If0f1df54216517aff5af0ce4ae120b25d7fdbaf6
2020-06-17 06:32:52 +00:00
Nucca Chen
b079e02a39 Merge "[BOT.10] Add unit test for data limit and rule change in BpfCoordinator" am: 8392e11329 am: 0d295a8642
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1311659

Change-Id: I9e6a6c89a080d7b168d31f390cc6241c252e7341
2020-06-17 06:31:45 +00:00
Mark Chien
7e501e2967 Merge "Revert "Revert "Pass entitlement configuration to Settings for entitlement check""" into rvc-dev am: 404c3adad7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11836350

Change-Id: Ibfea2e6f2564942eca60c84a5df5583acc1b9e8b
2020-06-17 06:24:22 +00:00
Mark Chien
404c3adad7 Merge "Revert "Revert "Pass entitlement configuration to Settings for entitlement check""" into rvc-dev 2020-06-17 06:07:52 +00:00
Mark Chien
edd4b50f58 Merge "Protect invalid entitlement app configuration" into rvc-dev am: 06b2e1cb17
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11699076

Change-Id: I1d9075a7c112dd1345d6a8dacf343886dc1b286b
2020-06-17 02:47:31 +00:00
markchien
017bfba0d8 Protect invalid entitlement app configuration
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
2020-06-16 19:06:34 +08:00
Hungming Chen
bfdcfe4ecd [BOT.13] Make offload coordinator poll interval configurable
Bug: 150736748
Test: BpfCoordinatorTest
Change-Id: I7f8dde3b57ee14eb33edbe2fd383df33cccc231c
2020-06-16 18:01:24 +08:00
Hungming Chen
8b3af8d775 [BOT.12] Add unit test for disabling BpfCoordinator by config
Bug: 150736748
Test: BpfCoordinatorTest
Change-Id: Iedb936b7592b6be773d1b84a2498bfc5a440a198
2020-06-16 18:01:17 +08:00
Mark Chien
c55e229dcb Revert "Revert "Pass entitlement configuration to Settings for entitlement check""
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
2020-06-15 16:38:53 +00:00
Hungming Chen
519f1201ca [BOT.11] BpfCoordinator could be disabled by device config
Bug: 150736748
Test: BpfCoordinatorTest
Change-Id: Id413b7f2f7edb2e5c3e02d5677fe536ed52fbbcb
2020-06-15 21:16:26 +08:00
Mark Chien
b4ac5bc5b4 Merge "Revert "Pass entitlement configuration to Settings for entitlement check"" into rvc-dev am: f1b2407490
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11836348

Change-Id: I9436ba6a4fe7ef3eb38316d831e047957302bc49
2020-06-12 17:45:36 +00:00
Mark Chien
f1b2407490 Merge "Revert "Pass entitlement configuration to Settings for entitlement check"" into rvc-dev 2020-06-12 17:33:24 +00:00
Mark Chien
9988903174 Revert "Pass entitlement configuration to Settings for entitlement check"
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
2020-06-12 15:29:39 +00:00
Remi NGUYEN VAN
e10b80de7d Move Inet[4]AddressUtils to libs/net
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
2020-06-12 17:04:06 +09:00
TreeHugger Robot
10ede1fcae Merge "Pass entitlement configuration to Settings for entitlement check" into rvc-dev am: 03cfdd49b6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11560353

Change-Id: I213f7fa7116f58ae63cb32ecbf9f62e8306a83d2
2020-06-11 15:14:42 +00:00
TreeHugger Robot
03cfdd49b6 Merge "Pass entitlement configuration to Settings for entitlement check" into rvc-dev 2020-06-11 15:00:57 +00:00
Hungming Chen
47f7a44350 [BOT.10] Add unit test for data limit and rule change in BpfCoordinator
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
2020-06-11 19:53:36 +08:00
markchien
217d7b01f8 Pass entitlement configuration to Settings for entitlement check
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
2020-06-11 13:53:27 +08:00
TreeHugger Robot
34d101b450 Merge "Make tether settings intent explicit" into rvc-dev 2020-06-10 17:47:19 +00:00
paulhu
5a07338239 Make tether settings intent explicit
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
2020-06-10 23:48:13 +08:00
Treehugger Robot
7c538fa7ff [BOT.6] Make BpfCoordinator to support data limit
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
2020-06-10 03:14:34 +00:00
Lorenzo Colitti
1aa15dab62 [BOT.9] Add unit test for data warning in BpfCoordinator
Bug: 150736748
Test: atest BpfCoordinatorTest
Original-Change: https://android-review.googlesource.com/1311658
Merged-In: Ic1f37de75b064d7c8717e1b496e13174bb8693ec
Change-Id: Ic1f37de75b064d7c8717e1b496e13174bb8693ec
2020-06-10 03:13:49 +00:00
Hungming Chen
6442858f9d [BOT.3] Add unit test for polling network stats in the coordinator
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
2020-06-10 03:10:48 +00:00