Commit Graph

7376 Commits

Author SHA1 Message Date
Lorenzo Colitti
4d034fb062 Merge "Re-notify if the network goes to PARTIAL." am: 94851761a8 am: 58d4e7304c
am: df84643d9b

Change-Id: If3c568a486fdaf5bbbde33676144379670e2aacd
2019-06-03 06:16:03 -07:00
Lorenzo Colitti
df84643d9b Merge "Re-notify if the network goes to PARTIAL." am: 94851761a8
am: 58d4e7304c

Change-Id: I1b79d3faf96ffe792738935088e4ebbdfcc0d878
2019-06-03 06:10:10 -07:00
Lorenzo Colitti
94851761a8 Merge "Re-notify if the network goes to PARTIAL." 2019-06-03 12:50:11 +00:00
Chiachang Wang
61e494012d Re-notify if the network goes to PARTIAL.
If NetworkMonitor detects partial connectivity before
EVENT_PROMPT_UNVALIDATED arrives, show the partial
connectivity notification immediately. Re-notify
partial connectivity silently if no internet
notification already there.

Bug: 130683832
Bug: 130766237
Test: atest com.android.server.ConnectivityServiceTest
Change-Id: I7d4eddc643ec795c3961097dc1bdd314d168f6c7
2019-06-03 12:49:53 +00:00
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
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
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
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
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
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
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
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
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
Chiachang Wang
d5895ce4cf Merge "Replace limited connectivity notification after detecting it" 2019-05-30 10:56:08 +00:00
Chalard Jean
7e594c23dd Merge "Prevent a 4-way binder interlock leading to a leak." am: baaef39c9b am: 88cf9c532e
am: dfbdf219ee

Change-Id: I36e0d112194f4abf6c0aa6ea20afbc6436bf0a6e
2019-05-30 03:44:17 -07:00
Chalard Jean
dfbdf219ee Merge "Prevent a 4-way binder interlock leading to a leak." am: baaef39c9b
am: 88cf9c532e

Change-Id: Idb8659a22b9d18f1d0bc566b476f4c536c00da90
2019-05-30 03:40:37 -07:00
Treehugger Robot
baaef39c9b Merge "Prevent a 4-way binder interlock leading to a leak." 2019-05-30 10:22:30 +00:00
Chalard Jean
383f26644a Merge "Always give VPN the INTERNET capability." am: 8690e1f144 am: 6d5a4a3b1d
am: f5c5c81000

Change-Id: I49f6eca58da809b176307df8eafc778e58a77de7
2019-05-30 01:59:28 -07:00
Chalard Jean
5c7c1def90 Always give VPN the INTERNET capability.
Split-tunnel VPN (which are the only ones affected by this change)
always fall through to the default network for routes they don't
handle, and even if the underlying network(s) don't provide access
this may be a pinhole that can actually reach the broader network.

In practice this behaves like the original release of P and is the
safest thing to do for Q. In R we should evaluate giving the VPN
app the ability to simply tell the network stack whether it does
provide Internet access or not.

Bug: 119216095
Test: FrameworksNetTests NetworkStackTests
Change-Id: I262ca41fe0225660551c9a421562405366b6acac
Merged-In: I262ca41fe0225660551c9a421562405366b6acac
(cherry picked from commit 6d5a4a3b1d1c69eb8a542fecf5e8a306822c19b7)
2019-05-30 08:54:35 +00:00
Chalard Jean
f5c5c81000 Merge "Always give VPN the INTERNET capability." am: 8690e1f144
am: 6d5a4a3b1d

Change-Id: I144939e7197deec403d6c91f83b414d357190bd4
2019-05-30 01:54:33 -07:00
Chalard Jean
8690e1f144 Merge "Always give VPN the INTERNET capability." 2019-05-30 08:36:19 +00:00
Chiachang Wang
af13b9f275 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
2019-05-30 16:19:47 +08:00
Chalard Jean
7284daa96e 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.

Change-Id: Ide2428dab3fcd6d7cd00aa2a9fd99d6c99b815a4
2019-05-30 17:12:46 +09:00