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

This commit is contained in:
Yuhao Zheng
2013-09-16 20:36:50 +00:00
committed by Android (Google) Code Review

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");