am af672998: Merge "Fix Settings app crash while enabling tethering" into klp-dev

* commit 'af672998af7fb0bba90f7d56504584a63ff189fa':
  Fix Settings app crash while enabling tethering
This commit is contained in:
Yuhao Zheng
2013-09-16 13:39:35 -07:00
committed by Android Git Automerger

View File

@@ -588,7 +588,8 @@ public final class WifiService extends IWifiManager.Stub {
*/
public void setWifiApEnabled(WifiConfiguration wifiConfig, boolean enabled) {
enforceChangePermission();
if (wifiConfig.isValid()) {
// null wifiConfig is a meaningful input for CMD_SET_AP
if (wifiConfig == null || wifiConfig.isValid()) {
mWifiController.obtainMessage(CMD_SET_AP, enabled ? 1 : 0, 0, wifiConfig).sendToTarget();
} else {
Slog.e(TAG, "Invalid WifiConfiguration");