From df401092718d95a4863087bbf761b5695d34a9c3 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Wed, 20 Oct 2021 11:27:13 +0100 Subject: [PATCH] Qualify references to WifiNetworkSuggestions Connectivity's metalava invocation does not depend on framework-wifi, so these references fail to resolve, and as a result metalava currently removes the import. Fully qualify the references instead, to avoid both metalava trying to resolve the dependency, and having to depend on framework-wifi just for javadoc. Bug: 186197911 Test: build the sdk (with connectivity module stubs as input) Change-Id: I7129821b9a0d08d06f8e977a3c17fa5f5f6f9cee --- .../src/android/net/ConnectivityManager.java | 4 ++-- .../src/android/net/NetworkCapabilities.java | 17 ++++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/framework/src/android/net/ConnectivityManager.java b/framework/src/android/net/ConnectivityManager.java index 8309869a13..c21bcfa18a 100644 --- a/framework/src/android/net/ConnectivityManager.java +++ b/framework/src/android/net/ConnectivityManager.java @@ -46,7 +46,6 @@ import android.net.SocketKeepalive.Callback; import android.net.TetheringManager.StartTetheringCallback; import android.net.TetheringManager.TetheringEventCallback; import android.net.TetheringManager.TetheringRequest; -import android.net.wifi.WifiNetworkSuggestion; import android.os.Binder; import android.os.Build; import android.os.Build.VERSION_CODES; @@ -3479,7 +3478,8 @@ public class ConnectivityManager { * {@link NetworkCapabilities#getTransportInfo()}) like {@link android.net.wifi.WifiInfo} * contain location sensitive information. *
  • OwnerUid (retrieved via {@link NetworkCapabilities#getOwnerUid()} is location - * sensitive for wifi suggestor apps (i.e using {@link WifiNetworkSuggestion}).
  • + * sensitive for wifi suggestor apps (i.e using + * {@link android.net.wifi.WifiNetworkSuggestion WifiNetworkSuggestion}). *

    *

    * Note: diff --git a/framework/src/android/net/NetworkCapabilities.java b/framework/src/android/net/NetworkCapabilities.java index e9bcd95a5e..4a86873080 100644 --- a/framework/src/android/net/NetworkCapabilities.java +++ b/framework/src/android/net/NetworkCapabilities.java @@ -27,7 +27,6 @@ import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.compat.annotation.UnsupportedAppUsage; import android.net.ConnectivityManager.NetworkCallback; -import android.net.wifi.WifiNetworkSuggestion; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; @@ -1192,14 +1191,14 @@ public final class NetworkCapabilities implements Parcelable { * *

    * This field will only be populated for VPN and wifi network suggestor apps (i.e using - * {@link WifiNetworkSuggestion}), and only for the network they own. - * In the case of wifi network suggestors apps, this field is also location sensitive, so the - * 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. 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. + * {@link android.net.wifi.WifiNetworkSuggestion WifiNetworkSuggestion}), and only for the + * network they own. In the case of wifi network suggestors apps, this field is also location + * sensitive, so the 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. 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() {