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

Commit 8c461c6f authored by Yuhao Zheng's avatar Yuhao Zheng
Browse files

Fix Settings app crash while enabling tethering

While enabling Portable Wifi hotspot in Settings, a null WifiConfiguration
is provided. This null config is on purpose and meanful, and it should bypass
the validation test to avoid the NullPointerException.

Bug: 10780414

Change-Id: Ic507ecae463946c925b3d5fb5a1d185b37db410f
parent b693ef60
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -582,7 +582,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");