Merge "Address comments on aosp/1612040." am: 0f6df3ba7d am: d0a19e01c1

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1613962

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I292f206377968a10052e0759d26819583e164b5a
This commit is contained in:
Treehugger Robot
2021-03-04 04:22:37 +00:00
committed by Automerger Merge Worker

View File

@@ -1478,7 +1478,10 @@ public class ConnectivityService extends IConnectivityManager.Stub
@NonNull
private NetworkInfo filterNetworkInfo(@NonNull NetworkInfo networkInfo, int type,
@NonNull NetworkCapabilities nc, int uid, boolean ignoreBlocked) {
NetworkInfo filtered = new NetworkInfo(networkInfo);
final NetworkInfo filtered = new NetworkInfo(networkInfo);
// Many legacy types (e.g,. TYPE_MOBILE_HIPRI) are not actually a property of the network
// but only exists if an app asks about them or requests them. Ensure the requesting app
// gets the type it asks for.
filtered.setType(type);
final DetailedState state = isNetworkWithCapabilitiesBlocked(nc, uid, ignoreBlocked)
? DetailedState.BLOCKED