Commit Graph

1854 Commits

Author SHA1 Message Date
Michael Groover
fb709dc8c6 Merge "Revert "Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator."" am: 3e712761a4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2037088

Change-Id: Ia528f780a047f6e0807e92fee2761d1adb6c951e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-31 02:00:40 +00:00
Michael Groover
3e712761a4 Merge "Revert "Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator."" 2022-03-31 01:39:28 +00:00
Lorenzo Colitti
25b7de3902 Merge "Don't throw in FullScore#policyNameOf." am: 644fe232cd am: 35b6c1eeaa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2041564

Change-Id: I35841a2ebfd1ad184e73af3534f702e1d6b9ac0f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-29 09:45:38 +00:00
Lorenzo Colitti
35b6c1eeaa Merge "Don't throw in FullScore#policyNameOf." am: 644fe232cd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2041564

Change-Id: I7143d220336b50b106cad79d890f49b77654a51c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-29 08:46:06 +00:00
Lorenzo Colitti
644fe232cd Merge "Don't throw in FullScore#policyNameOf." 2022-03-29 08:38:21 +00:00
Lorenzo Colitti
1727d9f1f2 Don't throw in FullScore#policyNameOf.
This code is correct on userdebug builds, but it is dangerous on
user builds because proguard might strip out the POLICY_*
constants and that would lead to crashes.

For now just log a wtf if an invalid policy name is found. A
better solution would be to make MessageUtils robust to this
problem, e.g., by having it store the SparseArray internally and
providing getters that do not throw, instead of the current
behaviour that returns the SparseArray. That is left to a future
CL.

Fix: 227161413
Test: atest FullScoreTest
Change-Id: I68b69ee9dd84773018e62c9a8f43e754ae04c486
2022-03-29 08:38:06 +00:00
Chiachang Wang
18facb5f86 Merge "Add tests for VPN validation in NetworkMonitor" am: 59e6e2b730 am: a0bcacf630
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1976726

Change-Id: If736e6425fd607ed2ce3a94d3fe20440d87fd8b0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-28 14:26:14 +00:00
Chiachang Wang
a0bcacf630 Merge "Add tests for VPN validation in NetworkMonitor" am: 59e6e2b730
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1976726

Change-Id: Ibe77ebefbfa4d26e51462446d7d475a7212bbd25
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-28 14:04:36 +00:00
Chiachang Wang
59e6e2b730 Merge "Add tests for VPN validation in NetworkMonitor" 2022-03-28 13:51:34 +00:00
Remi NGUYEN VAN
0395b70000 Use Sources.bp for building
Reference Sources.bp from Android.bp, so that they are used as build
files.

Sources.bp is separate from Android.bp as it was migrated from the
Android.bp files in the old code location. They can be merged into the
main Android.bp file (or removed by removing the filegroups) after the
migration is done.

Also remove references to the AIDL filegroups, as files are now merged
into the common framework/aidl-export directory which is used as include
directory for aidl source generation already, so they do not need to be
referenced separately. framework/aidl-export can contain AIDLs for S-
API classes that became updatable API in T (the contents of
framework-t), as they are the same as any other API class for the
purposes of AIDL code generation: it's OK for any S+ code to reference
S+ API classes.

Finally, fix reference to mByteStream in IpConfigStoreTest. It was
already wrong but did not break the build because the test was not being
built in the old location.

Bug: 222234190
Test: TH
Merged-In: I81893df9f327abb84f1561b2b33027a2d23a4d65
Merged-In: I67c703e3f7aa9d5787f032a79ed62e45412baf4f
Change-Id: I9093f9ae2f9d76e597f20de48680e459891755b4
2022-03-25 14:58:43 +00:00
Remi NGUYEN VAN
700ffc994f Merge history of ConnectivityT
Renamed files/directories:
ConnectivityT/service/Android.bp --> service-t/Sources.bp
ConnectivityT/framework-t/Android.bp --> framework-t/Sources.bp
ConnectivityT/framework-t/aidl-export --> framework/aidl-export
ConnectivityT/service --> service-t
ConnectivityT/framework-t --> framework-t
ConnectivityT/tests --> tests
ConnectivityT/OWNERS --> (removed)

BUG: 222234190
TEST: TH
Ignore-AOSP-First: Move with history done per-branch
Merged-In: I81893df9f327abb84f1561b2b33027a2d23a4d65
Merged-In: I67c703e3f7aa9d5787f032a79ed62e45412baf4f
Change-Id: I27a91f1a94f9d807f92762436f533c4b0d0114d5
2022-03-25 11:02:45 +00:00
Remi NGUYEN VAN
af582a015b Use Sources.bp for building
Reference Sources.bp from Android.bp, so that they are used as build
files.

Sources.bp is separate from Android.bp as it was migrated from the
Android.bp files in the old code location. They can be merged into the
main Android.bp file (or removed by removing the filegroups) after the
migration is done.

Also remove references to the AIDL filegroups, as files are now merged
into the common framework/aidl-export directory which is used as include
directory for aidl source generation already, so they do not need to be
referenced separately. framework/aidl-export can contain AIDLs for S-
API classes that became updatable API in T (the contents of
framework-t), as they are the same as any other API class for the
purposes of AIDL code generation: it's OK for any S+ code to reference
S+ API classes.

Finally, fix reference to mByteStream in IpConfigStoreTest. It was
already wrong but did not break the build because the test was not being
built in the old location.

Bug: 222234190
Test: TH
Merged-In: I1fe5091361c7766dc7b6b4fb8c7b62d403e950bb
Change-Id: If738f607be84b3d7e2045a83a4d2976ed0d4e188
2022-03-25 09:46:39 +00:00
Remi NGUYEN VAN
3464805acc Merge history of ConnectivityT
Renamed files/directories:
ConnectivityT/service/Android.bp --> service-t/Sources.bp
ConnectivityT/framework-t/Android.bp --> framework-t/Sources.bp
ConnectivityT/framework-t/aidl-export --> framework/aidl-export
ConnectivityT/service --> service-t
ConnectivityT/framework-t --> framework-t
ConnectivityT/tests --> tests
ConnectivityT/OWNERS --> (removed)

BUG: 222234190
TEST: TH
Merged-In: I1fe5091361c7766dc7b6b4fb8c7b62d403e950bb
Change-Id: Ib592434ff50c06e25894f6ed7d7e3e8e1e3ea67b
2022-03-24 14:19:13 +00:00
Chalard Jean
2f23fa51d8 Add tests for VPN validation in NetworkMonitor
Test: New tests in this patch
      also FrameworksNetTests
Test: atest CtsNetTestCases CtsNetTestCasesLatestSdk
Change-Id: I68aa5201ad94531e5a40999816844faef5531525
2022-03-23 11:19:44 +00:00
Michael Groover
eef36c8917 Revert "Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator."
This reverts commit 7569d51446.

Reason for revert: ag/17318348 moved the declaration of the protected-broadcasts from the telephony package to the platform's manifest, so a flag is no longer required when registering for these. In addition, ag/17307852 is syncing the behavior of unexported runtime receivers with that of manifest receivers by limiting the UIDs that can broadcast to these receivers to the root and system UIDs; with the RECEIVER_NOT_EXPORTED flag from this commit, these receivers would no longer be able to receive these broadcasts when sent from the telephony UID.

Bug: 225999840
Change-Id: Ifb15506434edabdfacf84c302881d0cf97d3add8
2022-03-23 02:04:57 +00:00
Nucca Chen
f5549f8a64 Merge "ClatCoordinator: wrap clatd information" am: a59eec920c am: 594085e774
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2028283

Change-Id: Ibac408578db2f9ecceaffe23e9c4d22850e080e8
2022-03-22 09:51:28 +00:00
Nucca Chen
a59eec920c Merge "ClatCoordinator: wrap clatd information" 2022-03-22 08:40:15 +00:00
Hungming Chen
328d15271b ClatCoordinator: wrap clatd information
This is a preparation for accessing BPF program and map from existing
Java class. The new class ClatdTracker stores the clatd information
for forking clatd, accessing BPF maps and attaching BPF programs.
Using an object is easier to pass all required parameters and reuse
known resource.

Also refactor existing function and rename existing variables for this
commit.

Bug: 221213090
Test: atest FrameworksNetTests
Change-Id: I02ea889de89329c52710726fbcf1d2eac61707d7
2022-03-22 15:20:17 +08:00
Benedict Wong
b5f372e724 Merge "Allow sending of Administrator UIDs for *NETWORK_STACK" am: 0e75662808 am: e26f8d1bfe
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1761211

Change-Id: I520b6c1bc6b8c1676c50a4d1bffb3df8cdfb18a2
2022-03-19 02:04:37 +00:00
Benedict Wong
a5604ea50f Allow sending of Administrator UIDs for *NETWORK_STACK
This change allows callers with the NETWORK_STACK or
PERMISSION_NETWORK_STACK to receive administrator UIDs. This will be
used by the VCN to ensure that administrator UIDs are accurately
populated, ensuring that the ConnectivityDiagnostics are triggered for
the VCN.

Bug: 193204385
Test: atest ConnectivityServiceTest
Change-Id: I3ecfbef6847dcc78adac05d0229719c97e3a220c
2022-03-18 21:52:57 +00:00
Martijn Coenen
e9b000e4a9 Merge "Setup permissions for SDK sandbox UIDs." am: b643f2a356 am: f67e7c6352
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2020099

Change-Id: I2149a7fb2dc77b5106091d1401cdcb620f2166ba
2022-03-18 14:12:11 +00:00
Martijn Coenen
b643f2a356 Merge "Setup permissions for SDK sandbox UIDs." 2022-03-18 13:35:51 +00:00
Lorenzo Colitti
3dad0783fd Merge "Support ignoring validation failures after roam." am: 004cbbcdad am: 2c4ba92b72
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2026185

Change-Id: Idd06e199b884b2f8d6d75b0d2207b4f5a7641067
2022-03-18 03:56:44 +00:00
Lorenzo Colitti
004cbbcdad Merge "Support ignoring validation failures after roam." 2022-03-18 03:15:49 +00:00
he_won.hwang
881307a834 Support ignoring validation failures after roam.
In some scenarios, Wi-Fi connectivity is disrupted after roam. If an application reacts to network errors by calling reportNetworkConnectivity(false), validation will immediately fail and the device will switch to cell data.

Add a way to ignore these validation failures for up to 10 seconds after Wi-Fi roams.

Bug: 216567577
Test: new unit tests

Change-Id: I58de486533bcc7c6e32b23536ae15bccb779e394
2022-03-18 10:30:28 +09:00
Patrick Rohr
5a9011125b Merge changes from topic "nullable-ipconfig" am: 1b13af010a am: 3a74a64079
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2026565

Change-Id: Idd172582e5d1f0d401b999b7eb8f1a5e5311ee5d
2022-03-17 08:13:58 +00:00
Patrick Rohr
1b13af010a Merge changes from topic "nullable-ipconfig"
* changes:
  Add test for nullable IpConfiguration
  Add Nullable IpConfiguration to ethernet update request
  Replace assertParcelSane with assertParcelingIsLossless
2022-03-17 06:17:02 +00:00
Patrick Rohr
fb82c3f702 Add test for nullable IpConfiguration
Test: atest EthernetNetworkUpdateRequestTest
Change-Id: Ibf565d46cfac0d44976ee6187db7234bb082da41
2022-03-16 20:29:10 +01:00
Sooraj Sasindran
3f32e9e066 Merge "Use int array for included and excluded uids" am: 2ccbfe9d8f am: 8b0350f4b6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2018920

Change-Id: I73373faabcf62add0703854b3cf8fb35668b197d
2022-03-16 18:58:04 +00:00
Chalard Jean
de665266cd Rename setAccessUids to setAllowedUids
Bug: 217725769
Test: ConnectivityServiceTest CtsNetTestCases
Change-Id: Ic8a3f91553d1462b7f54259c467fb90a950bdd59
Merged-In: I8860fbb353eedf5d01e9dc248e4d765046bd562c
2022-03-16 17:58:20 +00:00
Sooraj Sasindran
2ccbfe9d8f Merge "Use int array for included and excluded uids" 2022-03-16 17:56:08 +00:00
Patrick Rohr
ceae88da2d Replace assertParcelSane with assertParcelingIsLossless
Per review comment on aosp/2012897.

Test: atest EthernetNetworkUpdateRequestTest
Change-Id: Ie2f21d821709cc82af9294d70826f153506fda4f
2022-03-16 17:20:36 +01:00
Patrick Rohr
6dde8ac532 Merge changes from topic "ethernet_mainline"
* changes:
  Fix the NPE thrown when starting Ethernet service in OS lower than T.
  Remove the stub ethernet service from Connectivity module.
  Update hidden API files for EthernetManager API move.
  Provide a stub ethernet service to build in sc-mainline-prod.
  Build ethernet framework source into framework-connectivity-tiramisu
2022-03-16 16:03:30 +00:00
Sooraj Sasindran
4904176454 Use int array for included and excluded uids
Use int array for included and excluded uids so that uses
same data type as in PreferentialNetworkServiceConfig

Bug: 217365439
Test: ran connectivity service unit tests
Change-Id: I9ac7e6498df2fd20b8397b2c110296e019c7389e
2022-03-16 07:19:11 +00:00
Chalard Jean
7d72b41c95 Rename setAccessUids to setAllowedUids
Bug: 217725769
Ignore-AOSP-First: Due to dependency on Telephony code which is not in
AOSP
Test: ConnectivityServiceTest CtsNetTestCases

Change-Id: I8860fbb353eedf5d01e9dc248e4d765046bd562c
2022-03-16 06:29:27 +00:00
Lorenzo Colitti
f2975db5a4 Merge "Rename setUidForeground to noteUidForeground" am: 8b7896b51a am: cf9f545864
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2018880

Change-Id: I8a3ac0a4dcf9201435ad227b36acf4e0f1889f22
2022-03-16 00:37:29 +00:00
Lorenzo Colitti
8b7896b51a Merge "Rename setUidForeground to noteUidForeground" 2022-03-15 23:33:26 +00:00
Martijn Coenen
3f01be0407 Setup permissions for SDK sandbox UIDs.
Applications may have an additional SDK sandbox process that should run
with the same network policy as the app itself. There is a 1:1 mapping
between appId and the SDK sandbox process that belongs to it; use that
mapping to set the same policy for SDK sandbox processes as for the app
that they belong to.

Bug: 215012578
Test: atest com.android.server.PermissionMonitorTest
Change-Id: Ibd2ada09c94d46e048f5731b90a721d8e85d3289
2022-03-15 10:06:39 +01:00
Xiao Ma
0a171c006c Build ethernet framework source into framework-connectivity-tiramisu
- move ethernet APIs, build it into framework-connectivity-tiramisu
- start ethernet service from ConnectivityServiceInitializer
- fix EthernetManager dependnecy in Tethering module
- fix EthernetNetworkSpecifier dependency in framework-connectivity
- fix the ethernet related config resource

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I54857b8517649048a343c72797668394d5225766
Merged-In: I54857b8517649048a343c72797668394d5225766
2022-03-14 14:06:35 +00:00
Xiao Ma
dbc8e0fb2b Split out the ethernet API surface and use framework-connectivity-t
Ethernet framework and service source code is going to be moved to
Connectivity mainline module, this CL contains below corresponding
changes to adapt the migration in f/b side:

1. Split out ethernet module-lib APIs to Connectivity module.
   Add the ethernet resource filegroup to tiramisu-updatable-sources
   filegroup as well, build them together. Also update the module-lib
   and system api txt to reflect the APIs change. Remove the hidden
   APIs which are moved to Connectivity module. This removal fixes the
   api inconsistent issue with Tethering/apex/hidden/.

2. Remove EthernetService from SystemServer which will be registered
   from ConnectivityServiceInitializer.

3. Replace the BackgroundThread class(imported from f/b/core/java)
   with the one in the modules-utils-backgroundthread lib, which is
   visible to Connectivity module.

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I3e13cb9c0e348333af295c2537d459aa6700ff17
Merged-In: I1956848d3248cc56e9841d221e5e4c160bed65a4
2022-03-14 13:47:01 +00:00
Aaron Huang
22999fd87a Add NetworkTemplateTest to common test for cts coverage
Test for NetworkTemplate.Builder

Bug: 215435701
Test: CtsNetTestCases
Change-Id: I3a55bc74388fa34a142abec308b67b185641c460
Merged-In: I3a55bc74388fa34a142abec308b67b185641c460
2022-03-10 14:57:46 +00:00
Xiao Ma
a9a3b4ce04 Split out the ethernet API surface and use framework-connectivity-t
Ethernet framework and service source code is going to be moved to
Connectivity mainline module, this CL contains below corresponding
changes to adapt the migration in f/b side:

1. Split out ethernet module-lib APIs to Connectivity module.
   Add the ethernet resource filegroup to tiramisu-updatable-sources
   filegroup as well, build them together. Also update the module-lib
   and system api txt to reflect the APIs change. Remove the hidden
   APIs which are moved to Connectivity module. This removal fixes the
   api inconsistent issue with Tethering/apex/hidden/.

2. Remove EthernetService from SystemServer which will be registered
   from ConnectivityServiceInitializer.

3. Replace the BackgroundThread class(imported from f/b/core/java)
   with the one in the modules-utils-backgroundthread lib, which is
   visible to Connectivity module.

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I1956848d3248cc56e9841d221e5e4c160bed65a4
2022-03-10 21:22:42 +09:00
Xiao Ma
eaaf7d3a83 Build ethernet framework source into framework-connectivity-tiramisu
- move ethernet APIs, build it into framework-connectivity-tiramisu
- start ethernet service from ConnectivityServiceInitializer
- fix EthernetManager dependnecy in Tethering module
- fix EthernetNetworkSpecifier dependency in framework-connectivity
- fix the ethernet related config resource

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Ignore-AOSP-First: Topic of Ethernet Mainline has merge conflict with
                   master, merge this CL first and cherry-pick it back.
Change-Id: I54857b8517649048a343c72797668394d5225766
2022-03-10 20:57:38 +09:00
Aaron Huang
5417280f17 Rename setUidForeground to noteUidForeground
Addresses API review feedback. Both setUidForeground in
NetworkStatsManager and NetworkStatsService are renamed to
noteUidForeground. Thus, the caller in test should be also
modified.

Bug: 222291301
Test: atest FrameworksNetTests
Change-Id: Ifa1e1af3d9fd8b1dc75a8f37947a5958f60ed415
2022-03-10 18:33:50 +08:00
Patrick Rohr
2f9ab72177 Merge "Add test for EthernetNetworkUpdateRequest" am: 6758a5dfff am: 396091b4b1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2012897

Change-Id: I3caea7ea56c7b020c3a13ecfe5e8978960b37a88
2022-03-09 10:12:36 +00:00
Patrick Rohr
6758a5dfff Merge "Add test for EthernetNetworkUpdateRequest" 2022-03-09 09:16:29 +00:00
junyulai
08e0130dcb [MS83] Add Cts for NetworkStatsCollection/History builders
Test: 1. atest CtsNetTestCases:android.net.netstats.NetworkStatsHistoryTest
 2. atest CtsNetTestCases:android.net.netstats.NetworkStatsCollectionTest
 3. atest FrameworksNetTests
Bug: 218441356
  (cherry-picked from ag/16811190)
Change-Id: If3d45325623cad987aab35f89c55f84042271adf
Merged-In: If3d45325623cad987aab35f89c55f84042271adf
2022-03-09 14:14:01 +08:00
Mark Chien
3b654e8781 Merge "Split updateMeteredNetwork{Allow, Deny}List into add and remove" am: cc29690fc1 am: 9eb82805bc
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2005313

Change-Id: Ie33ff8b5f6582005e59964d4c255f538e88441ef
2022-03-09 05:45:14 +00:00
Mark Chien
cc29690fc1 Merge "Split updateMeteredNetwork{Allow, Deny}List into add and remove" 2022-03-09 05:00:58 +00:00
markchien
e46042b833 Split updateMeteredNetwork{Allow, Deny}List into add and remove
Split the updateXXX methods into an addXXX and removeXXX instead of using
a boolean parameter to indicate whether the uid should be added or removed

Bug: 218494748
Test: atest FrameworksNetTests
Change-Id: I868cf35c8f51b25d8719e618c6c48a5cd642da7f
2022-03-09 11:17:27 +08:00