diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2016-10-10 09:07:22 -0600 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2016-10-10 09:07:22 -0600 |
commit | 3af8543217b11cb1d539c455a83b6c81f7ca6f9b (patch) | |
tree | b11c17af1e1b4b024f2ee444cdbb34024326d58d | |
parent | ff11b78c8fae99f240769f980017f1b64d560fdc (diff) | |
parent | 8d36019a03d68dfba436532d105e1d233217bcc2 (diff) | |
download | android_frameworks_opt_net_wifi-3af8543217b11cb1d539c455a83b6c81f7ca6f9b.tar.gz android_frameworks_opt_net_wifi-3af8543217b11cb1d539c455a83b6c81f7ca6f9b.tar.bz2 android_frameworks_opt_net_wifi-3af8543217b11cb1d539c455a83b6c81f7ca6f9b.zip |
Merge 8d36019a03d68dfba436532d105e1d233217bcc2 on remote branch
Change-Id: Ie95d20e7ade5f482d7f22c6e56f632ff1703f077
6 files changed, 28 insertions, 12 deletions
diff --git a/service/java/com/android/server/wifi/SoftApManager.java b/service/java/com/android/server/wifi/SoftApManager.java index a91a4eec7..4fdc6bfb0 100644 --- a/service/java/com/android/server/wifi/SoftApManager.java +++ b/service/java/com/android/server/wifi/SoftApManager.java @@ -190,7 +190,7 @@ public class SoftApManager { } /* Setup country code if it is provide. */ - if (mCountryCode != null) { + if (mCountryCode != null && (mCountryCode.length() != 0)) { /** * Country code is mandatory for 5GHz band, return an error if failed to set * country code when AP is configured for 5GHz band. diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index cc6fe000f..855afa7e0 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -802,7 +802,7 @@ public class WifiMetrics { public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { synchronized (mLock) { pw.println("WifiMetrics:"); - if (args.length > 0 && PROTO_DUMP_ARG.equals(args[0])) { + if ((args != null) && args.length > 0 && PROTO_DUMP_ARG.equals(args[0])) { //Dump serialized WifiLog proto consolidateProto(true); for (ConnectionEvent event : mConnectionEventList) { diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index 505ad0dd8..297c29f78 100755 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -189,6 +189,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { private final WifiCertManager mCertManager; private final WifiInjector mWifiInjector; + private boolean mIsControllerStarted = false; /** * Asynchronous channel to WifiStateMachine */ @@ -446,6 +447,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { mInIdleMode = mPowerManager.isDeviceIdleMode(); mWifiController.start(); + mIsControllerStarted = true; // If we are already disabled (could be due to airplane mode), avoid changing persist // state here @@ -621,6 +623,10 @@ public class WifiServiceImpl extends IWifiManager.Stub { Binder.restoreCallingIdentity(ident); } + if (!mIsControllerStarted) { + Slog.e(TAG,"WifiController is not yet started, abort setWifiEnabled"); + return false; + } mWifiController.sendMessage(CMD_WIFI_TOGGLED); return true; } diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 9c24b775e..5ebb4ff9f 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -1359,6 +1359,7 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss mCountryCode.enableVerboseLogging(mVerboseLoggingLevel); mWifiLogger.startLogging(DBG); mWifiMonitor.enableVerboseLogging(mVerboseLoggingLevel); + mWifiP2pServiceImpl.enableVerboseLogging(mVerboseLoggingLevel); mWifiNative.enableVerboseLogging(mVerboseLoggingLevel); mWifiConfigManager.enableVerboseLogging(mVerboseLoggingLevel); mSupplicantStateTracker.enableVerboseLogging(mVerboseLoggingLevel); @@ -6743,6 +6744,8 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss sendNetworkStateChangeBroadcast(mLastBssid); } mDriverRoaming = true; + sendMessageDelayed(obtainMessage(CMD_IP_RECHABILITY_SESSION_END, + 0, 0), 10000); break; case CMD_RSSI_POLL: if (message.arg1 == mRssiPollToken) { @@ -7115,6 +7118,8 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss // mIpManager.confirmConfiguration() is called within // the handling of SupplicantState.COMPLETED. mDriverRoaming = true; + sendMessageDelayed(obtainMessage(CMD_IP_RECHABILITY_SESSION_END, + 0, 0), 10000); transitionTo(mConnectedState); } else { messageHandlingStatus = MESSAGE_HANDLING_STATUS_DISCARD; @@ -7182,12 +7187,6 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss mWifiConnectivityManager.handleConnectionStateChanged( WifiConnectivityManager.WIFI_STATE_CONNECTED); } - - if (mDriverRoaming) { - sendMessageDelayed(obtainMessage(CMD_IP_RECHABILITY_SESSION_END, - 0, 0), 10000); - - } registerConnected(); lastConnectAttemptTimestamp = 0; targetWificonfiguration = null; diff --git a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java index f51e5b5fa..5b82167e5 100644 --- a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java +++ b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java @@ -101,7 +101,7 @@ import java.util.List; */ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub { private static final String TAG = "WifiP2pService"; - private static final boolean DBG = false; + private static boolean DBG = false; private static final String NETWORKTYPE = "WIFI_P2P"; private Context mContext; @@ -484,6 +484,14 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub { return new Messenger(mP2pStateMachine.getHandler()); } + public void enableVerboseLogging(int verbose) { + if (verbose > 0 ) { + DBG = true; + } else { + DBG = false; + } + } + /** This is used to provide information to drivers to optimize performance depending * on the current mode of operation. * 0 - disabled @@ -876,6 +884,7 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub { class P2pNotSupportedState extends State { @Override public boolean processMessage(Message message) { + if (DBG) logd(getName() + message.toString()); switch (message.what) { case WifiP2pManager.DISCOVER_PEERS: replyToMessage(message, WifiP2pManager.DISCOVER_PEERS_FAILED, diff --git a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java index d279482ff..7108cb857 100644 --- a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java +++ b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java @@ -2540,9 +2540,11 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub { void logCallback(String callback, ClientInfo ci, int id, String extra) { StringBuilder sb = new StringBuilder(); sb.append(callback) - .append(": ") - .append(ci.toString()) - .append(",Id=") + .append(": "); + if (ci != null) { + sb.append(ci.toString()); + } + sb .append(",Id=") .append(id); if (extra != null) { sb.append(",").append(extra); |