Commit Graph

1545 Commits

Author SHA1 Message Date
Ashwini Oruganti
17e3df1968 Add an exported flag in manifest
With b/150232615, we will need an explicit value set for the exported
flag when intent filters are present, as the default behavior is
changing for S+. This change adds the value reflecting the previous
default to the manifest.

These changes were made using an automated tool, the xml file may be
reformatted slightly creating a larger diff. The only "real" change is
the addition of "android:exported" to activities, services, and
receivers that have one or more intent-filters.

Bug: 150232615
Test: TH
Exempt-From-Owner-Approval: mechanical refactoring
Change-Id: I4457ff2bd466a4c56fed2570e110f251031c2385
2020-03-23 18:34:09 +00:00
Cody Kesting
d1ce7ad9a0 Merge "Restrict VPN Diagnostics callbacks to underlying networks." am: 034480fb36 am: 0d3efcb097 am: 63d73e70be am: 05e0c8b4fc am: 7fa7676058
Change-Id: I5b498a3c51ec010265261f1b48a344fff167a9c5
2020-03-18 21:11:29 +00:00
Cody Kesting
63d73e70be Merge "Restrict VPN Diagnostics callbacks to underlying networks." am: 034480fb36 am: 0d3efcb097
Change-Id: Iae4aa40b2232171f241d99a81ec84cbbac1fd64d
2020-03-18 20:26:46 +00:00
Cody Kesting
3657c3b052 Change NetworkCapabilities administrator UIDs to be stored as int[]. am: 1043927267 am: a5195fd1cb am: 9ac1fc8dc1 am: b3521a5e7f
Change-Id: Ib80d4fb966fd9f45154bcf9591e1f499acdee09a
2020-03-18 20:19:29 +00:00
Cody Kesting
034480fb36 Merge "Restrict VPN Diagnostics callbacks to underlying networks." 2020-03-18 20:07:52 +00:00
Cody Kesting
a5195fd1cb Change NetworkCapabilities administrator UIDs to be stored as int[]. am: 1043927267
Change-Id: I26343fa85d936aa71dbe983341343fd1d74a7a0a
2020-03-18 19:56:33 +00:00
Cody Kesting
1043927267 Change NetworkCapabilities administrator UIDs to be stored as int[].
NetworkCapabilities#mAdministratorUids is used to track the UIDs that
are administrators of the given Network. This value was previously
stored as List<Integer>. However, general Android API Council guidelines
recommend using Arrays for primitive values. In order to be consistent
with the guidelines, updating the field to use an Array.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: I2652a5b0f276b8944454af5cb4b1383a3e054cfa
2020-03-18 17:40:24 +00:00
Junyu Lai
1f36b6a659 Merge "[SM08] Add NetworkTemplate unit test for fetching mobile data usage" 2020-03-18 14:16:59 +00:00
Junyu Lai
a5df29c24c Merge "[SM07] Make combine subtype configurable from Settings" 2020-03-18 12:20:39 +00:00
junyulai
d63ba64c52 [SM08] Add NetworkTemplate unit test for fetching mobile data usage
Test: atest NetworkTemplateTest
Bug: 129082217

Change-Id: I7eaca623adf93f9b8d53c2e5857ecae90ea572ab
2020-03-18 18:04:18 +08:00
Junyu Lai
7872f6186a Merge "Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister" am: e9e871ef83 am: ef43214f03 am: 0851670d30 am: 69a6311c32 am: b608deec66
Change-Id: I1ee7a26186885d3a79a32ec9e45f5bcd656a6680
2020-03-18 10:01:45 +00:00
junyulai
8e0fc53cfe [SM07] Make combine subtype configurable from Settings
Note that enabling/disabling would not take effect until device
reboot. This will be addressed in follow-up patch.

Test: 1. atest NetworkStatsServieTest SettingsBackupTest
      2. adb shell settings put global netstats_combine_subtype_enabled 1|0
Bug: 146415925

Change-Id: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
2020-03-18 17:58:14 +08:00
Junyu Lai
0851670d30 Merge "Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister" am: e9e871ef83 am: ef43214f03
Change-Id: I941bdbd6877dbf5e269ee4e49fd3947681025961
2020-03-18 09:02:12 +00:00
Lorenzo Colitti
0fc574664c Merge "mtu: Add MTU parameter to Routes" am: b76fc089d7 am: aa3afd9d64 am: b7dbb0b230 am: 8e9d7e2b40 am: fe65a99b43
Change-Id: Ib7fe339df5518a0f783cb1d4624e86c686cd6c2d
2020-03-18 08:37:24 +00:00
Lorenzo Colitti
b7dbb0b230 Merge "mtu: Add MTU parameter to Routes" am: b76fc089d7 am: aa3afd9d64
Change-Id: I2164808ef628eb7c12e875f0bde7f5151bf6a5b5
2020-03-18 07:52:25 +00:00
Junyu Lai
6ac0d280bc Merge changes If330e853,Ie2d229be,Ic6b2f10f
* changes:
  [SM05] Enable record mobile network stats by collapsed rat type
  [SM04] Support fetching data with NetworkTemplate with subType
  [SM02] Support record mobile network stats by collapsed rat type
2020-03-18 07:36:40 +00:00
junyulai
7bd2a24dab Fix flaky ConnectivityServiceTest#testNetworkFactoryUnregister
Test: atest ConnectivityServiceTest#testNetworkFactoryUnregister \
      --geneate-new-metrics 100
Bug: 151792032
Change-Id: Iece9e8ad5c51170cd404ac995d0005392d37fe0c
2020-03-18 15:22:54 +08:00
Lorenzo Colitti
b76fc089d7 Merge "mtu: Add MTU parameter to Routes" 2020-03-18 07:20:01 +00:00
junyulai
a7117e41a2 [SM05] Enable record mobile network stats by collapsed rat type
Switch on the recording in device side. Metrics will be
collected in follow-up patches which can be independently
enabled/disabled.

This change also fix the fail in NetworkStatsCollectionTest
which caused by enabling this feature, where the rounding
problem happened when records are distributed into smaller
buckets and categorized into more NetworkIdentity.

Test: atest FrameworksNetTests
Bug: 129082217
Change-Id: If330e85330a4ff713dd420c98d42fa741eabd90a
2020-03-18 12:59:07 +08:00
Lucas Lin
ad691b3e04 Merge "Add version check to prevent test fail on Android Q" am: 96da9cf154 am: ed930bec98
Change-Id: I1985c4cfe6ff1712f2d181a151bfee0160fc96bf
2020-03-18 04:23:00 +00:00
Lucas Lin
96da9cf154 Merge "Add version check to prevent test fail on Android Q" 2020-03-18 03:56:37 +00:00
Junyu Lai
6fa3bc3460 Merge "[SP25] Rename functions that add Entry conditionally" 2020-03-18 03:16:41 +00:00
junyulai
175c770f1c [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
Merged-In: I9495a198cf247e6c79100f7ac1edcea370b071de
(cherry picked from ag/10700816)
2020-03-18 00:29:15 +00:00
junyulai
0dbffa4ad5 [SP25] Rename functions that add Entry conditionally am: 5d89df732b
Change-Id: I5f9924cf5b3eccfcdaa6dda991a102b97cebd11a
2020-03-17 23:35:57 +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
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
ba4aecf53c Merge "Update ConnectivityDiagnosticsCallback function name." into rvc-dev am: b0dc78e311
Change-Id: I42c78c2626d1592bd5a0da215579f55bf04dc088
2020-03-17 15:48:00 +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
ba33556f86 Merge changes I97015365,Ic9db4b9b am: d080a4a32d am: 1c25e4ff44
Change-Id: I058fcb4d7dac3ef384c3ccbe5a2cc880c6aed2a3
2020-03-17 10:16:15 +00:00
Chiachang Wang
d080a4a32d Merge changes I97015365,Ic9db4b9b
* changes:
  Add NattKeepalivePacketDataTest
  Add KeepalivePacketDataTest
2020-03-17 09:38:41 +00:00
Remi NGUYEN VAN
bcd6edb9d6 Merge "services.net: Use the new ModuleNetworkStackClient" 2020-03-17 09:21:40 +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
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
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
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
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