Commit Graph

8468 Commits

Author SHA1 Message Date
Cody Kesting
5ec743bd25 Merge "Add support for registering test networks with administrators." 2020-03-16 18:02:55 +00:00
Automerger Merge Worker
e13e8da1c8 Merge "Replace com.android.internal.util.Preconditions.checkNotNull with java.util.Objects.requireNonNull" am: b303fc5222 am: ad7408a4e6
Change-Id: I4f4cc6289b598c5c2af24cc1b3d68dcc643c6d93
2020-03-16 17:42:52 +00:00
Automerger Merge Worker
ad7408a4e6 Merge "Replace com.android.internal.util.Preconditions.checkNotNull with java.util.Objects.requireNonNull" am: b303fc5222
Change-Id: Ibcfc11f90c8caa34954db73f668ca35a34c50e8d
2020-03-16 17:27:39 +00:00
Cody Kesting
b303fc5222 Merge "Replace com.android.internal.util.Preconditions.checkNotNull with java.util.Objects.requireNonNull" 2020-03-16 17:11:54 +00:00
Lorenzo Colitti
2c74e66034 Ensure that NetworkFactory objects cannot be reused.
NetworkFactory is turning into a one-time object that cannot be
re-used. Check for this in ConnectivityService.

Bug: 148635501
Test: test continues to pass
Change-Id: I793436ee0f4b5d778788ad34b8a2575d2ad0ed80
Merged-In: I793436ee0f4b5d778788ad34b8a2575d2ad0ed80
2020-03-17 01:39:23 +09:00
Automerger Merge Worker
a46d20bb30 Merge "Protect ConnectivityService from SecurityException in permission check." am: ed459f5f1a am: 26cb0b40bf
Change-Id: I7027d7111aeed8ec5835c3dcf0ef5d24046d4b8b
2020-03-16 14:54:07 +00:00
Automerger Merge Worker
26cb0b40bf Merge "Protect ConnectivityService from SecurityException in permission check." am: ed459f5f1a
Change-Id: I30d993e431b9d6486dcaebdc48c525a861301f70
2020-03-16 14:47:49 +00:00
Cody Kesting
ed459f5f1a Merge "Protect ConnectivityService from SecurityException in permission check." 2020-03-16 14:33:25 +00:00
Automerger Merge Worker
59c84d0a3e Merge changes I801ddc49,Id1b8f41b am: ba350f4652 am: dc9aa00cb7
Change-Id: Ibc0b7c74ce55198fc6804b5cf1ea414aad912a4f
2020-03-16 11:56:19 +00:00
Automerger Merge Worker
dc9aa00cb7 Merge changes I801ddc49,Id1b8f41b am: ba350f4652
Change-Id: I604bcfab22d7b26b84bf126d02d9be612fcb6d29
2020-03-16 11:41:19 +00:00
Aaron Huang
b782017f20 Removing some of the API don't have to be @SystemApi
Some of the API we made @SystemApi won't be used by mainline
module. Removing these from the surface.

Bug: 151266974
Test: atest FrameworksNetTests
      atest FrameworksTelephonyTests
      atest FrameworksWifiTests

Change-Id: Ie30efa172f93a7557fb6ef56f4daf80e958c3787
Merged-In: Ie30efa172f93a7557fb6ef56f4daf80e958c3787
2020-03-16 17:39:41 +08:00
junyulai
cc38304ad8 [SP24] Rename functions that add Entry unconditionally
Currently, in NetworkStats, there are many methods to manipulate
the records. However, some methods are similar and ambiguous,
such as addEntry, addValues, setValues, addIfaceValues,
combineValues and combineAllValues.

Thus, properly grouping and renaming methods are necessary.
In this change, for methods that add one record unconditionally,
name them insertEntry.
  setIfaceValues -> insertEntry
  addEntry -> insertEntry

Test: atest FrameworksNetTests ImsPhoneCallTrackerTest TetheringTests
Test: m doc-comment-check-docs
Bug: 148895143
Change-Id: I801ddc49e283a254b9586700c9b597c0adb0d459
2020-03-16 14:27:45 +08:00
Automerger Merge Worker
9859cf437c Merge "[SP21] Address comments for API council review about aosp/1172143" am: 24ab7411ba am: c01d9f8266
Change-Id: If460ba88094d078d48819d074678c5580ca65fc0
2020-03-16 03:14:17 +00:00
Automerger Merge Worker
c339a871d6 [SP21] Address comments for API council review about aosp/1172143 am: 0c88795cb5 am: 1b7fe1b6f7
Change-Id: Ia5e64eb524a852539850f46df87a6b28d4910cbc
2020-03-16 03:13:45 +00:00
Automerger Merge Worker
c01d9f8266 Merge "[SP21] Address comments for API council review about aosp/1172143" am: 24ab7411ba
Change-Id: Ief866c87b9e69b892fca435e8555080ffdad4af7
2020-03-16 03:05:06 +00:00
Automerger Merge Worker
1b7fe1b6f7 [SP21] Address comments for API council review about aosp/1172143 am: 0c88795cb5
Change-Id: I8634d6f6ed65ec6b10009a90b147881fe1fc4530
2020-03-16 03:03:51 +00:00
Junyu Lai
24ab7411ba Merge "[SP21] Address comments for API council review about aosp/1172143" 2020-03-16 02:41:19 +00:00
Roshan Pius
fae5822946 services.net: Add a static library needed by wifi module
Add a new static library that compiles against system_current which
includes all the parts needed by the wifi mainline module.

Also,
a) Refactored TcpKeepalivePacketData to use public APIs. The parcel
read/write methods in the base class are @hide and they're not used by
the other child class (NatKeepalivePacketData). So, remove the @hide
method from base class and use it direcly in the child class.

Bug: 145825329
Test: Device boots up & connects to wifi networks.
Change-Id: Ifde69b579cfe5b813766f676acb10e436e64a44c
Merged-In: Ifde69b579cfe5b813766f676acb10e436e64a44c
2020-03-16 00:23:42 +00:00
Automerger Merge Worker
65ec5c1f76 Merge "Resolve ambiguous argument." am: 16cad96e9f am: 79a0b0096d
Change-Id: I32bca87c4453bd491611ce6c5d95da5b66e45aab
2020-03-14 04:13:49 +00:00
Automerger Merge Worker
79a0b0096d Merge "Resolve ambiguous argument." am: 16cad96e9f
Change-Id: I4c03bb6d16127929f4d60aa071aee18e8ac4c669
2020-03-14 03:52:51 +00:00
Chalard Jean
16cad96e9f Merge "Resolve ambiguous argument." 2020-03-14 03:38:01 +00:00
Automerger Merge Worker
464939aa5c Merge "Update Javadoc comments for ConnectivityDiagnostics constants." am: 0b6dd36a52 am: 438f8bbe71
Change-Id: I5e9af3351e6386e09319c8ac049a2700368b7ed3
2020-03-13 19:48:36 +00:00
Automerger Merge Worker
438f8bbe71 Merge "Update Javadoc comments for ConnectivityDiagnostics constants." am: 0b6dd36a52
Change-Id: I279519ca5013c4109dee9f6860852d9b3a70776a
2020-03-13 19:34:01 +00:00
Cody Kesting
0b6dd36a52 Merge "Update Javadoc comments for ConnectivityDiagnostics constants." 2020-03-13 19:09:18 +00:00
Chalard Jean
a7cc6d8eee Resolve ambiguous argument.
CTS tests don't have access to TestNetworkAgent and therefore
require overloading this method, which means 'null' is ambiguous.

Bug: 139268426
Test: FrameworksNetTests
Change-Id: I9279718bde30bd98eff901921fb3411d22da72e5
2020-03-13 21:17:33 +09:00
Automerger Merge Worker
bd67f2f4eb Merge "Remove redundant connected notification" am: 62b8d6f24d am: b9a08a4645
Change-Id: I5673cf68e12b1f9bcbd368437504952991371d09
2020-03-13 07:48:19 +00:00
Automerger Merge Worker
b9a08a4645 Merge "Remove redundant connected notification" am: 62b8d6f24d
Change-Id: I7e52f81e6b1d98480f9c851d861fa00a98729c6c
2020-03-13 07:30:45 +00:00
Treehugger Robot
62b8d6f24d Merge "Remove redundant connected notification" 2020-03-13 07:10:13 +00:00
Automerger Merge Worker
28fe008d57 Merge "Add test for NetworkAgentConfig" am: d4db72dbfc am: d08a6c4ec9
Change-Id: I5a93f786545cb1df9c84b339657e2f9a803b7853
2020-03-13 04:44:46 +00:00
Automerger Merge Worker
d08a6c4ec9 Merge "Add test for NetworkAgentConfig" am: d4db72dbfc
Change-Id: I00936490e096c54cebc408a899a18c1dbf9e93ea
2020-03-13 04:32:04 +00:00
Aaron Huang
d4db72dbfc Merge "Add test for NetworkAgentConfig" 2020-03-13 04:13:04 +00:00
Roshan Pius
e072ca8b35 services.net: Use the new ModuleNetworkStackClient
Use the new ModuleNetworkStackClient to retrieve instances IpMemoryStore
& IpClient.

Bug: 145825329
Test: Compiles
Change-Id: I065525fdbd64b9509ef0f47bb35954d267c65fd2
Merged-In: I065525fdbd64b9509ef0f47bb35954d267c65fd2
2020-03-12 18:55:31 -07:00
junyulai
0c88795cb5 [SP21] Address comments for API council review about aosp/1172143
Test: atest FrameworksNetTests ImsPhoneCallTrackerTest
Test: atest TetheringTests NetworkStackTests
Test: m doc-comment-check-docs
Fix: 148552904

Change-Id: I141393f229e772d2eb9f7c156849e379bd71b845
2020-03-12 21:34:17 +08:00
lucaslin
9e90c02511 Add version check to prevent test fail on Android Q
Include androidx.core_core for androidx.core.os.BuildCompat.

Bug: 151293251
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest
Change-Id: I73ef7eececec757a6e9683b231bf73fcd8d49f8d
2020-03-12 11:54:40 +00:00
Automerger Merge Worker
62a15a95cc Merge "Add javadoc for Network#netId" am: 08679046fe am: 7c87e61500
Change-Id: I1adbf90c9ac47d2918123dc3fe587f34c1dbbbb9
2020-03-12 10:30:33 +00:00
Automerger Merge Worker
7c87e61500 Merge "Add javadoc for Network#netId" am: 08679046fe
Change-Id: Ie59644d3f581b17856625409112eb5c5bd8d2aa4
2020-03-12 10:16:29 +00:00
Mark Chien
08679046fe Merge "Add javadoc for Network#netId" 2020-03-12 09:55:18 +00:00
markchien
43321d2e00 Add javadoc for Network#netId
Bug: 151156820
Test: m doc-comment-check-docs
Change-Id: Iea34a5c58a8b77c83258a39a8a44601e21a482f5
2020-03-12 09:54:44 +00:00
paulhu
27ca44913a Kill ConnectivityManager.CONNECTIVITY_ACTION_SUPL
CONNECTIVITY_ACTION_SUPL is marked as a "temporary hack" and has
never been public. Remove this intent definition since no one is
receiving this intent and should use network callback to know the
connection change.

Bug: 109636544
Test: atest FrameworksNetTests
Change-Id: Ie9e5127742beba04f1c191e894e8a29fe1e704bb
2020-03-11 22:14:11 +08:00
Automerger Merge Worker
16967f5a37 Merge "Add CTS for SocketUtils.makePacketSocketAddress(int, int, byte[])" am: da284dc189 am: a40c813a46
Change-Id: I988faa70f42a42be3d6158842f722d8e1d19ab37
2020-03-11 10:43:57 +00:00
Automerger Merge Worker
a40c813a46 Merge "Add CTS for SocketUtils.makePacketSocketAddress(int, int, byte[])" am: da284dc189
Change-Id: Ieb04ad8b9d0d36840d61cf10585672deb797c911
2020-03-11 10:25:04 +00:00
Paul Hu
da284dc189 Merge "Add CTS for SocketUtils.makePacketSocketAddress(int, int, byte[])" 2020-03-11 09:50:26 +00:00
paulhu
4c48b0a060 Add CTS for SocketUtils.makePacketSocketAddress(int, int, byte[])
Bug: 149426063
Bug: 150640362
Test: atest CtsNetTestCasesLatestSdk:android.net.util.SocketUtilsTest
      on both Q and R devices
Change-Id: I4b5a3dfb78b404d414b7dc358e6f16c3414a8b33
2020-03-11 15:20:26 +08:00
Cody Kesting
807ce6621b Clean up unit testing for ConnectivityDiagnostics.
Connectivity Diagnostics included an unnecessary try-catch for verifying
that the permissions check for invoking ConnectivityDiagnosticsCallbacks
doesn't throw when the uid and package name do not match.

Bug: 149119324
Test: atest FrameworksNetTests
Change-Id: Ie302b1f4f437e819fdd15ec28adb0b56750c2c53
2020-03-10 23:27:01 -07:00
Cody Kesting
a84aee7ad3 Add support for registering test networks with administrators.
CTS testing for ConnectivityDiagnosticsManager requires registering
TestNetworks with the administrator UIDs set. This sets up the CTS
process to be an administrator over the test network, which allows it to
receive ConnectivityDiagnosticsCallback callbacks.

Bug: 148032944
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Test: atest IpSecManagerTunnelTest
Change-Id: I7a443c368cf1ac470fbe40883ca24bc3143153b0
2020-03-10 23:27:01 -07:00
Cody Kesting
1dee169fae Replace com.android.internal.util.Preconditions.checkNotNull with
java.util.Objects.requireNonNull

Note: This is a partial cherry-pick.

Bug: 126528330

Test: Treehugger
Change-Id: I60fbb04b2720761f9c364b8c8350906d3d4a0ee7
Merged-In: Idb1b6ba41af3b52f3376b1157259af3c30328c4e
(cherry picked from commit d4e7dd113d)
2020-03-10 23:26:30 -07:00
Benedict Wong
feff1cde9a Automatically set IPsec tunnel interface as up
This change makes IPsec tunnel interfaces automatically get brought up
once they are created. Originally this was considered to be an
additional safety check, as they would not be start routing traffic
until explicitly brought up. However, in the intervening time, the
NetworkManagementController now requires the NETWORK_STACK permission to
set an interface as up. Additionally, that call is a hidden API, and
thus not usable for use cases such as IWLAN.

Bug: 149348618
Test: FrameworksNetTests, CtsNetTestCases passing.
Change-Id: I55b63a748463a388e1e2991d2d5d6b3023545e60
2020-03-10 23:08:16 -07:00
Tyler Wear
e4314861e3 mtu: Add MTU parameter to Routes
- Change route to update existing route
- MTU parameter added to AddRoute

Bug: 142892223
Test: unit test
Change-Id: Ie339d0cee5be12c2232a4631fed61219a0facc64
2020-03-11 13:33:10 +08:00
Automerger Merge Worker
19edb580e6 [automerger skipped] Merge "Remove framework code that has moved to frameworks/libs/net" am: 73808bd4cf -s ours am: 96a23bf0db -s ours
am skip reason: Change-Id Ibf2f370c97a602f186e37ea9ffbe177dd2ee0f1c with SHA-1 9d279abf30 is in history

Change-Id: I3e6b84639e5121f8f667ee35738db151d57644df
2020-03-11 04:55:07 +00:00
Automerger Merge Worker
96a23bf0db [automerger skipped] Merge "Remove framework code that has moved to frameworks/libs/net" am: 73808bd4cf -s ours
am skip reason: Change-Id Ibf2f370c97a602f186e37ea9ffbe177dd2ee0f1c with SHA-1 9d279abf30 is in history

Change-Id: I88ef318934572883b59615bd6a1644a5f658842b
2020-03-11 04:35:01 +00:00