From bc02a2d93907686a3d40fc23b9b7040a0e8df670 Mon Sep 17 00:00:00 2001 From: Bonian Chen Date: Fri, 1 Oct 2021 18:55:52 +0800 Subject: [PATCH] [Settings] Refactor MobileNetworkUtils Code refactor MobileNetworkUtils - move isWorldMode() detection to the first line within shouldSpeciallyUpdateGsmCdma() Bug: 201757298 Test: presubmit pass Change-Id: Iccffca52b2e0e48ff62ec749c0cf3faa273b0e18 --- .../settings/network/telephony/MobileNetworkUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/network/telephony/MobileNetworkUtils.java b/src/com/android/settings/network/telephony/MobileNetworkUtils.java index ebf77a0acca..f20a5bbadf5 100644 --- a/src/com/android/settings/network/telephony/MobileNetworkUtils.java +++ b/src/com/android/settings/network/telephony/MobileNetworkUtils.java @@ -582,6 +582,9 @@ public class MobileNetworkUtils { */ @VisibleForTesting static boolean shouldSpeciallyUpdateGsmCdma(Context context, int subId) { + if (!isWorldMode(context, subId)) { + return false; + } final TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class) .createForSubscriptionId(subId); final int networkMode = getNetworkTypeFromRaf( @@ -594,7 +597,7 @@ public class MobileNetworkUtils { || networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA || networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA) { - if (!isTdscdmaSupported(context, subId) && isWorldMode(context, subId)) { + if (!isTdscdmaSupported(context, subId)) { return true; } }