From 8d1668da94c1369f6d68e71007c3255336cb6b92 Mon Sep 17 00:00:00 2001 From: Zheng BaoZhong Date: Wed, 5 Aug 2009 08:57:49 -0400 Subject: [PATCH] Wifi: Fix synchronization bug in multicast lock. Signed-off-by: Mike Lockwood --- services/java/com/android/server/WifiService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index d4e57d2397dbf..fae987a3af878 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -1889,7 +1889,9 @@ public class WifiService extends IWifiManager.Stub { // our new size == 1 (first call), but this function won't // be called often and by making the stopPacket call each // time we're less fragile and self-healing. - WifiNative.stopPacketFiltering(); + synchronized (mWifiStateTracker) { + WifiNative.stopPacketFiltering(); + } } int uid = Binder.getCallingUid(); @@ -1925,7 +1927,9 @@ public class WifiService extends IWifiManager.Stub { removed.unlinkDeathRecipient(); } if (mMulticasters.size() == 0) { - WifiNative.startPacketFiltering(); + synchronized (mWifiStateTracker) { + WifiNative.startPacketFiltering(); + } } Long ident = Binder.clearCallingIdentity();