Commit Graph

8816 Commits

Author SHA1 Message Date
junyulai
08da9375a6 [automerger skipped] [SP24] Rename functions that add Entry unconditionally am: 9f288e6990 -s ours
am skip reason: Change-Id I801ddc49e283a254b9586700c9b597c0adb0d459 with SHA-1 2521ad7386 is in history

Change-Id: I480e66ff5b65a1ba24ecffb288ba429c2f94219e
2020-03-17 23:35:52 +00:00
junyulai
180557c20a [automerger skipped] [SP21] Address comments for API council review about aosp/1172143 am: 2cb4c9359a -s ours
am skip reason: Change-Id I141393f229e772d2eb9f7c156849e379bd71b845 with SHA-1 f8660076c0 is in history

Change-Id: I80ab45b6a34b66f1bed766b3e2fb72926325021e
2020-03-17 23:35:48 +00:00
Automerger Merge Worker
35175b3239 [automerger skipped] Merge "Update ConnectivityDiagnosticsCallback function name." am: ff5be42146 am: a076070c56 -s ours
am skip reason: Change-Id Ieea727ecee6cf358a53a215fd4b06233dfe967ea with SHA-1 b5411218f8 is in history

Change-Id: I593e009d15d961fc44f5433cb8638aa7686d2b16
2020-03-17 19:28:24 +00:00
Automerger Merge Worker
a076070c56 Merge "Update ConnectivityDiagnosticsCallback function name." am: ff5be42146
Change-Id: I51d625ac3c086aceba9c06be7585e0e4f5022f1a
2020-03-17 19:13:39 +00:00
Cody Kesting
ff5be42146 Merge "Update ConnectivityDiagnosticsCallback function name." 2020-03-17 19:00:39 +00:00
Cody Kesting
e4d2df5726 Update ConnectivityDiagnosticsCallback function name.
API Council feedback suggests renaming ConnectivityDiagnosticsCallback
'onConnectivityReport' function to be 'onConnectivityReportAvailable'.

Bug: 150598997
Test: atest FrameworksNetTests
Change-Id: Ieea727ecee6cf358a53a215fd4b06233dfe967ea
Merged-In: Ieea727ecee6cf358a53a215fd4b06233dfe967ea
2020-03-17 17:10:38 +00:00
Automerger Merge Worker
22e22c3b3e Merge "Shorten the output of NetworkAgentInfo#toString()." am: 5d089181a8 am: c2dcb2f8e5
Change-Id: I4fb9efa69133ce8f960a37cfbb73264a4bfbf97a
2020-03-17 15:54:48 +00:00
Automerger Merge Worker
1ae67980c2 [automerger skipped] Merge "Add support for registering test networks with administrators." into rvc-dev am: d95e6de42f -s ours
am skip reason: Change-Id I7a443c368cf1ac470fbe40883ca24bc3143153b0 with SHA-1 c5941bb7a3 is in history

Change-Id: I9b0525df547a8f79b739df90f39c2aad412de2c2
2020-03-17 15:48:50 +00:00
Automerger Merge Worker
27d2d10b8b [automerger skipped] Merge "Protect ConnectivityService from SecurityException in permission check." into rvc-dev am: 6e0d458d63 -s ours
am skip reason: Change-Id Ibe2874f2a5249432270aa1b9eb7d004bbba35ac2 with SHA-1 5df8e985df is in history

Change-Id: If88006f48fc2f25ca989d830a37d651a75f68448
2020-03-17 15:48:31 +00:00
Automerger Merge Worker
ba4aecf53c Merge "Update ConnectivityDiagnosticsCallback function name." into rvc-dev am: b0dc78e311
Change-Id: I42c78c2626d1592bd5a0da215579f55bf04dc088
2020-03-17 15:48:00 +00:00
Automerger Merge Worker
c2dcb2f8e5 Merge "Shorten the output of NetworkAgentInfo#toString()." am: 5d089181a8
Change-Id: I73e47e19588a758fbee07ae96670b126251a9b56
2020-03-17 15:42:42 +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
Treehugger Robot
5d089181a8 Merge "Shorten the output of NetworkAgentInfo#toString()." 2020-03-17 15:29:39 +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
Lorenzo Colitti
924fb4c08e Shorten the output of NetworkAgentInfo#toString().
Currently, printing a NetworkAgentInfo results in a very long
string. Make it a bit shorter by:

- Not printing a number of fields in NetworkInfo that are no
  longer used.
- Instead of printing flags regardless of whether they are true
  false, only print ones that are true. For example, this changes
    everCaptivePortalDetected{true} lastCaptivePortalDetected{false} captivePortalValidationPending{false}
  to:
    everCaptivePortalDetected
- Only printing clat information if clatd is started.

Also, put the long and variable-length fields lp and nc at the
end of the output.

Test: manual
Change-Id: I3312286be307ef1762890cbc6b717f12ce5b2b92
2020-03-17 22:29:37 +09:00
Automerger Merge Worker
8df9d88504 [automerger skipped] Merge "Removing some of the API don't have to be @SystemApi" am: c4d6a4f566 am: 86ba38a5ba -s ours
am skip reason: Change-Id Ie30efa172f93a7557fb6ef56f4daf80e958c3787 with SHA-1 e93348f00d is in history

Change-Id: I3f81a90e806947d60fb8fe4f4856491284a43ed0
2020-03-17 13:15:17 +00:00
Automerger Merge Worker
86ba38a5ba Merge "Removing some of the API don't have to be @SystemApi" am: c4d6a4f566
Change-Id: I6687ba646982ea924feae7d8da6732a04184321e
2020-03-17 13:04:11 +00:00
Treehugger Robot
c4d6a4f566 Merge "Removing some of the API don't have to be @SystemApi" 2020-03-17 12:51:25 +00:00
Automerger Merge Worker
ba33556f86 Merge changes I97015365,Ic9db4b9b am: d080a4a32d am: 1c25e4ff44
Change-Id: I058fcb4d7dac3ef384c3ccbe5a2cc880c6aed2a3
2020-03-17 10:16:15 +00:00
Automerger Merge Worker
1c25e4ff44 Merge changes I97015365,Ic9db4b9b am: d080a4a32d
Change-Id: Ic99385f58c7a0ee246d7dfeb12eb1723fda65c4b
2020-03-17 09:54:53 +00:00
Chiachang Wang
d080a4a32d Merge changes I97015365,Ic9db4b9b
* changes:
  Add NattKeepalivePacketDataTest
  Add KeepalivePacketDataTest
2020-03-17 09:38:41 +00:00
Automerger Merge Worker
56ccf539c3 [automerger skipped] Merge "services.net: Add a static library needed by wifi module" am: a0f5e8f3c2 am: 5cc4a63246 -s ours
am skip reason: Change-Id Ifde69b579cfe5b813766f676acb10e436e64a44c with SHA-1 7cf9cb25e3 is in history

Change-Id: Ia476746bb37fee381245f49a801bf9abb32ba04d
2020-03-17 09:35:52 +00:00
Automerger Merge Worker
8d5189d6fb [automerger skipped] Merge "services.net: Use the new ModuleNetworkStackClient" am: bcd6edb9d6 am: 8ad449dff9 -s ours
am skip reason: Change-Id I065525fdbd64b9509ef0f47bb35954d267c65fd2 with SHA-1 1ce72ca363 is in history

Change-Id: I25e57f7208899f370a5131daa271dbf40ffcbe49
2020-03-17 09:35:40 +00:00
Automerger Merge Worker
5cc4a63246 Merge "services.net: Add a static library needed by wifi module" am: a0f5e8f3c2
Change-Id: I9088ccdec461145b16597d50834d231c9ea771d5
2020-03-17 09:28:23 +00:00
Automerger Merge Worker
8ad449dff9 Merge "services.net: Use the new ModuleNetworkStackClient" am: bcd6edb9d6
Change-Id: I97918b59b98a76267935680ceae19881f5f42e7b
2020-03-17 09:27:07 +00:00
Treehugger Robot
a0f5e8f3c2 Merge "services.net: Add a static library needed by wifi module" 2020-03-17 09:22:12 +00:00
Remi NGUYEN VAN
bcd6edb9d6 Merge "services.net: Use the new ModuleNetworkStackClient" 2020-03-17 09:21:40 +00:00
Automerger Merge Worker
2966ce4bee [automerger skipped] Merge "Add test for NetworkAgentConfig" into rvc-dev am: b8f5f43f67 -s ours
am skip reason: Change-Id If9158d086bacb0ade94d59898ac223e4c8f4f73a with SHA-1 1feaacee76 is in history

Change-Id: I28afe6a88dc5972527f1f2949062813ca83295c6
2020-03-17 09:16:01 +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
91a66f29ac Merge "Move sensitive field parceling bool to constructor" am: 9e2a0cb322 am: 82280b8bb9
Change-Id: Ice332671a4b97dad595c79c8c42ce47dca52b8e2
2020-03-17 08:17:51 +00:00
Automerger Merge Worker
82280b8bb9 Merge "Move sensitive field parceling bool to constructor" am: 9e2a0cb322
Change-Id: Ib5619a2173d838e81091415fe6323370f61c9461
2020-03-17 08:05:40 +00:00
Remi NGUYEN VAN
9e2a0cb322 Merge "Move sensitive field parceling bool to constructor" 2020-03-17 07:49:38 +00:00
Chiachang Wang
fd007f01ef Add NattKeepalivePacketDataTest
Add test for constructor and parcel

Test: atest CtsNetTestCasesLatestSdk:android.net.NattKeepalivePacketDataTest
      on both Q and R devices
Bug: 151402211
Change-Id: I97015365604be1846e3ecbaf60ac99e334705565
2020-03-17 15:48:02 +08: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
Chiachang Wang
13c97ebd73 Add KeepalivePacketDataTest
Add test for constructor of KeepalivePacketData and
InvalidPacketException

Bug: 151109466
Test: atest CtsNetTestCasesLatestSdk:android.net.KeepalivePacketDataTest
      on both Q and R devices
Change-Id: Ic9db4b9b83ff96c87f41c5f381763c3ee8dd27c8
2020-03-17 14:24:50 +08:00
Automerger Merge Worker
6111724f31 [automerger skipped] Merge "Ensure that NetworkFactory objects cannot be reused." am: 3b2d608aa8 am: f95a726ac4 -s ours
am skip reason: Change-Id I793436ee0f4b5d778788ad34b8a2575d2ad0ed80 with SHA-1 62fd0c1ab8 is in history

Change-Id: I5672bf0133a8fa10a8d8332367d6a6fc046071e8
2020-03-17 05:19:06 +00:00
Automerger Merge Worker
f95a726ac4 Merge "Ensure that NetworkFactory objects cannot be reused." am: 3b2d608aa8
Change-Id: Ifc5cac306f1558c8560f1829eea538fe9a395b26
2020-03-17 04:55:06 +00:00
Lorenzo Colitti
3b2d608aa8 Merge "Ensure that NetworkFactory objects cannot be reused." 2020-03-17 04:35:01 +00:00
Automerger Merge Worker
40524fdcc6 Merge "Make LinkPropertiesTest backwards compatible" am: 167478a027 am: 5955798254
Change-Id: Ie1db141b72770490632c3974b904ee9b1438922e
2020-03-17 03:05:25 +00:00
Automerger Merge Worker
5955798254 Merge "Make LinkPropertiesTest backwards compatible" am: 167478a027
Change-Id: Iedcb704eba4a342058a7b6fdea3f1bd83dec4744
2020-03-17 02:48:05 +00:00
Remi NGUYEN VAN
c38954692a Move sensitive field parceling bool to constructor
This addresses API review comments recommending to use a copy
constructor with additional parameters instead of a dedicated method.
makeSensitiveFieldsParcelingCopy becomes LinkProperties(base, true).

Bug: 150877475
Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests
Change-Id: Ib145ca7f36dcbee6ef47d09862a181fc04a28f03
2020-03-17 11:42:33 +09:00
Remi NGUYEN VAN
167478a027 Merge "Make LinkPropertiesTest backwards compatible" 2020-03-17 02:27:27 +00:00
Remi NGUYEN VAN
1d88c2e1a1 Make LinkPropertiesTest backwards compatible
LinkPropertiesTest must be backwards compatible with Q for CTS.

In Q 4 fields were added: DhcpServerAddress, WakeOnLanSupported,
CaptivePortalApiUrl, CaptivePortalData. The new test only tests these
fields on R and above.
testLinkPropertiesParcelable_Q still verifies that there are 14 fields
on Q, so the 4 extra fields can be ignored.

The changes use androidx.core.os.BuildCompat.isAtLeastR(), so
androidx.core_core is added as a dependency to FrameworksNetCommonTests.

Test: atest CtsNetTestCasesLatestSdk:android.net.LinkPropertiesTest
        on Q and R devices
Bug: 150918852
Change-Id: I570efa4eb483a717d4204a18473d02653a69f46d
2020-03-17 11:23:13 +09:00
Automerger Merge Worker
146c358e5a Merge "Clean up unit testing for ConnectivityDiagnostics." am: 01f0a15807 am: d9d7d4666f
Change-Id: Idb2167c10f18e3d551a653483ba9ea344b872b87
2020-03-16 20:09:39 +00:00