[Settings] configuration for hidding SIM provider UI

Hide SIM provider UI based on configuraion.

Bug: 240515161
Test: test cases and local testing
Change-Id: I1cb83787dc1ac1d61bb6bed6aa9c5e7a3ad6e69b
This commit is contained in:
Bonian Chen
2022-10-18 03:33:50 +00:00
parent d16201a375
commit 2f07595eb0
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);