commit | 6b2d573a5c93819261d3b587ba10715f8f0a7970 | [log] [tgz] |
---|---|---|
author | Patrick Rohr <prohr@google.com> | Wed Mar 19 09:25:19 2025 -0700 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Mar 19 09:25:19 2025 -0700 |
tree | 3d5a82e4ba4b22aa62c308f86fed8107f77c9540 | |
parent | 9c2f4c01bdf1084c2de67c86ab6648f4caadb0fb [diff] | |
parent | 27b011caf2edb02e550e1f8aa2eae3e2066d27b3 [diff] |
Add missing permission check to offerNetwork am: 27b011caf2 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/31944104 Change-Id: I95d3caea5871aaee7a2a60153054ae0294f501c1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java index a12f3cd..8abe564 100755 --- a/service/src/com/android/server/ConnectivityService.java +++ b/service/src/com/android/server/ConnectivityService.java
@@ -7487,6 +7487,11 @@ Objects.requireNonNull(score); Objects.requireNonNull(caps); Objects.requireNonNull(callback); + if (caps.hasTransport(TRANSPORT_TEST)) { + enforceAnyPermissionOf(mContext, Manifest.permission.MANAGE_TEST_NETWORKS); + } else { + enforceNetworkFactoryPermission(); + } final boolean yieldToBadWiFi = caps.hasTransport(TRANSPORT_CELLULAR) && !avoidBadWifi(); final NetworkOffer offer = new NetworkOffer( FullScore.makeProspectiveScore(score, caps, yieldToBadWiFi),