Commit Graph

930 Commits

Author SHA1 Message Date
Nucca Chen
3af4ef9ce5 Merge "[BOT.10] Add unit test for data limit and rule change in BpfCoordinator" am: 8392e11329 am: 0d295a8642 am: b079e02a39 am: 5b878baac3 am: e424cd0a18
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1311659

Change-Id: I9e5ca6c6d61e35f0b65add90b19d59c05a77bf0f
2020-06-17 07:02:46 +00:00
Mark Chien
37867cc26b Merge "Revert "Revert "Pass entitlement configuration to Settings for entitlement check""" into rvc-dev am: 404c3adad7 am: 7e501e2967 am: bccb89a187 am: 36a6c56989
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11836350

Change-Id: Ic89fe046e75a76aebf05e47c8754010f52a45536
2020-06-17 07:02:13 +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
66cdc1f38e Merge "Protect invalid entitlement app configuration" into rvc-dev am: 06b2e1cb17 am: edd4b50f58 am: cd1d6ff1ff am: f4d3d46981
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11699076

Change-Id: I46e9cc995a3b1fe9628f2487e969b87c2c2371c9
2020-06-17 03:33:08 +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
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
03a094dfce Merge "Revert "Pass entitlement configuration to Settings for entitlement check"" into rvc-dev am: f1b2407490 am: b4ac5bc5b4 am: b05fa7f798 am: a7cec49bfc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11836348

Change-Id: I53318fdc3d116127dd9d22bb449b8868313a38ba
2020-06-12 18:10:27 +00: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
TreeHugger Robot
8613dab375 Merge "Pass entitlement configuration to Settings for entitlement check" into rvc-dev am: 03cfdd49b6 am: 56a635ceb5 am: aa0f47ccb3 am: 1f6f0a7743
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11560353

Change-Id: I9d0da41702117523bc1570ce9eead4283192b768
2020-06-11 16:19:17 +00:00
TreeHugger Robot
1f6f0a7743 Merge "Pass entitlement configuration to Settings for entitlement check" into rvc-dev am: 03cfdd49b6 am: 56a635ceb5 am: aa0f47ccb3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11560353

Change-Id: I4ad9c2e14018c888e9a0b27f0b16643f233a7f6b
2020-06-11 15:57:28 +00: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
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
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
Treehugger Robot
734076036d Merge "Address comment from aosp/1232197" am: 7e6ff1bde1 am: a87d030207 am: 5a18fd3d2c am: 30543064b5 am: 99a9f03255
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1318288

Change-Id: Ib1c65c3f9880792b49813bb6871f0eb8f0dcb880
2020-06-09 18:28:16 +00:00
Treehugger Robot
5a18fd3d2c Merge "Address comment from aosp/1232197" am: 7e6ff1bde1 am: a87d030207
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1318288

Change-Id: Iabdcc3b95239019a625e9823f70c30a9bded706a
2020-06-09 17:59:03 +00:00
Treehugger Robot
7e6ff1bde1 Merge "Address comment from aosp/1232197" 2020-06-09 17:19:33 +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
23d3edbde9 Merge "[BOT.6] Make BpfCoordinator to support data limit" am: 73dd6f71f8 am: 3e58ec268b am: fe3f85ba3d am: b3debb2fd2 am: 6384a7e2c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1302436

Change-Id: I67c81b00045b747e2b976e4d1017d88c7bb2d024
2020-06-09 14:09:14 +00:00
Treehugger Robot
fe3f85ba3d Merge "[BOT.6] Make BpfCoordinator to support data limit" am: 73dd6f71f8 am: 3e58ec268b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1302436

Change-Id: Icf64d856318173ad599a4f48295c9bdf591967f1
2020-06-09 13:28:38 +00:00
Treehugger Robot
73dd6f71f8 Merge "[BOT.6] Make BpfCoordinator to support data limit" 2020-06-09 12:58:20 +00:00
Mark Chien
83e2c271f8 Merge "Move TetheringTests to presubmit" am: 597265fa13 am: 6b63e8da67 am: 43e70468ce am: afa80c5df1 am: f42bfa272e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1318279

Change-Id: I1d8b2b50db95291d2058430057534d69f2fb0149
2020-06-09 10:07:19 +00:00
Hungming Chen
269c0886ed [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
Change-Id: I829d36339973f9473fe6b616c48aa288f18d1c46
2020-06-09 17:33:03 +08:00
Mark Chien
43e70468ce Merge "Move TetheringTests to presubmit" am: 597265fa13 am: 6b63e8da67
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1318279

Change-Id: I6cbfa15e623daef9dc70e764a4f701689209f1b2
2020-06-09 09:24:40 +00:00
Mark Chien
597265fa13 Merge "Move TetheringTests to presubmit" 2020-06-09 08:48:13 +00:00
Lorenzo Colitti
5229ce83c1 Merge "[BOT.9] Add unit test for data warning in BpfCoordinator" am: fd349683c9 am: dd9f16708c am: 6ae789f577 am: 03bfac4fba am: d0ce22518f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1311658

Change-Id: If111f79a8e218518b8d6a389c723141168371d29
2020-06-09 03:15:15 +00:00
Automerger Merge Worker
6cb4fb6f50 Merge "Merge "[BOT.4] Make BpfCoordinator to support data warning" am: cdf210fd71 am: 74b81e046c am: 4ac4347e8b" into rvc-d1-dev-plus-aosp am: 8b2df8df35 am: dfee3092f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1302435

Change-Id: I312f88e60e9c85e1f3b48e6c251dc0bd38fbb2d5
2020-06-09 03:14:54 +00:00
Lorenzo Colitti
6ae789f577 Merge "[BOT.9] Add unit test for data warning in BpfCoordinator" am: fd349683c9 am: dd9f16708c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1311658

Change-Id: I5db2504e87edf3389dced385191cc250b88e2da0
2020-06-09 02:55:52 +00:00
Lorenzo Colitti
4ac4347e8b Merge "[BOT.4] Make BpfCoordinator to support data warning" am: cdf210fd71 am: 74b81e046c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1302435

Change-Id: I686b01c362ed61d7333279f4c951039afa9a2fbd
2020-06-09 02:55:01 +00:00
Lorenzo Colitti
fd349683c9 Merge "[BOT.9] Add unit test for data warning in BpfCoordinator" 2020-06-09 02:22:59 +00:00
Lorenzo Colitti
cdf210fd71 Merge "[BOT.4] Make BpfCoordinator to support data warning" 2020-06-09 02:22:43 +00:00
Paul Hu
dfec1d719f Merge "Make tether settings intent explicit" am: 51241a168c am: 913cd757d5 am: 98a32f115d am: aca14f6f73 am: 0b985506fa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1318286

Change-Id: I289182fb29004e4364b1b01316b5abd0cd426b10
2020-06-08 17:39:28 +00:00
Paul Hu
98a32f115d Merge "Make tether settings intent explicit" am: 51241a168c am: 913cd757d5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1318286

Change-Id: I7eafc623fcd88b9544756295d84c936c2ab2507a
2020-06-08 16:20:55 +00:00
Paul Hu
51241a168c Merge "Make tether settings intent explicit" 2020-06-08 10:31:21 +00:00