Commit Graph

1530 Commits

Author SHA1 Message Date
Automerger Merge Worker
75f615e14c Merge "Reduce advertised ipv6 mtu by 16 to fit ethernet header" am: b23d20fea7 am: 376e086fef am: f0fff78d9d
Change-Id: I2ce8d87603b1628735b376efe21da43d3ea53225
2020-02-19 23:11:06 +00:00
Automerger Merge Worker
3c1cf6e09a [automerger skipped] Merge "Add tethering client callbacks" am: 5ea7a9466b am: 6b281c9304 am: 3883a5ce7b -s ours
am skip reason: Change-Id I96291038cf7b39a67547a5f74fcd7cbedc1ca002 with SHA-1 c8871c1b66 is in history

Change-Id: I046ad2de1e65468df9f70f189abfa1162f15a7c0
2020-02-19 23:10:08 +00:00
Automerger Merge Worker
acf2c63b4e [automerger skipped] Merge "Fix usage of annotations in TetheringLib" am: 907976e0a2 am: a4dbd9a897 am: 3cea47c781 -s ours
am skip reason: Change-Id I1fae97a1c1e0ba07fa3e2d64cde7650cd26d0acd with SHA-1 63dc279dfc is in history

Change-Id: Ifdfeae4e43afd3892ced4964d54e532a1f46e8fc
2020-02-19 23:09:45 +00:00
Automerger Merge Worker
efc2d97316 [automerger skipped] Merge "Use framework-tethering-stub instead of framework-tethering" am: b8a6208240 am: 101b4e2bb5 am: 42dbff65d6 -s ours
am skip reason: Change-Id I97ef83f7f9b4c1376f373713036f5256318f1050 with SHA-1 44fc26d19e is in history

Change-Id: I1771917998eeda2d18abb1f576e5091828651ea0
2020-02-19 23:09:23 +00:00
Automerger Merge Worker
26c1bc0ab3 Merge "Add TetheringTests to postsubmit" am: a0c1281870 am: 2d89fa53d3 am: b9a8a92364
Change-Id: I6597bb11941d92f222e8dc0a4edf1e9f8e2a5fde
2020-02-19 23:09:00 +00:00
Peter Collingbourne
9969e5dff7 Tethering: Don't crash if wifi unavailable.
r.android.com/1213016 seems to have caused the following crash on devices
without wifi:

FATAL EXCEPTION: main
Process: com.android.networkstack.process, PID: 1041
java.lang.RuntimeException: Unable to create service com.android.server.connectivity.tethering.TetheringService: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.net.wifi.WifiManager.registerSoftApCallback(java.util.concurrent.Executor, android.net.wifi.WifiManager$SoftApCallback)' on a null object reference
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4005)
	at android.app.ActivityThread.access$1500(ActivityThread.java:220)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:216)
	at android.app.ActivityThread.main(ActivityThread.java:7396)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:949)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.net.wifi.WifiManager.registerSoftApCallback(java.util.concurrent.Executor, android.net.wifi.WifiManager$SoftApCallback)' on a null object reference
	at com.android.server.connectivity.tethering.Tethering.<init>(Tethering.java:317)
	at com.android.server.connectivity.tethering.TetheringService.makeTethering(TetheringService.java:90)
	at com.android.server.connectivity.tethering.TetheringService.onCreate(TetheringService.java:81)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3993)

Fix it by null checking wifiManager before calling a method on it.

Bug: 142352330
Change-Id: I46e2f3053a59d3dba6a186a9eed34fa63b45d03e
2020-02-19 12:55:44 -08:00
Anton Hansson
e814258f09 Stop exposing generated AIDL from Tethering
We don't want new modules exposing stable aidl directly. APIs should
be defined as java @SystemApi. It also seems like nothing actually
depend on these interfaces, except one simple exception.

Bug: 147200698
Test: m
Change-Id: Ia4222fa35a9a2f3c75cebb12f75c536f27e2fe16
2020-02-19 19:03:24 +00:00
Anton Hansson
c82ea10ea2 Stop exposing generated AIDL from Tethering
We don't want new modules exposing stable aidl directly. APIs should
be defined as java @SystemApi. It also seems like nothing actually
depend on these interfaces, except one simple exception.

Bug: 147200698
Test: m
Change-Id: Ia4222fa35a9a2f3c75cebb12f75c536f27e2fe16
Merged-In: Ia4222fa35a9a2f3c75cebb12f75c536f27e2fe16
2020-02-19 16:26:05 +00:00
Lorenzo Colitti
9a1f9d4669 Merge "Tethering offload: add/remove IPv6 forwarding rules on ND events." 2020-02-19 13:41:10 +00:00
Lorenzo Colitti
ffd4bf34be Merge "Minimal support for IPv6 upstreams in IpServer tests." 2020-02-19 13:38:00 +00:00
Lorenzo Colitti
5e15d7b06a Tethering offload: add/remove IPv6 forwarding rules on ND events.
Use IpNeighborMonitor to listen for ND cache events on the
downstream interface, and push downstream IPv6 fowarding rules
to netd.

Rules are pushed when:
- IPv6 neighbours appear/disappear on the downstream interface.
- The upstream changes.

Test: new unit test
Change-Id: I7b01ba179a4d6bb248fd6c4994e48800613a4efa
2020-02-19 20:50:43 +09:00
Treehugger Robot
b23d20fea7 Merge "Reduce advertised ipv6 mtu by 16 to fit ethernet header" 2020-02-19 11:20:29 +00:00
Maciej Żenczykowski
da0fb1bca8 Reduce advertised ipv6 mtu by 16 to fit ethernet header
This is a temporary hack to workaround the inability of current
kernel's ebpf bpf_skb_change_mode() function to prefix a 14-byte
ethernet header on to a packet without going over the upstream
(source, rawip) interface's mtu *before* we bpf_redirect() to
the downstream (destination, ethernet) interface.

Test: build, atest, atest TetheringTests
Bug: 149816401
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I646148ebfd978a2489c0cd065e4b671b01150add
2020-02-19 10:44:54 +00:00
Lorenzo Colitti
d50b3ed6c7 Minimal support for IPv6 upstreams in IpServer tests.
This makes the IpServer tests a bit more realistic. It is needed
by an upcoming change that adds new functionality, and is in its
own commit because it modifies the behaviour of all the existing
tests.

Test: atest TetheringTests
Change-Id: I8c3267bea983d1453c010b7b6b85548b9481a153
2020-02-19 19:43:23 +09:00
Mark Chien
5ea7a9466b Merge "Add tethering client callbacks" 2020-02-19 10:41:30 +00:00
Mark Chien
907976e0a2 Merge "Fix usage of annotations in TetheringLib" 2020-02-19 09:54:13 +00:00
Mark Chien
b8a6208240 Merge "Use framework-tethering-stub instead of framework-tethering" 2020-02-19 09:46:24 +00:00
Remi NGUYEN VAN
b9379a518c Add tethering client callbacks
The callbacks are fired when the list of connected clients or their IP
addresses / hostname change.

Test: flashed, connected 2 devices, verified callbacks
Test: atest TetheringTests
Bug: 135411507
Change-Id: I96291038cf7b39a67547a5f74fcd7cbedc1ca002
Merged-In: I96291038cf7b39a67547a5f74fcd7cbedc1ca002
2020-02-19 17:05:00 +08:00
Remi NGUYEN VAN
293d351b7e Fix usage of annotations in TetheringLib
Annotations such as @SystemApi cannot be jarjared to a different
package, as the members would not match the system API declarations.

Instead, only build against the annotations from
framework-annotations-lib, but do not include them as classes in the
output jar; annotations are not required to be available to the
classloader at runtime.

Test: builds, boots, tethering working
Bug: 147812912
Fixes: 148609988
Change-Id: I1fae97a1c1e0ba07fa3e2d64cde7650cd26d0acd
Merged-In: I1fae97a1c1e0ba07fa3e2d64cde7650cd26d0acd
2020-02-19 16:32:26 +08:00
markchien
b6ad1966c4 Use framework-tethering-stub instead of framework-tethering
The non-updatable part of the platform now is built with
framework-tethering-stub, which is a stub library of
framework-tethering.

Bug: 147200698
Test: m
Change-Id: I97ef83f7f9b4c1376f373713036f5256318f1050
Merged-In: I97ef83f7f9b4c1376f373713036f5256318f1050
2020-02-19 15:10:44 +08:00
markchien
7261420793 Add TetheringTests to postsubmit
The tethering unit tests were in FrameworksNetTests, but were moved out
so were no longer run in presubmit. Now put them to postsubmit first.
Should be moved to presubmit after a while.

Bug: 148998835
Test: atest --test-mapping frameworks/base/packages/Tethering:postsubmit

Change-Id: I9ca36cba7bfde8409a06dbeb7166337c55b39691
2020-02-19 14:43:16 +08:00
Amos Bianchi
bc47a4578b Merge "Use constant for tethering connector poll interval." 2020-02-18 20:46:25 +00:00
Remi NGUYEN VAN
c8871c1b66 Add tethering client callbacks
The callbacks are fired when the list of connected clients or their IP
addresses / hostname change.

Test: flashed, connected 2 devices, verified callbacks
Test: atest TetheringTests
Bug: 135411507
Change-Id: I96291038cf7b39a67547a5f74fcd7cbedc1ca002
2020-02-18 13:32:16 +08:00
Treehugger Robot
5cce783b41 Merge "Catch correct exception for adding route fail" am: c2050ac731 am: 55c0f41695 am: b6589dc1f6
Change-Id: Ie79acf53b0cdb532f81d4e61e669bdb101b71c0a
2020-02-17 14:19:32 +00:00
Mark Chien
88f04a19df Merge "Fix usage of annotations in TetheringLib" 2020-02-17 11:00:55 +00:00
markchien
6c2b7cc4bd Catch correct exception for adding route fail
Bug: 149535950
Test: OFF/ON hotspot
Change-Id: Ic52e2b2f3cec1a39a70302c41ab67ec1a1a55b1a
2020-02-15 11:35:00 +08:00
Amos Bianchi
1faaf591dd Use constant for tethering connector poll interval.
A constant is defined but a literal is used instead.

Test: manual

Change-Id: I233e11af4e39a35d9a47e45066df994a9f547272
2020-02-13 16:18:47 -08:00
Automerger Merge Worker
545995255d Merge "Fix TetheredClient and TetheredClientTest" am: 8451e20d98 am: 8ab2f58ab9 am: c8190ff316
Change-Id: I8a3d01dbd02639e07284a3dc6798c0db512c8307
2020-02-12 23:11:04 +00:00
Remi NGUYEN VAN
8451e20d98 Merge "Fix TetheredClient and TetheredClientTest" 2020-02-12 21:58:07 +00:00
Remi NGUYEN VAN
63dc279dfc Fix usage of annotations in TetheringLib
Annotations such as @SystemApi cannot be jarjared to a different
package, as the members would not match the system API declarations.

Instead, only build against the annotations from
framework-annotations-lib, but do not include them as classes in the
output jar; annotations are not required to be available to the
classloader at runtime.

Test: builds, boots, tethering working
Bug: 147812912
Fixes: 148609988
Change-Id: I1fae97a1c1e0ba07fa3e2d64cde7650cd26d0acd
2020-02-12 03:44:16 +00:00
Automerger Merge Worker
481eb3b9fc Merge "Move offload config hidl usage from native to java" am: b03a821085 am: b5930afb19 am: 5fac37b596
Change-Id: I92cfc902c44e9e263828d142fd6ff360b39e97e6
2020-02-10 09:46:28 +00:00
Mark Chien
b03a821085 Merge "Move offload config hidl usage from native to java" 2020-02-10 09:01:12 +00:00
markchien
547e168540 Move offload config hidl usage from native to java
TetheringUtil JNI is too big that it statically linking hidl and its
dependency library. To remove these static libraries, calling hidl in java
directly instead of using JNI.

Bug: 148984662
Test: -build, flash, boot
      -manually ON/OFF tethering

Change-Id: Id5a9759eb453fddaf0c3b7a31da17224e35e963e
2020-02-10 15:25:19 +08:00
Automerger Merge Worker
d9fed88dca Merge "rm libbinderthreadstate" am: b569cf369b am: 4c80c8da0c am: 2afa74f459
Change-Id: I167e26697d1356280cec9c5eefb361359f6da4a8
2020-02-09 23:54:34 +00:00
Treehugger Robot
b569cf369b Merge "rm libbinderthreadstate" 2020-02-09 23:06:21 +00:00
Automerger Merge Worker
d070ced417 Merge "Always report non-null TetherStatesParcel" am: 8cbc588f5e am: 5aeb1cdb03 am: badf5be580
Change-Id: I4eba246b0e9093665a391624e1df95b621637e11
2020-02-07 11:33:51 +00:00
TreeHugger Robot
b307afbdf5 Merge "Use framework-tethering-stub instead of framework-tethering" 2020-02-07 11:32:23 +00:00
Remi NGUYEN VAN
bb60ee8f10 Fix TetheredClient and TetheredClientTest
- Ensure that addAddresses preserves the ordering of addresses
 - Fix assertion that was supposed to check equality of TetheredClient
   with a different tethering type, and used the same type.

Bug: 148996181
Test: atest TetheringTests
Change-Id: I86cef7b834d7ae7afa3d1d748ccac6b3a7e57ebc
2020-02-07 19:55:33 +09:00
Mark Chien
8cbc588f5e Merge "Always report non-null TetherStatesParcel" 2020-02-07 10:48:28 +00:00
Steven Moreland
1d89dfc93e rm libbinderthreadstate
This library is empty, and its functionality has moved
into libbinder/libhwbinder.

Bug: 148692216
Test: N/A
Change-Id: I3ee973cef68281cb57b4912b4b66c798b5d9d715
2020-02-06 13:23:47 -08:00
markchien
44fc26d19e Use framework-tethering-stub instead of framework-tethering
The non-updatable part of the platform now is built with
framework-tethering-stub, which is a stub library of
framework-tethering.

Bug: 147200698
Test: m
Change-Id: I97ef83f7f9b4c1376f373713036f5256318f1050
2020-02-07 00:27:26 +08:00
Automerger Merge Worker
eb86937861 Merge "Fix NPE that netd callback call null TetheringConfiguration object" am: a156a16654 am: 1e360dac26 am: 49a7487b3c
Change-Id: Ic43120a6538468eee803682cccf3d20cd16ef5ea
2020-02-06 09:25:35 +00:00
markchien
f5a7c1647b Always report non-null TetherStatesParcel
Before this change, tetherStatesParcel may be null when there is no
avaialbe tethering interface yet. TetheringManager should handle null
case. But it is annoy to check null case each time and easy to have error.
Report non-null empty TetherStatesParcel object instead.

Bug: 148874619
Test: -build, flash, boot
      -atest TetheringTests
      -OFF/ON hotspot

Change-Id: I0717e7958c9409648170498d5e76322207856de3
2020-02-06 17:18:39 +08:00
Mark Chien
a156a16654 Merge "Fix NPE that netd callback call null TetheringConfiguration object" 2020-02-06 09:03:39 +00:00
markchien
7dda458908 Fix NPE that netd callback call null TetheringConfiguration object
Bug: 148386056
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I3b1dd958fc107fdc9a6059fbdcf358af4822ebde
2020-02-06 15:25:47 +08:00
Jimmy Chen
d2ab0eeb13 Tethering: add p2p regex for shared p2p group interface
For the device does not support separate group interface,
there is only one interface, ex. p2p0, for both device and group interface.

Fixes: 141382930
Bug: 141382930
Test: atest TetheringTests
      launch GO on walleye
Change-Id: I064dd8d5dc372411ee771496813ae7c43ed037bc
2020-02-04 14:42:39 +08:00
Automerger Merge Worker
1ad5455738 Merge "Fix NPE in tethering startup" am: ee013e376a am: 4b9770b9f5 am: c755a813f4
Change-Id: I6d0796f470d2f52350db96f0b6e5b0c7caeddb3d
2020-02-03 03:33:27 +00:00
Mark Chien
ee013e376a Merge "Fix NPE in tethering startup" 2020-02-03 02:52:43 +00:00
Automerger Merge Worker
06cea03b79 [automerger skipped] Merge "Tethering: build tethering as unbundled APP" am: db2365d74c am: e4d6debb2c am: 35747b6023 -s ours
am skip reason: Change-Id I09117228c193137f6359fdcfced38352b8a38f57 with SHA-1 51706aae8b is in history

Change-Id: Ica145b87a479505ca63921dd8d85a44b47d0c395
2020-01-31 16:58:30 +00:00
Automerger Merge Worker
2f3f3684f6 [automerger skipped] Merge "Tethering: Fix hidden API selectBestRoute" am: 95a55b3839 am: 4bd5b588b0 am: bb3fc0b544 -s ours
am skip reason: Change-Id I824a05fac8b606123667d20ab9b1f7de905e4088 with SHA-1 78c1bbcf14 is in history

Change-Id: Idf50196df385b73ae463660b6339f478225f1719
2020-01-31 16:58:19 +00:00