Commit Graph

8615 Commits

Author SHA1 Message Date
Paul Hu
0b55f2fac7 Merge "Make PendingIntent immutable and correct Settings package name" am: 8ae6128b05
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1325698

Change-Id: I39f50eb0b88d0f255bea1bd46cf61da010491f20
2020-06-23 04:09:20 +00:00
Paul Hu
8ae6128b05 Merge "Make PendingIntent immutable and correct Settings package name" 2020-06-23 03:55:22 +00:00
paulhu
68426196a5 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
Merged-In: I02e3277358623400aa03dc8996af3d7c46a8ce76
2020-06-23 10:05:01 +08:00
Treehugger Robot
4454ba73ff Merge "Update DnsManagerTest for AIDL interface change" am: 9f725d606a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1345375

Change-Id: Ic9836cb0ca7ad9e97b7edb135dbb1f8269f4a0df
2020-06-22 15:50:00 +00:00
Treehugger Robot
9f725d606a Merge "Update DnsManagerTest for AIDL interface change" 2020-06-22 15:31:54 +00:00
Ken Chen
a523111101 Update DnsManagerTest for AIDL interface change
Check one more parameter enforceDnsUid in ResolverOptionsParcel in
DnsManagerTest.

Bug: 159587277
Test: atest
com.android.server.connectivity.DnsManagerTest#testSendDnsConfiguration

Change-Id: Ic53f42b968626294c851dac252a70769846ba427
Merged-In: Ic53f42b968626294c851dac252a70769846ba427
2020-06-22 15:10:12 +00:00
Mike Yu
d7b0b95a3a Merge "Support DNS-over-TLS probes in NetworkDiagnostics" am: 64ffa1762f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1011670

Change-Id: I9e436446179750315be45ddc034cece5afd3c004
2020-06-22 06:45:25 +00:00
Mike Yu
d0e4221f64 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
Change-Id: I1b54abed0e931ca4b8a97149459cde54da1c3d6f
2020-06-20 16:22:35 +08:00
Aaron Huang
e2a6e9a49a Merge "Address comments from aosp/1298476" am: 6dc9a28b88
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1340040

Change-Id: I3c7c0ef738b6c6b964dc91c593cbf2b6166e3843
2020-06-18 10:34:10 +00:00
Aaron Huang
6dc9a28b88 Merge "Address comments from aosp/1298476" 2020-06-18 10:18:57 +00:00
Aaron Huang
50f06aca36 Address comments from aosp/1298476
This patch addresses the followings,
- Pass Looper to NetworkStatsSubscriptionsMonitor constructor
- Replace Looper with TestLooper in unit test
- Assert fail if result of condition check is not expected.

Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsServiceTest
      atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
Change-Id: Ibcaba2b38af80cc0ec9a4e428a3b3a1538bc4325
2020-06-18 15:05:19 +08:00
Aaron Huang
5410692469 Merge "Dynamically enable/disable watch for RAT type changes" am: 2ad5b1419e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1315574

Change-Id: Id5c4ad325779322bbf4881816235904a6d454583
2020-06-18 04:09:37 +00:00
Aaron Huang
2ad5b1419e Merge "Dynamically enable/disable watch for RAT type changes" 2020-06-18 03:51:51 +00:00
Treehugger Robot
a89e9a29a3 Merge "Treat RouteInfo with different interfaces as different routes" am: 6d4e2d5ec3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331916

Change-Id: Ibe919ea7c2096094fdb48fc91881d9f19678ac50
2020-06-17 13:07:42 +00:00
Treehugger Robot
6d4e2d5ec3 Merge "Treat RouteInfo with different interfaces as different routes" 2020-06-17 12:51:08 +00:00
Rubin Xu
ad524dec0b 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
Change-Id: I57987233d42a0253eaee2e1ca5f28728c2354620
2020-06-17 12:01:41 +01:00
Aaron Huang
c078fae644 Merge "Add unit test for NetworkStatsSubscriptionsMonitor" am: 4a4540dee6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1298476

Change-Id: I1b191cd4706a7409794d382bda95ef6933b019a1
2020-06-17 09:09:13 +00:00
Aaron Huang
4a4540dee6 Merge "Add unit test for NetworkStatsSubscriptionsMonitor" 2020-06-17 08:52:20 +00:00
Aaron Huang
b412cf8212 Dynamically enable/disable watch for RAT type changes
Add ContentObserver to observe the status of
NETSTATS_COMBINE_SUBTYPE_ENABLED to determine that
NetworkStatsSubscriptionsMonitor start or stop
monitoring data usage per RAT type changes.

Bug: 154080515
Test: atest NetworkStatsServiceTest#testDynamicWatchForNetworkRatTypeChanges
Change-Id: I272d589633c9186b45753228b05aa0b40b7c7b89
2020-06-17 17:09:10 +09:00
Chiachang Wang
8825abb697 Merge "Test extra info sent to NetworkMonitor" am: cd192301a2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331060

Change-Id: If48de0d3fe326d72170b13ec6a9477dfc8dc48ff
2020-06-16 00:52:01 +00:00
Chiachang Wang
cd192301a2 Merge "Test extra info sent to NetworkMonitor" 2020-06-16 00:38:58 +00:00
Benedict Wong
bc6da9922c Merge "Set correct owner UID for VPN agentConnect()" am: 08447ffcc0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1326493

Change-Id: I04609b41c9e878e1e3ca8f128d86290012d4ede7
2020-06-15 17:18:15 +00:00
Benedict Wong
08447ffcc0 Merge "Set correct owner UID for VPN agentConnect()" 2020-06-15 17:09:46 +00:00
Aaron Huang
791dfcb0f5 Add unit test for NetworkStatsSubscriptionsMonitor
Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
(copy from ag/11788484 but getActiveAndHiddenSubscriptionIdList() since it's renamed
in internal)
Change-Id: Ia162f36efe96d90b2f6f70190d9fa855bba34484
Merged-In: I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91
2020-06-15 07:05:19 +00:00
Chiachang Wang
0f6aeff137 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
Change-Id: I4f827664c528bea30cc957a0a617dd37693f4460
2020-06-12 18:13:00 +08:00
Chalard Jean
1baaf76e55 Merge "Document the limitation to a hundred callbacks." am: 665d54db52
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1313813

Change-Id: Id2f70609c46ec6252b7e734c1e5838016314400f
2020-06-11 12:46:15 +00:00
Chalard Jean
665d54db52 Merge "Document the limitation to a hundred callbacks." 2020-06-11 12:31:09 +00:00
Chalard Jean
7f06b34acd 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
Change-Id: I5911d01984695550b6c9afe7a8eb535bf5e320a1
2020-06-11 12:30:21 +00:00
Mark Chien
4c645dd681 Merge "Cleanup config_mobile_hotspot_provision_app usage" am: 443092b9a8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1329014

Change-Id: I3d265ab9806605e18384fa6321452f7c96f3f48b
2020-06-11 07:40:27 +00:00
markchien
11f729b0b5 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
2020-06-10 15:52:24 +00:00
Benedict Wong
e3bcbc0ec7 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
Change-Id: Ic979dad73983d722365849fbfb0becfd432b894c
2020-06-08 14:33:01 -07:00
Xin Li
82dfa8f215 [automerger skipped] Merge "Merge QQ3A.200605.002 into master" am: a346d8259f -s ours
am skip reason: Change-Id I5e28537689d1a53e99f91eafd494eb3a0c890f46 with SHA-1 afbf77813b is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1323623

Change-Id: Iacc1884e345d9df125b3a9bbf32d1d10d3a4757d
2020-06-08 15:56:48 +00:00
Xin Li
a346d8259f Merge "Merge QQ3A.200605.002 into master" 2020-06-06 01:41:11 +00:00
Treehugger Robot
43299a816e Merge "Update javadoc to use complete sentence" am: 1b33b21814
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1323953

Change-Id: I6c8358c81bbc7a08802ef027fcd32adea4821ba0
2020-06-05 03:17:00 +00:00
Treehugger Robot
1b33b21814 Merge "Update javadoc to use complete sentence" 2020-06-05 03:02:36 +00:00
Chiachang Wang
74c9a25719 Merge "Update extra info before registering" am: 004dde17a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1310538

Change-Id: I6eb786edfe615574c731097df09ae3142e137999
2020-06-05 00:24:09 +00:00
Chiachang Wang
004dde17a5 Merge "Update extra info before registering" 2020-06-05 00:04:04 +00:00
Chiachang Wang
d24c4d2f15 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
Change-Id: I41bf8a6ddad200f00524d9b2dd1bf169810ee460
2020-06-04 07:46:14 +00:00
Chiachang Wang
c9d788a50c 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
Change-Id: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
2020-06-03 13:01:01 +08:00
Junyu Lai
3cabc6713f Merge "Disable log for per uid blocked status changed event" am: 0aad631ab4
Original change: undetermined

Change-Id: I6ba38a19e1ac1d7f3f3eccef76aa10f75273ca47
2020-06-02 09:52:38 +00:00
Junyu Lai
0aad631ab4 Merge "Disable log for per uid blocked status changed event" 2020-06-02 09:39:30 +00:00
junyulai
0202567a01 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
2020-06-02 14:26:36 +08:00
Maciej Żenczykowski
02a2410340 Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" am: 4423b79af3
Change-Id: I4128678546feba6840ddb210244992846705e5d9
2020-06-01 02:14:25 +00:00
Maciej Żenczykowski
4423b79af3 Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" 2020-06-01 02:00:40 +00:00
Luke Huang
cc4ced860a Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS
NETID_USE_LOCAL_NAMESERVERS is no longer in libnetd_client

Bug: 151895202
Test: build
Change-Id: Iea0c2488dcabdd24d6ffca8134cd11ed12e8308a
Merged-In: Iea0c2488dcabdd24d6ffca8134cd11ed12e8308a
2020-05-30 19:04:44 -07:00
Remi NGUYEN VAN
8d78387b3b Merge "Allow TRANSPORT_TEST ethernet networks" am: c45abad7fd
Change-Id: Ib9ab1ddb855c90219e94c4b74dc7268cfbcdb661
2020-05-29 21:43:41 +00:00
Benedict Wong
6f54a418dc Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" am: 618912a51c
Change-Id: I4a135e75105a49b25b65ba76a3c252467bd9d5ea
2020-05-29 21:41:40 +00:00
Remi NGUYEN VAN
c45abad7fd Merge "Allow TRANSPORT_TEST ethernet networks" 2020-05-29 06:26:14 +00:00
Benedict Wong
618912a51c Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" 2020-05-29 01:55:08 +00:00
Remi NGUYEN VAN
d64d6c3e98 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
Change-Id: I0d9477977c88aa055625ab4046577a41e76b05ff
2020-05-29 10:22:50 +09:00