Commit Graph

8955 Commits

Author SHA1 Message Date
TreeHugger Robot
e6f13e706f Merge "Support DNS-over-TLS probes in NetworkDiagnostics" into rvc-dev am: 56e7d278a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11940428

Change-Id: Icb40fc91833cdcfb3c79303e4f08cabd60343242
2020-06-22 14:27:54 +00:00
TreeHugger Robot
56e7d278a8 Merge "Support DNS-over-TLS probes in NetworkDiagnostics" into rvc-dev 2020-06-22 14:15:40 +00:00
Lorenzo Colitti
643fbc8e47 Merge "Make PendingIntent immutable and correct Settings package name" into rvc-dev am: 1b7f9ca7d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881938

Change-Id: Ibdf37115a43d5ebbc4e34b5668351916ee5671d1
2020-06-22 09:13:55 +00:00
Lorenzo Colitti
1b7f9ca7d0 Merge "Make PendingIntent immutable and correct Settings package name" into rvc-dev 2020-06-22 09:00:25 +00:00
Mike Yu
b6b7e0c2be Support DNS-over-TLS probes in NetworkDiagnostics
Probe DNS servers to see they support DNS-over-TLS. Use system
CAs to verify whether the certificates sent by DNS servers are
trusted or not. An error is thrown to cause the probe failed if
DNS servers send untrusted certificates.

Unlike the DnsResolver which doesn't verify the certificates
in opportunistic mode, all of the DoT probes from NetworkDiagnostics
check certificates.

DoT probes apply to the DNS servers gotten from LinkProperties
and the DoT servers gotten from PrivateDnsConfig whatever private
DNS mode is.

A common example in DNS strict mode:
.  DNS TLS dst{8.8.8.8} hostname{dns.google} src{192.168.43.2:48436} qtype{1} qname{815149-android-ds.metric.gstatic.com}: SUCCEEDED: 1/1 NOERROR (432ms)
F  DNS TLS dst{192.168.43.144} hostname{}: FAILED: java.net.ConnectException: failed to connect to /192.168.43.144 (port 853) from /192.168.43.2 (port 41770) after 2500ms: isConnected failed: ECONNREFUSED (Connection refused) (172ms)
.  DNS TLS dst{8.8.4.4} hostname{dns.google} src{192.168.43.2:37598} qtype{1} qname{759312-android-ds.metric.gstatic.com}: SUCCEEDED: 1/1 NOERROR (427ms)

An example when the CA is not trusted:
F  DNS TLS dst{8.8.8.8} hostname{dns.google}: FAILED: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. (16ms)

An example when TCP/TLS handshake timeout:
F  DNS TLS dst{8.8.8.8} hostname{dns.google}: FAILED: java.net.SocketTimeoutException: failed to connect to /8.8.8.8 (port 853) from /192.168.2.108 (port 45680) after 2500ms (2514ms)

Bug: 132925257
Bug: 118369977
Test: atest FrameworksNetTests
Original-Change: https://android-review.googlesource.com/1011670
Merged-In: I1b54abed0e931ca4b8a97149459cde54da1c3d6f
Change-Id: I1b54abed0e931ca4b8a97149459cde54da1c3d6f
2020-06-22 08:57:49 +00:00
paulhu
f2db66615d Make PendingIntent immutable and correct Settings package name
ConnectivityService puts up some notifications with pending
intents, but these pending intents are mutable that content can
be changed by someone. So make these pending intents to be
immutable.

Some OEMs have their own Settings package. Thus, need to get the
current using Settings package name instead of just use default
name "com.android.settings".

Bug: 154928507
Test: atest FrameworksNetTests
Change-Id: I02e3277358623400aa03dc8996af3d7c46a8ce76
2020-06-22 15:32:01 +08:00
Remi NGUYEN VAN
2b7046ac9b Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: 6e5b6b612d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11846903

Change-Id: Ia5028f7dfeadbcf928efb9862b481c82e2849e18
2020-06-19 01:08:47 +00:00
Remi NGUYEN VAN
6e5b6b612d Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev 2020-06-19 00:49:29 +00:00
Lorenzo Colitti
5409cf46b5 Merge "Move DnsPacket to libs net" into rvc-dev am: 81f0fe48d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862407

Change-Id: I74cac5c415d8b3447b57cda7cba1caa215e84ea2
2020-06-18 14:58:19 +00:00
Luke Huang
854adb51eb Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: I10202dc784bafa044a04546d0a765370331223dc
2020-06-18 14:46:02 +00:00
TreeHugger Robot
9a0218f958 Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev am: 65efcc84a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11869883

Change-Id: I84b0010488024aa9867ad4af7a4013854cdeeaa1
2020-06-18 14:34:45 +00:00
TreeHugger Robot
b3a9f82988 Merge "Treat RouteInfo with different interfaces as different routes" into rvc-dev am: 70e3f56147
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11882397

Change-Id: I4c96f81ba9118b545b69eb507333f09ea634bdf8
2020-06-18 14:29:52 +00:00
Lorenzo Colitti
81f0fe48d2 Merge "Move DnsPacket to libs net" into rvc-dev 2020-06-18 10:14:47 +00:00
Luke Huang
51221efa45 Move DnsPacket to libs net
This class might be used by some mainline modules.

Bug: 151052811
Test: atest DnsPacketTest
Test: atest DnsResolverTest
Change-Id: I8841d91456952ded5efbf8ea221289aecc7746ad
2020-06-18 16:17:04 +08:00
Luke Huang
bbcd3b326b Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev 2020-06-18 03:03:06 +00:00
Luke Huang
5a42a4132f Disable sockets and DNS if process lacks INTERNET permission.
This is a Client-only solution.
  - Add to NetdClient a per-process std::atomic_boolean
    similar to netIdForProcess and netIdForResolv.
  - The boolean says whether the process should be
    allowed Internet connectivity.
  - Add an @hide method to NetUtils.java to set the boolean;
    call it from the initialization code of the new
    process just after forking from zygote.
  - Make netdClientSocket and dnsOpenProxy check the
    boolean. If the boolean is false, return EPERM from
    socket calls.

Bug: 150028556
Test: atest NetworkUtilsTest
Test: atest CtsAppSecurityHostTestCases:UseProcessTest
Change-Id: If002280fbad493dfc2db3d9d505c0257d49a9056
Exempt-From-Owner-Approval: OWNERS already approved identical patchset 5
2020-06-18 03:02:06 +00:00
TreeHugger Robot
65efcc84a0 Merge "Set correct owner UID for VPN agentConnect()" into rvc-dev 2020-06-17 15:26:22 +00:00
Treehugger Robot
58897cc491 Treat RouteInfo with different interfaces as different routes
On Android different interfaces usually use different routing tables.
As a result, a change in interface should not be treated as route
update, but rather a remove and an add.

This change fixes a bug in VPN seamless handover where routes
failed to be updated when a new tunnel interface replaces the existing
one within the same network.

Bug: 158696878
Test: atest com.android.cts.net.HostsideVpnTests
Test: atest NetworkStackTests
Test: atest CtsNetTestCases
Test: atest FrameworksNetTests
Original-Change: https://android-review.googlesource.com/1331916
Merged-In: I57987233d42a0253eaee2e1ca5f28728c2354620
Change-Id: I57987233d42a0253eaee2e1ca5f28728c2354620
2020-06-17 13:34:11 +00:00
TreeHugger Robot
35b7392a08 Merge "Test extra info sent to NetworkMonitor" into rvc-dev am: 8202b399da
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11862409

Change-Id: Ie8f59a561f7184bcfbbe38e99da78ce092475ff8
2020-06-16 03:28:44 +00:00
Chiachang Wang
1182d5a7fc Test extra info sent to NetworkMonitor
Test extra info sent to NetworkMonitor correctly if network
agent is created through new NetworkAgent constructor without
legacy network info taken as parameter.

Bug: 156173829
Test: atest FrameworkNetTests
Merged-In: I4f827664c528bea30cc957a0a617dd37693f4460
Change-Id: I4f827664c528bea30cc957a0a617dd37693f4460
2020-06-16 01:57:46 +00:00
Benedict Wong
b001522433 Set correct owner UID for VPN agentConnect()
This commit changes agentConnect to set the owner UID as the mOwnerUid
field instead of the Binder.getCallingUid().

Binder.getCallingUid() can return incorrect results for platform VPNs,
as agentConnect() is called under a clean calling UID.

Additionally, this relaxes the ownerUid sanitization check to allow a
VPN network's owner to see it's own ownership information.

Vpn.mOwnerUid is guaranteed to be correct, as all VPNs MUST have called
prepareInternal() at some previous point, which sets mOwnerUid as the
package's UID (or SYSTEM_UID if this is legacy VPN).

Bug: 150135470
Test: CTS tests showing ownership information
Merged-In: Ic979dad73983d722365849fbfb0becfd432b894c
Change-Id: Ic979dad73983d722365849fbfb0becfd432b894c
(cherry picked from commit e29bf99a7fc1067c546d7fa6cbcb9001fb110d16)
2020-06-16 01:42:48 +00:00
Remi NGUYEN VAN
c3884937e1 Move Inet[4]AddressUtils to libs/net
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.

Also refine comments in DhcpResults following feedback in previous
change.

Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
2020-06-12 17:04:06 +09:00
Chalard Jean
14280d011d Merge "Document the limitation to a hundred callbacks." into rvc-dev am: df9ce18085
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11835429

Change-Id: Ic82a23e6f949bd2c74c3dc49da516938f0603e2e
2020-06-12 04:58:27 +00:00
Chalard Jean
df9ce18085 Merge "Document the limitation to a hundred callbacks." into rvc-dev 2020-06-12 04:54:02 +00:00
Aaron Huang
2070880fab Merge "Add unit test for NetworkStatsSubscriptionsMonitor" into rvc-dev am: 70afc75769
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788484

Change-Id: I43328c82223382978ac3475a195011547f6d0fdc
2020-06-12 02:11:58 +00:00
Aaron Huang
70afc75769 Merge "Add unit test for NetworkStatsSubscriptionsMonitor" into rvc-dev 2020-06-12 01:58:59 +00:00
Chalard Jean
cece40543e Document the limitation to a hundred callbacks.
Some developers have been surprised by this limitation and had trouble
figuring out what the issue was. Add documentation to address this.

This also includes a drive-by removal of a duplicate check.

Bug: 149867479
Test: doc-only change
Original-Change: https://android-review.googlesource.com/1313813
Merged-In: I5911d01984695550b6c9afe7a8eb535bf5e320a1
Change-Id: I5911d01984695550b6c9afe7a8eb535bf5e320a1
2020-06-12 00:35:39 +00:00
Mark Chien
bd60308b8f Merge "Cleanup config_mobile_hotspot_provision_app usage" into rvc-dev am: ef24e2121d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11716092

Change-Id: Iece352be0190b902c4949c1feb76281653a9b59f
2020-06-11 15:42:41 +00:00
markchien
f949ec251f Cleanup config_mobile_hotspot_provision_app usage
config_mobile_hotspot_provision_app would be move out of framework and
only private for tethering only.
enforceTetherChangePermission is no longer needed because its only
caller PanService already gate by other privileged permission
(BLUETOOTH_PRIVILEGED).

Bug: 146918263
Test: m

Change-Id: I030871c2bc46bc09c4e52970b4995f98d31bb90e
Merged-In: I030871c2bc46bc09c4e52970b4995f98d31bb90e
2020-06-11 13:32:12 +00:00
Lorenzo Colitti
e709bb9955 Merge "Update extra info before registering" into rvc-dev am: 4720606b02
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11745979

Change-Id: I7b68541f2cf1b3367b5aa6b6221b636f54c2e53e
2020-06-10 15:32:55 +00:00
Lorenzo Colitti
4720606b02 Merge "Update extra info before registering" into rvc-dev 2020-06-10 15:17:38 +00:00
Aaron Huang
a8eab54eee Add unit test for NetworkStatsSubscriptionsMonitor
Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
Change-Id: I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91
2020-06-09 00:40:36 +08:00
TreeHugger Robot
5a1fcd7990 Merge "Update javadoc to use complete sentence" into rvc-dev am: 1f883f9099
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11745980

Change-Id: Ic28db88cac7f13c6355eb9ce76cd8cee660c6c93
2020-06-08 09:10:42 +00:00
Treehugger Robot
9d2a21503b Update javadoc to use complete sentence
Avoid using the "iff" abbreviation in our Javadoc.

Bug: 158092978
Test: m doc-comment-check-docs and check the generated doc
Merged-In: I41bf8a6ddad200f00524d9b2dd1bf169810ee460
Change-Id: I41bf8a6ddad200f00524d9b2dd1bf169810ee460
2020-06-05 04:50:14 +00:00
Chiachang Wang
d33028c205 Update extra info before registering
The extra info is taken into NetworkMonitor from while creating
it. The NetworkMonitor is created when a new agent is registered
but the extra info is not available at that time. Make sure the
field is set in the NetworkInfo when registering.

Bug: 156173829
Test: adb shell dumpsys network and check the apn in the extra
      info shown correctly
Test: atest FrameworkNetTests
Merged-In: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
Change-Id: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
2020-06-05 01:46:06 +00:00
Junyu Lai
dac17d9337 Merge "Disable log for per uid blocked status changed event" into rvc-dev am: cba8b949b3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11700105

Change-Id: Iaafbe392cbbfa220d6c02b3fa1eced2ac683b8fe
2020-06-03 06:37:03 +00:00
Junyu Lai
edb74fd839 Disable log for per uid blocked status changed event
This consumes ~3.5% system logs, however it is not very useful
when debugging since similar information could be obtained from
dumpsys {connectivity|netpolicy}. Thus, remove the log.

Test: manual
Bug: 135504481
Change-Id: I04d2b7402f892546722fe6868c521afd9534f183
Merged-In: I04d2b7402f892546722fe6868c521afd9534f183
(cherry picked from commit 21a352f761ce558bea6fa9ab2a4e49a164228b56)
2020-06-02 10:19:41 +00:00
Remi NGUYEN VAN
8aa298adce Merge "Allow TRANSPORT_TEST ethernet networks" into rvc-dev am: fcd1fd8f26
Original change: undetermined

Change-Id: Ida76ccf2f5b99f77c17ae3ff732e7f56a1676306
2020-06-02 00:25:06 +00:00
Remi NGUYEN VAN
bfd4336f31 Allow TRANSPORT_TEST ethernet networks
Ethernet networks using tap interfaces should have TRANSPORT_TEST so
they are not considered by network selection.

Test: atest CaptivePortalApiTest FrameworksNetTests
Bug: 156319532
Original-Change: https://android-review.googlesource.com/1317238
Merged-In: I0d9477977c88aa055625ab4046577a41e76b05ff
Change-Id: I0d9477977c88aa055625ab4046577a41e76b05ff
2020-06-01 01:43:32 +00:00
Benedict Wong
1d63ae83d2 Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" into rvc-dev am: 36d9c275ac
Change-Id: If586cc601523aced520da3ebba00bca60d34a794
2020-05-29 17:32:44 +00:00
Benedict Wong
36d9c275ac Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" into rvc-dev 2020-05-29 17:17:10 +00:00
Cody Kesting
909e6477bd Merge "Comment reason for simulateDataStall structure." into rvc-dev am: 84ad118843
Change-Id: I6b27cbb174090936f8dfcbe0d82dcdbe387683ee
2020-05-29 16:40:40 +00:00
Cody Kesting
84ad118843 Merge "Comment reason for simulateDataStall structure." into rvc-dev 2020-05-29 16:29:23 +00:00
TreeHugger Robot
76f82ab58f Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" into rvc-dev am: 51de3f8a10
Change-Id: I3ab5b7ad875abbe7fe6edcb834bf7d0cb06e5116
2020-05-29 14:09:23 +00:00
TreeHugger Robot
51de3f8a10 Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" into rvc-dev 2020-05-29 14:01:18 +00:00
Chalard Jean
42e012ca7d Merge "Adjust tests for renaming groupHint to cluster." into rvc-dev am: 6489161fd5
Change-Id: I91768e43fb69c74058b248a03698d6ffedf94f55
2020-05-29 04:21:59 +00:00
Automerger Merge Worker
dcb0e912b1 Adjust tests for renaming groupHint to cluster.
Bug: 146460486
Test: atest android.net.IpMemoryStoreTest
Test: atest com.android.server.connectivity.ipmemorystore.IpMemoryStoreServiceTest
Change-Id: Ia9797bb93aa4ff89147a77823d342dc22aec6a25
Merged-In: I69f7a2971cc5985d0f0078aecc39d4d6a6130033
(cherry-picked from aosp/1311654)
2020-05-29 02:28:59 +00:00
Benedict Wong
ba8ca78394 Add RequiresFeature annotations for IKEv2 VPN profiles
This change adds the @RequiresFeature annotation to Ikev2VpnProfile
Builder methods, and checks before provisioning VPN profiles.

Bug: 156681625
Test: New tests added, passing.
Change-Id: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
Merged-In: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
(cherry picked from commit e84a17dd1706f4c8373047b2023a1ec4b7cf4bf3)
2020-05-28 19:07:29 -07:00
TreeHugger Robot
0e07dc6af3 Merge changes I289d935f,I0121a4ac,Ie73ba058,I4393afcb,Ifebd946e, ... into rvc-dev am: c119ee1ed2
Change-Id: Iec9a061d0f91993e65c5d110955e8f23b0f0d945
2020-05-28 21:28:28 +00:00
Maciej Żenczykowski
c6bd588b29 NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter. am: 19e7950e50
Change-Id: Ibaee70f31f27f7457bd8524d4ab62bc76fff5dea
2020-05-28 21:28:25 +00:00