Commit Graph

1070 Commits

Author SHA1 Message Date
Orion Hodson
697ec868d2 Sync with libnativehelper refactoring
jniGetFDFromFileDescriptor() is now a legacy method and moved to a
separate header.

Bug: 151443957
Bug: 158749603
Test: m
Change-Id: Icd06e9a315680c2251dbb9032a904dd6d66aa359
Merged-In: Icd06e9a315680c2251dbb9032a904dd6d66aa359
Exempt-From-Owner-Approval: cherry pick
(cherry picked from commit a5c4682505)
2020-06-24 12:47:10 +00:00
TreeHugger Robot
5c5ee11ba0 [automerger skipped] Merge "tethering: offload: Netlink Req" into rvc-dev am: 0de458a801 -s ours
am skip reason: Change-Id Iaf3e847e92f205b55f10fa85c17b9f3995d52099 with SHA-1 6b94c31626 is in history

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

Change-Id: Ib853e8dcf754451407ef858f3af766b9cab9696c
2020-06-24 06:50:26 +00:00
TreeHugger Robot
0de458a801 Merge "tethering: offload: Netlink Req" into rvc-dev 2020-06-24 06:46:47 +00:00
Lorenzo Colitti
fdb754c00d [automerger skipped] Merge "Tethering: Add WiGig support" into rvc-dev am: 7852107b29 -s ours
am skip reason: Change-Id Ic4d3aca0ed69234093af7f0206dab3335938c52a with SHA-1 6896f6193f is in history

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

Change-Id: I972b6d352b2c65f023b6a5239a32e9bfec573472
2020-06-24 04:40:39 +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
Lorenzo Colitti
4d2944cda4 Merge "tethering: offload: Netlink Req" am: b90c974174 am: d45fd82ad0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1290954

Change-Id: I5f976d70d87ef25ebb8e1483532781ac3d42425b
2020-06-24 03:44:31 +00:00
Lorenzo Colitti
b90c974174 Merge "tethering: offload: Netlink Req" 2020-06-24 03:11:26 +00:00
Mark Chien
fdf89ee7fb Merge "Tethering: Add WiGig support" am: 65fadfc134 am: 6c5b5b0803
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1177323

Change-Id: Ib48182d51cc6e4586cb43f8ca51ea673ee14d1d7
2020-06-22 23:43:43 +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
Dedy Lansky
6896f6193f 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
2020-06-22 21:17:46 +08:00
Wayne Ma
31b6461408 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: I81e0304f0560cbd070c5bb49967a8b6bf3e5d58a
2020-06-22 08:51:46 +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
Remi NGUYEN VAN
6534f90a6c Merge "Use unstable networkstack AIDLs in development branches" into rvc-dev-plus-aosp 2020-06-22 04:32:42 +00:00
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