Change the sanitizeCaps signature in preparation for moving
This will move to NetworkAgentInfo. The caps argument is always the same and can be removed, while the nai argument will become 'this'. The authenticator will need to be passed. This is a second step towards addressing the leftover comment from aosp/1958906. Bug: 238139913 Test: FrameworksNetTests CtsNetTestCases Change-Id: Ife5e91de15d0571f1251d2cd6f1b3ecc256572c6
This commit is contained in:
@@ -3607,7 +3607,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
nai.declaredCapabilitiesUnsanitized =
|
||||
new NetworkCapabilities((NetworkCapabilities) arg.second);
|
||||
final NetworkCapabilities sanitized = sanitizedCapabilitiesFromAgent(
|
||||
nai, nai.declaredCapabilitiesUnsanitized);
|
||||
mCarrierPrivilegeAuthenticator, nai);
|
||||
maybeUpdateWifiRoamTimestamp(nai, sanitized);
|
||||
updateCapabilities(nai.getCurrentScore(), nai, sanitized);
|
||||
break;
|
||||
@@ -7331,7 +7331,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
nai.declaredCapabilitiesUnsanitized = new NetworkCapabilities(nai.networkCapabilities);
|
||||
// Make sure the LinkProperties and NetworkCapabilities reflect what the agent info said.
|
||||
final NetworkCapabilities nc =
|
||||
sanitizedCapabilitiesFromAgent(nai, nai.declaredCapabilitiesUnsanitized);
|
||||
sanitizedCapabilitiesFromAgent(mCarrierPrivilegeAuthenticator, nai);
|
||||
nai.getAndSetNetworkCapabilities(mixInCapabilities(nai, nc));
|
||||
processLinkPropertiesFromAgent(nai, lp);
|
||||
nai.linkProperties = lp;
|
||||
@@ -7809,9 +7809,10 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
* {@link NetworkAgentInfo#declaredCapabilitiesUnsanitized}.
|
||||
*/
|
||||
// TODO : move this to NetworkAgentInfo
|
||||
private NetworkCapabilities sanitizedCapabilitiesFromAgent(@NonNull final NetworkAgentInfo nai,
|
||||
@NonNull final NetworkCapabilities unsanitized) {
|
||||
final NetworkCapabilities nc = new NetworkCapabilities(unsanitized);
|
||||
private NetworkCapabilities sanitizedCapabilitiesFromAgent(
|
||||
final CarrierPrivilegeAuthenticator carrierPrivilegeAuthenticator,
|
||||
@NonNull final NetworkAgentInfo nai) {
|
||||
final NetworkCapabilities nc = new NetworkCapabilities(nai.declaredCapabilitiesUnsanitized);
|
||||
if (nc.hasConnectivityManagedCapability()) {
|
||||
Log.wtf(TAG, "BUG: " + nai + " has CS-managed capability.");
|
||||
}
|
||||
@@ -7822,7 +7823,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
}
|
||||
NetworkAgentInfo.restrictCapabilitiesFromNetworkAgent(nc, nai.creatorUid,
|
||||
mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE),
|
||||
mCarrierPrivilegeAuthenticator);
|
||||
carrierPrivilegeAuthenticator);
|
||||
return nc;
|
||||
}
|
||||
|
||||
@@ -7951,7 +7952,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
|
||||
if (nai.propagateUnderlyingCapabilities()) {
|
||||
applyUnderlyingCapabilities(nai.declaredUnderlyingNetworks,
|
||||
sanitizedCapabilitiesFromAgent(nai, nai.declaredCapabilitiesUnsanitized),
|
||||
sanitizedCapabilitiesFromAgent(mCarrierPrivilegeAuthenticator, nai),
|
||||
newNc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user