385735 Commits

Author SHA1 Message Date
Neil Fuller
a326166eba Merge "Switch to HexEncoding from ByteStringUtils" 2019-05-30 16:31:09 +00:00
Neil Fuller
ae6fef3de7 Switch to HexEncoding from ByteStringUtils
Migration in preparation for deletion of ByteStringUtils.

DexLogger contains import ordering fixes to enable upload.

Bug: 124232146
Test: build only
Exempt-From-Owner-Approval: Already approved internally
Merged-In: I2cb09da5ec5296799e03bab812b7fb29452a623e
Change-Id: I2cb09da5ec5296799e03bab812b7fb29452a623e
2019-05-30 16:30:53 +00:00
Lorenzo Colitti
4e4efe42a1 Add one more test for VPN usage stats.
(cherry picked from commit 1419b0b20e4b079bfa66662d042b4dc35fb22d78)

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
e4bfdccb57 Addressing comments for http://ag/7700679.
(cherry picked from commit a229333986f95e48347fa8b653d7e1776019f84a)

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
ad0be320e2 Merge "Fix a comment" 2019-05-30 14:39:48 +00:00
Luke Huang
3fd64333d2 Merge "Fix issue for DnsResolver#query" 2019-05-30 11:22:50 +00:00
Chiachang Wang
b6482348b0 Merge "Replace limited connectivity notification after detecting it" 2019-05-30 10:56:08 +00:00
Treehugger Robot
2b801dc016 Merge "Prevent a 4-way binder interlock leading to a leak." 2019-05-30 10:22:30 +00:00
Chalard Jean
8a0f055e75 Fix a comment
I need to learn to read

Bug: 119216095
Test: comment-only change
Change-Id: Ia2317fc146462e73c1c770ad0f6f2009e497649b
2019-05-30 18:10:01 +09:00
Chalard Jean
3ec6ba7509 Merge "Always give VPN the INTERNET capability." 2019-05-30 08:36:19 +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
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
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
Mark Chien
1bbb08b87f Merge "Fix captive portal can't show certificate problem" 2019-05-30 02:13:41 +00:00
Haibo Huang
4fb04e8b7f Merge "Fix compilation issues with new kotlin compiler" 2019-05-29 22:21:00 +00:00
Treehugger Robot
c51996859d Merge "bpfmt -w Android.bp" 2019-05-29 22:02:37 +00:00
Colin Cross
32e0401582 Convert SettingsLib tests to Android.bp
See build/soong/README.md for more information.

Bug: 122332340
Test: m RunSettingsRoboTests
Test: atest SettingsLibTests (same failures before and after)
Change-Id: I69b5b2c6c22f93a31ef978710867226cb1ba3db0
Merged-In: I69b5b2c6c22f93a31ef978710867226cb1ba3db0
2019-05-29 14:44:48 -07:00
Tobias Thierer
21558d758d Merge "Refactoring: Rewrite links in Metalava instead of carrying patches." 2019-05-29 21:13:05 +00:00
Chen Xu
478cbabf8c Merge "NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions" 2019-05-29 17:15:41 +00:00
Jaewoong Jung
cb36cba281 Merge "Convert PrintRecommendationService to Android.bp." 2019-05-29 16:21:58 +00:00
Jaewoong Jung
0fc171c6a6 Convert PrintRecommendationService to Android.bp.
See build/soong/README.md for more information.

Bug: 122332340
Test: Built and flashed to a Pixel device + TreeHugger
Merged-In: I4ff0577a0c27b8a451e6aca2c62c2437481c2a0c
Change-Id: I4ff0577a0c27b8a451e6aca2c62c2437481c2a0c
2019-05-29 08:41:03 -07:00
Chalard Jean
9690384221 Merge "Add a common test library." 2019-05-29 12:16:08 +00:00
Tobias Thierer
bc05034a26 bpfmt -w Android.bp
This CL reformats Android.bp via the above command line.
Before running it, I first had to "make bpfmt".

Test: Visual inspection / self-review only.

Change-Id: I00857646720198e13f875056793802b2e4350264
2019-05-29 12:26:03 +01:00
Tobias Thierer
8f55941ebc Refactoring: Rewrite links in Metalava instead of carrying patches.
Another CL in this topic introduces the metalava feature flag
--replace-documentation <ancestor java packages> <regex> <replacement>
to perform regex replacements in the documentation of some elements.

This CL uses that feature to re-write links in libcore/ojluni/
documentation that previously carried patches.

Since .bp files don't appear to support String literals that are not
(un)escaped, \ and $ occurring in the regexp/replacement parameters
need to be escaped in the .bp file.

Bug: 129765390
Test: Manually checked that this CL topic does not affect the result of
      "make ds-docs offline-sdk-docs"

Change-Id: Idb7366530c4ab255c1348cf48881cf2bde31be1e
2019-05-29 12:26:03 +01:00
Luke Huang
8c4ef95cbb Merge "Minor changes for DnsUtils and its test" 2019-05-29 10:17:24 +00:00
Neil Fuller
b4cc036c1e Merge "Switch to HexEncoding from ByteStringUtils" 2019-05-29 10:12:27 +00:00
Neil Fuller
6ae67f8574 Switch to HexEncoding from ByteStringUtils
Migration in preparation for deletion of ByteStringUtils.

This change also fixes some import issues necessary for upload.

Bug: 124232146
Test: build only
Exempt-From-Owner-Approval: Already approved internally
Merged-In: I6ee12e9914503a5b628ae6da82a396aa71dd972c
Change-Id: I6ee12e9914503a5b628ae6da82a396aa71dd972c
2019-05-29 10:11:44 +00:00
markchien
1302494b6e Fix captive portal can't show certificate problem
Captive portal overrides two shouldOverrideUrlLoading methods,
but show certificate logic only be implemented in deprecated one.

Bug: 133714666
Test: -build, flash, boot
      -atest FramworksNetTests
      -manual test

Change-Id: Ibdcfb814d9552563416fc30b314916559862c361
2019-05-29 18:10:05 +08:00
chen xu
bd0005b43d NetworkStatAccess Should checkCarrierPrivileges cross all subscriptions
Bug: 133236378
Test: Manual
Change-Id: I49fbde1fe73b33aadcf8fd23ad224f363b137bf3
2019-05-28 23:28:56 -07:00
Luke Huang
9f97f97d0d Minor changes for DnsUtils and its test
fix nits for ag/7671031

Bug: 129530368
Test: atest DnsUtilsTest
Change-Id: I562d33870a933a5fe55c89137a2d9574e3c59b90
2019-05-29 13:56:27 +08:00
Sal Savage
d8b457545a Merge "Update BluetoothProfileConnector to invoke service disconnections with correct profile ID" 2019-05-29 01:26:04 +00:00
Treehugger Robot
b2f9798688 Merge "Do not fully compiled debuggable apps" 2019-05-28 23:47:22 +00:00
Calin Juravle
a349dde606 Do not fully compiled debuggable apps
Force vmSafeMode behaviour on debuggable apps:
- the runtime ignores their compiled code
- they generally have lots of methods that could make the compiler used
run out of memory

Bug: 130828957
Test: manual
Merged-In: I946ce15a18729ec6620aca257c52e5b9e4434265
Change-Id: I946ce15a18729ec6620aca257c52e5b9e4434265
2019-05-28 22:57:19 +00:00
Treehugger Robot
3996c9eb72 Merge "Avoid fake high input latency while vsync drifting" 2019-05-28 21:31:32 +00:00
Haibo Huang
11ab950560 Fix compilation issues with new kotlin compiler
These code failed with kotlinc v1.3.31.

1) Drawable.draw is marked as @NotNull. The declaration in both side
doesn't match.

2) Seems kotlin doesn't recognize getMatrix / setMatrix as a property
now. This is a little weird but may also because of @NotNull annotation
in setMatrix parameter.

Test: build with old and new compiler
Change-Id: Id7f34229e29bbceb6271a0648acf3512c10ed04c
Merged-In: Id5a85c787876248e610cc668f54e7bd40629d4e0
2019-05-28 17:23:44 +00:00
Sal Savage
4afdab44ab Update BluetoothProfileConnector to invoke service disconnections with correct profile ID
Bug: b/133517229
Test: Build + Manual on automotive hardware
Change-Id: Id8dbeaf844a65020f610505f81eea20b96ec002a
2019-05-28 16:56:23 +00:00
Chalard Jean
ce75e0e335 Add a common test library.
This is the most common test library for Connectivity tests. It is
meant to be usable in framework tests, network stack tests, CTS,
GTS. To achieve that, it can only depend on framework classes.

Bug: none
Test: NetworkMonitorTest
Test: NsdManagerTest
Test: ConnectivityServiceTest
Test: OffloadControllerTest
Test: NetworkStatsObserversTest
Test: NetworkStatsServiceTest
(all the touched classes)

Change-Id: Ic47cbe7ba0e407145fa6bc49bb2adb3c5937dbc4
2019-05-28 22:20:51 +09:00
Chalard Jean
70682e9f17 Merge "Let the system server have CONNECTIVITY_USE_RESTRICTED_NETWORKS." 2019-05-28 12:26:10 +00:00
Chalard Jean
1f397201e3 Merge "Make the memory store operations serial." 2019-05-28 10:51:19 +00:00
Treehugger Robot
4b2247d506 Merge "Fix deadlock which causing ANR" 2019-05-28 10:29:23 +00:00
Vladimir Marko
b1ec613190 Merge "Remove unnecessary dependencies on ART libraries." 2019-05-28 08:43:47 +00:00
Chalard Jean
5d258aecb6 Make the memory store operations serial.
Bug: 128499160
Test: new test in this patch
Change-Id: I10b5c5cd85fcb76924ba96c8c379be677774705d
2019-05-28 16:56:50 +09:00
Xiao Ma
2bc72d2fe0 Merge "Wipe the data in IpMemoryStore database upon network factory reset." 2019-05-28 00:52:00 +00:00
Treehugger Robot
d47ae01063 Merge "Deprecate getNetworkType" 2019-05-27 21:10:50 +00:00
Treehugger Robot
0c7239996d Merge "Add permissions check for getNetworkType" 2019-05-27 19:04:39 +00:00
Luke Huang
e682b1526a Merge "Remove broken test testRfc6724Sort" 2019-05-27 14:12:05 +00:00
Treehugger Robot
ab6ab9e4d4 Merge "Reinstate access to a forgotten member" 2019-05-27 11:14:37 +00:00
Luke Huang
c04fd72fff Remove broken test testRfc6724Sort
This test is conitnuely fail in cuttlefish.
Lack of ipv6 default route in cuttlefish caused the test failed.
The reason is that the result of rfc6724Sort depends on on the route in system.
It is not good to expect any route should exists, so remove it.

Bug: 133649648
Test: atest DnsUtilsTest
Change-Id: I91f89782b9b989fa1a49e666bb5ce2df3a0dbbf7
2019-05-27 17:49:32 +08:00
Chalard Jean
506686bc3d Let the system server have CONNECTIVITY_USE_RESTRICTED_NETWORKS.
Also :
- Fix testUidFilteringDuringVpnConnectDisconnectAndUidUpdates that
  was failing on devices with a first released SDK >= Q
- Add a test actually tests that the system has the permission, as
  the test was only testing what's in the mock

Bug: 119770201
Test: New test making sure this stays true
Change-Id: I74cf5f0fa17fcf818f1fed78c7e3e4375c20152e
2019-05-27 16:35:22 +09:00