[Settings] configuration for hidding SIM provider UI

Hide SIM provider UI based on configuraion.

Bug: 240515161
Test: test cases and local testing
Merged-In: I1cb83787dc1ac1d61bb6bed6aa9c5e7a3ad6e69b
Change-Id: Ibe22c3ba377a15f770622d235ebddc63b4bf3ed6
This commit is contained in:
Bonian Chen
2022-11-14 10:06:48 +00:00
parent ccfa7fa918
commit 0e03586dda
7 changed files with 25 additions and 4 deletions

View File

@@ -341,7 +341,18 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
}
}
/**
* Whether to show any UI which is SIM related.
*/
@VisibleForTesting
boolean showAnySubscriptionInfo(Context context) {
return (context != null) && SubscriptionUtil.isSimHardwareVisible(context);
}
private void addNetworkMobileProviderController() {
if (!showAnySubscriptionInfo(getContext())) {
return;
}
if (mNetworkMobileProviderController == null) {
mNetworkMobileProviderController = new NetworkMobileProviderController(
getContext(), PREF_KEY_PROVIDER_MOBILE_NETWORK);