Commit Graph

7924 Commits

Author SHA1 Message Date
Automerger Merge Worker
faa71bfb70 Merge "Make getNetworkSpecifier() public API." am: ad60ef88e0 am: 5ea0681fa3 am: cdbb9b07e5
Change-Id: I73894e4236dc5660f2eb54be3d48aa7359822947
2019-12-12 12:47:00 +00:00
Automerger Merge Worker
cdbb9b07e5 Merge "Make getNetworkSpecifier() public API." am: ad60ef88e0 am: 5ea0681fa3
Change-Id: I884c4e4c9ed891594845d599358f19f4a8e2ad60
2019-12-12 12:26:06 +00:00
Chalard Jean
5ea0681fa3 Merge "Make getNetworkSpecifier() public API."
am: ad60ef88e0

Change-Id: I92d0b7cb179e1c0f5cb789c2c668254732fbf30a
2019-12-12 04:04:32 -08:00
Chalard Jean
c07f570d1c Make getNetworkSpecifier() public API.
The builder lets clients set it, and this may be useful for
unit tests of apps. It should be public.
The need arises from uses of this in WiFi and Telephony
network factories.

Test: build
Bug: 135998869
Change-Id: I57279cac139c28e8654d2066ba0c60edd1e6cd98
2019-12-12 13:10:55 +09:00
Automerger Merge Worker
fb1529dd68 [automerger skipped] Merge changes Iaa78a7ed,I6497b7ef into pi-dev am: 6e79d000ab -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history am: 9f25649d7b -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history am: 99e7f42615 -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history am: d17b510007 -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history am: 00863947cf -s ours
am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history

Change-Id: Icb1fb78aa56e87f63381e0b0772e544cbcaed4f6
2019-12-12 01:37:30 +00:00
Automerger Merge Worker
00863947cf [automerger skipped] Merge changes Iaa78a7ed,I6497b7ef into pi-dev am: 6e79d000ab -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history am: 9f25649d7b -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history am: 99e7f42615 -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history am: d17b510007 -s ours
am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history

Change-Id: I761abdcdb86884e89f40ce6e616d77235a76cc7a
2019-12-12 01:19:50 +00:00
Automerger Merge Worker
d17b510007 [automerger skipped] Merge changes Iaa78a7ed,I6497b7ef into pi-dev am: 6e79d000ab -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history am: 9f25649d7b -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history am: 99e7f42615 -s ours
am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history

Change-Id: I72c045aeeb3c516a286ad5ef6413fb227019a299
2019-12-12 01:00:30 +00:00
Automerger Merge Worker
99e7f42615 [automerger skipped] Merge changes Iaa78a7ed,I6497b7ef into pi-dev am: 6e79d000ab -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history am: 9f25649d7b -s ours
am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history

Change-Id: I33d00fde7d89d4cd84876bc982c6b28fa95287f5
2019-12-12 00:38:49 +00:00
Automerger Merge Worker
9f25649d7b [automerger skipped] Merge changes Iaa78a7ed,I6497b7ef into pi-dev am: 6e79d000ab -s ours
am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 caefc43336 is in history

Change-Id: I92c1131ef02f7ca5e399b47c62993cf28719b66a
2019-12-12 00:17:28 +00:00
Lorenzo Colitti
837030aaa7 Support strict mode private DNS on VPNs that provide Internet.
Currently, strict mode private DNS does not work on VPNs because
NetworkMonitor does not validate VPNs. When a VPN connects, it
immediately transitions to ValidatedState, skipping private DNS
hostname resolution.

This change makes NetworkMonitor perform private DNS hostname
resolution and evaluation even on VPNs.

In order to ensure that the system always immediately switches to
the VPN as soon as it connects, remove the unvalidated penalty
for VPN networks. This ensures that the VPN score is always 101
and the VPN always outscores other networks as soon as it
connects. Previously, it would only outscore other networks
when no-op validation completed.

Backport of 1a26465d92.

Bug: 122652057
Test: atest FrameworksNetTests
Test: manually ran a VPN with private DNS in strict mode
Test: atest android.net.cts.ConnectivityManagerTest com.android.cts.net.HostsideVpnTests
Change-Id: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
Merged-In: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
2019-12-11 20:19:40 +09:00
Lorenzo Colitti
41417ca64a Add test coverage for strict mode private DNS.
Support faking out the DNS lookups used by NetworkMonitor to
resolve strict mode DNS, and add more test coverage.

These tests were partly adapted from tests we have in Q but
also contain new coverage. This is because in Q the interface
between ConnectivityService and NetworkMonitor changed
substantially, and it is impractical to backport
NetworkMonitorTest.

Bug: 122652057
Test: atest FrameworksNetTests
Change-Id: I6497b7efa539267576d38d3036eef0af0df4e9cb
Merged-In: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
2019-12-11 20:19:29 +09:00
Automerger Merge Worker
b68295262b Merge changes Ibebdae14,I0c097e77,I6c889b15,I4771f2e9,I2a52f7f4 am: b24e34c19b am: e0571b8680 am: dd8ef77c1c
Change-Id: Ibec3f2ac8b0860d4be316da284c5535b8722cbe2
2019-12-11 04:59:42 +00:00
Automerger Merge Worker
dd8ef77c1c Merge changes Ibebdae14,I0c097e77,I6c889b15,I4771f2e9,I2a52f7f4 am: b24e34c19b am: e0571b8680
Change-Id: Ie95647b87b89337a7556f46ebf1fb577677959bf
2019-12-11 04:38:04 +00:00
Chalard Jean
e0571b8680 Merge changes Ibebdae14,I0c097e77,I6c889b15,I4771f2e9,I2a52f7f4
am: b24e34c19b

Change-Id: I8162ce9e5b1cb813d2b50325cc3a986d6a846a65
2019-12-10 20:13:20 -08:00
Chalard Jean
b9c0272643 [NS A23.1] Minor cleanup
The argument is always true.

Test: ConnectivityServiceTest
Change-Id: Ibebdae14e63e6baf74db054038ee575ec462f6d5
2019-12-10 14:15:15 +09:00
Chalard Jean
8ffefbac16 [NS A23] Move a synchronized block in a central place
As the calls to this apparently need to be synchronized, let's
do it all in the same place instead of in all callers

Test: FrameworksNetTests
Change-Id: I0c097e7756fc155ba0243834b84626e86c68340e
2019-12-10 14:15:14 +09:00
Chalard Jean
ec70c4f03e [NS A22] Small refactoring
The point of this is to be able to move parts of processListenRequests
independently.

Test: FrameworksNetTests
Change-Id: I6c889b15696123c1120221977b0f36fa3d91de56
2019-12-10 14:15:14 +09:00
Chalard Jean
fa8105ac33 [NS A21] More cleanup
Test: FrameworksNetTests NetworkStackTests
Change-Id: I4771f2e9151ff16a7045d9c3025ac686f244b22d
2019-12-10 14:15:14 +09:00
Chalard Jean
1c89b21fca [NS A20] Cleanup
A lot of this code can't be triggered at all.
• newNetwork.created in l.6488 is implied by newNetwork.everConnected
  in l.6357
• !newNetwork.isVPN() in l.6488 is implied by the fact that VPNs are
  always foreground, so oldPermission can't != newPermission in l.6488
• updateUids in l.6502 is useless because uids can't change during a
  rematch (because there is no code doing that). Metered state and
  roaming state similarly can't change during a rematch, so
  meteredChanged and roamingChanged are always false
• updateAllVpnCapabilities in l.6537 is useless because VPN do not
  inherit the foreground state of their underlying networks, which
  would be the only reason to call that in l.6537
• Object.equals() in l.6480 is necessary false because at this line
  it is known that the foreground state has changed, which must have
  caused the NET_CAPABILITY_FOREGROUND to be different, so the objects
  can't be equal

Test: FrameworksNetTests NetworkStackTest
Change-Id: I2a52f7f4a085f3eea22a1dd170af8f04671250ff
2019-12-10 14:14:57 +09:00
Jeffrey Huang
e74b48200b Merge "Rename writeToProto to be dumpDebug" 2019-12-06 18:53:15 +00:00
lucaslin
b32eba5c27 Merge "Remove incorrect annotation - @TransportType" am: 644939bad5 am: b116ed1751
am: 817eb87936

Change-Id: Ib551ea9fbdfd0a927c4570560ba74148e43453c1
2019-12-06 01:02:15 -08:00
lucaslin
817eb87936 Merge "Remove incorrect annotation - @TransportType" am: 644939bad5
am: b116ed1751

Change-Id: Ia82a146de1afadcc415ba69fd5cf01480332b37f
2019-12-05 21:01:12 -08:00
lucaslin
b116ed1751 Merge "Remove incorrect annotation - @TransportType"
am: 644939bad5

Change-Id: I99b74e5e67f5ff6f8d35f627e2c40ef4ca001c0c
2019-12-05 20:57:08 -08:00
Treehugger Robot
644939bad5 Merge "Remove incorrect annotation - @TransportType" 2019-12-06 04:50:27 +00:00
lucaslin
7ff9ed145a Remove incorrect annotation - @TransportType
This annotation is mis-adding by aosp/929879, and now it also
makes compilation failure for Telephony Mainline.

Bug: 145755373
Test: atest FrameworksNetTests
Change-Id: Ic22ce6bf17c4300b8cd52217976bfb215a123f68
2019-12-06 11:17:25 +08:00
Jeffrey Huang
a8e97d4f95 Rename writeToProto to be dumpDebug
We want to eventually migrate some of these APIs to be @SystemApi for mainline modules.
The #dumpDebug name is more appropriate than #writeToProto.

Bug: 142279786
Test: Manual
Change-Id: I60793e91cedf6b720d4ecef6a8484f4fed4ff30f
2019-12-05 11:28:11 -08:00
markchien
b77e80bff5 Merge "Expose netId to SystemApi" am: cec4a7df3a am: bd154aca0c
am: bafe3cfffb

Change-Id: I4dce3a699666c8f75e028b7dc2e196ca0b44b41c
2019-12-05 00:43:27 -08:00
markchien
bafe3cfffb Merge "Expose netId to SystemApi" am: cec4a7df3a
am: bd154aca0c

Change-Id: I23f6428954d08761d9671b419887d58dd29171fd
2019-12-04 18:39:46 -08:00
markchien
bd154aca0c Merge "Expose netId to SystemApi"
am: cec4a7df3a

Change-Id: I930b421d373ac67ec5987b9440a45e6dbc536074
2019-12-04 18:35:41 -08:00
Treehugger Robot
cec4a7df3a Merge "Expose netId to SystemApi" 2019-12-05 02:29:41 +00:00
Automerger Merge Worker
c50746d76b [automerger skipped] Merge "Replace the permission of internal connectivity checks" am: af0a3e0525 am: 638ce2d8ca -s ours
am skip reason: Change-Id I8f2dd1cd0609056494eaf612d39820e273ae093f with SHA-1 ec0a963cea is in history

Change-Id: Ib7fe99ba9f914d33da3145b926568bcbe418e6b2
2019-12-04 20:01:55 +00:00
Automerger Merge Worker
9efe42a177 Merge changes Ie756b9aa,I38110f3a am: 810e743c54 am: 8324d9830c
Change-Id: I884650a0a0fbf1a96f81ca927886eb2a563f4e28
2019-12-04 19:56:21 +00:00
Automerger Merge Worker
7f652ab276 Merge "Merge Android10 QPR1 into AOSP master" am: d6c8feb116 am: 8f18d75101
Change-Id: Ia31d8ba0396b6a5bf63863b4318b7543283851b2
2019-12-04 16:58:08 +00:00
Paul Hu
638ce2d8ca Merge "Replace the permission of internal connectivity checks" am: af0a3e0525
am: f7534cc2df

Change-Id: I461936789b24940cc81146e9d0fc6c4c455206ed
2019-12-04 08:51:28 -08:00
Chalard Jean
8324d9830c Merge changes Ie756b9aa,I38110f3a am: 810e743c54
am: 42ba28f18f

Change-Id: I8695507cb084a198308b5765bc8fb873ca3f6a30
2019-12-04 08:50:54 -08:00
Xin Li
8f18d75101 Merge "Merge Android10 QPR1 into AOSP master" am: d6c8feb116
am: 6ce75bed7f

Change-Id: I3bf58b1afbff9e0a40106771a9f389b1e2c1b940
2019-12-04 08:09:19 -08:00
markchien
931b4fae18 Expose netId to SystemApi
Tethering will be build as unblundled APP. It can't use @hide
API anymore. Expose netId for tethering because it need to set
proxy dns server with netId.

Bug: 144758139
Test: build
Change-Id: Ifefa791940874617bb479f5c23488d14be87f45e
2019-12-04 14:33:51 +08:00
Paul Hu
f7534cc2df Merge "Replace the permission of internal connectivity checks"
am: af0a3e0525

Change-Id: I5bb6a6074a2ac08f04147d415fb1d2bfbd411850
2019-12-03 22:04:50 -08:00
Paul Hu
af0a3e0525 Merge "Replace the permission of internal connectivity checks" 2019-12-04 05:59:59 +00:00
Paul Hu
dd32fc08e7 Merge "Replace the permission of internal connectivity checks" 2019-12-04 05:52:01 +00:00
paulhu
ec0a963cea Replace the permission of internal connectivity checks
A number of connectivity checks that protect system-only methods
check for CONNECTIVITY_INTERNAL, but CONNECTIVITY_INTERNAL is a
signature|privileged permission. We should audit the permission
checks, and convert checks that protect code that should not be
called outside the system to a signature permission. So replace
all CONNECTIVITY_INTERNAL to other proper permissions.

Bug: 32963470
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Change-Id: I8f2dd1cd0609056494eaf612d39820e273ae093f
2019-12-04 11:45:51 +08:00
paulhu
d70b7dd6e3 Replace the permission of internal connectivity checks
A number of connectivity checks that protect system-only methods
check for CONNECTIVITY_INTERNAL, but CONNECTIVITY_INTERNAL is a
signature|privileged permission. We should audit the permission
checks, and convert checks that protect code that should not be
called outside the system to a signature permission. So replace
all CONNECTIVITY_INTERNAL to other proper permissions.

Bug: 32963470
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Change-Id: I8f2dd1cd0609056494eaf612d39820e273ae093f
Merged-In: I8f2dd1cd0609056494eaf612d39820e273ae093f
2019-12-04 11:44:45 +08:00
Chalard Jean
42ba28f18f Merge changes Ie756b9aa,I38110f3a
am: 810e743c54

Change-Id: I69e6c9234f0a983a56ee19d4d4dfe97618dc8f56
2019-12-03 18:18:53 -08:00
Treehugger Robot
810e743c54 Merge changes Ie756b9aa,I38110f3a
* changes:
  [NS A19] Inline updateCapabilities in rematch.
  [NS A18] Reverse listens and request-availables
2019-12-04 02:07:45 +00:00
Xin Li
6ce75bed7f Merge "Merge Android10 QPR1 into AOSP master"
am: d6c8feb116

Change-Id: I3b2912dffdd5be501077c9983bb922ee7a3767d1
2019-12-03 16:09:13 -08:00
Treehugger Robot
d6c8feb116 Merge "Merge Android10 QPR1 into AOSP master" 2019-12-03 23:15:02 +00:00
Automerger Merge Worker
7465ce4923 Merge "Disable a flaky test" am: 932dda858a am: 18946e3c78
Change-Id: Ia3596b558fb09600e7d9a16f0dce03d4402ee653
2019-12-03 16:51:32 +00:00
Chalard Jean
18946e3c78 Merge "Disable a flaky test" am: 932dda858a
am: cee0905447

Change-Id: Ie1fccb536e6df45491139ead179e8f5c2127d98f
2019-12-03 08:38:00 -08:00
Chalard Jean
cee0905447 Merge "Disable a flaky test"
am: 932dda858a

Change-Id: I8a6fc40976c6ab234cabd4af37dc4a530e2b47a1
2019-12-03 08:30:03 -08:00
Chalard Jean
b04416ea86 Disable a flaky test
Bug: 145513323
Test: FrameworkNetTests
Change-Id: I66e02fdaab2969b77db4a0f0e6fb8b1a981d9350
2019-12-03 16:13:22 +09:00