diff --git a/res/xml/channel_notification_settings.xml b/res/xml/channel_notification_settings.xml
index ff1427b..44a21ac 100644
--- a/res/xml/channel_notification_settings.xml
+++ b/res/xml/channel_notification_settings.xml
@@ -25,10 +25,9 @@
         android:order="1"
         android:layout="@layout/settings_entity_header" />
 
-    <com.android.settingslib.widget.LayoutPreference
+    <com.android.settings.widget.SettingsMainSwitchPreference
         android:key="block"
-        android:order="2"
-        android:layout="@layout/styled_switch_bar" />
+        android:order="2" />
 
     <!-- Importance toggle -->
     <com.android.settingslib.RestrictedSwitchPreference
diff --git a/src/com/android/settings/network/AllowedNetworkTypesListener.java b/src/com/android/settings/network/AllowedNetworkTypesListener.java
new file mode 100644
index 0000000..a11f3b4
--- /dev/null
+++ b/src/com/android/settings/network/AllowedNetworkTypesListener.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.network;
+
+import android.content.Context;
+import android.telephony.PhoneStateListener;
+import android.telephony.TelephonyManager;
+import android.util.Log;
+
+import androidx.annotation.VisibleForTesting;
+
+import java.util.Map;
+import java.util.concurrent.Executor;
+
+
+/**
+ * {@link PhoneStateListener} to listen to Allowed Network Types changed
+ */
+public class AllowedNetworkTypesListener extends PhoneStateListener implements
+        PhoneStateListener.AllowedNetworkTypesChangedListener {
+    private static final String LOG_TAG = "NetworkModeListener";
+
+    @VisibleForTesting
+    AllowedNetworkTypesListener.OnAllowedNetworkTypesChangedListener mListener;
+    private long mAllowedNetworkType = -1;
+    private Executor mExecutor;
+
+    public AllowedNetworkTypesListener(Executor executor) {
+        super();
+        mExecutor = executor;
+    }
+
+    public void setAllowedNetworkTypesChangedListener(OnAllowedNetworkTypesChangedListener lsn) {
+        mListener = lsn;
+    }
+
+    /**
+     * Register a PhoneStateListener for Allowed Network Types changed.
+     * @param context the Context
+     * @param subId the subscription id.
+     */
+    public void register(Context context, int subId) {
+        TelephonyManager telephonyManager = context.getSystemService(
+                TelephonyManager.class).createForSubscriptionId(subId);
+        telephonyManager.registerPhoneStateListener(mExecutor, this);
+    }
+
+    /**
+     * Unregister a PhoneStateListener for Allowed Network Types changed.
+     * @param context the Context
+     * @param subId the subscription id.
+     */
+    public void unregister(Context context, int subId) {
+        TelephonyManager telephonyManager = context.getSystemService(
+                TelephonyManager.class).createForSubscriptionId(subId);
+        telephonyManager.unregisterPhoneStateListener(this);
+    }
+
+    @Override
+    public void onAllowedNetworkTypesChanged(Map<Integer, Long> allowedNetworkTypesList) {
+        long newAllowedNetworkType = allowedNetworkTypesList.get(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER);
+        if (mListener != null && mAllowedNetworkType != newAllowedNetworkType) {
+            mListener.onAllowedNetworkTypesChanged();
+            Log.d(LOG_TAG, "onAllowedNetworkChanged: " + mAllowedNetworkType);
+        }
+        mAllowedNetworkType = newAllowedNetworkType;
+    }
+
+    /**
+     * Listener for update of Preferred Network Mode change
+     */
+    public interface OnAllowedNetworkTypesChangedListener {
+        /**
+         * Notify the allowed network type changed.
+         */
+        void onAllowedNetworkTypesChanged();
+    }
+}
diff --git a/src/com/android/settings/network/PreferredNetworkModeContentObserver.java b/src/com/android/settings/network/PreferredNetworkModeContentObserver.java
deleted file mode 100644
index 9d07eb4..0000000
--- a/src/com/android/settings/network/PreferredNetworkModeContentObserver.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.network;
-
-import android.content.Context;
-import android.database.ContentObserver;
-import android.net.Uri;
-import android.os.Handler;
-import android.provider.Settings;
-
-import androidx.annotation.VisibleForTesting;
-
-/**
- * {@link ContentObserver} to listen to Preferred Network Mode change
- */
-public class PreferredNetworkModeContentObserver extends ContentObserver {
-    @VisibleForTesting
-    OnPreferredNetworkModeChangedListener mListener;
-
-    public PreferredNetworkModeContentObserver(Handler handler) {
-        super(handler);
-    }
-
-    public void setPreferredNetworkModeChangedListener(OnPreferredNetworkModeChangedListener lsn) {
-        mListener = lsn;
-    }
-
-    @Override
-    public void onChange(boolean selfChange) {
-        super.onChange(selfChange);
-        if (mListener != null) {
-            mListener.onPreferredNetworkModeChanged();
-        }
-    }
-
-    public void register(Context context, int subId) {
-        final Uri uri = Settings.Global.getUriFor(
-                Settings.Global.PREFERRED_NETWORK_MODE + subId);
-        context.getContentResolver().registerContentObserver(uri, false, this);
-    }
-
-    public void unregister(Context context) {
-        context.getContentResolver().unregisterContentObserver(this);
-    }
-
-    /**
-     * Listener for update of Preferred Network Mode change
-     */
-    public interface OnPreferredNetworkModeChangedListener {
-        void onPreferredNetworkModeChanged();
-    }
-}
diff --git a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
index 8a32a95..9e7a3a8 100644
--- a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
+++ b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
@@ -20,10 +20,7 @@
 import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
 
 import android.content.Context;
-import android.os.Handler;
-import android.os.Looper;
 import android.os.PersistableBundle;
-import android.provider.Settings;
 import android.telephony.CarrierConfigManager;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
@@ -37,7 +34,7 @@
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
-import com.android.settings.network.PreferredNetworkModeContentObserver;
+import com.android.settings.network.AllowedNetworkTypesListener;
 import com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants;
 
 import java.util.ArrayList;
@@ -53,7 +50,7 @@
         ListPreference.OnPreferenceChangeListener, LifecycleObserver {
 
     private static final String LOG_TAG = "EnabledNetworkMode";
-    private PreferredNetworkModeContentObserver mPreferredNetworkModeObserver;
+    private AllowedNetworkTypesListener mAllowedNetworkTypesListener;
     private Preference mPreference;
     private PreferenceScreen mPreferenceScreen;
     private TelephonyManager mTelephonyManager;
@@ -88,18 +85,18 @@
 
     @OnLifecycleEvent(ON_START)
     public void onStart() {
-        if (mPreferredNetworkModeObserver == null) {
+        if (mAllowedNetworkTypesListener == null) {
             return;
         }
-        mPreferredNetworkModeObserver.register(mContext, mSubId);
+        mAllowedNetworkTypesListener.register(mContext, mSubId);
     }
 
     @OnLifecycleEvent(ON_STOP)
     public void onStop() {
-        if (mPreferredNetworkModeObserver == null) {
+        if (mAllowedNetworkTypesListener == null) {
             return;
         }
-        mPreferredNetworkModeObserver.unregister(mContext);
+        mAllowedNetworkTypesListener.unregister(mContext, mSubId);
     }
 
     @Override
@@ -145,10 +142,10 @@
         mCarrierConfigManager = mContext.getSystemService(CarrierConfigManager.class);
         mBuilder = new PreferenceEntriesBuilder(mContext, mSubId);
 
-        if (mPreferredNetworkModeObserver == null) {
-            mPreferredNetworkModeObserver = new PreferredNetworkModeContentObserver(
-                    new Handler(Looper.getMainLooper()));
-            mPreferredNetworkModeObserver.setPreferredNetworkModeChangedListener(
+        if (mAllowedNetworkTypesListener == null) {
+            mAllowedNetworkTypesListener = new AllowedNetworkTypesListener(
+                    mContext.getMainExecutor());
+            mAllowedNetworkTypesListener.setAllowedNetworkTypesChangedListener(
                     () -> updatePreference());
         }
 
@@ -205,13 +202,12 @@
                     .createForSubscriptionId(mSubId);
 
             final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
-            final boolean isNrEnabledFromCarrierConfig = carrierConfig != null
-                    && carrierConfig.getBoolean(CarrierConfigManager.KEY_NR_ENABLED_BOOL);
             mAllowed5gNetworkType = checkSupportedRadioBitmask(
-                    mTelephonyManager.getAllowedNetworkTypes(),
+                    mTelephonyManager.getAllowedNetworkTypesForReason(
+                            TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_CARRIER),
                     TelephonyManager.NETWORK_TYPE_BITMASK_NR);
-            mSupported5gRadioAccessFamily = isNrEnabledFromCarrierConfig
-                    && checkSupportedRadioBitmask(mTelephonyManager.getSupportedRadioAccessFamily(),
+            mSupported5gRadioAccessFamily = checkSupportedRadioBitmask(
+                    mTelephonyManager.getSupportedRadioAccessFamily(),
                     TelephonyManager.NETWORK_TYPE_BITMASK_NR);
             mIsGlobalCdma = mTelephonyManager.isLteCdmaEvdoGsmWcdmaEnabled()
                     && carrierConfig != null
@@ -370,9 +366,9 @@
         }
 
         private int getPreferredNetworkMode() {
-            int networkMode = Settings.Global.getInt(mContext.getContentResolver(),
-                    Settings.Global.PREFERRED_NETWORK_MODE + mSubId,
-                    TelephonyManager.DEFAULT_PREFERRED_NETWORK_MODE);
+            int networkMode = MobileNetworkUtils.getNetworkTypeFromRaf(
+                    (int) mTelephonyManager.getAllowedNetworkTypesForReason(
+                            TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
             if (!showNrList()) {
                 Log.d(LOG_TAG, "Network mode :" + networkMode + " reduce NR");
                 networkMode = reduceNrToLteNetworkType(networkMode);
@@ -452,7 +448,7 @@
          * Sets the display string for the network mode choice and selects the corresponding item
          *
          * @param networkMode the current network mode. The current mode might not be an option in
-         *                   the choice list. The nearest choice is selected instead
+         *                    the choice list. The nearest choice is selected instead
          */
         void setPreferenceValueAndSummary(int networkMode) {
             setSelectedEntry(networkMode);
@@ -624,7 +620,7 @@
          * @return the corresponding network mode with 5G.
          */
         private int addNrToLteNetworkType(int networkType) {
-            switch(networkType) {
+            switch (networkType) {
                 case TelephonyManagerConstants.NETWORK_MODE_LTE_ONLY:
                     return TelephonyManagerConstants.NETWORK_MODE_NR_LTE;
                 case TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO:
@@ -658,7 +654,7 @@
          * @return the corresponding network mode without 5G.
          */
         private int reduceNrToLteNetworkType(int networkType) {
-            switch(networkType) {
+            switch (networkType) {
                 case TelephonyManagerConstants.NETWORK_MODE_NR_LTE:
                     return TelephonyManagerConstants.NETWORK_MODE_LTE_ONLY;
                 case TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO:
@@ -781,7 +777,7 @@
         }
 
         private String[] getEntryValues() {
-            final Integer [] intArr = mEntriesValue.toArray(new Integer[0]);
+            final Integer[] intArr = mEntriesValue.toArray(new Integer[0]);
             return Arrays.stream(intArr)
                     .map(String::valueOf)
                     .toArray(String[]::new);
diff --git a/src/com/android/settings/network/telephony/Enhanced4gBasePreferenceController.java b/src/com/android/settings/network/telephony/Enhanced4gBasePreferenceController.java
index 348c9c8..fbbdabc 100644
--- a/src/com/android/settings/network/telephony/Enhanced4gBasePreferenceController.java
+++ b/src/com/android/settings/network/telephony/Enhanced4gBasePreferenceController.java
@@ -95,8 +95,9 @@
 
         mShow5gLimitedDialog = carrierConfig.getBoolean(
                 CarrierConfigManager.KEY_VOLTE_5G_LIMITED_ALERT_DIALOG_BOOL);
-        mIsNrEnabledFromCarrierConfig = carrierConfig.getBoolean(
-                CarrierConfigManager.KEY_NR_ENABLED_BOOL);
+        mIsNrEnabledFromCarrierConfig = carrierConfig.getInt(
+                CarrierConfigManager.KEY_CARRIER_NR_AVAILABILITY_INT)
+                != CarrierConfigManager.CARRIER_NR_AVAILABILITY_NONE;
         return this;
     }
 
diff --git a/src/com/android/settings/network/telephony/MobileNetworkUtils.java b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
index 430e2bf..e8f9770 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkUtils.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
@@ -359,10 +359,10 @@
         }
 
         if (isWorldMode(context, subId)) {
-            final int settingsNetworkMode = android.provider.Settings.Global.getInt(
-                    context.getContentResolver(),
-                    android.provider.Settings.Global.PREFERRED_NETWORK_MODE + subId,
-                    TelephonyManager.DEFAULT_PREFERRED_NETWORK_MODE);
+            final int settingsNetworkMode = getNetworkTypeFromRaf(
+                    (int) telephonyManager.getAllowedNetworkTypesForReason(
+                            TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
+
             if (settingsNetworkMode == NETWORK_MODE_LTE_GSM_WCDMA
                     || settingsNetworkMode == NETWORK_MODE_LTE_CDMA_EVDO
                     || settingsNetworkMode == NETWORK_MODE_NR_LTE_GSM_WCDMA
@@ -388,10 +388,11 @@
         if (isGsmBasicOptions(context, subId)) {
             return true;
         }
-        final int networkMode = android.provider.Settings.Global.getInt(
-                context.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + subId,
-                TelephonyManager.DEFAULT_PREFERRED_NETWORK_MODE);
+        final TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class)
+                .createForSubscriptionId(subId);
+        final int networkMode = getNetworkTypeFromRaf(
+                (int) telephonyManager.getAllowedNetworkTypesForReason(
+                        TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
         if (isWorldMode(context, subId)) {
             if (networkMode == NETWORK_MODE_LTE_CDMA_EVDO
                     || networkMode == NETWORK_MODE_LTE_GSM_WCDMA
@@ -455,10 +456,9 @@
             return false;
         }
 
-        final int networkMode = android.provider.Settings.Global.getInt(
-                context.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + subId,
-                TelephonyManager.DEFAULT_PREFERRED_NETWORK_MODE);
+        final int networkMode = getNetworkTypeFromRaf(
+                (int) telephonyManager.getAllowedNetworkTypesForReason(
+                        TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
         if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO
                 && isWorldMode(context, subId)) {
             return false;
@@ -570,15 +570,17 @@
      */
     @VisibleForTesting
     static boolean shouldSpeciallyUpdateGsmCdma(Context context, int subId) {
-        final int networkMode = android.provider.Settings.Global.getInt(
-                context.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + subId,
-                TelephonyManager.DEFAULT_PREFERRED_NETWORK_MODE);
+        final TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class)
+                .createForSubscriptionId(subId);
+        final int networkMode = getNetworkTypeFromRaf(
+                (int) telephonyManager.getAllowedNetworkTypesForReason(
+                        TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
         if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_GSM
                 || networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA
                 || networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA
                 || networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA
-                || networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA
+                || 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)) {
                 return true;
diff --git a/src/com/android/settings/network/telephony/NetworkPreferenceCategoryController.java b/src/com/android/settings/network/telephony/NetworkPreferenceCategoryController.java
index 042eb5f..25651f5 100644
--- a/src/com/android/settings/network/telephony/NetworkPreferenceCategoryController.java
+++ b/src/com/android/settings/network/telephony/NetworkPreferenceCategoryController.java
@@ -20,8 +20,6 @@
 import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
 
 import android.content.Context;
-import android.os.Handler;
-import android.os.Looper;
 import android.telephony.SubscriptionManager;
 
 import androidx.lifecycle.Lifecycle;
@@ -29,7 +27,7 @@
 import androidx.lifecycle.OnLifecycleEvent;
 import androidx.preference.PreferenceScreen;
 
-import com.android.settings.network.PreferredNetworkModeContentObserver;
+import com.android.settings.network.AllowedNetworkTypesListener;
 import com.android.settings.widget.PreferenceCategoryController;
 
 /**
@@ -39,15 +37,15 @@
         implements LifecycleObserver {
 
     private PreferenceScreen mPreferenceScreen;
-    private PreferredNetworkModeContentObserver mPreferredNetworkModeObserver;
+    private AllowedNetworkTypesListener mAllowedNetworkTypesListener;
     protected int mSubId;
 
     public NetworkPreferenceCategoryController(Context context, String key) {
         super(context, key);
         mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
-        mPreferredNetworkModeObserver = new PreferredNetworkModeContentObserver(
-                new Handler(Looper.getMainLooper()));
-        mPreferredNetworkModeObserver.setPreferredNetworkModeChangedListener(
+        mAllowedNetworkTypesListener = new AllowedNetworkTypesListener(
+                context.getMainExecutor());
+        mAllowedNetworkTypesListener.setAllowedNetworkTypesChangedListener(
                 () -> updatePreference());
     }
 
@@ -57,12 +55,12 @@
 
     @OnLifecycleEvent(ON_START)
     public void onStart() {
-        mPreferredNetworkModeObserver.register(mContext, mSubId);
+        mAllowedNetworkTypesListener.register(mContext, mSubId);
     }
 
     @OnLifecycleEvent(ON_STOP)
     public void onStop() {
-        mPreferredNetworkModeObserver.unregister(mContext);
+        mAllowedNetworkTypesListener.unregister(mContext, mSubId);
     }
 
     @Override
diff --git a/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java b/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java
index ff6ff59..2419779 100644
--- a/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java
+++ b/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceController.java
@@ -18,7 +18,6 @@
 
 import android.content.Context;
 import android.os.PersistableBundle;
-import android.provider.Settings;
 import android.telephony.CarrierConfigManager;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
@@ -80,17 +79,13 @@
     public boolean onPreferenceChange(Preference preference, Object object) {
         final int newPreferredNetworkMode = Integer.parseInt((String) object);
 
-        if (mTelephonyManager.setPreferredNetworkTypeBitmask(
-                MobileNetworkUtils.getRafFromNetworkType(newPreferredNetworkMode))) {
-            Settings.Global.putInt(mContext.getContentResolver(),
-                    Settings.Global.PREFERRED_NETWORK_MODE + mSubId,
-                    newPreferredNetworkMode);
+        mTelephonyManager.setAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER,
+                MobileNetworkUtils.getRafFromNetworkType(newPreferredNetworkMode));
+
             final ListPreference listPreference = (ListPreference) preference;
             listPreference.setSummary(getPreferredNetworkModeSummaryResId(newPreferredNetworkMode));
             return true;
-        }
-
-        return false;
     }
 
     public void init(int subId) {
@@ -104,9 +99,9 @@
     }
 
     private int getPreferredNetworkMode() {
-        return Settings.Global.getInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + mSubId,
-                TelephonyManager.DEFAULT_PREFERRED_NETWORK_MODE);
+        return MobileNetworkUtils.getNetworkTypeFromRaf(
+                (int) mTelephonyManager.getAllowedNetworkTypesForReason(
+                        TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
     }
 
     private int getPreferredNetworkModeSummaryResId(int NetworkMode) {
diff --git a/src/com/android/settings/network/telephony/cdma/CdmaBasePreferenceController.java b/src/com/android/settings/network/telephony/cdma/CdmaBasePreferenceController.java
index a100d70..06c3edb 100644
--- a/src/com/android/settings/network/telephony/cdma/CdmaBasePreferenceController.java
+++ b/src/com/android/settings/network/telephony/cdma/CdmaBasePreferenceController.java
@@ -17,11 +17,6 @@
 package com.android.settings.network.telephony.cdma;
 
 import android.content.Context;
-import android.database.ContentObserver;
-import android.net.Uri;
-import android.os.Handler;
-import android.os.Looper;
-import android.provider.Settings;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 
@@ -29,6 +24,7 @@
 import androidx.preference.PreferenceManager;
 import androidx.preference.PreferenceScreen;
 
+import com.android.settings.network.AllowedNetworkTypesListener;
 import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settings.network.telephony.TelephonyBasePreferenceController;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
@@ -44,22 +40,25 @@
     protected Preference mPreference;
     protected TelephonyManager mTelephonyManager;
     protected PreferenceManager mPreferenceManager;
-    private DataContentObserver mDataContentObserver;
+    private AllowedNetworkTypesListener mAllowedNetworkTypesListener;
 
     public CdmaBasePreferenceController(Context context, String key) {
         super(context, key);
         mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
-        mDataContentObserver = new DataContentObserver(new Handler(Looper.getMainLooper()));
     }
 
     @Override
     public void onStart() {
-        mDataContentObserver.register(mContext, mSubId);
+        if (mAllowedNetworkTypesListener != null) {
+            mAllowedNetworkTypesListener.register(mContext, mSubId);
+        }
     }
 
     @Override
     public void onStop() {
-        mDataContentObserver.unRegister(mContext);
+        if (mAllowedNetworkTypesListener != null) {
+            mAllowedNetworkTypesListener.unregister(mContext, mSubId);
+        }
     }
 
     @Override
@@ -74,12 +73,25 @@
         mSubId = subId;
         mTelephonyManager = mContext.getSystemService(TelephonyManager.class)
                 .createForSubscriptionId(mSubId);
+
+        if (mAllowedNetworkTypesListener == null) {
+            mAllowedNetworkTypesListener = new AllowedNetworkTypesListener(
+                    mContext.getMainExecutor());
+            mAllowedNetworkTypesListener.setAllowedNetworkTypesChangedListener(
+                    () -> updatePreference());
+        }
     }
 
     public void init(int subId) {
         init(null, subId);
     }
 
+    private void updatePreference() {
+        if (mPreference != null) {
+            updateState(mPreference);
+        }
+    }
+
     @Override
     public void displayPreference(PreferenceScreen screen) {
         super.displayPreference(screen);
@@ -88,30 +100,4 @@
             ((CdmaListPreference) mPreference).setSubId(mSubId);
         }
     }
-
-    /**
-     * Listener that listens to mobile data state change.
-     */
-    public class DataContentObserver extends ContentObserver {
-
-        public DataContentObserver(Handler handler) {
-            super(handler);
-        }
-
-        @Override
-        public void onChange(boolean selfChange) {
-            super.onChange(selfChange);
-            updateState(mPreference);
-        }
-
-        public void register(Context context, int subId) {
-            final Uri uri = Settings.Global.getUriFor(
-                    Settings.Global.PREFERRED_NETWORK_MODE + subId);
-            context.getContentResolver().registerContentObserver(uri, false, this);
-        }
-
-        public void unRegister(Context context) {
-            context.getContentResolver().unregisterContentObserver(this);
-        }
-    }
 }
diff --git a/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java b/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java
index 2b0c221..5dd4453 100644
--- a/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java
+++ b/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java
@@ -26,6 +26,8 @@
 import androidx.preference.ListPreference;
 import androidx.preference.Preference;
 
+import com.android.settings.network.telephony.MobileNetworkUtils;
+
 /**
  * Preference controller for "System Select"
  */
@@ -50,10 +52,10 @@
                 resetCdmaRoamingModeToDefault();
             }
         }
-        final int settingsNetworkMode = Settings.Global.getInt(
-                mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + mSubId,
-                TelephonyManager.DEFAULT_PREFERRED_NETWORK_MODE);
+
+        final int settingsNetworkMode = MobileNetworkUtils.getNetworkTypeFromRaf(
+                (int) mTelephonyManager.getAllowedNetworkTypesForReason(
+                        TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
         final boolean enableList = settingsNetworkMode != NETWORK_MODE_LTE_GSM_WCDMA
                 && settingsNetworkMode != NETWORK_MODE_NR_LTE_GSM_WCDMA;
         listPreference.setEnabled(enableList);
diff --git a/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java b/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
index 5fa70f9..19302da 100644
--- a/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
+++ b/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
@@ -24,6 +24,7 @@
 import android.content.Context;
 import android.os.Bundle;
 import android.os.Handler;
+import android.os.HandlerExecutor;
 import android.os.Looper;
 import android.os.PersistableBundle;
 import android.os.SystemClock;
@@ -43,7 +44,7 @@
 
 import com.android.settings.R;
 import com.android.settings.core.SubSettingLauncher;
-import com.android.settings.network.PreferredNetworkModeContentObserver;
+import com.android.settings.network.AllowedNetworkTypesListener;
 import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settings.network.telephony.NetworkSelectSettings;
 import com.android.settings.network.telephony.TelephonyTogglePreferenceController;
@@ -63,7 +64,7 @@
 
     private final Handler mUiHandler;
     private PreferenceScreen mPreferenceScreen;
-    private PreferredNetworkModeContentObserver mPreferredNetworkModeObserver;
+    private AllowedNetworkTypesListener mAllowedNetworkTypesListener;
     private TelephonyManager mTelephonyManager;
     private boolean mOnlyAutoSelectInHome;
     private List<OnNetworkSelectModeListener> mListeners;
@@ -78,8 +79,9 @@
         mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
         mListeners = new ArrayList<>();
         mUiHandler = new Handler(Looper.getMainLooper());
-        mPreferredNetworkModeObserver = new PreferredNetworkModeContentObserver(mUiHandler);
-        mPreferredNetworkModeObserver.setPreferredNetworkModeChangedListener(
+        mAllowedNetworkTypesListener = new AllowedNetworkTypesListener(
+                new HandlerExecutor(mUiHandler));
+        mAllowedNetworkTypesListener.setAllowedNetworkTypesChangedListener(
                 () -> updatePreference());
     }
 
@@ -94,12 +96,12 @@
 
     @OnLifecycleEvent(ON_START)
     public void onStart() {
-        mPreferredNetworkModeObserver.register(mContext, mSubId);
+        mAllowedNetworkTypesListener.register(mContext, mSubId);
     }
 
     @OnLifecycleEvent(ON_STOP)
     public void onStop() {
-        mPreferredNetworkModeObserver.unregister(mContext);
+        mAllowedNetworkTypesListener.unregister(mContext, mSubId);
     }
 
     @Override
diff --git a/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java b/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
index 2cc5bf1..1b77c6d 100644
--- a/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
+++ b/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
@@ -22,8 +22,6 @@
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
 import android.provider.Settings;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionManager;
@@ -38,7 +36,7 @@
 
 import com.android.settings.R;
 import com.android.settings.core.SubSettingLauncher;
-import com.android.settings.network.PreferredNetworkModeContentObserver;
+import com.android.settings.network.AllowedNetworkTypesListener;
 import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settings.network.telephony.NetworkSelectSettings;
 import com.android.settings.network.telephony.TelephonyBasePreferenceController;
@@ -54,15 +52,15 @@
     private TelephonyManager mTelephonyManager;
     private Preference mPreference;
     private PreferenceScreen mPreferenceScreen;
-    private PreferredNetworkModeContentObserver mPreferredNetworkModeObserver;
+    private AllowedNetworkTypesListener mAllowedNetworkTypesListener;
 
     public OpenNetworkSelectPagePreferenceController(Context context, String key) {
         super(context, key);
         mTelephonyManager = context.getSystemService(TelephonyManager.class);
         mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
-        mPreferredNetworkModeObserver = new PreferredNetworkModeContentObserver(
-                new Handler(Looper.getMainLooper()));
-        mPreferredNetworkModeObserver.setPreferredNetworkModeChangedListener(
+        mAllowedNetworkTypesListener = new AllowedNetworkTypesListener(
+                context.getMainExecutor());
+        mAllowedNetworkTypesListener.setAllowedNetworkTypesChangedListener(
                 () -> updatePreference());
 
     }
@@ -85,12 +83,12 @@
 
     @OnLifecycleEvent(ON_START)
     public void onStart() {
-        mPreferredNetworkModeObserver.register(mContext, mSubId);
+        mAllowedNetworkTypesListener.register(mContext, mSubId);
     }
 
     @OnLifecycleEvent(ON_STOP)
     public void onStop() {
-        mPreferredNetworkModeObserver.unregister(mContext);
+        mAllowedNetworkTypesListener.unregister(mContext, mSubId);
     }
 
     @Override
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index 461fd87..fa215e7 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -752,7 +752,8 @@
         }
         try {
             getContext().getSystemService(UserManager.class)
-                    .removeUserOrSetEphemeral(UserHandle.myUserId());
+                    .removeUserOrSetEphemeral(UserHandle.myUserId(),
+                            /* evenWhenDisallowed= */ false);
             ActivityManager.getService().switchUser(UserHandle.USER_SYSTEM);
         } catch (RemoteException re) {
             Log.e(TAG, "Unable to remove self user");
diff --git a/tests/unit/src/com/android/settings/network/AllowedNetworkTypesListenerTest.java b/tests/unit/src/com/android/settings/network/AllowedNetworkTypesListenerTest.java
new file mode 100644
index 0000000..3387368
--- /dev/null
+++ b/tests/unit/src/com/android/settings/network/AllowedNetworkTypesListenerTest.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.network;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.os.HandlerExecutor;
+import android.telephony.PhoneStateListener;
+import android.telephony.RadioAccessFamily;
+import android.telephony.TelephonyManager;
+import android.test.mock.MockContentResolver;
+
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@RunWith(AndroidJUnit4.class)
+public class AllowedNetworkTypesListenerTest {
+
+    private static final int SUB_ID = 1;
+
+    private Context mContext;
+    private MockContentResolver mResolver;
+    private AllowedNetworkTypesListener mAllowedNetworkTypesListener;
+
+    @Mock
+    private AllowedNetworkTypesListener.OnAllowedNetworkTypesChangedListener mListener;
+    @Mock
+    private TelephonyManager mTelephonyManager;
+
+
+    @Before
+    @UiThreadTest
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(ApplicationProvider.getApplicationContext());
+        when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
+        doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(SUB_ID);
+
+        mAllowedNetworkTypesListener =
+                spy(new AllowedNetworkTypesListener(mContext.getMainExecutor()));
+    }
+
+    @Test
+    public void onChange_shouldCallListener() {
+        mAllowedNetworkTypesListener.mListener = mListener;
+        Map<Integer, Long> allowedNetworkTypesList = new HashMap<>();
+        long networkType = (long) RadioAccessFamily.getRafFromNetworkType(
+                TelephonyManager.NETWORK_MODE_LTE_CDMA_EVDO);
+        allowedNetworkTypesList.put(TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER,
+                networkType);
+        mAllowedNetworkTypesListener.onAllowedNetworkTypesChanged(allowedNetworkTypesList);
+
+        verify(mListener).onAllowedNetworkTypesChanged();
+    }
+
+    @Test
+    public void register_shouldRegisterContentObserver() {
+        mAllowedNetworkTypesListener.register(mContext, SUB_ID);
+
+        verify(mTelephonyManager, times(1)).registerPhoneStateListener(any(HandlerExecutor.class),
+                any(PhoneStateListener.class));
+    }
+
+    @Test
+    public void unregister_shouldUnregisterContentObserver() {
+        mAllowedNetworkTypesListener.unregister(mContext, SUB_ID);
+
+        verify(mTelephonyManager).unregisterPhoneStateListener(
+                mAllowedNetworkTypesListener);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/EnabledNetworkModePreferenceControllerTest.java
similarity index 68%
rename from tests/robotests/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerTest.java
rename to tests/unit/src/com/android/settings/network/EnabledNetworkModePreferenceControllerTest.java
index ca36f1f..81841b7 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/EnabledNetworkModePreferenceControllerTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2021 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,21 +21,23 @@
 import static com.android.settings.core.BasePreferenceController.AVAILABLE;
 import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
 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;
+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.WCDMA;
 
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.junit.Assert.assertEquals;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
 
 import android.content.Context;
-import android.net.Uri;
 import android.os.PersistableBundle;
-import android.provider.Settings;
 import android.telephony.CarrierConfigManager;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionManager;
@@ -43,9 +45,12 @@
 
 import androidx.lifecycle.LifecycleOwner;
 import androidx.preference.ListPreference;
+import androidx.preference.PreferenceManager;
 import androidx.preference.PreferenceScreen;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
 
-import com.android.settings.R;
 import com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
@@ -54,10 +59,8 @@
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
 
-@RunWith(RobolectricTestRunner.class)
+@RunWith(AndroidJUnit4.class)
 public class EnabledNetworkModePreferenceControllerTest {
     private static final int SUB_ID = 2;
     public static final String KEY = "enabled_network";
@@ -81,19 +84,21 @@
     private LifecycleOwner mLifecycleOwner;
     private Lifecycle mLifecycle;
 
+    @UiThreadTest
     @Before
     public void setUp() throws Exception {
         MockitoAnnotations.initMocks(this);
         mLifecycleOwner = () -> mLifecycle;
         mLifecycle = new Lifecycle(mLifecycleOwner);
-        mContext = spy(RuntimeEnvironment.application);
-        doReturn(mTelephonyManager).when(mContext).getSystemService(Context.TELEPHONY_SERVICE);
-        doReturn(mTelephonyManager).when(mContext).getSystemService(TelephonyManager.class);
-        doReturn(mCarrierConfigManager).when(mContext).getSystemService(CarrierConfigManager.class);
+        mContext = spy(ApplicationProvider.getApplicationContext());
+
+        when(mContext.getSystemService(CarrierConfigManager.class)).thenReturn(
+                mCarrierConfigManager);
+        when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager);
+        when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
         doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(SUB_ID);
         doReturn(mInvalidTelephonyManager).when(mTelephonyManager).createForSubscriptionId(
                 SubscriptionManager.INVALID_SUBSCRIPTION_ID);
-        doReturn(mContext).when(mContext).createPackageContext(anyString(), anyInt());
         doReturn(mServiceState).when(mTelephonyManager).getServiceState();
         mPersistableBundle = new PersistableBundle();
         doReturn(mPersistableBundle).when(mCarrierConfigManager).getConfig();
@@ -106,6 +111,7 @@
         mPreference.setKey(mController.getPreferenceKey());
     }
 
+    @UiThreadTest
     @Test
     public void getAvailabilityStatus_hideCarrierNetworkSettings_returnUnavailable() {
         mPersistableBundle.putBoolean(
@@ -115,6 +121,7 @@
         assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
     }
 
+    @UiThreadTest
     @Test
     public void getAvailabilityStatus_hidePreferredNetworkType_returnUnavailable() {
         mPersistableBundle.putBoolean(CarrierConfigManager.KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL,
@@ -135,6 +142,7 @@
         assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
     }
 
+    @UiThreadTest
     @Test
     public void getAvailabilityStatus_notWorldPhone_returnAvailable() {
         mPersistableBundle.putBoolean(CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL,
@@ -144,6 +152,7 @@
         assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
     }
 
+    @UiThreadTest
     @Test
     public void updateState_LteWorldPhone_GlobalHasLte() {
         mPersistableBundle.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
@@ -155,9 +164,10 @@
                 .contains(String.valueOf(TelephonyManager.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void updateState_5gWorldPhone_GlobalHasNr() {
-        mPersistableBundle.putBoolean(CarrierConfigManager.KEY_NR_ENABLED_BOOL, true);
+        mockAllowedNetworkTypes(ALLOWED_ALL_NETWORK_TYPE);
         mockAccessFamily(TelephonyManager.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA);
         mController.init(mLifecycle, SUB_ID);
         mPersistableBundle.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
@@ -169,15 +179,18 @@
                 .contains(String.valueOf(TelephonyManager.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void updateState_selectedOn5gItem() {
-        mPersistableBundle.putBoolean(CarrierConfigManager.KEY_NR_ENABLED_BOOL, true);
+        mockAllowedNetworkTypes(ALLOWED_ALL_NETWORK_TYPE);
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA);
         mockAccessFamily(TelephonyManager.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA);
         mController.init(mLifecycle, SUB_ID);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA);
+
+        // NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA = NR | LTE | RAF_TD_SCDMA | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (NR | LTE | RAF_TD_SCDMA | GSM | WCDMA));
 
         mController.updateState(mPreference);
 
@@ -186,16 +199,18 @@
                         TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void updateState_disAllowed5g_5gOptionHidden() {
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA);
         mockAccessFamily(TelephonyManager.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA);
         mockAllowedNetworkTypes(DISABLED_5G_NETWORK_TYPE);
         mController.init(mLifecycle, SUB_ID);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA);
 
+        // NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA = NR | LTE | RAF_TD_SCDMA | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (NR | LTE | RAF_TD_SCDMA | GSM | WCDMA));
         mController.updateState(mPreference);
 
         assertThat(mPreference.getEntryValues())
@@ -204,16 +219,18 @@
                         String.valueOf(TelephonyManager.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void updateState_disAllowed5g_selectOn4gOption() {
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA);
         mockAccessFamily(TelephonyManager.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA);
         mockAllowedNetworkTypes(DISABLED_5G_NETWORK_TYPE);
         mController.init(mLifecycle, SUB_ID);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA);
 
+        // NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA = NR | LTE | RAF_TD_SCDMA | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (NR | LTE | RAF_TD_SCDMA | GSM | WCDMA));
         mController.updateState(mPreference);
 
         assertThat(mPreference.getValue()).isEqualTo(
@@ -221,38 +238,43 @@
                         TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void updateState_NrEnableBoolFalse_5gOptionHidden() {
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_NR_LTE_GSM_WCDMA);
         mockAccessFamily(TelephonyManager.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA);
-        mPersistableBundle.putBoolean(CarrierConfigManager.KEY_NR_ENABLED_BOOL, false);
+        mockAllowedNetworkTypes(DISABLED_5G_NETWORK_TYPE);
 
         mController.init(mLifecycle, SUB_ID);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_NR_LTE_GSM_WCDMA);
+
+        // NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA = LTE | CDMA | EVDO | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (LTE | CDMA | EVDO | GSM | WCDMA));
 
         mController.updateState(mPreference);
 
         assertThat(mPreference.getValue()).isEqualTo(
                 String.valueOf(
-                        TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA));
+                        TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
         assertThat(mPreference.getEntryValues())
                 .asList()
                 .doesNotContain(
                         String.valueOf(TelephonyManager.NETWORK_MODE_NR_LTE_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void updateState_GlobalDisAllowed5g_GlobalWithoutNR() {
         mockAccessFamily(TelephonyManager.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA);
         mockAllowedNetworkTypes(DISABLED_5G_NETWORK_TYPE);
         mController.init(mLifecycle, SUB_ID);
         mPersistableBundle.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA);
 
+        // NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA = NR | LTE | CDMA | EVDO | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (NR | LTE | CDMA | EVDO | GSM | WCDMA));
         mController.updateState(mPreference);
 
         assertThat(mPreference.getEntryValues())
@@ -261,16 +283,18 @@
                         String.valueOf(TelephonyManager.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void updateState_GlobalDisAllowed5g_SelectOnGlobal() {
         mockAccessFamily(TelephonyManager.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA);
         mockAllowedNetworkTypes(DISABLED_5G_NETWORK_TYPE);
         mController.init(mLifecycle, SUB_ID);
         mPersistableBundle.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA);
 
+        // NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA = NR | LTE | CDMA | EVDO | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (NR | LTE | CDMA | EVDO | GSM | WCDMA));
         mController.updateState(mPreference);
 
         assertThat(mPreference.getValue()).isEqualTo(
@@ -278,13 +302,15 @@
                         TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void updateState_updateByNetworkMode() {
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA);
 
+        // NETWORK_MODE_TDSCDMA_GSM_WCDMA = RAF_TD_SCDMA | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (RAF_TD_SCDMA | GSM | WCDMA));
         mController.updateState(mPreference);
 
         assertThat(mPreference.getValue()).isEqualTo(
@@ -292,33 +318,38 @@
         assertThat(mPreference.getSummary()).isEqualTo("3G");
     }
 
+    @UiThreadTest
     @Test
     public void updateState_updateByNetworkMode_useDefaultValue() {
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA);
 
+        // NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA = LTE | CDMA | EVDO | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (LTE | CDMA | EVDO | GSM | WCDMA));
         mController.updateState(mPreference);
 
         assertThat(mPreference.getValue()).isEqualTo(
-                String.valueOf(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA));
+                String.valueOf(TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void onPreferenceChange_updateSuccess() {
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA);
         doReturn(true).when(mTelephonyManager).setPreferredNetworkTypeBitmask(
-                getRafFromNetworkType(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA));
+                getRafFromNetworkType(
+                        TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
 
         mController.updateState(mPreference);
         mController.onPreferenceChange(mPreference,
-                String.valueOf(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA));
+                String.valueOf(TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
 
         assertThat(mPreference.getValue()).isEqualTo(
-                String.valueOf(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA));
+                String.valueOf(TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void onPreferenceChange_updateFail() {
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA);
@@ -333,14 +364,21 @@
                 String.valueOf(TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA));
     }
 
+    @UiThreadTest
     @Test
     public void preferredNetworkModeNotification_preferenceUpdates() {
-        PreferenceScreen screen = mock(PreferenceScreen.class);
+
+        final PreferenceManager preferenceManager = new PreferenceManager(mContext);
+        PreferenceScreen screen = preferenceManager.createPreferenceScreen(mContext);
+        mPreference.setKey(KEY);
+        screen.addPreference(mPreference);
         mockEnabledNetworkMode(TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA);
-        doReturn(mPreference).when(screen).findPreference(KEY);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA);
+
+        // NETWORK_MODE_TDSCDMA_GSM_WCDMA = RAF_TD_SCDMA | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (RAF_TD_SCDMA | GSM | WCDMA));
+
         mController.displayPreference(screen);
         mController.updateState(mPreference);
         mLifecycle.handleLifecycleEvent(ON_START);
@@ -348,59 +386,59 @@
         assertThat(Integer.parseInt(mPreference.getValue())).isEqualTo(
                 TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA);
         assertThat(mPreference.getSummary()).isEqualTo("3G");
-
-
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_GSM_ONLY);
-        final Uri uri = Settings.Global.getUriFor(Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID);
-        mContext.getContentResolver().notifyChange(uri, null);
-
-        assertThat(Integer.parseInt(mPreference.getValue())).isEqualTo(
-                TelephonyManagerConstants.NETWORK_MODE_GSM_ONLY);
-        assertThat(mPreference.getSummary()).isEqualTo("2G");
     }
 
+    @UiThreadTest
     @Test
     public void checkResource_stringArrayLength() {
-        String[] entryValues = mController.getResourcesForSubId().getStringArray(
-                R.array.enabled_networks_cdma_values);
+        int id = mController.getResourcesForSubId().getIdentifier("enabled_networks_cdma_values",
+                "array", mContext.getPackageName());
+        String[] entryValues = mController.getResourcesForSubId().getStringArray(id);
         assertEquals(4, entryValues.length);
 
-        entryValues = mController.getResourcesForSubId().getStringArray(
-                R.array.enabled_networks_cdma_no_lte_values);
+        id = mController.getResourcesForSubId().getIdentifier("enabled_networks_cdma_no_lte_values",
+                "array", mContext.getPackageName());
+        entryValues = mController.getResourcesForSubId().getStringArray(id);
         assertEquals(2, entryValues.length);
 
-        entryValues = mController.getResourcesForSubId().getStringArray(
-                R.array.enabled_networks_cdma_only_lte_values);
+        id = mController.getResourcesForSubId().getIdentifier(
+                "enabled_networks_cdma_only_lte_values", "array", mContext.getPackageName());
+        entryValues = mController.getResourcesForSubId().getStringArray(id);
         assertEquals(2, entryValues.length);
 
-        entryValues = mController.getResourcesForSubId().getStringArray(
-                R.array.enabled_networks_tdscdma_values);
+        id = mController.getResourcesForSubId().getIdentifier("enabled_networks_tdscdma_values",
+                "array", mContext.getPackageName());
+        entryValues = mController.getResourcesForSubId().getStringArray(id);
         assertEquals(3, entryValues.length);
 
-        entryValues = mController.getResourcesForSubId().getStringArray(
-                R.array.enabled_networks_except_gsm_lte_values);
+        id = mController.getResourcesForSubId().getIdentifier(
+                "enabled_networks_except_gsm_lte_values", "array", mContext.getPackageName());
+        entryValues = mController.getResourcesForSubId().getStringArray(id);
         assertEquals(1, entryValues.length);
 
-        entryValues = mController.getResourcesForSubId().getStringArray(
-                R.array.enabled_networks_except_gsm_values);
+        id = mController.getResourcesForSubId().getIdentifier("enabled_networks_except_gsm_values",
+                "array", mContext.getPackageName());
+        entryValues = mController.getResourcesForSubId().getStringArray(id);
         assertEquals(2, entryValues.length);
 
-        entryValues = mController.getResourcesForSubId().getStringArray(
-                R.array.enabled_networks_except_lte_values);
+        id = mController.getResourcesForSubId().getIdentifier("enabled_networks_except_lte_values",
+                "array", mContext.getPackageName());
+        entryValues = mController.getResourcesForSubId().getStringArray(id);
         assertEquals(2, entryValues.length);
 
-        entryValues = mController.getResourcesForSubId().getStringArray(
-                R.array.enabled_networks_values);
+        id = mController.getResourcesForSubId().getIdentifier("enabled_networks_values", "array",
+                mContext.getPackageName());
+        entryValues = mController.getResourcesForSubId().getStringArray(id);
         assertEquals(3, entryValues.length);
 
-        entryValues = mController.getResourcesForSubId().getStringArray(
-                R.array.enabled_networks_values);
+        id = mController.getResourcesForSubId().getIdentifier("enabled_networks_values", "array",
+                mContext.getPackageName());
+        entryValues = mController.getResourcesForSubId().getStringArray(id);
         assertEquals(3, entryValues.length);
 
-        entryValues = mController.getResourcesForSubId().getStringArray(
-                R.array.preferred_network_mode_values_world_mode);
+        id = mController.getResourcesForSubId().getIdentifier(
+                "preferred_network_mode_values_world_mode", "array", mContext.getPackageName());
+        entryValues = mController.getResourcesForSubId().getStringArray(id);
         assertEquals(3, entryValues.length);
     }
 
@@ -408,15 +446,17 @@
         if (networkMode == TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA) {
             mockPhoneType(TelephonyManager.PHONE_TYPE_GSM);
             mPersistableBundle.putBoolean(CarrierConfigManager.KEY_SUPPORT_TDSCDMA_BOOL, true);
-        } else if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA) {
+        } else if (networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA
+                || networkMode == TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA) {
             mockPhoneType(TelephonyManager.PHONE_TYPE_GSM);
             mPersistableBundle.putBoolean(CarrierConfigManager.KEY_PREFER_2G_BOOL, true);
             mPersistableBundle.putBoolean(CarrierConfigManager.KEY_LTE_ENABLED_BOOL, true);
         } else if (networkMode == TelephonyManagerConstants.NETWORK_MODE_NR_LTE_TDSCDMA_GSM_WCDMA) {
             mockPhoneType(TelephonyManager.PHONE_TYPE_GSM);
             mPersistableBundle.putBoolean(CarrierConfigManager.KEY_SUPPORT_TDSCDMA_BOOL, true);
-        } else if (networkMode
-                == TelephonyManagerConstants.NETWORK_MODE_NR_LTE_GSM_WCDMA) {
+        } else if (networkMode == TelephonyManagerConstants.NETWORK_MODE_NR_LTE_GSM_WCDMA
+                || networkMode
+                == TelephonyManagerConstants.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA) {
             mockPhoneType(TelephonyManager.PHONE_TYPE_GSM);
             mPersistableBundle.putBoolean(CarrierConfigManager.KEY_PREFER_2G_BOOL, true);
             mPersistableBundle.putBoolean(CarrierConfigManager.KEY_LTE_ENABLED_BOOL, true);
@@ -424,7 +464,8 @@
     }
 
     private void mockAllowedNetworkTypes(long allowedNetworkType) {
-        doReturn(allowedNetworkType).when(mTelephonyManager).getAllowedNetworkTypes();
+        doReturn(allowedNetworkType).when(mTelephonyManager).getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_CARRIER);
     }
 
     private void mockAccessFamily(int networkMode) {
diff --git a/tests/unit/src/com/android/settings/network/PreferredNetworkModeContentObserverTest.java b/tests/unit/src/com/android/settings/network/PreferredNetworkModeContentObserverTest.java
deleted file mode 100644
index e07a8f1..0000000
--- a/tests/unit/src/com/android/settings/network/PreferredNetworkModeContentObserverTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.network;
-
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.content.Context;
-import android.provider.Settings;
-import android.test.mock.MockContentResolver;
-
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-@RunWith(AndroidJUnit4.class)
-public class PreferredNetworkModeContentObserverTest {
-
-    private static final int SUB_ID = 1;
-
-    private Context mContext;
-    private MockContentResolver mResolver;
-    private PreferredNetworkModeContentObserver mPreferredNetworkModeContentObserver;
-
-    @Mock
-    private PreferredNetworkModeContentObserver.OnPreferredNetworkModeChangedListener mListener;
-
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        mContext = spy(ApplicationProvider.getApplicationContext());
-
-        mResolver = spy(new MockContentResolver(mContext));
-        when(mContext.getContentResolver()).thenReturn(mResolver);
-        mPreferredNetworkModeContentObserver =
-                spy(new PreferredNetworkModeContentObserver(null));
-    }
-
-    @Test
-    public void onChange_shouldCallListener() {
-        mPreferredNetworkModeContentObserver.mListener = mListener;
-        mPreferredNetworkModeContentObserver.onChange(true);
-
-        verify(mListener).onPreferredNetworkModeChanged();
-    }
-
-    @Test
-    public void register_shouldRegisterContentObserver() {
-        mPreferredNetworkModeContentObserver.register(mContext, SUB_ID);
-
-        verify(mResolver).registerContentObserver(
-                Settings.Global.getUriFor(Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID), false,
-                mPreferredNetworkModeContentObserver);
-    }
-
-    @Test
-    public void unregister_shouldUnregisterContentObserver() {
-        mPreferredNetworkModeContentObserver.unregister(mContext);
-
-        verify(mResolver).unregisterContentObserver(mPreferredNetworkModeContentObserver);
-    }
-}
diff --git a/tests/unit/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java b/tests/unit/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
index 9c0a082..028b224 100644
--- a/tests/unit/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
+++ b/tests/unit/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
@@ -16,14 +16,20 @@
 
 package com.android.settings.network.telephony;
 
+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.RAF_TD_SCDMA;
+import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.WCDMA;
+
 import static com.google.common.truth.Truth.assertThat;
+
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
-
 import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.nullable;
-import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
@@ -38,7 +44,6 @@
 import android.net.Network;
 import android.net.NetworkCapabilities;
 import android.os.PersistableBundle;
-import android.provider.Settings;
 import android.telecom.PhoneAccountHandle;
 import android.telecom.TelecomManager;
 import android.telephony.CarrierConfigManager;
@@ -50,7 +55,6 @@
 import androidx.test.ext.junit.runners.AndroidJUnit4;
 
 import com.android.settings.network.ims.MockWfcQueryImsState;
-import com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -196,10 +200,10 @@
     public void isCdmaOptions_worldModeWithGsmWcdma_returnTrue() {
         when(mTelephonyManager.getPhoneType()).thenReturn(TelephonyManager.PHONE_TYPE_GSM);
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
-
-        Settings.Global.putInt(mContext.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID_1,
-                TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA);
+        // NETWORK_MODE_LTE_GSM_WCDMA = LTE | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (LTE | GSM | WCDMA));
 
         assertThat(MobileNetworkUtils.isCdmaOptions(mContext, SUB_ID_1)).isTrue();
     }
@@ -271,9 +275,10 @@
     public void shouldSpeciallyUpdateGsmCdma_ModeLteTdscdmaGsm_returnTrue() {
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_SUPPORT_TDSCDMA_BOOL, false);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID_1,
-                TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_GSM);
+        // NETWORK_MODE_LTE_TDSCDMA_GSM = LTE | RAF_TD_SCDMA | GSM
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (LTE | RAF_TD_SCDMA | GSM));
 
         assertThat(MobileNetworkUtils.shouldSpeciallyUpdateGsmCdma(mContext, SUB_ID_1)).isTrue();
     }
@@ -282,9 +287,10 @@
     public void shouldSpeciallyUpdateGsmCdma_ModeLteTdscdmaGsmWcdma_returnTrue() {
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_SUPPORT_TDSCDMA_BOOL, false);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID_1,
-                TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA);
+        // NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA = LTE | RAF_TD_SCDMA | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (LTE | RAF_TD_SCDMA | GSM | WCDMA));
 
         assertThat(MobileNetworkUtils.shouldSpeciallyUpdateGsmCdma(mContext, SUB_ID_1)).isTrue();
     }
@@ -293,9 +299,10 @@
     public void shouldSpeciallyUpdateGsmCdma_ModeLteTdscdma_returnTrue() {
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_SUPPORT_TDSCDMA_BOOL, false);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID_1,
-                TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA);
+        // NETWORK_MODE_LTE_TDSCDMA = LTE | RAF_TD_SCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (LTE | RAF_TD_SCDMA));
 
         assertThat(MobileNetworkUtils.shouldSpeciallyUpdateGsmCdma(mContext, SUB_ID_1)).isTrue();
     }
@@ -304,9 +311,10 @@
     public void shouldSpeciallyUpdateGsmCdma_ModeLteTdscdmaWcdma_returnTrue() {
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_SUPPORT_TDSCDMA_BOOL, false);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID_1,
-                TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA);
+        // NETWORK_MODE_LTE_TDSCDMA_WCDMA = LTE | RAF_TD_SCDMA | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (LTE | RAF_TD_SCDMA | WCDMA));
 
         assertThat(MobileNetworkUtils.shouldSpeciallyUpdateGsmCdma(mContext, SUB_ID_1)).isTrue();
     }
@@ -315,9 +323,11 @@
     public void shouldSpeciallyUpdateGsmCdma_ModeLteTdscdmaCdmaEvdoGsmWcdma_returnTrue() {
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_SUPPORT_TDSCDMA_BOOL, false);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID_1,
-                TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA);
+        // NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA
+        //     = LTE | RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (LTE | RAF_TD_SCDMA | CDMA | EVDO | GSM | WCDMA));
 
         assertThat(MobileNetworkUtils.shouldSpeciallyUpdateGsmCdma(mContext, SUB_ID_1)).isTrue();
     }
@@ -326,9 +336,10 @@
     public void shouldSpeciallyUpdateGsmCdma_ModeLteCdmaEvdoGsmWcdma_returnTrue() {
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_WORLD_MODE_ENABLED_BOOL, true);
         mCarrierConfig.putBoolean(CarrierConfigManager.KEY_SUPPORT_TDSCDMA_BOOL, false);
-        Settings.Global.putInt(mContext.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID_1,
-                TelephonyManagerConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA);
+        // NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA = LTE | CDMA | EVDO | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (LTE | CDMA | EVDO | GSM | WCDMA));
 
         assertThat(MobileNetworkUtils.shouldSpeciallyUpdateGsmCdma(mContext, SUB_ID_1)).isTrue();
     }
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 c5da3c5..6bca9ab 100644
--- a/tests/unit/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/telephony/PreferredNetworkModePreferenceControllerTest.java
@@ -18,17 +18,20 @@
 
 import static com.android.settings.core.BasePreferenceController.AVAILABLE;
 import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
-import static com.android.settings.network.telephony.MobileNetworkUtils.getRafFromNetworkType;
+import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.GSM;
+import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.RAF_TD_SCDMA;
+import static com.android.settings.network.telephony.TelephonyConstants.RadioAccessFamily.WCDMA;
 
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import android.content.Context;
 import android.os.PersistableBundle;
-import android.provider.Settings;
 import android.telephony.CarrierConfigManager;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionManager;
@@ -41,7 +44,6 @@
 import com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants;
 import com.android.settings.testutils.ResourcesUtils;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -89,12 +91,6 @@
         mPreference.setKey(mController.getPreferenceKey());
     }
 
-    @After
-    public void tearDown() {
-        Settings.Global.putInt(
-                mContext.getContentResolver(), Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID, 0);
-    }
-
     @Test
     public void getAvailabilityStatus_hideCarrierNetworkSettings_returnUnavailable() {
         mPersistableBundle.putBoolean(CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL,
@@ -134,9 +130,10 @@
 
     @Test
     public void updateState_updateByNetworkMode() {
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA);
+        // NETWORK_MODE_TDSCDMA_GSM_WCDMA = RAF_TD_SCDMA | GSM | WCDMA
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (RAF_TD_SCDMA | GSM | WCDMA));
 
         mController.updateState(mPreference);
 
@@ -148,28 +145,13 @@
     }
 
     @Test
-    public void onPreferenceChange_updateSuccess() {
-        doReturn(true).when(mTelephonyManager).setPreferredNetworkTypeBitmask(
-                getRafFromNetworkType(TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA));
-
+    public void onPreferenceChange_updateNetworkMode() {
         mController.onPreferenceChange(mPreference,
                 String.valueOf(TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA));
 
-        assertThat(Settings.Global.getInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID, 0)).isEqualTo(
-                TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA);
-    }
-
-    @Test
-    public void onPreferenceChange_updateFail() {
-        doReturn(false).when(mTelephonyManager).setPreferredNetworkTypeBitmask(
-                getRafFromNetworkType(TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA));
-
-        mController.onPreferenceChange(mPreference,
-                String.valueOf(TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA));
-
-        assertThat(Settings.Global.getInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID, 0)).isNotEqualTo(
-                TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA);
+        verify(mTelephonyManager, times(1)).setAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER,
+                MobileNetworkUtils.getRafFromNetworkType(
+                        TelephonyManagerConstants.NETWORK_MODE_LTE_TDSCDMA));
     }
 }
diff --git a/tests/unit/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceControllerTest.java
index 3bc3935..8cff38e 100644
--- a/tests/unit/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceControllerTest.java
@@ -16,6 +16,10 @@
 
 package com.android.settings.network.telephony.cdma;
 
+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.WCDMA;
+
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.Mockito.doReturn;
@@ -28,11 +32,10 @@
 
 import androidx.preference.ListPreference;
 import androidx.preference.PreferenceManager;
+import androidx.test.annotation.UiThreadTest;
 import androidx.test.core.app.ApplicationProvider;
 import androidx.test.ext.junit.runners.AndroidJUnit4;
 
-import com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -53,8 +56,8 @@
     private ListPreference mPreference;
     private Context mContext;
     private int mCdmaRoamingMode;
-    private int mSettingsNetworkMode;
 
+    @UiThreadTest
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
@@ -72,20 +75,12 @@
         mCdmaRoamingMode = Settings.Global.getInt(mContext.getContentResolver(),
             Settings.Global.CDMA_ROAMING_MODE,
             TelephonyManager.CDMA_ROAMING_MODE_ANY);
-
-        mSettingsNetworkMode = Settings.Global.getInt(
-            mContext.getContentResolver(),
-            Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-            TelephonyManager.DEFAULT_PREFERRED_NETWORK_MODE);
     }
 
     @After
     public void tearDown() {
         Settings.Global.putInt(mContext.getContentResolver(),
             Settings.Global.CDMA_ROAMING_MODE, mCdmaRoamingMode);
-
-        Settings.Global.putInt(mContext.getContentResolver(),
-            Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID, mSettingsNetworkMode);
     }
 
     @Test
@@ -118,9 +113,9 @@
     public void updateState_LteGSMWcdma_disabled() {
         doReturn(TelephonyManager.CDMA_ROAMING_MODE_HOME).when(
                 mTelephonyManager).getCdmaRoamingMode();
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.PREFERRED_NETWORK_MODE + SUB_ID,
-                TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA);
+        when(mTelephonyManager.getAllowedNetworkTypesForReason(
+                TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER)).thenReturn(
+                (long) (LTE | GSM | WCDMA));
 
         mController.updateState(mPreference);
 
