Commit Graph

622 Commits

Author SHA1 Message Date
android-build-team Robot
67d9d012b6 Make change and version bump to r_aml_300802400 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: If743b76583bc895f11674e468792c0da1b958121
2020-06-23 03:17:14 +00:00
Wayne Ma
4c847d23f1 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: I8d7444fb29ad1339d9b2d33f6e1688015c5613b7
2020-06-22 08:51:51 +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
android-build-team Robot
75c7ca2283 Make change and version bump to r_aml_300802300 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: Ie54721e710eda02bda97af622520078fca01d632
2020-06-22 03:17:06 +00:00
android-build-team Robot
8997b6c8e1 Make change and version bump to r_aml_300802200 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: Ibddfd670698e66c42797c61e7020c1382fecb2bf
2020-06-20 03:22:10 +00:00
TreeHugger Robot
36eab72880 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: I3153f51a66df5eaf2f220ed50c2a83de960b83f7
2020-06-19 08:29:30 +00:00
android-build-team Robot
1a09018e55 Make change and version bump to r_aml_300802100 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: I7af1c3a55b61516884940432f9146eb26c169668
2020-06-19 07:17:59 +00:00
TreeHugger Robot
930a956e50 Merge changes I2292c1cb,I8f60c137 into rvc-dev am: aee09af636
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11907887

Change-Id: Ifacd13ca8fc146c1a3f01ddf38dc9aed7678f08f
2020-06-19 06:51:45 +00:00
Lorenzo Colitti
d6741dcc4a 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: I4cfe32fab474ba9bab5e96a90329ad52e87eba77
2020-06-19 06:51:42 +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
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
e7afe55beb Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev 2020-06-19 00:49:29 +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
android-build-team Robot
2f8db2964d Make change and version bump to r_aml_300802000 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: I6601ad32346eec33bef7dde00ae7d744c86aa8e4
2020-06-18 07:17:34 +00:00
android-build-team Robot
fad40ff9e9 Make change and version bump to r_aml_300801900 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: I357be5bdb76f6276711e39743d88974b7d1cf248
2020-06-17 19:58:05 +00: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
android-build-team Robot
51fc9bad09 Make change and version bump to r_aml_300801800 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: I86d41b911e1b337ff794f3f2d636661ce7427985
2020-06-17 07:19:12 +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
android-build-team Robot
f90328dd70 Make change and version bump to r_aml_300801700 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: Ie3a0a9efb7b092ee585abb28e50502077e44ee3e
2020-06-16 07:16:41 +00: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
android-build-team Robot
3a24b176e7 Make change and version bump to r_aml_300801600 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: Ia1f7a301c15fddbaa0009e2106b95e4b0a76b329
2020-06-15 07:16:48 +00:00
android-build-team Robot
c77a1e9e52 Make change and version bump to r_aml_300801500 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: I75d67291909ddeb356f2927c4e11c2981ebeff37
2020-06-14 07:21:49 +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
android-build-team Robot
0b741e482c Make change and version bump to r_aml_300801400 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: I9c9f527416459b38c32ccf5b65f4054cea5b586f
2020-06-12 07:21:50 +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
android-build-team Robot
54bb5f39ae Make change and version bump to r_aml_300801300 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: Ia261164ce399e211f9136fa36b6d28f9aea918d1
2020-06-11 07:16:12 +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
ccf1551ed0 Merge "Move TetheringTests to presubmit" into rvc-dev 2020-06-11 01:35:38 +00: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
android-build-team Robot
1fbd32ecd5 Make change and version bump to r_aml_300801200 for mainline module file: packages/Tethering/apex/manifest.json
Change-Id: Ib12acc94b460b14aa189a97511df0f1138e47484
2020-06-10 07:17:04 +00: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
Lorenzo Colitti
11b88351c0 [BOT.4] Make BpfCoordinator to support data warning
Invoke the existing polling thread to update data alert statistics.
Once the data alert limit has reached, trigger the notification.

Bug: 150736748
Test: BpfCoordinatorTest
Original-Change: https://android-review.googlesource.com/1302435
Merged-In: Ibf25560ca2e9f003d8eba01361dc7d35ec1b1627
Change-Id: Ibf25560ca2e9f003d8eba01361dc7d35ec1b1627
2020-06-10 03:12:52 +00:00
Hungming Chen
810a381cd4 [BOT.5] Move class Ipv6ForwardingRule from IpServer to the coordinator
This is a preparation for moving adding/removing forwarding rules from
IpServer to BpfCoordinator.

Bug: 150736748
Test: atest IpServerTest
Original-Change: https://android-review.googlesource.com/1317234
Merged-In: I85316ef09ff3c9389ded11dcc384493d699da48e
Change-Id: I85316ef09ff3c9389ded11dcc384493d699da48e
2020-06-10 03:11:41 +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
Hungming Chen
d50f53b58a [BOT.2] Create a coordinator and stats provider to provide tether stats
Make BPF tethering offload coordinator, BpfCoordinator,
registers a network stats provider, BpfTetherStatsProvider, and
provide the tethering stats from the BPF map.

Bug: 150736748
Test: new test BpfCoordinatorTest

Original-Change: https://android-review.googlesource.com/1256189
Merged-In: I22e71f87b67668f7e733e4f215d93bf5b2c9380d
Change-Id: I22e71f87b67668f7e733e4f215d93bf5b2c9380d
2020-06-10 03:10:13 +00:00
Hungming Chen
020cb554f5 [BOT.1] Add a class ForwardedStats in TetheringUtils
Used to record offload transmitted/received forwarded bytes/packets.

Bug: 150736748
Test: new test BpfTetheringCoordinatorTest
Original-Change: https://android-review.googlesource.com/1306257
Merged-In: Ie8725f95c3ddd5fb3811d479de32d2c1f7dcb493
Change-Id: Ie8725f95c3ddd5fb3811d479de32d2c1f7dcb493
2020-06-10 03:09:36 +00:00
Mark Chien
0fffc85052 Move TetheringTests to presubmit
The TetheringTests are green in postsubmit for a while.
Also add TetheringIntegrationTests to postsubmit.

Bug: 148998835
Test: atest --test-mapping frameworks/base/packages/Tethering:postsubmit
      atest --test-mapping frameworks/base/packages/Tethering:presubmit
Merged-In: I80d29d06fde5a718c31a0a5ad2e2562be5bf419f
Change-Id: I80d29d06fde5a718c31a0a5ad2e2562be5bf419f
2020-06-10 02:33:37 +00:00