send network state changed broadcast when BSSID change

Change-Id: I1920d8656a9db0aead90787b5049106a5e7ab538
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index fb9e9fd..7c65f3a 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -7263,7 +7263,12 @@
                         break;
                     }
                     mLastBssid = (String) message.obj;
-                    mWifiInfo.setBSSID((String) message.obj);
+                    if (mLastBssid != null
+                            && (mWifiInfo.getBSSID() == null
+                            || !mLastBssid.equals(mWifiInfo.getBSSID()))) {
+                        mWifiInfo.setBSSID((String) message.obj);
+                        sendNetworkStateChangeBroadcast(mLastBssid);
+                    }
                     break;
                 default:
                     return NOT_HANDLED;
@@ -7537,6 +7542,7 @@
                        mWifiInfo.setBSSID(mLastBssid);
                        mWifiInfo.setNetworkId(mLastNetworkId);
                        mWifiConfigStore.handleBSSIDBlackList(mLastNetworkId, mLastBssid, true);
+                       sendNetworkStateChangeBroadcast(mLastBssid);
                        transitionTo(mObtainingIpState);
                    } else {
                        messageHandlingStatus = MESSAGE_HANDLING_STATUS_DISCARD;