Make the temporary NC sanitized instead of inlining

This is a no-op refactoring. This will be useful to
mutate a member of the NC before sending it to the app.

Test: ConnectivityServiceTest
Change-Id: I1cf472bd7626d5ee2b163078a695c4a52ac39085
This commit is contained in:
Chalard Jean 2022-02-28 10:58:17 +09:00 • committed by Paul Hu
commit 713e38cd31

View file

@ -8352,14 +8352,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
switch (notificationType) {
case ConnectivityManager.CALLBACK_AVAILABLE: {
final NetworkCapabilities nc =
networkCapabilitiesRestrictedForCallerPermissions(
networkAgent.networkCapabilities, nri.mPid, nri.mUid);
putParcelable(
bundle,
createWithLocationInfoSanitizedIfNecessaryWhenParceled(
nc, includeLocationSensitiveInfo, nri.mPid, nri.mUid,
networkCapabilitiesRestrictedForCallerPermissions(
networkAgent.networkCapabilities, nri.mPid, nri.mUid),
includeLocationSensitiveInfo, nri.mPid, nri.mUid,
nrForCallback.getRequestorPackageName(),
nri.mCallingAttributionTag));
nri.mCallingAttributionTag);
putParcelable(bundle, nc);
putParcelable(bundle, linkPropertiesRestrictedForCallerPermissions(
networkAgent.linkProperties, nri.mPid, nri.mUid));
// For this notification, arg1 contains the blocked status.