From 189d009e37e85d4d1f0fa3d10023e0f09198b562 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 11 Mar 2021 21:16:44 -0800 Subject: [PATCH] ConnectivityManager: Address review comments from aosp/1595396 Bug: 156867433 Test: atest android.net Test: atest com.android.server Change-Id: I7f5d043732ae22edd14bf581b7dc676c9236b545 --- framework/src/android/net/ConnectivityManager.java | 2 ++ framework/src/android/net/NetworkCapabilities.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/src/android/net/ConnectivityManager.java b/framework/src/android/net/ConnectivityManager.java index d196c1a2d1..68f9fbbd28 100644 --- a/framework/src/android/net/ConnectivityManager.java +++ b/framework/src/android/net/ConnectivityManager.java @@ -3409,6 +3409,8 @@ public class ConnectivityManager { * not include location sensitive info. *

*/ + // Note: Some existing fields which are location sensitive may still be included without + // this flag if the app targets SDK < S (to maintain backwards compatibility). public static final int FLAG_INCLUDE_LOCATION_INFO = 1 << 0; /** @hide */ diff --git a/framework/src/android/net/NetworkCapabilities.java b/framework/src/android/net/NetworkCapabilities.java index 881fa8c270..d9acc3178a 100644 --- a/framework/src/android/net/NetworkCapabilities.java +++ b/framework/src/android/net/NetworkCapabilities.java @@ -1141,7 +1141,9 @@ public final class NetworkCapabilities implements Parcelable { * app needs to hold {@link android.Manifest.permission#ACCESS_FINE_LOCATION} permission. If the * app targets SDK version greater than or equal to {@link Build.VERSION_CODES#S}, then they * also need to use {@link NetworkCallback#FLAG_INCLUDE_LOCATION_INFO} to get the info in their - * callback. The app will be blamed for location access if this field is included. + * callback. If the apps targets SDK version equal to {{@link Build.VERSION_CODES#R}, this field + * will always be included. The app will be blamed for location access if this field is + * included. *

*/ public int getOwnerUid() {