Commit Graph

549 Commits

Author SHA1 Message Date
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
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
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
c6298512e4 Merge changes from topic "am-be6a9190f28c4c1fa3990ea22425f5b8-rvc-dev" into rvc-dev am: 8ef4c5bac0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11818540

Change-Id: If839b5722aa8a648e5b97d4c0ef7a111a0754631
2020-06-10 06:55:05 +00:00
Lorenzo Colitti
40e28391e5 [BOT.9] Add unit test for data warning in BpfCoordinator am: 1aa15dab62
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11818918

Change-Id: Ia561692d2405b59d7518bcd4bc18b4a3e5ee1943
2020-06-10 06:54:56 +00:00
Lorenzo Colitti
d0ca099573 [BOT.4] Make BpfCoordinator to support data warning am: 11b88351c0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11818381

Change-Id: I945ba8844fa6f666772cd8a968ba06f00ea8e360
2020-06-10 06:54:53 +00:00
Hungming Chen
41c971a024 [BOT.5] Move class Ipv6ForwardingRule from IpServer to the coordinator am: 810a381cd4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11818380

Change-Id: Ibd36f70caf5980c575958f141116bda380fda04a
2020-06-10 06:54:50 +00:00
Hungming Chen
a2f02c617e [BOT.3] Add unit test for polling network stats in the coordinator am: 6442858f9d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11818379

Change-Id: I9817b26a7e53dcc018fe52c632276bea2f523b68
2020-06-10 06:54:48 +00:00
Hungming Chen
81d15877d4 [BOT.2] Create a coordinator and stats provider to provide tether stats am: d50f53b58a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11818539

Change-Id: Ic87b80f2856282e30fbba93a85cdfd3e8edb9fad
2020-06-10 06:54:39 +00:00
Hungming Chen
3b29ab8c1b [BOT.1] Add a class ForwardedStats in TetheringUtils am: 020cb554f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11818818

Change-Id: I9ec4b9f4018c2c96c1e4ff3c0da9a7509c39ee44
2020-06-10 06:54:36 +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
Lorenzo Colitti
38fa7123d2 Merge "Use the latest stable netd AIDL interface in Tethering." into rvc-dev am: c76256c1ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11807347

Change-Id: Ifd88be2016a986ac473ec963e032bda0128261e7
2020-06-10 03:09:52 +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
Lorenzo Colitti
601971d2d2 Use the latest stable netd AIDL interface in Tethering.
This is required to use the new BPF tethering APIs that set data
usage limits.

AOSP and master are already using -unstable instead of -V3.
In order not to change master, the Merged-In tag is set to the CL
that switched AOSP (and master) to -unstable.

Test: m
Bug: 150736748
Merged-In: I2d2cedf560319653f67f6b06f7abb0bf66eba91a
Change-Id: Idba29b0fe428ac6552a025dcbe15729739088e9e
2020-06-10 01:07:29 +09:00
TreeHugger Robot
07f6ff7138 Merge "Stop reducing RA advertised ipv6 mtu by 16 - not needed." into rvc-dev am: 36ff42e508
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11620914

Change-Id: I36ff80bcb8e6d9f576c87084fc6feb79001bf594
2020-06-03 04:23:34 +00:00
TreeHugger Robot
36ff42e508 Merge "Stop reducing RA advertised ipv6 mtu by 16 - not needed." into rvc-dev 2020-06-03 04:15:32 +00:00
TreeHugger Robot
2f6b53c989 Merge "Gate exemptFromEentitlementCheck by Network_STACK permission" into rvc-dev am: 905ad0070d
Original change: undetermined

Change-Id: Ie82e3bf2716730f6532e3deb267da3f469f3ab6b
2020-06-02 15:21:44 +00:00
TreeHugger Robot
905ad0070d Merge "Gate exemptFromEentitlementCheck by Network_STACK permission" into rvc-dev 2020-06-02 15:09:56 +00:00