Commit Graph

8650 Commits

Author SHA1 Message Date
soma, kawata
29444ae336 Fix NullPointerException in ConnectivityService
[Problem]
NullPointerException occurs in ConnectivityService when boot up.

[Root Cause]
When ConnectivityService starts up, isTetheringSupported may access
UserManager that has not been created yet. Therefore,
NullPointerException occurs.

[Solution]
Changed to create UserManager before makeTethering().

Bug: 134351774
Test: ConnectivityServiceTest
Change-Id: I299ecfa6af7295c1f3922f37d90eb5d3ab0d0286
2019-06-03 16:38:27 +09:00
Lorenzo Colitti
c123ebacbd [automerger skipped] Merge changes Ib9a15fec,I9f3f2588 into qt-dev am: f4a435aca0 -s ours am: 4b5b1f6f71 -s ours
am: 478500efff -s ours
am skip reason: change_id Ib9a15fececd8579fc5b139fe0341275a45512e0f with SHA1 6edf86cd9c is in history

Change-Id: Iaaabfd03a1f9895e7afa84af90a1a2a3e2739c8b
2019-05-31 09:28:50 -07:00
Lorenzo Colitti
86fd3ca898 Merge "[automerger skipped] Merge changes Ib9a15fec,I9f3f2588 into qt-dev am: f4a435aca0 am: 3d7da92f91 -s ours
am: 6015da41ff -s ours
am skip reason: change_id Ib9a15fececd8579fc5b139fe0341275a45512e0f with SHA1 6edf86cd9c is in history

Change-Id: Ic4a71618bfa8d431bdbfcde3892499c50cd2e6fc
2019-05-31 09:26:39 -07:00
Lorenzo Colitti
478500efff [automerger skipped] Merge changes Ib9a15fec,I9f3f2588 into qt-dev am: f4a435aca0 -s ours
am: 4b5b1f6f71 -s ours
am skip reason: change_id Ib9a15fececd8579fc5b139fe0341275a45512e0f with SHA1 6edf86cd9c is in history

Change-Id: Icbc02f3e68f813f889d0c91950ea489cb46b17fa
2019-05-31 09:14:31 -07:00
Lorenzo Colitti
b48760c242 [automerger skipped] Merge changes Ib9a15fec,I9f3f2588 into qt-dev am: f4a435aca0
am: 3d7da92f91 -s ours
am skip reason: change_id Ib9a15fececd8579fc5b139fe0341275a45512e0f with SHA1 6edf86cd9c is in history

Change-Id: Icc72ee8aa8a51abe3072c3dabed450cef094e418
2019-05-31 09:12:40 -07:00
Lorenzo Colitti
4b5b1f6f71 [automerger skipped] Merge changes Ib9a15fec,I9f3f2588 into qt-dev
am: f4a435aca0 -s ours
am skip reason: change_id Ib9a15fececd8579fc5b139fe0341275a45512e0f with SHA1 6edf86cd9c is in history

Change-Id: I2aa4637ae7a48afbf7b4ad953837762262bd94b8
2019-05-31 08:58:13 -07:00
Lorenzo Colitti
fef8619d64 Merge "Don't crash ConnectivityService if the network stack crashes." am: 55d1b0500a am: ac29a97d10 am: fc289313db
am: 87aea88c62

Change-Id: Ic0290841473e49e1b9fce9dadbbbbf69feae4d39
2019-05-31 07:32:41 -07:00
Lorenzo Colitti
87aea88c62 Merge "Don't crash ConnectivityService if the network stack crashes." am: 55d1b0500a am: ac29a97d10
am: fc289313db

Change-Id: I985416bbb655a36f85b9d0bc9d9a401fe7b56f5c
2019-05-31 07:27:38 -07:00
Lorenzo Colitti
fc289313db Merge "Don't crash ConnectivityService if the network stack crashes." am: 55d1b0500a
am: ac29a97d10

Change-Id: Idae97f7dc29fd95ede722fe34dc20b941002a41c
2019-05-31 07:22:43 -07:00
Lorenzo Colitti
7577c856bc Don't crash ConnectivityService if the network stack crashes.
When the network stack crashes, the system will rebind to it.
Existing references are no longer useful (they just throw
RemoteException) but if the system is still up, then the user
can at least recover the situation by taking actions such as
going into airplane mode, toggling wifi, etc.

This CL stops ConnectivityService from crashing the system when
it cannot talk to NetworkMonitor. This is arguably better than
crashing the system, because crashing the system is disruptive
and carries the serious risk of a bootloop from which it is not
possible to recover.

NetworkStackClient already contains code to crash the system
when the network stack crashes. This change help ensure that
if a crash occurs, it is the result of an explicit decision by
that code instead of an unchecked exception in one of the callers
of the network stack.

Bug: 133725814
Test: builds, boots
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: Ib9a15fececd8579fc5b139fe0341275a45512e0f
Merged-In: Ib9a15fececd8579fc5b139fe0341275a45512e0f
(cherry picked from commit ac29a97d10fe8ea0720763f4ca4657cac85732a1)
2019-05-31 14:19:36 +00:00
Lorenzo Colitti
6edf86cd9c Don't crash ConnectivityService if the network stack crashes.
When the network stack crashes, the system will rebind to it.
Existing references are no longer useful (they just throw
RemoteException) but if the system is still up, then the user
can at least recover the situation by taking actions such as
going into airplane mode, toggling wifi, etc.

This CL stops ConnectivityService from crashing the system when
it cannot talk to NetworkMonitor. This is arguably better than
crashing the system, because crashing the system is disruptive
and carries the serious risk of a bootloop from which it is not
possible to recover.

NetworkStackClient already contains code to crash the system
when the network stack crashes. This change help ensure that
if a crash occurs, it is the result of an explicit decision by
that code instead of an unchecked exception in one of the callers
of the network stack.

Bug: 133725814
Test: builds, boots
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: Ib9a15fececd8579fc5b139fe0341275a45512e0f
2019-05-31 19:30:36 +09:00
Chalard Jean
ad6e0aa85e Merge "[automerger skipped] Merge "Prevent a 4-way binder interlock leading to a leak." into qt-dev am: f3eaec257a am: 929210b213 -s ours
am: 74e22ad420 -s ours
am skip reason: change_id Ide2428dab3fcd6d7cd00aa2a9fd99d6c99b815a4 with SHA1 7284daa96e is in history

Change-Id: I9bc76284a14723986646e9860f7434e912b00730
2019-05-31 02:38:18 -07:00
Chalard Jean
ee57a04697 [automerger skipped] Merge "Prevent a 4-way binder interlock leading to a leak." into qt-dev am: f3eaec257a -s ours am: f304c9d67e -s ours
am: e7f53c1a0f -s ours
am skip reason: change_id Ide2428dab3fcd6d7cd00aa2a9fd99d6c99b815a4 with SHA1 7284daa96e is in history

Change-Id: I7c6c0fdf0a6e8ba2d7ea82156973104d6914f44e
2019-05-31 02:36:51 -07:00
Android Build Merger (Role)
74e22ad420 Merge "[automerger skipped] Merge "Prevent a 4-way binder interlock leading to a leak." into qt-dev am: f3eaec257a am: 929210b213 -s ours am skip reason: change_id Ide2428dab3fcd6d7cd00aa2a9fd99d6c99b815a4 with SHA1 7284daa96e is in history" into qt-r1-dev-plus-aosp 2019-05-31 09:32:36 +00:00
Chalard Jean
e925e64bce [automerger skipped] Merge "Prevent a 4-way binder interlock leading to a leak." into qt-dev am: f3eaec257a
am: 929210b213 -s ours
am skip reason: change_id Ide2428dab3fcd6d7cd00aa2a9fd99d6c99b815a4 with SHA1 7284daa96e is in history

Change-Id: Ibc28983759c80ae21756e7a3c03b9db7aae285d8
2019-05-31 02:31:50 -07:00
Chalard Jean
e7f53c1a0f [automerger skipped] Merge "Prevent a 4-way binder interlock leading to a leak." into qt-dev am: f3eaec257a -s ours
am: f304c9d67e -s ours
am skip reason: change_id Ide2428dab3fcd6d7cd00aa2a9fd99d6c99b815a4 with SHA1 7284daa96e is in history

Change-Id: I165b03e552cfacd2eaa694094834a081234d2e73
2019-05-31 02:31:49 -07:00
Chalard Jean
f304c9d67e [automerger skipped] Merge "Prevent a 4-way binder interlock leading to a leak." into qt-dev
am: f3eaec257a -s ours
am skip reason: change_id Ide2428dab3fcd6d7cd00aa2a9fd99d6c99b815a4 with SHA1 7284daa96e is in history

Change-Id: I08e37b4458b3c6242a1cca8aab913b09642a9e53
2019-05-31 02:26:51 -07:00
Varun Anand
23b9b0068a [automerger skipped] Merge changes from topic "vpn_data_accn_tests" am: b50e778fa7 am: 9561790069 -s ours am: 35dff8c0b9 -s ours
am: a995bd5d5a -s ours
am skip reason: change_id Iffd3f95fc2e11d311691a797b010edb38d2ef3c6 with SHA1 20204cdf6a is in history

Change-Id: I5843bda44deaca837e2517465df3f8d9f3f2d5d2
2019-05-30 14:08:06 -07:00
Varun Anand
a995bd5d5a [automerger skipped] Merge changes from topic "vpn_data_accn_tests" am: b50e778fa7 am: 9561790069 -s ours
am: 35dff8c0b9 -s ours
am skip reason: change_id Iffd3f95fc2e11d311691a797b010edb38d2ef3c6 with SHA1 20204cdf6a is in history

Change-Id: I982ce55558624e26531695abf09e3108b2463780
2019-05-30 13:47:41 -07:00
Varun Anand
35dff8c0b9 [automerger skipped] Merge changes from topic "vpn_data_accn_tests" am: b50e778fa7
am: 9561790069 -s ours
am skip reason: change_id Iffd3f95fc2e11d311691a797b010edb38d2ef3c6 with SHA1 20204cdf6a is in history

Change-Id: I86c99de74590e3ad54055a16b5c349b6ba3659ab
2019-05-30 13:26:09 -07:00
Luke Huang
7aac233f38 [automerger skipped] Merge "Merge "Fix issue for DnsResolver#query" into qt-dev am: bd5e52bd4d am: 308ae8f73c" into qt-r1-dev-plus-aosp
am: 94dc5ff9cb -s ours
am skip reason: change_id Ibb5080acd3c296650d56532fc7da525e9fa95e8f with SHA1 0c60cd9d94 is in history

Change-Id: Ib47ff2cace7d2c1a8baac653a4f480ecd074b8e1
2019-05-30 10:04:40 -07:00
Luke Huang
431671cf01 [automerger skipped] Merge "Fix issue for DnsResolver#query" into qt-dev am: bd5e52bd4d am: dd6b466b89
am: 20446db50a -s ours
am skip reason: change_id Ibb5080acd3c296650d56532fc7da525e9fa95e8f with SHA1 0c60cd9d94 is in history

Change-Id: If5cd009ca06efbb0709c0397eb20bcae2823ede5
2019-05-30 10:00:17 -07:00
Chiachang Wang
734764fe1c [automerger skipped] Merge "Replace limited connectivity notification after detecting it" into qt-dev am: db8cd0ac3e -s ours am: d5e1830ff2 -s ours
am: eb394fed22 -s ours
am skip reason: change_id I004e78a33689e2208918d4316bcf9a8f50a0bac3 with SHA1 66cc78d6ab is in history

Change-Id: I38aa6f806cec21fc09af2cc2465e7fbe8f279165
2019-05-30 09:52:02 -07:00
Chiachang Wang
411c798e26 Merge "[automerger skipped] Merge "Replace limited connectivity notification after detecting it" into qt-dev am: db8cd0ac3e am: be8bca1997 -s ours
am: 1c3578abd3 -s ours
am skip reason: change_id I004e78a33689e2208918d4316bcf9a8f50a0bac3 with SHA1 66cc78d6ab is in history

Change-Id: I47511d2d0ee9cbc4a63da96dc3b9f58cec8b08fa
2019-05-30 09:50:12 -07:00
Chalard Jean
3ef609ba29 Merge "[automerger skipped] Merge "Always give VPN the INTERNET capability." into qt-dev am: bc16cf3d72 -s ours am: c7028a4757 -s ours
am: 92df460a31 -s ours
am skip reason: change_id I262ca41fe0225660551c9a421562405366b6acac with SHA1 318feaf1ed is in history

Change-Id: I1f97dc9d291b6b65b4562b9288862da124023dea
2019-05-30 09:46:02 -07:00
Android Build Merger (Role)
94dc5ff9cb Merge "Merge "Fix issue for DnsResolver#query" into qt-dev am: bd5e52bd4d am: 308ae8f73c" into qt-r1-dev-plus-aosp 2019-05-30 16:41:12 +00:00
Chalard Jean
5e79065a1e [automerger skipped] Merge "Always give VPN the INTERNET capability." into qt-dev am: bc16cf3d72 am: 053f8b300e -s ours
am: 0f81c6675d -s ours
am skip reason: change_id I262ca41fe0225660551c9a421562405366b6acac with SHA1 318feaf1ed is in history

Change-Id: I8c7be91223f840cca4a252b091c65ef4a34db144
2019-05-30 09:41:09 -07:00
Luke Huang
2f1751f7f5 Merge "Fix issue for DnsResolver#query" into qt-dev am: bd5e52bd4d
am: 308ae8f73c

Change-Id: I5fe26b5f749fc4722fb150e9374f4f0a41c2446c
2019-05-30 09:37:40 -07:00
Luke Huang
20446db50a Merge "Fix issue for DnsResolver#query" into qt-dev am: bd5e52bd4d
am: dd6b466b89

Change-Id: I9120ab4d19d19662d6c0143c5fba044fc037a49d
2019-05-30 09:37:23 -07:00
Chiachang Wang
eb394fed22 [automerger skipped] Merge "Replace limited connectivity notification after detecting it" into qt-dev am: db8cd0ac3e -s ours
am: d5e1830ff2 -s ours
am skip reason: change_id I004e78a33689e2208918d4316bcf9a8f50a0bac3 with SHA1 66cc78d6ab is in history

Change-Id: I94d2289bf8a7d8487490b3cf587b55b27ca910a6
2019-05-30 09:35:55 -07:00
Chiachang Wang
d926c0b003 [automerger skipped] Merge "Replace limited connectivity notification after detecting it" into qt-dev am: db8cd0ac3e
am: be8bca1997 -s ours
am skip reason: change_id I004e78a33689e2208918d4316bcf9a8f50a0bac3 with SHA1 66cc78d6ab is in history

Change-Id: Ia244e081e6e135c578275db1405c3b5b4d23b877
2019-05-30 09:34:37 -07:00
Chalard Jean
aa668b9198 [automerger skipped] Merge "Always give VPN the INTERNET capability." into qt-dev am: bc16cf3d72 -s ours
am: c7028a4757 -s ours
am skip reason: change_id I262ca41fe0225660551c9a421562405366b6acac with SHA1 318feaf1ed is in history

Change-Id: I6ab350671e08b74e5c181866f819607d0c2078f3
2019-05-30 09:32:59 -07:00
Chalard Jean
0f81c6675d [automerger skipped] Merge "Always give VPN the INTERNET capability." into qt-dev am: bc16cf3d72
am: 053f8b300e -s ours
am skip reason: change_id I262ca41fe0225660551c9a421562405366b6acac with SHA1 318feaf1ed is in history

Change-Id: I11d02ceddf42a5102d7d45ec9b986c6e68e235ab
2019-05-30 09:30:44 -07:00
Luke Huang
308ae8f73c Merge "Fix issue for DnsResolver#query" into qt-dev
am: bd5e52bd4d

Change-Id: Ia1ce7b84f4ae4984e1b940760f02901c88fade48
2019-05-30 09:18:02 -07:00
Chiachang Wang
d5e1830ff2 [automerger skipped] Merge "Replace limited connectivity notification after detecting it" into qt-dev
am: db8cd0ac3e -s ours
am skip reason: change_id I004e78a33689e2208918d4316bcf9a8f50a0bac3 with SHA1 66cc78d6ab is in history

Change-Id: I11daaf075229a2891eb2d8b3df54a91a285d52fb
2019-05-30 09:16:54 -07:00
Chalard Jean
c7028a4757 [automerger skipped] Merge "Always give VPN the INTERNET capability." into qt-dev
am: bc16cf3d72 -s ours
am skip reason: change_id I262ca41fe0225660551c9a421562405366b6acac with SHA1 318feaf1ed is in history

Change-Id: I367d5afaa5ee254064d61f7f807af838b37583fe
2019-05-30 09:15:23 -07:00
Lorenzo Colitti
635b441ff9 Add one more test for VPN usage stats.
(cherry picked from commit 20204cdf6a)

Covers the case where the majority of traffic through the VPN is
caused by the VPN app itself, and ensures that that traffic is
correctly attributed to the VPN app as opposed to spread between
the other apps that use the VPN.

Bug: 120145746
Test: atest NetworkStatsServiceTest
Change-Id: Ibd7646dc088fa4180abd696e89c3148ff34ce190
Merged-In: Iffd3f95fc2e11d311691a797b010edb38d2ef3c6
2019-05-30 15:59:28 +00:00
Varun Anand
4d83f3e073 Addressing comments for http://ag/7700679.
(cherry picked from commit 78d5ac4f8f)

Note, that its in a separate CL so we could cherry-pick this CL to aosp.
http://ag/7700679 is already in aosp (http://aosp/865073).

Bug: 113122541
Bug: 120145746
Test: atest FrameworksNetTests

Change-Id: Ic1767bc8bf1460e4223f86465fc72344428e6055
Merged-In: I7cfda226b4ed11b67002b83b38fba0f5caf96718
2019-05-30 15:59:07 +00:00
Chalard Jean
ef64770162 Prevent a 4-way binder interlock leading to a leak.
System server             |        NetworkStack
                              |
NetworkMonitorCallbacks  ←----|--- NetworkMonitorCallbacks$Stub$Proxy
         ↓                    |           ↑
  NetworkAgentInfo            |      NetworkMonitor
         ↓                    |           ↑
NetworkMonitor$Stub$Proxy ----|---→ NetworkMonitorImpl

Bug: b/133174607
Test: Manual. The simplest artifact is observed by watching the output of
adb shell dumpsys meminfo -d com.android.networkstack | grep 'Proxy Binders'
while connecting and disconnecting multiple times to any network.
This will display the number of binder proxies. Before this, the binder
proxy count increases by 1 with each connection and never goes down (there
is some noise, as proxy objects are sometimes created for other reasons,
and get GC'd eventually). After this, the binder proxy count is always
eventually stable at 27 + connected network count.

See the bug for the complete analysis.

Merged-In: Ide2428dab3fcd6d7cd00aa2a9fd99d6c99b815a4
Change-Id: I6b74cf12bdbc72c0593d2a4d6f39c895d1ef3534
(cherry picked from commit eb43884fee35102a7fc886750d6a7e891a82ce33)
2019-05-30 14:46:45 +00:00
TreeHugger Robot
bd5e52bd4d Merge "Fix issue for DnsResolver#query" into qt-dev 2019-05-30 13:37:38 +00:00
TreeHugger Robot
db8cd0ac3e Merge "Replace limited connectivity notification after detecting it" into qt-dev 2019-05-30 12:52:33 +00:00
Luke Huang
976e09ab5c Fix issue for DnsResolver#query
1. Previously, getDnsNetId doesn't handle all the cases.
Fix it with cosidering bypass private DNS flag.
2. Make getDnsNetId return Network instead of netId,
and change name from getDnsNetId to getDnsNetwork

Bug: 129530368
Test: atest DnsResolverTest DnsUtilsTest

Merged-In: Ibb5080acd3c296650d56532fc7da525e9fa95e8f
(cherry picked from commit 3854966dc9499e39187835606397b16367e5e27b)

Change-Id: I37353642088bcc17da0cf17f78a5ed9efc9aefc3
2019-05-30 11:58:25 +00:00
Luke Huang
0c60cd9d94 Merge "Fix issue for DnsResolver#query" am: 7edc776afc am: da47327520 am: 36fecce5a1
am: 495f11f81b

Change-Id: Ibb5080acd3c296650d56532fc7da525e9fa95e8f
2019-05-30 04:46:40 -07:00
Chiachang Wang
551043d3e4 Replace limited connectivity notification after detecting it
No internet notification may be prompted before partial
connectivity being detected. Partial connectivity status will
be set into NAI and prompted in the Setting. Behavior is not
aligned between Setting and notification. Thus, update
notification again if partial connectivity is detected.
Also, sliently show the updated notification if no internet
notification has already been shown to user to prevent alerting
user in short time.

Bug: 130683832
Test: Verified with simulated partial connectivity
Test: atest FrameworksNetTests
Change-Id: Ie16a8ce6e0fa437048e8c1eea240314ca30e9520
Merged-In: I004e78a33689e2208918d4316bcf9a8f50a0bac3
Merged-In: I14385a39d99a45c4a6a50a665f456f589c2f4da3
(cherry picked from commit a5c68348d89f256cb5f42283d983d05834c7e36c)
2019-05-30 11:46:21 +00:00
Luke Huang
495f11f81b Merge "Fix issue for DnsResolver#query" am: 7edc776afc am: da47327520
am: 36fecce5a1

Change-Id: I1e9fac6c64a80019c4dee1969cd316202f74ac51
2019-05-30 04:41:18 -07:00
Luke Huang
36fecce5a1 Merge "Fix issue for DnsResolver#query" am: 7edc776afc
am: da47327520

Change-Id: I819fa9eb0abab64951fdb8adb7b1fc660544a1ad
2019-05-30 04:36:42 -07:00
Luke Huang
7edc776afc Merge "Fix issue for DnsResolver#query" 2019-05-30 11:22:50 +00:00
Chiachang Wang
fedfbb39b7 Merge "Replace limited connectivity notification after detecting it" am: d5895ce4cf am: 7cfc1d4ec6 am: 66cc78d6ab
am: c39b238f3a

Change-Id: I14385a39d99a45c4a6a50a665f456f589c2f4da3
2019-05-30 04:20:49 -07:00
Chiachang Wang
c39b238f3a Merge "Replace limited connectivity notification after detecting it" am: d5895ce4cf am: 7cfc1d4ec6
am: 66cc78d6ab

Change-Id: I155464b3467f32fcf98053b47787783c3988ef6d
2019-05-30 04:15:42 -07:00
Chiachang Wang
66cc78d6ab Merge "Replace limited connectivity notification after detecting it" am: d5895ce4cf
am: 7cfc1d4ec6

Change-Id: I004e78a33689e2208918d4316bcf9a8f50a0bac3
2019-05-30 04:10:30 -07:00