Commit Graph

8634 Commits

Author SHA1 Message Date
Junyu Lai
53bdd05439 Merge changes from topics "am-ad04c8ad832c4674be35bfc5fe4280dd-rvc-dev", "sp21-api-review-feedback", "sp25-networkstats-rename" into rvc-dev am: 3e09da5d5d
Change-Id: I8b2ee860681bc161e0256ad4273cefbe316df4d1
2020-03-17 23:37:11 +00:00
junyulai
69e146bbc5 [SP25] Rename functions that add Entry conditionally am: 5d89df732b
Change-Id: Ie34fa0421b619af8479ca254bc6a895792a993d0
2020-03-17 23:35:53 +00:00
junyulai
bf8e5cf064 [SP24] Rename functions that add Entry unconditionally am: 9f288e6990
Change-Id: I983a448c1556b86fdf79c4989b2b0c579730837b
2020-03-17 23:35:50 +00:00
junyulai
43ff860cf2 [SP21] Address comments for API council review about aosp/1172143 am: 2cb4c9359a
Change-Id: I77a249ad66acf360ec1b0acfe14f9db704040c11
2020-03-17 23:35:40 +00:00
Junyu Lai
3e09da5d5d Merge changes from topics "am-ad04c8ad832c4674be35bfc5fe4280dd-rvc-dev", "sp21-api-review-feedback", "sp25-networkstats-rename" into rvc-dev
* changes:
  [SP25] Rename functions that add Entry conditionally
  [SP24] Rename functions that add Entry unconditionally
  [SP23] Address misc API review comment about NetworkStats
  [SP21] Address comments for API council review about aosp/1172143
  [SP20] Check signature permission when accessing network stats provider
2020-03-17 23:11:34 +00:00
Automerger Merge Worker
cbc2ca4681 Merge "Add support for registering test networks with administrators." into rvc-dev am: d95e6de42f
Change-Id: Id6e807272dca79a2e02974a7e6985eb6e7515326
2020-03-17 15:49:07 +00:00
Automerger Merge Worker
579c2bd4af Merge "Protect ConnectivityService from SecurityException in permission check." into rvc-dev am: 6e0d458d63
Change-Id: I5b44ff9afedcf40d82ba0c4666b2b16e72583383
2020-03-17 15:48:48 +00:00
Automerger Merge Worker
5bc1ba2198 Merge "Update ConnectivityDiagnosticsCallback function name." into rvc-dev am: b0dc78e311
Change-Id: I8c016464f6ba4b3237332bb2148183cb5d755ec4
2020-03-17 15:48:20 +00:00
Cody Kesting
d95e6de42f Merge "Add support for registering test networks with administrators." into rvc-dev 2020-03-17 15:31:26 +00:00
Cody Kesting
6e0d458d63 Merge "Protect ConnectivityService from SecurityException in permission check." into rvc-dev 2020-03-17 15:31:06 +00:00
Cody Kesting
b0dc78e311 Merge "Update ConnectivityDiagnosticsCallback function name." into rvc-dev 2020-03-17 15:29:55 +00:00
junyulai
5d89df732b [SP25] Rename functions that add Entry conditionally
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 conditionally,
name them addEntry.
  addValues -> addEntry

Test: atest FrameworksNetTests ImsPhoneCallTrackerTest TetheringTests
Fix: 148895143
Change-Id: I9495a198cf247e6c79100f7ac1edcea370b071de
2020-03-17 14:59:59 +00:00
junyulai
9f288e6990 [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
Merged-In: I801ddc49e283a254b9586700c9b597c0adb0d459
(cherry picked from aosp/1256352)
2020-03-17 14:59:31 +00:00
junyulai
2cb4c9359a [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
Merged-In: I141393f229e772d2eb9f7c156849e379bd71b845
(cherry picked from aosp/1253717)
2020-03-17 14:57:59 +00:00
Automerger Merge Worker
10e6b23cab Merge "Add test for NetworkAgentConfig" into rvc-dev am: b8f5f43f67
Change-Id: I5eef2519e160c98408951da8a33d089db09b7ceb
2020-03-17 09:15:46 +00:00
TreeHugger Robot
b8f5f43f67 Merge "Add test for NetworkAgentConfig" into rvc-dev 2020-03-17 09:00:38 +00:00
Automerger Merge Worker
a97418446e Add test for NetworkAgentConfig
Bug: 139268426
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkAgentConfigTest
Change-Id: If9158d086bacb0ade94d59898ac223e4c8f4f73a
Merged-In: If9158d086bacb0ade94d59898ac223e4c8f4f73a
(cherry picked from aosp/1253722)
2020-03-17 08:44:38 +00:00
Automerger Merge Worker
539cd36a1d 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
Merged-In: I7a443c368cf1ac470fbe40883ca24bc3143153b0
(cherry picked from commit 7b105b6194679fad6afe3615f0654b547034be6c)
2020-03-17 00:22:09 -07:00
Automerger Merge Worker
30762e1e07 Protect ConnectivityService from SecurityException in permission check.
ConnectivityService currently calls
LocationPermissionChecker#checkLocationPermission. This method call
throws a SecurityException if the given package name and UID do not
match. This permission check is made from the ConnectivityService
Thread, so any Exception being thrown will crash the SystemServer. This
is not acceptable, so surround the permission check in a try-catch in
case any SecurityExceptions are thrown.

Bug: 149119324
Test: atest ConnectivityServiceTest
Change-Id: Ibe2874f2a5249432270aa1b9eb7d004bbba35ac2
Merged-In: Ibe2874f2a5249432270aa1b9eb7d004bbba35ac2
(cherry picked from commit 9eacc855b63b36f5b937e703b20d4b0bb077ab75)
2020-03-17 00:21:50 -07:00
Cody Kesting
b5411218f8 Update ConnectivityDiagnosticsCallback function name.
API Council feedback suggests renaming ConnectivityDiagnosticsCallback
'onConnectivityReport' function to be 'onConnectivityReportAvailable'.

Bug: 150598997
Test: atest FrameworksNetTests
Change-Id: Ieea727ecee6cf358a53a215fd4b06233dfe967ea
(cherry picked from commit 324b224cc48fcb12125bd1727be70ad2effbfce3)
2020-03-17 00:16:58 -07:00
Automerger Merge Worker
940f298248 Merge "Ensure that NetworkFactory objects cannot be reused." into rvc-dev am: f7da86d448
Change-Id: Id010c4fb6386722666d979c973f26b9d4d0e6cdf
2020-03-16 16:27:57 +00:00
TreeHugger Robot
f7da86d448 Merge "Ensure that NetworkFactory objects cannot be reused." into rvc-dev 2020-03-16 16:23:23 +00:00
Automerger Merge Worker
44778f4e42 Merge "Update Javadoc comments for ConnectivityDiagnostics constants." into rvc-dev am: bbc723d9ba
Change-Id: Icf694f44f543756e117e5eb18f0c46a15fa517ed
2020-03-16 15:56:46 +00:00
Cody Kesting
bbc723d9ba Merge "Update Javadoc comments for ConnectivityDiagnostics constants." into rvc-dev 2020-03-16 15:39:43 +00:00
Automerger Merge Worker
94a4abe30b Merge "Add test for getDeprecationTime and getExpirationTime" into rvc-dev am: 95d81dfeff
Change-Id: I2416902c665063f6ce6d59c5105d974f4075876d
2020-03-16 10:00:31 +00:00
Automerger Merge Worker
46b1d18fc5 Add test for getDeprecationTime and getExpirationTime
Add for cts coverage for system API

Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk:android.net.LinkAddressTest
Change-Id: I64cd2c914f2da71383af7cdef2cf64c60a7d268c
Merged-In: I64cd2c914f2da71383af7cdef2cf64c60a7d268c
(cherry picked from commit 1e7f68f39c0855a45dbf4eeecbff430a2f6f3396)
2020-03-16 08:04:19 +00:00
Automerger Merge Worker
d11c52b585 Merge "Accept MAINLINE_NETWORK_STACK permission on register/unregister network provider" into rvc-dev am: 46a3b708b2
Change-Id: Ic5103cf650dc16a2d6dd7ace1f25386175a27b0c
2020-03-16 05:54:09 +00:00
Automerger Merge Worker
b464fd2143 Merge "Removing some of the API don't have to be @SystemApi" into rvc-dev am: eb93e7de21
Change-Id: I1c34bf3459158578949ad665fcce3cff7d15e353
2020-03-16 05:53:53 +00:00
Paul Hu
46a3b708b2 Merge "Accept MAINLINE_NETWORK_STACK permission on register/unregister network provider" into rvc-dev 2020-03-16 05:48:33 +00:00
Aaron Huang
eb93e7de21 Merge "Removing some of the API don't have to be @SystemApi" into rvc-dev 2020-03-16 05:47:34 +00:00
Automerger Merge Worker
9889ee4fe1 Merge "Resolve ambiguous argument." into rvc-dev am: 6738abeabf
Change-Id: I42d8dcfd819d21e87679746f50303adf378298cc
2020-03-16 02:14:58 +00:00
Automerger Merge Worker
de065b5eb8 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: I5d7deea82d7114fa38f37b90f94fe7e6073bd848
(cherry picked from commit ff83f1d7eea38c4143869cbf10dca5972421f6cd)
2020-03-15 12:56:05 +00:00
Automerger Merge Worker
b1b6a59bce Merge "Add javadoc for Network#netId" into rvc-dev am: 239acdbbb1
Change-Id: I1095996e36241eb0a42598aa737322610767599f
2020-03-15 03:04:40 +00:00
Mark Chien
239acdbbb1 Merge "Add javadoc for Network#netId" into rvc-dev 2020-03-15 02:53:29 +00:00
Automerger Merge Worker
7c138deb9b Merge changes from topic "services.net-wifi" into rvc-dev am: 79a252687d
Change-Id: I6da73de3e0d9605a072d04509d9e0488a86ba749
2020-03-13 22:54:54 +00:00
Automerger Merge Worker
1411a48409 services.net: Use the new ModuleNetworkStackClient am: 1ce72ca363
Change-Id: I9ef3ec22d6924d43087b975914baf6055e88cf4d
2020-03-13 22:54:51 +00:00
Roshan Pius
79a252687d Merge changes from topic "services.net-wifi" into rvc-dev
* changes:
  services.net: Add a static library needed by wifi module
  services.net: Use the new ModuleNetworkStackClient
2020-03-13 22:39:09 +00:00
Automerger Merge Worker
ca0cbf817b Update Javadoc comments for ConnectivityDiagnostics constants.
API Council feedback requested adding documentation for detection method
constants used in DataStallReport to indicate how the Data Stall was
detected.

Bug: 150598997
Test: n/a
Change-Id: Ib08f05562dd4b17973eeee97452d9f56d37e80fe
Merged-In: Ib08f05562dd4b17973eeee97452d9f56d37e80fe
(cherry picked from commit 52d9e61121883945931de533b5cfd44da30c0248)
2020-03-13 21:00:31 +00:00
Cody Kesting
4cab4ab5f2 Merge "Clear UIDs when sharing NetworkCapabilties for ConnectivityDiagnostics." into rvc-dev 2020-03-13 18:44:50 +00:00
Roshan Pius
7cf9cb25e3 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.
b) Add jar-jar rules for all the statically linked dependencies in wifi
service jar rules.

Exempt-From-Owner-Approval: Minor change on top of owner's approval.
Bug: 145825329
Test: Device boots up & connects to wifi networks.
Change-Id: Ifde69b579cfe5b813766f676acb10e436e64a44c
2020-03-13 14:42:09 +00:00
Aaron Huang
e93348f00d 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
2020-03-13 15:08:05 +08:00
Lorenzo Colitti
62fd0c1ab8 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
2020-03-13 15:51:56 +09:00
Automerger Merge Worker
5b4b6d710d Add javadoc for Network#netId
Bug: 151156820
Test: m doc-comment-check-docs

Change-Id: I18e6022c7b0b8bf132069f33d916d1b16d53d4f0
Merged-In: Iea34a5c58a8b77c83258a39a8a44601e21a482f5
(cherry picked from commit ab23c0fef8c02a9d63b1b48628eb687f589aac72)
2020-03-13 02:31:30 +00:00
Roshan Pius
1ce72ca363 services.net: Use the new ModuleNetworkStackClient
Use the new ModuleNetworkStackClient to retrieve instances IpMemoryStore
& IpClient.

Bug: 145825329
Test: Compiles
Change-Id: I065525fdbd64b9509ef0f47bb35954d267c65fd2
2020-03-12 18:26:13 -07:00
Automerger Merge Worker
8b080861a3 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
Merged-In: I4b5a3dfb78b404d414b7dc358e6f16c3414a8b33
(cherry picked from aosp/1243868)
2020-03-12 01:45:22 +00:00
Chiachang Wang
3021e53984 Merge "Skip Route tests that are R-specific on Q" into rvc-dev 2020-03-11 09:36:23 +00:00
Lorenzo Colitti
a49516676a Merge "Merge NetworkStatsService handler changes." into rvc-dev 2020-03-11 06:19:18 +00:00
Automerger Merge Worker
e79a15713c Skip Route tests that are R-specific on Q
MTU was added in R so test for it should be run on Q. Also
revise test to adopt rule.

Test: atest CtsNetTestCasesLatestSdk:android.net.LinkAddressTest
      on both devices
Bug: 150918852
Change-Id: Ibab9cfae0d35b26c6e4ca0defbb89769b04201d4
Merged-In: Ibab9cfae0d35b26c6e4ca0defbb89769b04201d4
(cherry picked from commit 09e5726e158d543b7632cd6e22f6e4c29b0bef52)
2020-03-10 12:47:19 +00:00
Automerger Merge Worker
ef12b64147 Accept MAINLINE_NETWORK_STACK permission on register/unregister network provider
Registering/Unregistering network provider needs NETWORK_FACTORY
which is signature only permission. But mainline modules can't
grant this permission because it's not signed with platform key.
Hence, these APIs should also accept MAINLINE_NETWORK_STACK
permission that allow mainline module to register/unregister
network provider.

Bug: 150733435
Test: atest FrameworksNetTests
Change-Id: Id22113aa0db01244817b4b008f5573c5e7b317f0
Merged-In: Id22113aa0db01244817b4b008f5573c5e7b317f0
(cherry picked from aosp/1248727)
2020-03-10 09:38:50 +00:00
Lucas Lin
10870e84af Merge "Remove redundant connected notification" into rvc-dev 2020-03-10 02:21:07 +00:00