diff --git a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
index 7d5230d..c428f98 100644
--- a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
+++ b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
@@ -26,6 +26,7 @@
 import android.content.res.Resources;
 import android.os.PersistableBundle;
 import android.telephony.CarrierConfigManager;
+import android.telephony.RadioAccessFamily;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyCallback;
@@ -445,7 +446,7 @@
         }
 
         private int getPreferredNetworkMode() {
-            int networkMode = MobileNetworkUtils.getNetworkTypeFromRaf(
+            int networkMode = RadioAccessFamily.getNetworkTypeFromRaf(
                     (int) mTelephonyManager.getAllowedNetworkTypesForReason(
                             TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
             if (!showNrList()) {
diff --git a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerHelper.kt b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerHelper.kt
index d297e1c..9af6437 100644
--- a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerHelper.kt
+++ b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerHelper.kt
@@ -18,6 +18,7 @@
 
 import android.content.Context
 import android.telephony.CarrierConfigManager
+import android.telephony.RadioAccessFamily
 import android.telephony.SubscriptionManager
 import android.telephony.TelephonyManager
 import androidx.lifecycle.LifecycleOwner
@@ -35,7 +36,7 @@
     viewLifecycleOwner.lifecycleScope.launch(Dispatchers.Default) {
         setAllowedNetworkTypesForReason(
             TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER,
-            MobileNetworkUtils.getRafFromNetworkType(newPreferredNetworkMode),
+            RadioAccessFamily.getRafFromNetworkType(newPreferredNetworkMode).toLong(),
         )
     }
 }
diff --git a/src/com/android/settings/network/telephony/MobileNetworkUtils.java b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
index 82083b5..341f7a1b 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkUtils.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
@@ -18,14 +18,6 @@
 
 import static android.provider.Telephony.Carriers.ENFORCE_MANAGED_URI;
 
-import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.CDMA;
-import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.EVDO;
-import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.GSM;
-import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.LTE;
-import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.NR;
-import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.RAF_TD_SCDMA;
-import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.RAF_UNKNOWN;
-import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.WCDMA;
 import static com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO;
 import static com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA;
 import static com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO;
@@ -56,11 +48,11 @@
 import android.telecom.PhoneAccountHandle;
 import android.telecom.TelecomManager;
 import android.telephony.CarrierConfigManager;
+import android.telephony.RadioAccessFamily;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
-import android.telephony.euicc.EuiccManager;
 import android.telephony.ims.ImsManager;
 import android.telephony.ims.ImsRcsManager;
 import android.telephony.ims.ProvisioningManager;
@@ -89,9 +81,7 @@
 import com.android.settingslib.graph.SignalDrawable;
 import com.android.settingslib.mobile.dataservice.SubscriptionInfoEntity;
 
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 public class MobileNetworkUtils {
 
@@ -334,7 +324,7 @@
         }
 
         if (isWorldMode(context, subId)) {
-            final int settingsNetworkMode = getNetworkTypeFromRaf(
+            final int settingsNetworkMode = RadioAccessFamily.getNetworkTypeFromRaf(
                     (int) telephonyManager.getAllowedNetworkTypesForReason(
                             TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
 
@@ -365,7 +355,7 @@
         }
         final TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class)
                 .createForSubscriptionId(subId);
-        final int networkMode = getNetworkTypeFromRaf(
+        final int networkMode = RadioAccessFamily.getNetworkTypeFromRaf(
                 (int) telephonyManager.getAllowedNetworkTypesForReason(
                         TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
         if (isWorldMode(context, subId)) {
@@ -433,7 +423,7 @@
         }
 
         if (isWorldMode(context, subId)) {
-            final int networkMode = getNetworkTypeFromRaf(
+            final int networkMode = RadioAccessFamily.getNetworkTypeFromRaf(
                     (int) telephonyManager.getAllowedNetworkTypesForReason(
                             TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
             if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO) {
@@ -548,7 +538,7 @@
         }
         final TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class)
                 .createForSubscriptionId(subId);
-        final int networkMode = getNetworkTypeFromRaf(
+        final int networkMode = RadioAccessFamily.getNetworkTypeFromRaf(
                 (int) telephonyManager.getAllowedNetworkTypesForReason(
                         TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
         if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_GSM
@@ -648,197 +638,6 @@
     }
 
     /**
-     * Loop through all the device logical slots to check whether the user's current country
-     * supports eSIM.
-     */
-    private static boolean isCurrentCountrySupported(Context context) {
-        final EuiccManager em = (EuiccManager) context.getSystemService(EuiccManager.class);
-        final TelephonyManager tm =
-                (TelephonyManager) context.getSystemService(TelephonyManager.class);
-
-        Set<String> countrySet = new HashSet<>();
-        for (int i = 0; i < tm.getPhoneCount(); i++) {
-            String countryCode = tm.getNetworkCountryIso(i);
-            if (!TextUtils.isEmpty(countryCode)) {
-                countrySet.add(countryCode);
-            }
-        }
-        boolean isSupported = countrySet.stream().anyMatch(em::isSupportedCountry);
-        Log.i(TAG, "isCurrentCountrySupported countryCodes: " + countrySet
-                + " eSIMSupported: " + isSupported);
-        return isSupported;
-    }
-
-    /**
-     *  Imported from {@link android.telephony.RadioAccessFamily}
-     */
-    public static long getRafFromNetworkType(int type) {
-        switch (type) {
-            case TelephonyManagerConstants.NETWORK_MODE_WCDMA_PREF:
-                return GSM | WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_GSM_ONLY:
-                return GSM;
-            case TelephonyManagerConstants.NETWORK_MODE_WCDMA_ONLY:
-                return WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_GSM_UMTS:
-                return GSM | WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_CDMA_EVDO:
-                return CDMA | EVDO;
-            case TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO:
-                return LTE | CDMA | EVDO;
-            case TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA:
-                return LTE | GSM | WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
-                return LTE | CDMA | EVDO | GSM | WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_LTE_ONLY:
-                return LTE;
-            case TelephonyManagerConstants.NETWORK_MODE_LTE_WCDMA:
-                return LTE | WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_CDMA_NO_EVDO:
-                return CDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_EVDO_NO_CDMA:
-                return EVDO;
-            case TelephonyManagerConstants.NETWORK_MODE_GLOBAL:
-                return GSM | WCDMA | CDMA | EVDO;
-            case TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_ONLY:
-                return RAF_TD_SCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_WCDMA:
-                return RAF_TD_SCDMA | WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA:
-                return LTE | RAF_TD_SCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM:
-                return RAF_TD_SCDMA | GSM;
-            case TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_GSM:
-                return LTE | RAF_TD_SCDMA | GSM;
-            case TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA:
-                return RAF_TD_SCDMA | GSM | WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA:
-                return LTE | RAF_TD_SCDMA | WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA:
-                return LTE | RAF_TD_SCDMA | GSM | WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
-                return RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA;
-            case TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
-                return LTE | RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_ONLY):
-                return NR;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_LTE):
-                return NR | LTE;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO):
-                return NR | LTE | CDMA | EVDO;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_LTE_GSM_WCDMA):
-                return NR | LTE | GSM | WCDMA;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA):
-                return NR | LTE | CDMA | EVDO | GSM | WCDMA;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_LTE_WCDMA):
-                return NR | LTE | WCDMA;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA):
-                return NR | LTE | RAF_TD_SCDMA;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM):
-                return NR | LTE | RAF_TD_SCDMA | GSM;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA):
-                return NR | LTE | RAF_TD_SCDMA | WCDMA;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA):
-                return NR | LTE | RAF_TD_SCDMA | GSM | WCDMA;
-            case (TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA):
-                return NR | LTE | RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA;
-            default:
-                return RAF_UNKNOWN;
-        }
-    }
-
-    /**
-     *  Imported from {@link android.telephony.RadioAccessFamily}
-     */
-    public static int getNetworkTypeFromRaf(int raf) {
-        raf = getAdjustedRaf(raf);
-
-        switch (raf) {
-            case (GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_WCDMA_PREF;
-            case GSM:
-                return TelephonyManagerConstants.NETWORK_MODE_GSM_ONLY;
-            case WCDMA:
-                return TelephonyManagerConstants.NETWORK_MODE_WCDMA_ONLY;
-            case (CDMA | EVDO):
-                return TelephonyManagerConstants.NETWORK_MODE_CDMA_EVDO;
-            case (LTE | CDMA | EVDO):
-                return TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO;
-            case (LTE | GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA;
-            case (LTE | CDMA | EVDO | GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA;
-            case LTE:
-                return TelephonyManagerConstants.NETWORK_MODE_LTE_ONLY;
-            case (LTE | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_LTE_WCDMA;
-            case CDMA:
-                return TelephonyManagerConstants.NETWORK_MODE_CDMA_NO_EVDO;
-            case EVDO:
-                return TelephonyManagerConstants.NETWORK_MODE_EVDO_NO_CDMA;
-            case (GSM | WCDMA | CDMA | EVDO):
-                return TelephonyManagerConstants.NETWORK_MODE_GLOBAL;
-            case RAF_TD_SCDMA:
-                return TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_ONLY;
-            case (RAF_TD_SCDMA | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_WCDMA;
-            case (LTE | RAF_TD_SCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA;
-            case (RAF_TD_SCDMA | GSM):
-                return TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM;
-            case (LTE | RAF_TD_SCDMA | GSM):
-                return TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_GSM;
-            case (RAF_TD_SCDMA | GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA;
-            case (LTE | RAF_TD_SCDMA | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA;
-            case (LTE | RAF_TD_SCDMA | GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA;
-            case (RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA;
-            case (LTE | RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA;
-            case (NR):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_ONLY;
-            case (NR | LTE):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_LTE;
-            case (NR | LTE | CDMA | EVDO):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO;
-            case (NR | LTE | GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_LTE_GSM_WCDMA;
-            case (NR | LTE | CDMA | EVDO | GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA;
-            case (NR | LTE | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_LTE_WCDMA;
-            case (NR | LTE | RAF_TD_SCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA;
-            case (NR | LTE | RAF_TD_SCDMA | GSM):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM;
-            case (NR | LTE | RAF_TD_SCDMA | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA;
-            case (NR | LTE | RAF_TD_SCDMA | GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA;
-            case (NR | LTE | RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA):
-                return TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA;
-            default:
-                return TelephonyManagerConstants.NETWORK_MODE_UNKNOWN;
-        }
-    }
-
-    /**
-     *  Imported from {@link android.telephony.RadioAccessFamily}
-     */
-    private static int getAdjustedRaf(int raf) {
-        raf = ((GSM & raf) > 0) ? (GSM | raf) : raf;
-        raf = ((WCDMA & raf) > 0) ? (WCDMA | raf) : raf;
-        raf = ((CDMA & raf) > 0) ? (CDMA | raf) : raf;
-        raf = ((EVDO & raf) > 0) ? (EVDO | raf) : raf;
-        raf = ((LTE & raf) > 0) ? (LTE | raf) : raf;
-        raf = ((NR & raf) > 0) ? (NR | raf) : raf;
-        return raf;
-    }
-
-    /**
      * Copied from SubscriptionsPreferenceController#activeNetworkIsCellular()
      */
     public static boolean activeNetworkIsCellular(Context context) {
diff --git a/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java b/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java
index 210cd87..2d567af 100644
--- a/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java
+++ b/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java
@@ -21,6 +21,7 @@
 import android.content.Context;
 import android.os.PersistableBundle;
 import android.telephony.CarrierConfigManager;
+import android.telephony.RadioAccessFamily;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 import android.util.Log;
@@ -72,7 +73,7 @@
 
         mTelephonyManager.setAllowedNetworkTypesForReason(
                 TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER,
-                MobileNetworkUtils.getRafFromNetworkType(newPreferredNetworkMode));
+                RadioAccessFamily.getRafFromNetworkType(newPreferredNetworkMode));
 
             final ListPreference listPreference = (ListPreference) preference;
             listPreference.setSummary(getPreferredNetworkModeSummaryResId(newPreferredNetworkMode));
@@ -94,7 +95,7 @@
             Log.w(TAG, "TelephonyManager is null");
             return TelephonyManagerConstants.NETWORK_MODE_UNKNOWN;
         }
-        return MobileNetworkUtils.getNetworkTypeFromRaf(
+        return RadioAccessFamily.getNetworkTypeFromRaf(
                 (int) mTelephonyManager.getAllowedNetworkTypesForReason(
                         TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
     }
diff --git a/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java b/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java
index 4f4c35d..fe702e4 100644
--- a/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java
+++ b/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java
@@ -22,14 +22,13 @@
 
 import android.content.Context;
 import android.provider.Settings;
+import android.telephony.RadioAccessFamily;
 import android.telephony.TelephonyManager;
 import android.util.Log;
 
 import androidx.preference.ListPreference;
 import androidx.preference.Preference;
 
-import com.android.settings.network.telephony.MobileNetworkUtils;
-
 /**
  * Preference controller for "System Select"
  */
@@ -65,7 +64,7 @@
             }
 
             final int settingsNetworkMode =
-                    hasTelephonyMgr ? MobileNetworkUtils.getNetworkTypeFromRaf(
+                    hasTelephonyMgr ? RadioAccessFamily.getNetworkTypeFromRaf(
                             (int) mTelephonyManager.getAllowedNetworkTypesForReason(
                                     TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER))
                             : NETWORK_MODE_UNKNOWN;
diff --git a/tests/unit/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerTest.java
index adc8dc0..ab57f4b 100644
--- a/tests/unit/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerTest.java
@@ -18,7 +18,6 @@
 
 import static androidx.lifecycle.Lifecycle.Event.ON_START;
 
-import static com.android.settings.network.telephony.MobileNetworkUtils.getRafFromNetworkType;
 import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.CDMA;
 import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.EVDO;
 import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.GSM;
@@ -37,6 +36,7 @@
 import android.content.Context;
 import android.os.PersistableBundle;
 import android.telephony.CarrierConfigManager;
+import android.telephony.RadioAccessFamily;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
@@ -304,7 +304,7 @@
     public void onPreferenceChange_updateSuccess() {
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA);
         doReturn(true).when(mTelephonyManager).setPreferredNetworkTypeBitmask(
-                getRafFromNetworkType(
+                RadioAccessFamily.getRafFromNetworkType(
                         TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
 
         mController.updateState(mPreference);
@@ -321,7 +321,8 @@
     public void onPreferenceChange_updateFail() {
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA);
         doReturn(false).when(mTelephonyManager).setPreferredNetworkTypeBitmask(
-                getRafFromNetworkType(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA));
+                RadioAccessFamily.getRafFromNetworkType(
+                        TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA));
 
         mController.updateState(mPreference);
         mController.onViewCreated(new TestLifecycleOwner());
@@ -438,7 +439,7 @@
     }
 
     private void mockAccessFamily(int networkMode) {
-        doReturn(MobileNetworkUtils.getRafFromNetworkType(networkMode))
+        doReturn((long) RadioAccessFamily.getRafFromNetworkType(networkMode))
                 .when(mTelephonyManager)
                 .getSupportedRadioAccessFamily();
     }
diff --git a/tests/unit/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceControllerTest.java
index f22ad3b..663945d 100644
--- a/tests/unit/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceControllerTest.java
@@ -30,6 +30,7 @@
 
 import android.content.Context;
 import android.os.PersistableBundle;
+import android.telephony.RadioAccessFamily;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
@@ -111,7 +112,7 @@
 
         verify(mTelephonyManager, times(1)).setAllowedNetworkTypesForReason(
                 TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER,
-                MobileNetworkUtils.getRafFromNetworkType(
+                RadioAccessFamily.getRafFromNetworkType(
                         TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA));
     }
 }
