Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a86f1ccc authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change Ie2d155a5 into eclair-mr2

* changes:
  Add a new API for initing Wifi multicast filtering
parents 54616f34 e2d155a5
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1829,6 +1829,19 @@ public class WifiService extends IWifiManager.Stub {
        }
    }

    public void initializeMulticastFiltering() {
        enforceMulticastChangePermission();

        synchronized (mMulticasters) {
            // if anybody had requested filters be off, leave off
            if (mMulticasters.size() != 0) {
                return;
            } else {
                WifiNative.startPacketFiltering();
            }
        }
    }

    public void acquireMulticastLock(IBinder binder, String tag) {
        enforceMulticastChangePermission();

+2 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ interface IWifiManager

    boolean releaseWifiLock(IBinder lock);

    void initializeMulticastFiltering();

    boolean isMulticastEnabled();

    void acquireMulticastLock(IBinder binder, String tag);
+13 −0
Original line number Diff line number Diff line
@@ -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;
        }
    }
}
+1 −9
Original line number Diff line number Diff line
@@ -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);