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

Commit a7e606e4 authored by Etan Cohen's avatar Etan Cohen Committed by Android (Google) Code Review
Browse files

Merge "Force MAC randomization to enabled on ACTION_WIFI_ADD_NETWORKS" into udc-dev

parents 4940c297 d3f7fa6a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -655,6 +655,10 @@ public class AddAppNetworksFragment extends InstrumentedFragment implements
            try {
                mWifiManager.addOrUpdatePasspointConfiguration(passpointConfig);
                mAnyNetworkSavedSuccess = true;

                // (force) enable MAC randomization on new credentials
                mWifiManager.setMacRandomizationSettingPasspointEnabled(
                        passpointConfig.getHomeSp().getFqdn(), true);
            } catch (IllegalArgumentException e) {
                mResultCodeArrayList.set(mUiToRequestedList.get(index).mIndex,
                        RESULT_NETWORK_ADD_ERROR);
@@ -669,6 +673,10 @@ public class AddAppNetworksFragment extends InstrumentedFragment implements
            final WifiConfiguration wifiConfiguration =
                    mUiToRequestedList.get(index).mWifiNetworkSuggestion.getWifiConfiguration();
            wifiConfiguration.SSID = addQuotationIfNeeded(wifiConfiguration.SSID);

            // (force) enable MAC randomization on new credentials
            wifiConfiguration.setMacRandomizationSetting(
                    WifiConfiguration.RANDOMIZATION_PERSISTENT);
            mWifiManager.save(wifiConfiguration, mSaveListener);
        }
    }