[Settings] Refactor MobileNetworkUtils
Code refactor MobileNetworkUtils - reduce number of accessing to isWorldMode() Bug: 201757298 Test: presubmit pass Change-Id: I710255887b5ba8038c3faf5471a88a02a15c015e
This commit is contained in:
@@ -468,11 +468,14 @@ public class MobileNetworkUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isWorldMode(context, subId)) {
|
||||
return isGsmBasicOptions(context, subId);
|
||||
}
|
||||
|
||||
final int networkMode = getNetworkTypeFromRaf(
|
||||
(int) telephonyManager.getAllowedNetworkTypesForReason(
|
||||
TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
|
||||
if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO
|
||||
&& isWorldMode(context, subId)) {
|
||||
if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO) {
|
||||
return false;
|
||||
}
|
||||
if (shouldSpeciallyUpdateGsmCdma(context, subId)) {
|
||||
@@ -483,10 +486,8 @@ public class MobileNetworkUtils {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isWorldMode(context, subId)) {
|
||||
if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA) {
|
||||
return true;
|
||||
}
|
||||
if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user