From 8b7e0d7c88a85d9e1e25aef00e90d6a09a13959e Mon Sep 17 00:00:00 2001 From: Weng Su Date: Fri, 19 May 2023 11:37:46 +0800 Subject: [PATCH] Avoid hotspot band updates when country code is inactive - The SAP usable channels cannot be queried when the country code is not activated, causing UI to display wrong design Bug: 280554293 Test: Manual test atest -c WifiHotspotRepositoryTest Change-Id: I58e8879438d7a630808aa2c4b69f21eb19968ab1 --- .../settings/wifi/repository/WifiHotspotRepository.java | 6 ------ .../settings/wifi/repository/WifiHotspotRepositoryTest.java | 2 -- 2 files changed, 8 deletions(-) diff --git a/src/com/android/settings/wifi/repository/WifiHotspotRepository.java b/src/com/android/settings/wifi/repository/WifiHotspotRepository.java index c46fb2b0053..676421472a2 100644 --- a/src/com/android/settings/wifi/repository/WifiHotspotRepository.java +++ b/src/com/android/settings/wifi/repository/WifiHotspotRepository.java @@ -102,7 +102,6 @@ public class WifiHotspotRepository { protected Boolean mIs6gBandSupported; protected Boolean mIs6gAvailable; protected MutableLiveData m6gAvailable; - protected String mCurrentCountryCode; protected ActiveCountryCodeChangedCallback mActiveCountryCodeChangedCallback; @VisibleForTesting @@ -568,17 +567,12 @@ public class WifiHotspotRepository { @Override public void onActiveCountryCodeChanged(String country) { log("onActiveCountryCodeChanged(), country:" + country); - mCurrentCountryCode = country; purgeRefreshData(); refresh(); } @Override public void onCountryCodeInactive() { - log("onCountryCodeInactive()"); - mCurrentCountryCode = null; - purgeRefreshData(); - refresh(); } } diff --git a/tests/unit/src/com/android/settings/wifi/repository/WifiHotspotRepositoryTest.java b/tests/unit/src/com/android/settings/wifi/repository/WifiHotspotRepositoryTest.java index 7110a1b2a52..af3b8f13ad4 100644 --- a/tests/unit/src/com/android/settings/wifi/repository/WifiHotspotRepositoryTest.java +++ b/tests/unit/src/com/android/settings/wifi/repository/WifiHotspotRepositoryTest.java @@ -78,7 +78,6 @@ import java.util.List; public class WifiHotspotRepositoryTest { static final String WIFI_SSID = "wifi_ssid"; static final String WIFI_PASSWORD = "wifi_password"; - static final String WIFI_CURRENT_COUNTRY_CODE = "US"; static final int WIFI_5GHZ_BAND_PREFERRED = BAND_2GHZ_5GHZ; static final int WIFI_6GHZ_BAND_PREFERRED = BAND_2GHZ_5GHZ_6GHZ; @@ -112,7 +111,6 @@ public class WifiHotspotRepositoryTest { mRepository = new WifiHotspotRepository(mContext, mWifiManager, mTetheringManager); mRepository.mSecurityType = mSecurityType; mRepository.mSpeedType = mSpeedType; - mRepository.mCurrentCountryCode = WIFI_CURRENT_COUNTRY_CODE; mRepository.mIsDualBand = true; mRepository.mIs5gAvailable = true; mRepository.mIs6gAvailable = true;