Commit Graph

572 Commits

Author SHA1 Message Date
Mark Chien
ea316b9be6 Merge "Skip testPhysicalEthernet if the test run adb over network" into rvc-dev am: a973bf1a56
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12105761

Change-Id: Ib429b7ed5fddd2d1a766b8b2b7e57c191ce59559
2020-07-09 00:39:31 +00:00
Treehugger Robot
6faf861994 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

Merged-In: I57d365d33316881c50c3bf7fd1c98926d10842d3
Change-Id: I57d365d33316881c50c3bf7fd1c98926d10842d3
2020-07-08 05:40:52 +00:00
TreeHugger Robot
1e6e79a7c3 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: I9db426581ba148b3743ac04a45af9bf4ea3089e4
2020-07-01 07:58:07 +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
TreeHugger Robot
91d1d07ff4 Merge "tethering: offload: Netlink Req" into rvc-dev am: 0de458a801
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11970745

Change-Id: I70a9139123e5703607e2c011c7449e37880e78d5
2020-06-24 06:51:09 +00:00
TreeHugger Robot
0de458a801 Merge "tethering: offload: Netlink Req" into rvc-dev 2020-06-24 06:46:47 +00:00
Lorenzo Colitti
96a0513a90 Merge "Tethering: Add WiGig support" into rvc-dev am: 7852107b29
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11953638

Change-Id: I6ceddc20bdec83e23039b9566187c3cbaff79176
2020-06-24 04:41:15 +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
Dedy Lansky
4dd87aafc0 Tethering: Add WiGig support
This change is a combination of following changes:

1) Tethering: add TETHERING_WIGIG type
   Currently both WIFI and WIGIG use the same tethering type,
   TETHERING_WIFI. This causes conflicts between the frameworks,
   when both WIFI and WIGIG SoftAPs are started, one or both will
   not work.
   Fix this by using a seperate tethering type for WIGIG.

2) Tethering: remove TETHERING_WIGIG state machine on interface down
   The wigig state machine relies on a TETHERING_STATE_CHANGED broadcast
   that is sent when the tethering state machine is first created, during
   interface up. Currently the tethering state machine is not removed
   on interface down except for TETHERING_BLUETOOTH, and as a result
   wigig tethering only works the first time SoftAP is started.
   In order to fix this, remove the tethering state machine on interface
   down for TETHERING_WIGIG as well.

Bug: 143356416
Test: TetheringCoverageTests

Change-Id: Ic4d3aca0ed69234093af7f0206dab3335938c52a
Merged-In: Ic4d3aca0ed69234093af7f0206dab3335938c52a
2020-06-22 23:23:25 +00:00
Wayne Ma
4b0912d248 Merge "Add framework-statsd dependency and make framework-statsd visible to Tethering package." into rvc-dev am: 7ce578a359
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11926261

Change-Id: If4a423ffe3cdd4f0f615aace774e2606deada766
2020-06-22 08:51:43 +00:00
waynema
b7048af0a9 Add framework-statsd dependency and make framework-statsd visible to
Tethering package.

Tethering needs StatsEvent and StatsLog which are in
framework-statsd.stubs.module_lib to write metrics.

Bug: 153942334

Test: make
Change-Id: I8ba142a9b3678de36e6c4880a64e992e00680f38
2020-06-22 06:57:51 +00:00
TreeHugger Robot
ebcd7131a1 Merge "Let only Ethernet manage ethernet interface up and down" into rvc-dev am: 28c2d1dcca
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11908430

Change-Id: I2a5179ac64f00bf6a4254ded6318d6f1c6f9fd6c
2020-06-19 08:28:26 +00:00
TreeHugger Robot
d8a97e64b5 Merge changes I2292c1cb,I8f60c137 into rvc-dev am: aee09af636
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11907887

Change-Id: Id831c7238460f31c19b647229029bc9fbf89ee5f
2020-06-19 06:51:26 +00:00
Lorenzo Colitti
f56b2d478a Memory leak due to no stop for IpNeighborMonitor. am: 93e59ee726
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11910263

Change-Id: I22a5b3526c32c989be5c0fc644e9f177b8fe2eac
2020-06-19 06:51:19 +00:00
Mark Chien
675697222a Let only Ethernet manage ethernet interface up and down
When LAN link is changed for using ethernet interface from Ethernet tethering to Ethernet,
there is confiict as Ethernet Tethering is trying to make ethernet link down and Ethernet is trying to make ethernet link up.

So, this would make Ethernet only manage ethernet interface link state.

Test: manual
Bug: 130840861
Merged-In: I1cd40ae764bdeecbb59e3889e9399b7f4b05f9cc
Change-Id: I1cd40ae764bdeecbb59e3889e9399b7f4b05f9cc
2020-06-19 06:49:46 +00:00
TreeHugger Robot
aee09af636 Merge changes I2292c1cb,I8f60c137 into rvc-dev
* changes:
  Test that IpNeighborMonitor is stopped when IpServer stops.
  Memory leak due to no stop for IpNeighborMonitor.
2020-06-19 06:36:50 +00:00
Mark Chien
754b32ce5b Merge "Add owneship of tethering module" into rvc-dev am: fb8fc4a0f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11910264

Change-Id: I4600aa0f43c010efe4238f92e0e70faec93a4f22
2020-06-19 04:43:33 +00:00
Treehugger Robot
a4a8a315fe Add owneship of tethering module
Bug: 158961959
Test: build/make/tools/checkowners.py packages/NetworkStack/OWNERS
Test: ./build/make/tools/checkowners.py \
frameworks/base/packages/Tethering/OWNERS

Merged-In: I13b291e5db6a8a8c9f2bfa477acabaea250aa48c
Change-Id: I13b291e5db6a8a8c9f2bfa477acabaea250aa48c
2020-06-19 03:37:43 +00: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
Lorenzo Colitti
93e59ee726 Memory leak due to no stop for IpNeighborMonitor.
1. When Wi-Fi enabled, ap0 interface is added and IpNeighborMonitor's
   start() is invoked in IpServer's constructor.
2. There's no stop for IpNeighborMonitor when IpServer stop.
3. During overnight test for Wi-Fi, networkstack is too slow to
   process request due to memory leak in IpNeighborMonitor and
   binder buffer is blocked causing exception.
Solution: Invoke IpNeighborMonitor.stop() in UnavailableState.enter().

Bug: 159097215
Test: automatic, turn on and off Wi-Fi every 6 seconds overnight
Original-Change: https://android-review.googlesource.com/1343440
Merged-In: I8f60c13706f05306e8f25a15f7861d7ecabbc10e
Change-Id: I8f60c13706f05306e8f25a15f7861d7ecabbc10e
2020-06-19 02:43:57 +00:00
Remi NGUYEN VAN
5689772f4d 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: Ia5028f7dfeadbcf928efb9862b481c82e2849e18
2020-06-19 01:08:47 +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
0715560195 Merge "Move DnsPacket to libs net" into rvc-dev am: 52032fa586
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: I74cac5c415d8b3447b57cda7cba1caa215e84ea2
2020-06-18 14:58:19 +00:00
TreeHugger Robot
4e994788db Merge "[BOT.13] Make offload coordinator poll interval configurable" into rvc-dev am: 6fddfb71e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882405

Change-Id: Ifb59c6a23e30335c16e6190c74f7b300a109e9e9
2020-06-18 14:51:21 +00:00
TreeHugger Robot
8fd0b8bcf2 Merge "[BOT.12] Add unit test for disabling BpfCoordinator by config" into rvc-dev am: 3358560be8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11883504

Change-Id: If985e431f6266777486375bc02dec9b30bd52211
2020-06-18 14:50:56 +00:00
TreeHugger Robot
744e7cd238 Merge changes I48a8de47,I95ea3050,I5a98c4cd into rvc-dev am: ec5a703838
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11892958

Change-Id: I25556f14d4f249e9360cc42ac6fac22df76e91fc
2020-06-18 14:50:18 +00:00
Nucca Chen
9d19ebf408 [BOT.8] Dump BPF offload information in dumpsys am: a340f25d3e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882881

Change-Id: I01c07889d61ce9ef6280e2b1134887e26505ba6d
2020-06-18 14:50:15 +00:00
Nucca Chen
f7257aaec8 [BOT.10] Add unit test for data limit and rule change in BpfCoordinator am: 2fbc671d4a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882403

Change-Id: I92fbb8eab84fa09e632f329e752ae06808eda951
2020-06-18 14:50:13 +00:00
Mark Chien
0382ca9dc1 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: I06154325294f31d3f742d38e8f5eea1ff2190a88
2020-06-18 14:28:08 +00:00
Mark Chien
7b5f30d3a4 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: Ida5076888f61e8e472e853ce1ee58f8106dacbb2
2020-06-18 14:25:17 +00:00
Lorenzo Colitti
52032fa586 Merge "Move DnsPacket to libs net" into rvc-dev 2020-06-18 10:14:47 +00:00
Luke Huang
8dd7e0a936 Move DnsPacket to libs net
This class might be used by some mainline modules.

Bug: 151052811
Test: atest DnsPacketTest
Test: atest DnsResolverTest
Change-Id: I8841d91456952ded5efbf8ea221289aecc7746ad
2020-06-18 16:17:04 +08: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
a340f25d3e [BOT.8] Dump BPF offload information in dumpsys
$ adb shell dumpsys tethering
BPF offload:
  Polling started
  Stats provider registered
  Upstream quota: {rmnet_data2=9223372036854775807}
  Forwarding stats:
    12(rmnet_data2) - ForwardedStats(rxb: 1065, rxp: 5, txb: 0, txp: 0)
  Forwarding rules:
    [wlan1]: iif(iface) oif(iface) v6addr srcmac dstmac
      12(rmnet_data2) 31(wlan1) /2401:e180:8831:77ae:a900:a03b:41fb..

Bug: 150736748
Test: Enable tethering on mobile data and check dumpsys tethering
Original-Change: https://android-review.googlesource.com/1302438
Merged-In: I95ea3050d92f3ba8136a63cd399d3450d183c8dc
Change-Id: I95ea3050d92f3ba8136a63cd399d3450d183c8dc
2020-06-17 07:29:10 +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
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
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
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
Mark Chien
ed00400645 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: Ifa96dbf15a2c96b7c1fc9af39c8270707864470b
2020-06-12 17:45:43 +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
56a635ceb5 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: I332e6f8965c1571508b310115c45cd4588c933ea
2020-06-11 15:15:15 +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
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
Mark Chien
637de75575 Merge "Move TetheringTests to presubmit" into rvc-dev am: ccf1551ed0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11818359

Change-Id: I839176744df185f47b0020ce7c3f74084934bd55
2020-06-11 01:38:37 +00:00
Mark Chien
ccf1551ed0 Merge "Move TetheringTests to presubmit" into rvc-dev 2020-06-11 01:35:38 +00:00
TreeHugger Robot
8bc0ca8c74 Merge "Make tether settings intent explicit" into rvc-dev am: 34d101b450
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11596544

Change-Id: I73dbaf73122522f7385520a8cee46c9299853b7c
2020-06-10 18:09:43 +00:00