diff options
| author | Irfan Sheriff <isheriff@google.com> | 2010-10-10 12:21:51 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-10 12:21:51 -0700 |
| commit | 7efff5c4c571d1a0111e31d73a87d27e1fae9de6 (patch) | |
| tree | 7cc269eadcd1618bf4ee69d53189395a03e0f188 | |
| parent | 7a64e3a6f3e9f4de9cb097f604187d06268c23be (diff) | |
| parent | 27827bab181b332387b6a043df430c7b1243c507 (diff) | |
| download | frameworks_base-7efff5c4c571d1a0111e31d73a87d27e1fae9de6.zip frameworks_base-7efff5c4c571d1a0111e31d73a87d27e1fae9de6.tar.gz frameworks_base-7efff5c4c571d1a0111e31d73a87d27e1fae9de6.tar.bz2 | |
Merge "fix getmacaddress race condition (don't auto-merge)" into gingerbread
| -rw-r--r-- | wifi/java/android/net/wifi/WifiStateTracker.java | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateTracker.java b/wifi/java/android/net/wifi/WifiStateTracker.java index 9d27bde..281077c 100644 --- a/wifi/java/android/net/wifi/WifiStateTracker.java +++ b/wifi/java/android/net/wifi/WifiStateTracker.java @@ -862,15 +862,7 @@ public class WifiStateTracker extends NetworkStateTracker { mIsAnyNetworkDisabled.set(false); requestConnectionInfo(); SupplicantState supplState = mWifiInfo.getSupplicantState(); - /** - * The MAC address isn't going to change, so just request it - * once here. - */ - String macaddr = getMacAddress(); - if (macaddr != null) { - mWifiInfo.setMacAddress(macaddr); - } if (LOCAL_LOGD) Log.v(TAG, "Connection to supplicant established, state=" + supplState); // Wi-Fi supplicant connection state changed: @@ -1289,6 +1281,10 @@ public class WifiStateTracker extends NetworkStateTracker { */ setNumAllowedChannels(); synchronized (this) { + String macaddr = WifiNative.getMacAddressCommand(); + if (macaddr != null) { + mWifiInfo.setMacAddress(macaddr); + } if (mRunState == RUN_STATE_STARTING) { mRunState = RUN_STATE_RUNNING; if (!mIsScanOnly) { @@ -2010,18 +2006,6 @@ public class WifiStateTracker extends NetworkStateTracker { } /** - * Get MAC address of radio - * - * @return MAC address, null on failure - */ - public synchronized String getMacAddress() { - if (mWifiState.get() != WIFI_STATE_ENABLED || isDriverStopped()) { - return null; - } - return WifiNative.getMacAddressCommand(); - } - - /** * Start driver * * @return {@code true} if the operation succeeds, {@code false} otherwise |
