Commit Graph

1055 Commits

Author SHA1 Message Date
Mark Chien
df63d22cbe [automerger skipped] Merge changes from topics "pass-res", "remove-isProvisioningNeeded" am: 788abd7c99 am: 932375528d -s ours
am skip reason: Change-Id I9a5ff5dbc1db3f3be7fcd7146862a16b373507e6 with SHA-1 017bfba0d8 is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1345357

Change-Id: Ie251a5e4cbfc78f8b26ae32a12679dd08bd348d9
2020-06-20 04:32:35 +00:00
markchien
1f5c10559b [automerger skipped] Pass entitlement configuration to Settings for entitlement check am: 902043f5c3 am: f7d9dd76ab -s ours
am skip reason: Change-Id I6f23553bb1da5f0b767f920b32a86fafb9e00b9e with SHA-1 217d7b01f8 is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1253710

Change-Id: I259c3a257511436baac8894c7677dbd3090941ab
2020-06-20 04:32:18 +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
962cf025d9 [automerger skipped] Merge "Let only Ethernet manage ethernet interface up and down" into rvc-dev am: 28c2d1dcca -s ours
am skip reason: Change-Id I1cd40ae764bdeecbb59e3889e9399b7f4b05f9cc with SHA-1 9807816e09 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11908430

Change-Id: I6bb2a35f0f74cbd4bfe9b3a82c322c56b804d034
2020-06-19 08:28:32 +00:00
TreeHugger Robot
b207e9c9de [automerger skipped] Merge changes I2292c1cb,I8f60c137 into rvc-dev am: aee09af636 -s ours
am skip reason: Change-Id I2292c1cbff06a304f70191b88d833b19af2b8b92 with SHA-1 00ea6cecd8 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11907887

Change-Id: I6cd21960502b97f81d6a8027b51ec77d6928f3a9
2020-06-19 06:51:23 +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
0d3aeb6139 Merge "Let only Ethernet manage ethernet interface up and down" am: ac8445ca3b am: eb4a072814
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1317394

Change-Id: Ifc233eff24c893ca542e75b683be0628eafba37f
2020-06-19 06:25:12 +00:00
Mark Chien
ac8445ca3b Merge "Let only Ethernet manage ethernet interface up and down" 2020-06-19 05:55:35 +00:00
Mark Chien
83d3905afb [automerger skipped] Merge "Add owneship of tethering module" into rvc-dev am: fb8fc4a0f1 -s ours
am skip reason: Change-Id I13b291e5db6a8a8c9f2bfa477acabaea250aa48c with SHA-1 c907a99efd is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11910264

Change-Id: I411e7cffe6c8cb734cf800100138dd522697baa6
2020-06-19 04:43:37 +00:00
Milim Lee
9807816e09 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
Change-Id: I1cd40ae764bdeecbb59e3889e9399b7f4b05f9cc
2020-06-19 12:44:22 +09: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
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
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
Treehugger Robot
3fd7eb2154 Merge "Test that IpNeighborMonitor is stopped when IpServer stops." 2020-06-19 02:36:06 +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
51229ef8f0 Merge "Memory leak due to no stop for IpNeighborMonitor." am: 4cc7532355 am: 1e488831bd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1343440

Change-Id: Idef540bd66d193eb9b7071374736633c7d0323d7
2020-06-18 16:36:32 +00:00
Lorenzo Colitti
4cc7532355 Merge "Memory leak due to no stop for IpNeighborMonitor." 2020-06-18 15:57:01 +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
h.zhang
d244bd097c 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
Change-Id: I8f60c13706f05306e8f25a15f7861d7ecabbc10e
2020-06-18 23:51:16 +09:00
Lorenzo Colitti
b957bd7af2 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: Ia19cb44ad56e4358c63564261d481459d1386542
2020-06-18 10:34:11 +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
Treehugger Robot
2fd07fd83c Merge "Add owneship of tethering module" am: 51a573cd07 am: ee9b027fce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1340034

Change-Id: Ic2f337be5cf8ed7f89fb88a2395df902cbdac441
2020-06-18 06:45:55 +00:00
Treehugger Robot
51a573cd07 Merge "Add owneship of tethering module" 2020-06-18 06:14:44 +00:00
TreeHugger Robot
69fd06b743 [automerger skipped] Merge "[BOT.13] Make offload coordinator poll interval configurable" into rvc-dev am: 6fddfb71e4 -s ours
am skip reason: Change-Id I7f8dde3b57ee14eb33edbe2fd383df33cccc231c with SHA-1 bfdcfe4ecd is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882405

Change-Id: I7237ba347d78f60094707d1b935c8f457c15e8d1
2020-06-18 05:30:24 +00:00
TreeHugger Robot
3bf5ab8826 [automerger skipped] Merge "[BOT.12] Add unit test for disabling BpfCoordinator by config" into rvc-dev am: 3358560be8 -s ours
am skip reason: Change-Id Iedb936b7592b6be773d1b84a2498bfc5a440a198 with SHA-1 8b3af8d775 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11883504

Change-Id: I79ca8d7c5679f170b251d4f376bc9908b002ca9c
2020-06-18 05:23:02 +00:00
TreeHugger Robot
6f726b9893 [automerger skipped] Merge changes I48a8de47,I95ea3050,I5a98c4cd into rvc-dev am: ec5a703838 -s ours
am skip reason: Change-Id Id413b7f2f7edb2e5c3e02d5677fe536ed52fbbcb with SHA-1 519f1201ca is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11892958

Change-Id: Ia8d500395dfd5fefac69025452bae071182e27e3
2020-06-18 05:17:47 +00:00
markchien
c907a99efd 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

Change-Id: I13b291e5db6a8a8c9f2bfa477acabaea250aa48c
2020-06-18 11:34:29 +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
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
be3598c113 Merge "[BOT.8] Dump BPF offload information in dumpsys" am: e765ab3d36 am: 52d3db170e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1302438

Change-Id: Ifd56fe444a7610736eb9f915f8df70f73eec8c02
2020-06-17 06:32:35 +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