Hide roaming option when carriers force all networks as HOME networks
This change will hide roaming option in carrier's network setting if the carrier overrrides the carrier config force_home_network_bool to true. Some carriers, like google Fi, has no concept of roaming. The carrier config force_home_network_bool is overridden to true to treat all cellular networks as home networks. There is no actually impact when user turn on/off the roaming option in network setting. Leaving an unused option just confuse many end users. Bug: 79424760 Test: make && make RunSettingsRoboTests Test: activate Fi service and make sure no roaming option Test: activate VZW service and make sure roaming option is present Test: override the cc config with adb command to make sure the roaming option is always correctly shown/hidden on the cc key values Change-Id: If6d0f7e3a5edea368b3a725afd9a2b4d1ad686ed
This commit is contained in:
@@ -65,6 +65,16 @@ public class RoamingPreferenceController extends TelephonyTogglePreferenceContro
|
||||
mCarrierConfigManager = context.getSystemService(CarrierConfigManager.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
|
||||
if (carrierConfig != null && carrierConfig.getBoolean(
|
||||
CarrierConfigManager.KEY_FORCE_HOME_NETWORK_BOOL)) {
|
||||
return CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
return AVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
if (mListener == null) {
|
||||
|
Reference in New Issue
Block a user