Commit Graph

7094 Commits

Author SHA1 Message Date
Lorenzo Colitti
b882c54945 Allow passing in acceptUnvalidated without explicitlySelected
This will allow wifi to tell ConnectivityService that partial
connectivity is acceptable even if the network is not explicitly
selected.

This is needed when the user selects a partial connectivity
network and tells the system to connect to the network, and never
to ask again. In such cases, the system must switch to the
network even if it is not explicitly selected.

Bug: 130766237
Test: atest FrameworksNetTests
Test: unit tests in an upcoming CL
Change-Id: I13465090b7b1c0bf5dc83362387a5428d77b7e1d
Merged-In: I13465090b7b1c0bf5dc83362387a5428d77b7e1d
(cherry picked from commit e01696a4c4)
2019-06-05 11:12:18 +09:00
Lorenzo Colitti
b643b2ba9c Merge "Allow passing in acceptUnvalidated without explicitlySelected" into qt-dev
am: 56b7edcae2

Change-Id: Ifd9dbc9c83e426e66417247cbf1fa594193e000f
2019-06-04 18:29:51 -07:00
TreeHugger Robot
56b7edcae2 Merge "Allow passing in acceptUnvalidated without explicitlySelected" into qt-dev 2019-06-04 18:00:31 +00:00
Android Build Merger (Role)
b9322773d2 Merge "Merge "Fix cannot create Nat-T keepalive on mobile data" into qt-dev am: eabafd5ceb am: ed0f1438e0" into qt-r1-dev-plus-aosp 2019-06-04 15:55:18 +00:00
junyulai
b41f0d3860 Merge "Fix cannot create Nat-T keepalive on mobile data" into qt-dev am: eabafd5ceb
am: ed0f1438e0

Change-Id: I9b719ddc913dfaeab2ae13b61dc0ffe96f26b252
2019-06-04 08:54:22 -07:00
junyulai
8bd7b31193 Merge "Fix cannot create Nat-T keepalive on mobile data" into qt-dev am: eabafd5ceb
am: 2f233cc104

Change-Id: I5cc209e05eb91a368c94f76efc961ba5fd2750fb
2019-06-04 08:54:19 -07:00
junyulai
2f233cc104 Merge "Fix cannot create Nat-T keepalive on mobile data" into qt-dev
am: eabafd5ceb

Change-Id: I580b4dd2e493430e8420ca0907f9cf7d1d5a8773
2019-06-04 08:48:21 -07:00
Lorenzo Colitti
e01696a4c4 Allow passing in acceptUnvalidated without explicitlySelected
This will allow wifi to tell ConnectivityService that partial
connectivity is acceptable even if the network is not explicitly
selected.

This is needed when the user selects a partial connectivity
network and tells the system to connect to the network, and never
to ask again. In such cases, the system must switch to the
network even if it is not explicitly selected.

Bug: 130766237
Test: atest FrameworksNetTests
Test: unit tests in an upcoming CL
Change-Id: I13465090b7b1c0bf5dc83362387a5428d77b7e1d
2019-06-04 14:35:22 +00:00
junyulai
97e3775df4 Fix cannot create Nat-T keepalive on mobile data
Currently phone process fail to unparcel NattKeepalivePacketData
since it is not in framework. Moves NattKeepalivePacketData to
framework to make it can be utilized by telephony.

This change also removes the error feedback triggered by calling
add keepalive packet filter to an unsupported network agent. This
is misinterpreted by KeepaliveTracker that start keepalive is
failing.

Bug: 134048171
Test: 1. atest android.net.cts.ConnectivityManagerTest#testSocketKeepaliveLimitTelephony
      2. atest android.net.cts.ConnectivityManagerTest
      3. atest FrameworksNetTests
      4. atest FrameworksTelephonyTests

Merged-In: If630d5b339aa722717258c721daa8ead8c431e2d
Change-Id: Ic0f168be6f5a6263a5e0565b6381dcb5c645660f
(cherry picked from commit 9ede677bb2c081ccdc41c8c3c19c949114bcc138)
2019-06-04 20:44:29 +08:00
Treehugger Robot
4a59f15464 Merge "Fix cannot create Nat-T keepalive on mobile data" 2019-06-04 12:09:00 +00:00
junyulai
88da121dfe Fix cannot create Nat-T keepalive on mobile data
Currently phone process fail to unparcel NattKeepalivePacketData
since it is not in framework. Moves NattKeepalivePacketData to
framework to make it can be utilized by telephony.

This change also removes the error feedback triggered by calling
add keepalive packet filter to an unsupported network agent. This
is misinterpreted by KeepaliveTracker that start keepalive is
failing.

Bug: 134048171
Test: 1. atest android.net.cts.ConnectivityManagerTest#testSocketKeepaliveLimitTelephony
      2. atest android.net.cts.ConnectivityManagerTest
      3. atest FrameworksNetTests
      4. atest FrameworksTelephonyTests
Change-Id: If630d5b339aa722717258c721daa8ead8c431e2d
2019-06-04 18:22:15 +08:00
Android Build Merger (Role)
a2abfa2f2b Merge "Merge "Don't auto-connect to networks that have no/limited connectivity." into qt-dev am: 4afb7f9b03 am: 74f7be63fc" into qt-r1-dev-plus-aosp 2019-06-04 00:18:18 +00:00
Lorenzo Colitti
690c9d6ffc Merge "Don't auto-connect to networks that have no/limited connectivity." into qt-dev am: 4afb7f9b03
am: 74f7be63fc

Change-Id: Ia33ff8920d47c22b8f901cb5dc9e3e93e3569699
2019-06-03 17:17:25 -07:00
Lorenzo Colitti
d9f0f9fb64 Merge "Don't auto-connect to networks that have no/limited connectivity." into qt-dev am: 4afb7f9b03
am: 7c74b37a97

Change-Id: Ia8b2e10f2792a22a91c6dfce82cc4cd9790c632c
2019-06-03 17:17:08 -07:00
Lorenzo Colitti
7c74b37a97 Merge "Don't auto-connect to networks that have no/limited connectivity." into qt-dev
am: 4afb7f9b03

Change-Id: Ic988e284f12b8b54c760d17cd6c6aa93e84f1721
2019-06-03 17:12:14 -07:00
TreeHugger Robot
4afb7f9b03 Merge "Don't auto-connect to networks that have no/limited connectivity." into qt-dev 2019-06-03 23:58:17 +00:00
Lorenzo Colitti
8e5f79ac51 [automerger skipped] Merge "Re-notify if the network goes to PARTIAL." into qt-dev am: ad3e86a742 -s ours
am: 29eefaccfd -s ours
am skip reason: change_id I1b79d3faf96ffe792738935088e4ebbdfcc0d878 with SHA1 df84643d9b is in history

Change-Id: I3d7a91b2d281a4df654640f83ca079aeef62ff9d
2019-06-03 07:34:42 -07:00
Lorenzo Colitti
29eefaccfd [automerger skipped] Merge "Re-notify if the network goes to PARTIAL." into qt-dev
am: ad3e86a742 -s ours
am skip reason: change_id I1b79d3faf96ffe792738935088e4ebbdfcc0d878 with SHA1 df84643d9b is in history

Change-Id: Ifa6185f3daa9087e9d2a6ecffb31c6029db331e0
2019-06-03 07:28:46 -07:00
Lorenzo Colitti
28325f2722 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
Merged-In: I1b79d3faf96ffe792738935088e4ebbdfcc0d878
(cherry picked from commit 58d4e7304cfce68e338ab34022a0b29d45f42c38)
2019-06-03 13:19:22 +00:00
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
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