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

Commit e843dea8 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android Git Automerger
Browse files

am 7efff5c4: Merge "fix getmacaddress race condition (don\'t auto-merge)" into gingerbread

Merge commit '7efff5c4' into gingerbread-plus-aosp

* commit '7efff5c4':
  fix getmacaddress race condition (don't auto-merge)
parents 390aceaf 7efff5c4
Loading
Loading
Loading
Loading
+4 −20
Original line number Diff line number Diff line
@@ -863,15 +863,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:
@@ -1290,6 +1282,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 {
        return WifiNative.getLinkSpeedCommand();
    }

    /**
     * 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
     *