Commit Graph

8097 Commits

Author SHA1 Message Date
Automerger Merge Worker
814bfc5c14 Merge changes from topic "dec13_netrevert" am: 9ea156af87 am: 5ca4b7fbf7
Change-Id: I9f6e7079d8e5d2e978ba618800c98df6e19e022b
2019-12-14 08:20:21 +00:00
Andrew Chant
5ca4b7fbf7 Merge changes from topic "dec13_netrevert"
am: 9ea156af87

Change-Id: I45543535ee0a394adcb4474ae51a0ce803c01f33
2019-12-14 00:06:02 -08:00
Andrew Chant
9ea156af87 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
6b569b2d62 Revert "[NS A24] Add an object to represent changes in assignment"
This reverts commit c375dccad3.

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
9e299b5f30 Revert "[NS A25] Send all listen callbacks after all rematches"
This reverts commit b56e56916f.

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
6f9f854916 Revert "[NS A26] Move available callbacks out of the rematch computation"
This reverts commit be083a195f.

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
06a8edd342 Revert "[NS A27] Remove useless logs and a useless var"
This reverts commit dbb4dff52e.

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
Aaron Huang
5a916810c6 Add keepalive related methods and fields to system APIs
Add KeepalivePacketData to system API for mainline support.
Also, remove InvalidPacketException class from SocketKeepalive
and create a new InvalidPacketException class in android.net

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest FrameworksNetTests
      atest NetworkStackTests
      atest FrameworksTelephonyTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
      atest android.net.cts
      atest android.net.wifi.cts
      atest android.telephony.cts

Change-Id: I2d982e8abb5cb6b4c74a20483550b18cf814320d
2019-12-13 23:05:37 +08:00
Automerger Merge Worker
e53ad944a0 Merge changes I4b793e86,I6f86add0,I2db9535b,I703db6d3 am: ff54f522a6 am: 149ad76a9a am: e4b05fdcb6
Change-Id: Ic7da17d474c2d699bd0053547698840b5d87972d
2019-12-13 08:38:04 +00:00
Automerger Merge Worker
e4b05fdcb6 Merge changes I4b793e86,I6f86add0,I2db9535b,I703db6d3 am: ff54f522a6 am: 149ad76a9a
Change-Id: Ib7b7179a2cff581f7187293880edc1163756cf06
2019-12-13 08:18:12 +00:00
Chalard Jean
149ad76a9a Merge changes I4b793e86,I6f86add0,I2db9535b,I703db6d3
am: ff54f522a6

Change-Id: Ic4317f9edf1ca8a1d9d47f53805c57a6ed63ba65
2019-12-13 00:09:32 -08:00
Chalard Jean
ff54f522a6 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
424ed576d2 Merge "Fix a doc" am: dc98e9be4c am: 082a268952 am: 70c582b46d
Change-Id: Id95b0c48ad7813ba31f2faad79600affc4856b95
2019-12-12 14:38:32 +00:00
Automerger Merge Worker
70c582b46d Merge "Fix a doc" am: dc98e9be4c am: 082a268952
Change-Id: I774c526b9fd7ae58ec690438e7de7fb532cd555f
2019-12-12 14:27:33 +00:00
Chalard Jean
082a268952 Merge "Fix a doc"
am: dc98e9be4c

Change-Id: Ic8624437203122ffb9fd6a3d07b8abe335cb68e9
2019-12-12 06:23:11 -08:00
Chalard Jean
dc98e9be4c Merge "Fix a doc" 2019-12-12 14:15:28 +00:00
Automerger Merge Worker
2d41a6ebe6 Merge "Make getNetworkSpecifier() public API." am: ad60ef88e0 am: c0f993bb04 am: f5d13c5ac5
Change-Id: I73894e4236dc5660f2eb54be3d48aa7359822947
2019-12-12 12:47:00 +00:00
Automerger Merge Worker
f5d13c5ac5 Merge "Make getNetworkSpecifier() public API." am: ad60ef88e0 am: c0f993bb04
Change-Id: I884c4e4c9ed891594845d599358f19f4a8e2ad60
2019-12-12 12:26:06 +00:00
Chalard Jean
c0f993bb04 Merge "Make getNetworkSpecifier() public API."
am: ad60ef88e0

Change-Id: I92d0b7cb179e1c0f5cb789c2c668254732fbf30a
2019-12-12 04:04:32 -08:00
Chalard Jean
2e3154435f Fix a doc
Test: FrameworksNetTests
Change-Id: I5c9aeb627d9f22aa84bc134b6c7d3c15f237a775
2019-12-12 13:56:13 +09:00
Chalard Jean
dbb4dff52e [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
be083a195f [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
b56e56916f [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
c375dccad3 [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
294ebbbad8 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
c248b51a2d [automerger skipped] Merge changes Iaa78a7ed,I6497b7ef into pi-dev am: 6e79d000ab -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history am: f729c28373 -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history am: 2e194c28b0 -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history am: 422245cbac -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history am: 2ef66a8e66 -s ours
am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history

Change-Id: Icb1fb78aa56e87f63381e0b0772e544cbcaed4f6
2019-12-12 01:37:30 +00:00
Automerger Merge Worker
2ef66a8e66 [automerger skipped] Merge changes Iaa78a7ed,I6497b7ef into pi-dev am: 6e79d000ab -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history am: f729c28373 -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history am: 2e194c28b0 -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history am: 422245cbac -s ours
am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history

Change-Id: I761abdcdb86884e89f40ce6e616d77235a76cc7a
2019-12-12 01:19:50 +00:00
Automerger Merge Worker
422245cbac [automerger skipped] Merge changes Iaa78a7ed,I6497b7ef into pi-dev am: 6e79d000ab -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history am: f729c28373 -s ours am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history am: 2e194c28b0 -s ours
am skip reason: Change-Id Iaa78a7edcf23755c89d7b354edbc28d37d74d891 with SHA-1 9ff61e4948 is in history

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

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

Change-Id: I92c1131ef02f7ca5e399b47c62993cf28719b66a
2019-12-12 00:17:28 +00:00
Lorenzo Colitti
b316f633e5 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 c455822846.

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
7c9b1c757a 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
01e6f6a35b Merge changes Ibebdae14,I0c097e77,I6c889b15,I4771f2e9,I2a52f7f4 am: b24e34c19b am: 8d934b3aac am: edf230a28c
Change-Id: Ibec3f2ac8b0860d4be316da284c5535b8722cbe2
2019-12-11 04:59:42 +00:00
Automerger Merge Worker
edf230a28c Merge changes Ibebdae14,I0c097e77,I6c889b15,I4771f2e9,I2a52f7f4 am: b24e34c19b am: 8d934b3aac
Change-Id: Ie95647b87b89337a7556f46ebf1fb577677959bf
2019-12-11 04:38:04 +00:00
Chalard Jean
8d934b3aac Merge changes Ibebdae14,I0c097e77,I6c889b15,I4771f2e9,I2a52f7f4
am: b24e34c19b

Change-Id: I8162ce9e5b1cb813d2b50325cc3a986d6a846a65
2019-12-10 20:13:20 -08:00
Chalard Jean
05cbe97f28 [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
05edd05f53 [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
cd397a2042 [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
1123f5d067 [NS A21] More cleanup
Test: FrameworksNetTests NetworkStackTests
Change-Id: I4771f2e9151ff16a7045d9c3025ac686f244b22d
2019-12-10 14:15:14 +09:00
Chalard Jean
5c4bddb8cd [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
ff20677c23 Merge "Rename writeToProto to be dumpDebug" 2019-12-06 18:53:15 +00:00
lucaslin
57f8ed7867 Merge "Remove incorrect annotation - @TransportType" am: ac81b72e22 am: 26468789ea
am: 70c11a69ac

Change-Id: Ib551ea9fbdfd0a927c4570560ba74148e43453c1
2019-12-06 01:02:15 -08:00
lucaslin
70c11a69ac Merge "Remove incorrect annotation - @TransportType" am: ac81b72e22
am: 26468789ea

Change-Id: Ia82a146de1afadcc415ba69fd5cf01480332b37f
2019-12-05 21:01:12 -08:00
lucaslin
26468789ea Merge "Remove incorrect annotation - @TransportType"
am: ac81b72e22

Change-Id: I99b74e5e67f5ff6f8d35f627e2c40ef4ca001c0c
2019-12-05 20:57:08 -08:00
Treehugger Robot
ac81b72e22 Merge "Remove incorrect annotation - @TransportType" 2019-12-06 04:50:27 +00:00
lucaslin
387ce1a837 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
3d97148418 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
be1810eddd Merge "Expose netId to SystemApi" am: ed2644bf65 am: 4127bbc6bf
am: 25797f3843

Change-Id: I4dce3a699666c8f75e028b7dc2e196ca0b44b41c
2019-12-05 00:43:27 -08:00
markchien
25797f3843 Merge "Expose netId to SystemApi" am: ed2644bf65
am: 4127bbc6bf

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

Change-Id: I930b421d373ac67ec5987b9440a45e6dbc536074
2019-12-04 18:35:41 -08:00