Restart Wi-Fi tethering automatically if configuration change

- When the Wi-Fi Hotspot is already started, if the user changes the configuration, the Wi-Fi Hotspot will be restarted automatically.

- When the Wi-Fi hotspot restarts, display a circle on the screen to indicate that it is processing.

Bug: 245258763
Test: manual test
atest -c WifiTetherSettingsTest \
         WifiHotspotSpeedSettingsTest
atest -c WifiHotspotRepositoryTest \
         WifiHotspotSecuritySettingsTest \
         WifiHotspotSecurityViewModelTest \
         WifiHotspotSpeedViewModelTest \
         WifiTetherViewModelTest

Change-Id: I6fdd5892916703095f28d0589ebc3b7dd59fcd61
This commit is contained in:
Weng Su
2023-04-20 21:40:30 +08:00
parent 0a506448b8
commit bf0e8c1dc7
15 changed files with 552 additions and 178 deletions

View File

@@ -100,6 +100,15 @@ public class WifiTetherViewModel extends AndroidViewModel {
return mWifiHotspotRepository.isSpeedFeatureAvailable();
}
/**
* Gets the Wi-Fi tethered AP Configuration.
*
* @return AP details in {@link SoftApConfiguration}
*/
public SoftApConfiguration getSoftApConfiguration() {
return mWifiHotspotRepository.getSoftApConfiguration();
}
/**
* Sets the tethered Wi-Fi AP Configuration.
*
@@ -153,4 +162,11 @@ public class WifiTetherViewModel extends AndroidViewModel {
}
mSpeedSummary.setValue(resId);
}
/**
* Gets Restarting LiveData
*/
public LiveData<Boolean> getRestarting() {
return mWifiHotspotRepository.getRestarting();
}
}