Merge "Ignore no permission calls for CaptivePortal.appRequest" into main

This commit is contained in:
Chiachang Wang 2024-03-14 06:48:06 +00:00 • committed by Gerrit Code Review
commit 4cd5b9e2d2

View file

@ -6021,7 +6021,15 @@ public class ConnectivityService extends IConnectivityManager.Stub
if (nm == null) return;
if (request == CaptivePortal.APP_REQUEST_REEVALUATION_REQUIRED) {
enforceNetworkStackPermission(mContext);
// This enforceNetworkStackPermission() should be adopted to check
// the required permission but this may be break OEM captive portal
// apps. Simply ignore the request if the caller does not have
// permission.
if (!hasNetworkStackPermission()) {
Log.e(TAG, "Calling appRequest() without proper permission. Skip");
return;
}
nm.forceReevaluation(mDeps.getCallingUid());
}
}