Commit Graph

1430 Commits

Author SHA1 Message Date
markchien
d9acdccbd3 Allow tethering pick prefix from all of private address range
Currently tethering only pick prefix from 192.168.0.0/16. There is no
aviable tethering address if the upstream address is 192.168.x.y/16.
This change allow tethering to pick prefix from any private address
rnages. Now it still pick from 192.168.0.0/16 only to avoid behavior
change. Will have follow up commit to change the configuration.

Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
      atest CtsTetheringTest

Change-Id: Ib6304eb8b4788e9196d0af48e72f00a6bda73a5f
2020-10-13 16:45:09 +08:00
Remi NGUYEN VAN
4cb4ef8333 Merge "Move IpUtils to frameworks/libs/net" 2020-10-09 00:13:40 +00:00
Mark Chien
f052e40f79 Merge "Make the IP subnet persistent till reboot" 2020-10-07 09:39:29 +00:00
markchien
a2ffad84c7 Make the IP subnet persistent till reboot
Make the IP subnet persistent if it do not conflict with upstream.
It allow client to reuse its IP that usually reduce DHCP procedure.

Bug: 168169687
Test: atest TetheringTests
Change-Id: Iddc5304730dce7b11c5d124b7eddce057d752bbd
2020-10-06 20:25:19 +08:00
Anton Hansson
b8a342e4bc Explicitly reference framework-wifi app build rule
This works around a build-system limitation where it does not know
which jars to feed r8 to resolve all classes during proguarding.

Bug: 160453030
Bug: 169931783
Test: build_mainline_modules.sh (with prebuilt sdk)
Change-Id: I3d9f2049cf898b5e551a5c5764df423abaa5e92d
Merged-In: I3d9f2049cf898b5e551a5c5764df423abaa5e92d
2020-10-05 11:43:39 +01:00
Remi NGUYEN VAN
2494a06bb3 Move IpUtils to frameworks/libs/net
The utility classes are useful for mainline modules and their tests, for
example IpClientIntegrationTest.

Bug: 168868607
Test: m && atest NetworkStaticLibTests
Change-Id: If2b1613aa18a7990391e2d31cc2951ca93f1cf3c
2020-10-05 14:38:19 +09:00
Treehugger Robot
0b1e7d8956 Merge "Make PrivateAddressCoordinator ignore vpn network" 2020-10-05 04:10:48 +00:00
Lorenzo Colitti
c99ef48090 Fix OffloadHardwareInterfaceTest.
r.android.com/1424920 changed the code but forgot to update the
unit test.

Also fix some lint errors.

Bug: 149109043
Test: atest TetheringTests TetheringPrivilegedTests
Change-Id: I53ca4b9877dcb4a759dee6ec63133653315d826f
2020-09-30 17:04:19 +09:00
Tyler Wear
7f70074abc tethering: offload: Netlink Req NfGen
Add the netfilter generic message header to
the netlink req. This is needed so the kernel
won't ignore the request for invalid params.

Bug: 149109043
Test: ConntrackSocketTest
Change-Id: I1757fdeb11a0cac5821021a22323cbd74fe22bdc
2020-09-30 15:07:47 +09:00
markchien
1a2163b972 Make PrivateAddressCoordinator ignore vpn network
If vpn app make its netmask as 0, PrivateAddressCoordinator
would not able to find suitable address for tethering downstream.
Since tethering do not support vpn as upstream, just ignore vpn
in PrivateAddressCoordinator.

Bug: 166365863
Test: atest TetheringTests
      atest CtsTetheringTest
Change-Id: Iabe265467044fea9fa437674ca29ffc7bcdefe3b
2020-09-28 17:22:19 +08:00
Treehugger Robot
18ee591257 Merge "Fix TetheredClient callback fail in InProcessTethering" 2020-09-28 08:53:53 +00:00
Treehugger Robot
f5096cc1e3 Merge "Remove double check interface by NetworkInterface" 2020-09-28 04:21:28 +00:00
markchien
f609923b4b Remove double check interface by NetworkInterface
NetworkInterface#getByName can not get the interface without IP addresses.
When setIncludeTestInterfaces(true) is called, the interface will be
placed in client mode, which will delete the link-local address. So calling
NetworkInterface#getByName to get test interface may not work before
switching to server mode.

Bug: 168215721
Test: atest CtsTethering
Change-Id: Ice8adcce1c4b2c86bd219c701b2afa9ba2339f24
2020-09-27 17:11:20 +08:00
Remi NGUYEN VAN
a8e68bb723 Merge "Remove unused testutils lib from tethering tests" 2020-09-24 08:16:21 +00:00
markchien
84ec4a397a Fix TetheredClient callback fail in InProcessTethering
TetheredClient callback would additional check whether caller has
NETWORK_SETTINGS or {MAINLINE_}NETWORK_STACK permission, but it do not
grant for self accessing. InProcessTethering run in system server, so
the services in system server would fail to call TetheredClient callback.
Grant permission for self process.

Bug: 169231588
Test: atest CtsTetheringTest
Change-Id: Ic04e44aef4df772c718ff25ed331bf02f5940c1d
2020-09-24 10:11:51 +08:00
Remi NGUYEN VAN
8f59ec090d Remove unused testutils lib from tethering tests
frameworks-base-testutils is unused in tethering integration tests, so
the dependency can be removed.
That test library also contains test classes, so removing the dependency
allows tethering tests to stop running the associated tests.

Also add jarjar rules to the unit tests to zap (remove) the test classes
from the output APK. Ideally the unit tests should stop depending on
that library too (TestableLooper can be used instead of TestLooper), or
the frameworks-base-testutils library should stop including test
classes.

Bug: 167968946
Test: m CtsTetheringTest TetheringTests
Change-Id: Ie950ce5b6181e388a7f71da430fd2dd8ada32e49
2020-09-23 17:10:42 +09:00
Remi NGUYEN VAN
72e81859f8 Merge "tethering: DAD Proxy Daemon" 2020-09-23 04:57:42 +00:00
Tyler Wear
90e4063fd2 tethering: DAD Proxy Daemon
DAD proxy daemon responsible for forwarding NS/NA between
tethered iface and upstream iface.

Change-Id: I2e58e10e7fa7dba6a6f63ad03b000549f3afc37e
2020-09-22 11:58:49 -07:00
Bill Yi
8c7f330e7a Merge "Merge mainline-release 6664920 to master - DO NOT MERGE" 2020-09-18 18:47:48 +00:00
Bill Yi
725af62a59 Merge mainline-release 6664920 to master - DO NOT MERGE
Merged-In: Id04ea331831e8b26ba99478848392b40a92548d5
Change-Id: I888da0c9475f2d00602d917d2f58169f8d7c93a4
2020-09-17 21:56:59 -07:00
Hungming Chen
56c632caed Move BPF offload program from netd to mainline
Test: as the follows.
$ adb shell ls sys/fs/bpf | grep offload
map_offload_tether_ingress_map
map_offload_tether_limit_map
map_offload_tether_stats_map
prog_offload_schedcls_ingress_tether_ether
prog_offload_schedcls_ingress_tether_rawip

$ adb shell dumpsys netd --short
  TetherController
    BPF ingress map: iif(iface) v6addr -> oif(iface) srcmac ..
      13(rmnet_data3) 2401:e180:8842:6e3:bc6a:2e45:c30:f418 -> ..
    BPF stats (downlink): iif(iface) -> packets bytes errors
      13(rmnet_data3) -> 7 488 0
    BPF limit: iif(iface) -> bytes
      13(rmnet_data3) -> 9223372036854775807

Log:
bpfloader: Loaded object: /apex/com.android.tethering/etc/bpf/offload.o

Change-Id: I71b7efb1f4bd6eb1cd469a0e1e4a56342dc6e579
2020-09-16 20:38:14 +08:00
Xin Li
3b8bfc4811 Merge Android R
Bug: 168057903
Merged-In: Ice3e441cc9c0df8d0a6acc016bb74375e081bd67
Change-Id: I1d85742f594be2007c99841b290e502b6ede624e
2020-09-09 20:21:10 -07:00
Anton Hansson
f94c8eb54f Merge "Simplify module visibility post build refactor" into stage-aosp-master 2020-09-07 08:09:53 +00:00
Anton Hansson
9aed13818c Simplify module visibility post build refactor
//visibility:override is no longer needed for impl_library_visibility
to override visibility.

Removing this allows the defaults module to specify better defaults.

- Stub libraries are made publicly visible, via `visibility`
- Impl libraries are private by default, but visibility is extended
  by the modules

Bug: 165017290
Test: m
Exempt-From-Owner-Approval: build refactor
Change-Id: Ibf35bfac5c99a21125f89ba10945f3364217b90f
2020-09-07 07:54:50 +00:00
Treehugger Robot
097abd5f98 [automerger skipped] Merge "Import translations. DO NOT MERGE ANYWHERE" am: 5db7c0028c -s ours
am skip reason: subject contains skip directive

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

Change-Id: I9102a96a0cb816b895ccf93a174dc6e91e59ee5a
2020-09-06 06:40:58 +00:00
Treehugger Robot
5db7c0028c Merge "Import translations. DO NOT MERGE ANYWHERE" 2020-09-06 06:27:36 +00:00
Bill Yi
2adde431b6 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I729ec6ac98a95690838697c28220b11b0f1b0399
2020-09-05 21:39:23 -07:00
Treehugger Robot
44d4d1333c [automerger skipped] Merge "Import translations. DO NOT MERGE ANYWHERE" am: 5e2016da9a -s ours
am skip reason: subject contains skip directive

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

Change-Id: I65af634549f635e7acf2a1b88213500081d8fde2
2020-09-05 04:33:51 +00:00
Bill Yi
6c701f5341 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ibfe7031a80e38ed3fe776e195514e6c7cad418ab
2020-09-05 01:14:22 +00:00
TreeHugger Robot
14d438a337 Merge "Import translations. DO NOT MERGE ANYWHERE" into stage-aosp-master 2020-09-03 15:17:50 +00:00
Bill Yi
ac8f65a544 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I946ba0e5ca40f934bdc7588eb244969103813c4c
2020-09-03 08:32:04 +00:00
Xin Li
31e2400668 Mark RP1A.200720.001 as merged
Bug: 167588565
Merged-In: I608df7327b8366fd365b11c6bdff9ed28fde99b0
Change-Id: Ie293ab2bcba5f778a7cac8476e226dc7c15e000f
2020-09-02 11:44:54 -07:00
Xin Li
82a71b8f72 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Mark Chien
1ed9e74716 Merge "Add usesCleartextTraffic to Tethering" am: 3aee2ac91a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1402629

Change-Id: Ia5d7695edf13ac4ae9544c648fa95068809f0ab1
2020-08-18 09:19:56 +00:00
Mark Chien
3aee2ac91a Merge "Add usesCleartextTraffic to Tethering" 2020-08-18 09:04:59 +00:00
markchien
c12b03a935 Add usesCleartextTraffic to Tethering
usesCleartextTraffic needs to be true for the networkstack process so
that the NetworkStack module can use no-encrypted probes to detect
captive portals.

When loaded in the networkstack process, all packages in process must
set usesCleartextTraffic=true, otherwise there may be races causing
the flag not to be set for the process.

Bug: 161860610
Test: CtsTetheringTest, TetheringTests
Change-Id: Ife03ee0c7096ea242eb701b297a69b471e15b436
2020-08-18 09:00:58 +00:00
Chalard Jean
c5d748e694 Merge "Rename Kotlin util files to not include the Kt suffix" am: b1a3247ab4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350084

Change-Id: I7e1f015c21d54591a1a25b5fa461e751bc707509
2020-08-13 04:09:27 +00:00
Chalard Jean
96924bf201 Rename Kotlin util files to not include the Kt suffix
Callers don't care what language the utilities are written in

Test: builds
Change-Id: Ie212144f36c50db223c05f3fcb6bad745842cb5e
2020-08-12 10:02:50 +09:00
Paul Hu
9caa751767 Merge "Verify pending intent flags" am: 346a361e93
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1325696

Change-Id: I6764ac9bface86d26f395c6a4fd8b63f7a08df6e
2020-08-10 01:46:50 +00:00
Paul Hu
346a361e93 Merge "Verify pending intent flags" 2020-08-10 01:32:12 +00:00
Chalard Jean
5ab9ebb883 Merge changes I33b70b0a,I1074eedb am: 8818498877
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1392725

Change-Id: I18869fe6bddd51f77068a91034b524f12c5a3450
2020-08-07 06:59:30 +00:00
Chalard Jean
827a8abfb5 Revert "Revert "Move Inet[4]AddressUtils to libs/net"" am: 78701646dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382497

Change-Id: Ia5e7e926bc3a9af8b03f8970738e6abe4c6d15b6
2020-08-07 06:59:26 +00:00
Chalard Jean
8818498877 Merge changes I33b70b0a,I1074eedb
* changes:
  Remove the services.net-module-wifi module target.
  Revert "Revert "Move Inet[4]AddressUtils to libs/net""
2020-08-07 06:45:15 +00:00
Chalard Jean
78701646dd Revert "Revert "Move Inet[4]AddressUtils to libs/net""
This patch is still needed and should go in now that the
error is fixed.
The patch was submitted into rvc-dev and is already in
rvc-dev-plus-aosp (patch in in ag/11923559, revert
skipped in ag/12072199). A follow-up will remove the
unused services.net-module-wifi target.

Test: originally tested in aosp/1324109
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Change-Id: I1074eedb0b0f156a1135e11210ec102de15ea674
Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b
2020-08-07 03:31:04 +00:00
Mark Chien
b537c25685 Merge "Allow wifi p2p to use legacy dedicated address" am: d2af4d9e2a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382398

Change-Id: I8977ef203c363d68c1c43ecd70f530a4924f01b9
2020-08-05 06:22:38 +00:00
Mark Chien
d2af4d9e2a Merge "Allow wifi p2p to use legacy dedicated address" 2020-08-05 06:01:37 +00:00
markchien
eb8fec2111 Allow wifi p2p to use legacy dedicated address
Some exsting applications may expect wifi p2p use legacy
"192.168.49.1/24" address. Have a configuration for wifi p2p to
decide whether to use legacy dedicated address or random address.

Bug: 161520826
Test: atest TetheringTests
Change-Id: If79973416a6780ee19ee785c65772b1a2dc1fbf7
2020-08-05 11:03:46 +08:00
paulhu
f603ed5fb8 Verify pending intent flags
All PendingIntent included activity and broadcast should set
FLAG_IMMUTABLE flag.

Bug: 156353008
Test: atest TetheringTests
Change-Id: I4592e914b67ecb8865d7de47797423f27e9ff840
2020-08-04 11:24:33 +08:00
Chalard Jean
d96c683595 Merge "Move utils from network stack to libs." am: f97ac209c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350083

Change-Id: I846dae9b7e36ddf6360bb946cc07beb8c44a34a5
2020-07-31 00:53:12 +00:00
Chalard Jean
f97ac209c2 Merge "Move utils from network stack to libs." 2020-07-31 00:44:46 +00:00