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

Commit 7efff5c4 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "fix getmacaddress race condition (don't auto-merge)" into gingerbread

parents 7a64e3a6 27827bab
Loading
Loading
Loading
Loading
+4 −20
Original line number Diff line number Diff line
@@ -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) {
@@ -2009,18 +2005,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
     *