summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2016-08-26 17:50:18 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-08-26 17:50:21 +0000
commit855210170c19a28f408137f0ab9d618abb5e008b (patch)
tree5e83dc4c5a2b463065ee4dff9d9c48e245f8e778
parent6bf296f6dc3c4ff2e4b345ad027762cd55df0fa0 (diff)
parent0e164b199ee33dbb1e9feeaa24c52231f9b81ac0 (diff)
Merge "Document correct context for obtaining WifiManager" into nyc-mr1-dev
-rw-r--r--core/java/android/content/Context.java6
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java2
2 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 3f18ea91c99a..f908abcc7ebd 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -2761,8 +2761,10 @@ public abstract class Context {
* <dd> A {@link android.net.ConnectivityManager ConnectivityManager} for
* handling management of network connections.
* <dt> {@link #WIFI_SERVICE} ("wifi")
- * <dd> A {@link android.net.wifi.WifiManager WifiManager} for management of
- * Wi-Fi connectivity.
+ * <dd> 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.
* <dt> {@link #WIFI_P2P_SERVICE} ("wifip2p")
* <dd> 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 bbc3d2fd5927..1633bd9c914a 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:
* <ul>