Merge "Fixed speed selection lost when changing password in Wi-Fi hotspot settings" into udc-dev am: 32602794ed

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22885040

Change-Id: I16732ae62948cd37f654d03739fc21973f9c754a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2023-04-27 19:25:08 +00:00
committed by Automerger Merge Worker
2 changed files with 44 additions and 6 deletions

View File

@@ -80,11 +80,14 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
@VisibleForTesting
SettingsMainSwitchBar mMainSwitchBar;
private WifiTetherSwitchBarController mSwitchBarController;
private WifiTetherSSIDPreferenceController mSSIDPreferenceController;
private WifiTetherPasswordPreferenceController mPasswordPreferenceController;
@VisibleForTesting
WifiTetherSSIDPreferenceController mSSIDPreferenceController;
@VisibleForTesting
WifiTetherPasswordPreferenceController mPasswordPreferenceController;
private WifiTetherSecurityPreferenceController mSecurityPreferenceController;
private WifiTetherMaximizeCompatibilityPreferenceController mMaxCompatibilityPrefController;
private WifiTetherAutoOffPreferenceController mWifiTetherAutoOffPreferenceController;
@VisibleForTesting
WifiTetherAutoOffPreferenceController mWifiTetherAutoOffPreferenceController;
private boolean mUnavailable;
private WifiRestriction mWifiRestriction;
@@ -269,10 +272,12 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
setLoading(restarting, false);
}
private SoftApConfiguration buildNewConfig() {
SoftApConfiguration.Builder configBuilder = new SoftApConfiguration.Builder();
@VisibleForTesting
SoftApConfiguration buildNewConfig() {
SoftApConfiguration currentConfig = mWifiTetherViewModel.getSoftApConfiguration();
SoftApConfiguration.Builder configBuilder = new SoftApConfiguration.Builder(currentConfig);
int securityType = (mWifiTetherViewModel.isSpeedFeatureAvailable())
? mWifiTetherViewModel.getSoftApConfiguration().getSecurityType()
? currentConfig.getSecurityType()
: mSecurityPreferenceController.getSecurityType();
configBuilder.setSsid(mSSIDPreferenceController.getSSID());
if (securityType != SoftApConfiguration.SECURITY_TYPE_OPEN) {