summaryrefslogtreecommitdiffstats
path: root/wifi/java/android
diff options
context:
space:
mode:
authorRobert Greenwalt <robdroid@android.com>2009-10-21 14:58:34 -0700
committerRobert Greenwalt <robdroid@android.com>2009-10-21 15:03:44 -0700
commite2d155a51e68694e17fa6e27d05c928215a5dbcf (patch)
treed092da97d68fc4adf8aa2536f452af3f8cd700b1 /wifi/java/android
parent3f9faf473712be7d6471913b921bf8a63ab3205d (diff)
downloadframeworks_base-e2d155a51e68694e17fa6e27d05c928215a5dbcf.zip
frameworks_base-e2d155a51e68694e17fa6e27d05c928215a5dbcf.tar.gz
frameworks_base-e2d155a51e68694e17fa6e27d05c928215a5dbcf.tar.bz2
Add a new API for initing Wifi multicast filtering
Gets rid of the old method which generated Log noise. bug: 1973855
Diffstat (limited to 'wifi/java/android')
-rw-r--r--wifi/java/android/net/wifi/IWifiManager.aidl2
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java13
-rw-r--r--wifi/java/android/net/wifi/WifiStateTracker.java10
3 files changed, 16 insertions, 9 deletions
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index 73dbb6f..f3738e3 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -70,6 +70,8 @@ interface IWifiManager
boolean releaseWifiLock(IBinder lock);
+ void initializeMulticastFiltering();
+
boolean isMulticastEnabled();
void acquireMulticastLock(IBinder binder, String tag);
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 27755ed..178f76e 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -1056,4 +1056,17 @@ public class WifiManager {
return false;
}
}
+
+ /**
+ * Initialize the multicast filtering to 'on'
+ * @hide no intent to publish
+ */
+ public boolean initializeMulticastFiltering() {
+ try {
+ mService.initializeMulticastFiltering();
+ return true;
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
}
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java
index b7d3a6e..d8538ea 100644
--- a/wifi/java/android/net/wifi/WifiStateTracker.java
+++ b/wifi/java/android/net/wifi/WifiStateTracker.java
@@ -786,16 +786,8 @@ public class WifiStateTracker extends NetworkStateTracker {
* Filter out multicast packets. This saves battery power, since
* the CPU doesn't have to spend time processing packets that
* are going to end up being thrown away.
- *
- * Note that rather than turn this off directly, we use the
- * public api - this keeps us all in sync - turn multicast on
- * first and then off.. if nobody else wants it on it'll be
- * off then and it's all synchronized within the API.
*/
- WifiManager.MulticastLock l =
- mWM.createMulticastLock("WifiStateTracker");
- l.acquire();
- l.release();
+ mWM.initializeMulticastFiltering();
if (mBluetoothA2dp == null) {
mBluetoothA2dp = new BluetoothA2dp(mContext);