Commit Graph

7607 Commits

Author SHA1 Message Date
Automerger Merge Worker
0b0d019da8 Merge "Fix parceling of LinkProperties Inet6Addr" am: 87c9d38d1e am: c7e09e3c83
Change-Id: Ie5b7782d788717dd1cc440e502d6cdf2d1c18eaa
2019-12-19 03:29:50 +00:00
Remi NGUYEN VAN
c7e09e3c83 Merge "Fix parceling of LinkProperties Inet6Addr"
am: 87c9d38d1e

Change-Id: I7e4de0ecf06d34f050a881250755c8c0456269fc
2019-12-18 19:12:04 -08:00
Remi NGUYEN VAN
87c9d38d1e Merge "Fix parceling of LinkProperties Inet6Addr" 2019-12-19 03:07:43 +00:00
Remi NGUYEN VAN
e50cd96c1d Fix parceling of LinkProperties Inet6Addr
IPv6 addresses parceled for DNS servers, private DNS servers, PCSCF
servers were parceled without the scope. This causes issues with
link-local DNS servers.

Test: atest FrameworksNetTests
Bug: 145181158
Change-Id: I0ed24e51d4d0656f4a1f932b5e9f646b35b4b971
2019-12-18 19:52:30 +09:00
Automerger Merge Worker
cc268504d4 Merge changes from topic "dec13_netrevert" am: 0a4f7921d9 am: 7e3ef8f227
Change-Id: I9f6e7079d8e5d2e978ba618800c98df6e19e022b
2019-12-14 08:20:21 +00:00
Andrew Chant
7e3ef8f227 Merge changes from topic "dec13_netrevert"
am: 0a4f7921d9

Change-Id: I45543535ee0a394adcb4474ae51a0ce803c01f33
2019-12-14 00:06:02 -08:00
Andrew Chant
0a4f7921d9 Merge changes from topic "dec13_netrevert"
* changes:
  Revert "[NS A24] Add an object to represent changes in assignment"
  Revert "[NS A25] Send all listen callbacks after all rematches"
  Revert "[NS A26] Move available callbacks out of the rematch computation"
  Revert "[NS A27] Remove useless logs and a useless var"
2019-12-14 07:10:08 +00:00
Andrew Chant
7d3990ae93 Revert "[NS A24] Add an object to represent changes in assignment"
This reverts commit a662979e97.

Reason for revert: Toggling wifi on/off causes networking to
 stop working with these four patches applied.
Bug: 146230156

Change-Id: Ie0217796c89abf0dc86e6a4f8324811155dc57cd
2019-12-14 03:35:07 +00:00
Andrew Chant
d717818353 Revert "[NS A25] Send all listen callbacks after all rematches"
This reverts commit 65f5a26b8d.

Reason for revert: Toggling wifi on/off causes networking to
 stop working with these four patches applied.
Bug: 146230156

Change-Id: Icd368df5ef76991dd2b4c1fa530cbc5fae2f61fa
2019-12-14 03:33:51 +00:00
Andrew Chant
e0daff0d95 Revert "[NS A26] Move available callbacks out of the rematch computation"
This reverts commit 17d97920bd.

Reason for revert: Toggling wifi on/off causes networking to
 stop working with these four patches applied.
Bug: 146230156

Change-Id: I9af7f8b9af1a6279f2b9f1249824da705164c6b5
2019-12-14 03:32:41 +00:00
Andrew Chant
cbdb845cb3 Revert "[NS A27] Remove useless logs and a useless var"
This reverts commit 3032de9f8d.

Reason for revert: Toggling wifi on/off causes networking to
 stop working with these four patches applied.
Bug: 146230156

Change-Id: I6c75ac179bcc08cc5979194eea69525b333e2ba7
2019-12-14 03:31:20 +00:00
Automerger Merge Worker
11790971c8 Merge changes I4b793e86,I6f86add0,I2db9535b,I703db6d3 am: a8ebfc4584 am: c437a40578
Change-Id: Ib7b7179a2cff581f7187293880edc1163756cf06
2019-12-13 08:18:12 +00:00
Chalard Jean
c437a40578 Merge changes I4b793e86,I6f86add0,I2db9535b,I703db6d3
am: a8ebfc4584

Change-Id: Ic4317f9edf1ca8a1d9d47f53805c57a6ed63ba65
2019-12-13 00:09:32 -08:00
Chalard Jean
a8ebfc4584 Merge changes I4b793e86,I6f86add0,I2db9535b,I703db6d3
* changes:
  [NS A27] Remove useless logs and a useless var
  [NS A26] Move available callbacks out of the rematch computation
  [NS A25] Send all listen callbacks after all rematches
  [NS A24] Add an object to represent changes in assignment
2019-12-13 06:50:36 +00:00
Automerger Merge Worker
5df08737ab Merge "Fix a doc" am: 1b4557a225 am: 4c0a5e30fd
Change-Id: I774c526b9fd7ae58ec690438e7de7fb532cd555f
2019-12-12 14:27:33 +00:00
Chalard Jean
4c0a5e30fd Merge "Fix a doc"
am: 1b4557a225

Change-Id: Ic8624437203122ffb9fd6a3d07b8abe335cb68e9
2019-12-12 06:23:11 -08:00
Chalard Jean
1b4557a225 Merge "Fix a doc" 2019-12-12 14:15:28 +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
945f2484a6 Fix a doc
Test: FrameworksNetTests
Change-Id: I5c9aeb627d9f22aa84bc134b6c7d3c15f237a775
2019-12-12 13:56:13 +09:00
Chalard Jean
3032de9f8d [NS A27] Remove useless logs and a useless var
These logs haven't found a bug in a long time and we now have
some structural guarantees that the conditions they check for
can't happen (like the checks that everything is happening on
the same thread).
Maybe we'll reinstate similar checks later, but for now they
are in the way and removing them is a small sacrifice for the
intended benefit.

The local was simply not used any more.

Test: FrameworksNetTests
Change-Id: I4b793e86039c204a038c1b0fecbf8a4927eef48d
2019-12-12 13:55:32 +09:00
Chalard Jean
17d97920bd [NS A26] Move available callbacks out of the rematch computation
Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: I6f86add0ccde221c22436ac1995ef6064b3ca69e
2019-12-12 13:55:32 +09:00
Chalard Jean
65f5a26b8d [NS A25] Send all listen callbacks after all rematches
Bug: 113554781
Test: ConnectivityServiceTests NetworkStackTests
Change-Id: I2db9535b1d72edd46b968b1bae66b148aa815235
2019-12-12 13:55:31 +09:00
Chalard Jean
a662979e97 [NS A24] Add an object to represent changes in assignment
Test: ConnectivityServiceTest
Change-Id: I703db6d3f039bd67a90fad0eadffc6cfed9a50ee
2019-12-12 13:21:43 +09: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
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
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
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
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
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