Commit Graph

420909 Commits

Author SHA1 Message Date
Zimuzo
c1a694dddd Merge "Add network health check watchdog triggered rollback tests" into qt-dev
am: 80b53bd68b

Change-Id: I760b8f0d948702a51b96c3aaffa6ccb268b891fe
2019-05-30 09:27:48 -07:00
Remi NGUYEN VAN
cc3bf6417a Merge changes I2cb4200b,If1fa00be into qt-dev
am: 6b2681521e

Change-Id: Ib279a80a19bcdaf53678921108c4932d04988474
2019-05-30 09:26:09 -07:00
arangelov
6fd8108679 Merge "Remove @VisibleForTesting from DevicePolicyEventLogger getters." into qt-dev
am: 26a28f64c5

Change-Id: Idbdde0976e2df6253a22e950837c414d51d92237
2019-05-30 09:24:43 -07:00
Luke Huang
eba8c859a3 Merge "Fix issue for DnsResolver#query" into qt-dev
am: 23d7a55d18

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

Change-Id: I11daaf075229a2891eb2d8b3df54a91a285d52fb
2019-05-30 09:16:54 -07:00
Julia Reynolds
902b4d78e9 Merge "Fix some issues in notification bucketing" into qt-dev
am: 634c095610

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

Change-Id: I367d5afaa5ee254064d61f7f807af838b37583fe
2019-05-30 09:15:23 -07:00
TreeHugger Robot
80b53bd68b Merge "Add network health check watchdog triggered rollback tests" into qt-dev 2019-05-30 15:22:26 +00:00
Remi NGUYEN VAN
6b2681521e Merge changes I2cb4200b,If1fa00be into qt-dev
* changes:
  PackageWatchdog listens for NetworkStack failures
  Proper handling of NetworkStack crash
2019-05-30 15:11:11 +00:00
TreeHugger Robot
26a28f64c5 Merge "Remove @VisibleForTesting from DevicePolicyEventLogger getters." into qt-dev 2019-05-30 15:05:26 +00:00
arangelov
3b37af4c3c Remove @VisibleForTesting from DevicePolicyEventLogger getters.
Also make it extendable for mocking and update atoms.proto comments.

Bug: 131833599
Test: compiled
Change-Id: I6a0e8a6175e7e9e46572ea4aa50ce7669a02588b
2019-05-30 14:40:12 +01:00
TreeHugger Robot
23d7a55d18 Merge "Fix issue for DnsResolver#query" into qt-dev 2019-05-30 13:37:38 +00:00
Remi NGUYEN VAN
6a135107ff PackageWatchdog listens for NetworkStack failures
In addition to the NetworkStack app monitoring, have PackageWatchdog
register an observer to NetworkStackClient to receive severe failure
notifications, and attempt a rollback if available.

The callback is registered in onPackagesReady(), which is called in the
boot sequence just before starting the NetworkStack.

Test: installed new networkstack, killed it twice, observe rollback
Test: unit test in change on top
Bug: 133725814
Change-Id: I2cb4200b78c2482cacc4bfe2ace1581b869be512
2019-05-30 21:52:51 +09:00
Remi NGUYEN VAN
5855ce28cf Proper handling of NetworkStack crash
Instead of always crashing on userdebug builds, do the following on all
builds:
 - If the device did not observe a NetworkStack crash in the last 6h
   crash the system server. This is to handle spurious crashes of the
   NetworkStack, so that the system can recover instead of staying
   without connectivity.
 - Otherwise, the device has had a recent crash. Notify the listeners
   (watchdog listener to be added) that something is seriously wrong,
   but do not crash to avoid bootlooping the device. This allows the
   watchdog to do its job, and avoids bricking the device in
   situations where the user could need to make emergency calls.

Bug: 133725814
Test: Killed the network stack, observe reboot of framework.
Test: Kill network stack again, observe nothing.
Test: Wipe data, install new network stack, kill it twice: rollback.
      (with patch on top applied)
Change-Id: If1fa00bed769eb60ca4832609006bdf15ceddb80
2019-05-30 21:52:40 +09:00
TreeHugger Robot
37efc112e2 Merge "Replace limited connectivity notification after detecting it" into qt-dev 2019-05-30 12:52:33 +00:00
Julia Reynolds
634c095610 Merge "Fix some issues in notification bucketing" into qt-dev 2019-05-30 12:30:30 +00:00
Zimuzo
e77a3e1de2 Add network health check watchdog triggered rollback tests
This cl improves code coverage for the PackageWatchdog explicit health
checks.

Updating the NetworkStack triggers an explicit health check with
a time deadline. At the deadline, if network is unavailable on the device,
the update is rolled back, if network is available, nothing happens.

Bug: 132640467
Test: atest StagedRollbackTest

Change-Id: I16a40244de9345930a1c981188aa33546fe872fc
2019-05-30 13:30:26 +01:00
TreeHugger Robot
bc16cf3d72 Merge "Always give VPN the INTERNET capability." into qt-dev 2019-05-30 12:10:22 +00:00
Luke Huang
459a5becd9 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 3854966dc9)

Change-Id: I37353642088bcc17da0cf17f78a5ed9efc9aefc3
2019-05-30 11:58:25 +00:00
Chiachang Wang
318a4884b9 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 a5c68348d8)
2019-05-30 11:46:21 +00:00
Luke Huang
9bc31a14c1 Merge "Fix issue for DnsResolver#query" am: 3fd64333d2
am: da47327520

Change-Id: I819fa9eb0abab64951fdb8adb7b1fc660544a1ad
2019-05-30 04:36:42 -07:00
Luke Huang
da47327520 Merge "Fix issue for DnsResolver#query"
am: 3fd64333d2

Change-Id: I012facbd15e78f2a484f4955828bb980fb553e95
2019-05-30 04:30:39 -07:00
Luke Huang
3fd64333d2 Merge "Fix issue for DnsResolver#query" 2019-05-30 11:22:50 +00:00
Chiachang Wang
a5c68348d8 Merge "Replace limited connectivity notification after detecting it" am: b6482348b0
am: 7cfc1d4ec6

Change-Id: I004e78a33689e2208918d4316bcf9a8f50a0bac3
2019-05-30 04:10:30 -07:00
Chiachang Wang
7cfc1d4ec6 Merge "Replace limited connectivity notification after detecting it"
am: b6482348b0

Change-Id: I9e501d404e465714c657d8056e84e008e72861c7
2019-05-30 04:05:38 -07:00
Chiachang Wang
b6482348b0 Merge "Replace limited connectivity notification after detecting it" 2019-05-30 10:56:08 +00:00
Chalard Jean
6010104f06 Merge "Prevent a 4-way binder interlock leading to a leak." am: 2b801dc016
am: 88cf9c532e

Change-Id: Idb8659a22b9d18f1d0bc566b476f4c536c00da90
2019-05-30 03:40:37 -07:00
Chalard Jean
88cf9c532e Merge "Prevent a 4-way binder interlock leading to a leak."
am: 2b801dc016

Change-Id: I00652e13f79a5b2d75fae36bf213e3c2727660c9
2019-05-30 03:35:12 -07:00
Treehugger Robot
2b801dc016 Merge "Prevent a 4-way binder interlock leading to a leak." 2019-05-30 10:22:30 +00:00
Remi NGUYEN VAN
f045873ea3 Merge "Check system_server PID in NetworkStack calls" into qt-dev
am: 0e740ae97e

Change-Id: I88c03a9ee636b3dec090845585d3bdaea559fbbb
2019-05-30 03:16:08 -07:00
TreeHugger Robot
0e740ae97e Merge "Check system_server PID in NetworkStack calls" into qt-dev 2019-05-30 10:01:13 +00:00
Jin Seok Park
49d3fb772a Merge "Catch OutOfMemoryError and log warning" into qt-dev
am: f66a0737ca

Change-Id: I73ffd7764f57470afcaac23ab5546d6ea786c387
2019-05-30 02:55:06 -07:00
Jin Seok Park
f66a0737ca Merge "Catch OutOfMemoryError and log warning" into qt-dev 2019-05-30 09:40:57 +00:00
Mark Chien
83a528fbf2 [automerger skipped] Merge "Fix captive portal can't show certificate problem" into qt-dev
am: 709c46a60a -s ours
am skip reason: change_id I64b05adcb46baf3fca116dbdc5177bc31c71e06d with SHA1 c0274d1315 is in history

Change-Id: I8b637490b79bc202530e095644ad7e23c434e59f
2019-05-30 02:19:36 -07:00
TreeHugger Robot
709c46a60a Merge "Fix captive portal can't show certificate problem" into qt-dev 2019-05-30 09:07:03 +00:00
Chalard Jean
c85f9a8968 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 6d5a4a3b1d)
2019-05-30 08:54:35 +00:00
Chalard Jean
aa88c42127 Merge "Always give VPN the INTERNET capability." am: 3ec6ba7509
am: 6d5a4a3b1d

Change-Id: I144939e7197deec403d6c91f83b414d357190bd4
2019-05-30 01:54:33 -07:00
Chalard Jean
6d5a4a3b1d Merge "Always give VPN the INTERNET capability."
am: 3ec6ba7509

Change-Id: I1e8c9dca828ef8631b3e7cfb58594c2afe91db21
2019-05-30 01:48:24 -07:00
Chalard Jean
3ec6ba7509 Merge "Always give VPN the INTERNET capability." 2019-05-30 08:36:19 +00:00
Sunny Goyal
fceb39bb05 Merge "Adding a compat class to listen for exclusion rect changes" into qt-dev
am: 14aabea07c

Change-Id: I5b9e7569cb81ed04bca887f522cb906524beb0e3
2019-05-30 01:28:26 -07:00
Remi NGUYEN VAN
4895c50e4f Check system_server PID in NetworkStack calls
Add a check that callers with UID 1000 always have the same PID. This is
a proxy for checking that no system is designed to bind to the network
stack unless it is the system_server, as otherwise either the
system_server would start crashing, or that system would not have access
to binder calls.

Also remove access from PHONE_UID as it is not being used.

Test: Flashed, WiFi working, Bluetooth reverse tethering shows no
      permission issue.
Bug: 133209255
Change-Id: Ib848aaaedfd599c1d4437378846c7dda74352019
2019-05-30 17:26:03 +09:00
Neil Fuller
43b25f1332 Merge "Switch to HexEncoding from ByteStringUtils" into qt-dev-plus-aosp 2019-05-30 08:24:54 +00:00
Chiachang Wang
d74d7e62d9 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
TreeHugger Robot
14aabea07c Merge "Adding a compat class to listen for exclusion rect changes" into qt-dev 2019-05-30 08:19:04 +00:00
Chalard Jean
d5603307e1 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
Chalard Jean
06d81d2c62 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
2019-05-30 16:11:14 +09:00
Winson Chung
a000d4f9c4 [automerger skipped] Merge "Update sysui OWNERS" into qt-dev
am: 8608b9e115 -s ours
am skip reason: change_id I43640d87c4fcd0a8211dc04c4203a7b80b150f58 with SHA1 5ec20d472e is in history

Change-Id: I0f0851a45797278eb8092242c2b5c7d5b453a9d8
2019-05-29 23:47:10 -07:00
Dario Freni
33af23a0ff Merge "Prevent installation of new APEX." into qt-dev
am: 2b5de1f231

Change-Id: I85e247ba4cc242528593b4d40a7f610e46acb608
2019-05-29 23:44:57 -07:00
Luke Huang
c211b27621 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
Change-Id: Ic8d45b802d72a266f9ec97bfea620c1ede6967e5
2019-05-30 06:34:03 +00:00
Winson Chung
8608b9e115 Merge "Update sysui OWNERS" into qt-dev 2019-05-30 06:33:26 +00:00