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

Commit b8ea4aa7 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Fix WRITE_SECURE_SETTINGS permission issue"

parents 5aaeaffd 6118069b
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -405,7 +405,14 @@ public class WifiService extends IWifiManager.Stub {
        }

        mWifiStateMachine.setWifiEnabled(enable);

        /*
         * Caller might not have WRITE_SECURE_SETTINGS,
         * only CHANGE_WIFI_STATE is enforced
         */
        long ident = Binder.clearCallingIdentity();
        persistWifiEnabled(enable);
        Binder.restoreCallingIdentity(ident);

        if (enable) {
            if (!mIsReceiverRegistered) {
@@ -451,7 +458,13 @@ public class WifiService extends IWifiManager.Stub {
                wifiConfig.SSID = mContext.getString(R.string.wifi_tether_configure_ssid_default);
                wifiConfig.allowedKeyManagement.set(KeyMgmt.NONE);
            }
            /*
             * Caller might not have WRITE_SECURE_SETTINGS,
             * only CHANGE_WIFI_STATE is enforced
             */
            long ident = Binder.clearCallingIdentity();
            setWifiApConfiguration(wifiConfig);
            Binder.restoreCallingIdentity(ident);
        }

        mWifiStateMachine.setWifiApEnabled(wifiConfig, enabled);