diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 3f18ea91c99a3..f908abcc7ebd2 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -2761,8 +2761,10 @@ public abstract class Context { *
A {@link android.net.ConnectivityManager ConnectivityManager} for * handling management of network connections. *
{@link #WIFI_SERVICE} ("wifi") - *
A {@link android.net.wifi.WifiManager WifiManager} for management of - * Wi-Fi connectivity. + *
A {@link android.net.wifi.WifiManager WifiManager} for management of Wi-Fi + * connectivity. On releases before NYC, it should only be obtained from an application + * context, and not from any other derived context to avoid memory leaks within the calling + * process. *
{@link #WIFI_P2P_SERVICE} ("wifip2p") *
A {@link android.net.wifi.p2p.WifiP2pManager WifiP2pManager} for management of * Wi-Fi Direct connectivity. diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index bbc3d2fd5927f..1633bd9c914a6 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -49,6 +49,8 @@ import java.util.concurrent.CountDownLatch; * This class provides the primary API for managing all aspects of Wi-Fi * connectivity. Get an instance of this class by calling * {@link android.content.Context#getSystemService(String) Context.getSystemService(Context.WIFI_SERVICE)}. + * On releases before NYC, it should only be obtained from an application context, and not from + * any other derived context to avoid memory leaks within the calling process. * It deals with several categories of items: *