[Settings] Refactor MobileNetworkUtils

Code refactor MobileNetworkUtils
  - reorder the rule within #shouldDisplayNetworkSelectOptions()

Bug: 201757298
Test: presubmit pass
Change-Id: Idba39ca806263b850fa23aa8bb2dd423860bc043
This commit is contained in:
Bonian Chen
2021-10-01 23:00:03 +08:00
parent b74ccf7f33
commit 1eef718549

View File

@@ -468,10 +468,7 @@ public class MobileNetworkUtils {
return false; return false;
} }
if (!isWorldMode(context, subId)) { if (isWorldMode(context, subId)) {
return isGsmBasicOptions(context, subId);
}
final int networkMode = getNetworkTypeFromRaf( final int networkMode = getNetworkTypeFromRaf(
(int) telephonyManager.getAllowedNetworkTypesForReason( (int) telephonyManager.getAllowedNetworkTypesForReason(
TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)); TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
@@ -482,15 +479,12 @@ public class MobileNetworkUtils {
return false; return false;
} }
if (isGsmBasicOptions(context, subId)) {
return true;
}
if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA) { if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA) {
return true; return true;
} }
}
return false; return isGsmBasicOptions(context, subId);
} }
/** /**