diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 4e919d6..8d04ab8 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -19,12 +19,17 @@
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.ims.ImsRcsManager;
 import android.text.TextUtils;
 import android.util.FeatureFlagUtils;
 
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.settings.core.FeatureFlags;
 import com.android.settings.enterprise.EnterprisePrivacySettings;
+import com.android.settings.network.SubscriptionUtil;
+import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.security.SecuritySettingsFeatureProvider;
 
@@ -304,7 +309,51 @@
     public static class WifiCallingDisclaimerActivity extends SettingsActivity { /* empty */ }
     public static class MobileNetworkListActivity extends SettingsActivity {}
     public static class PowerMenuSettingsActivity extends SettingsActivity {}
-    public static class SubscriptionSettingsActivity extends SettingsActivity {  /* empty */  }
+    public static class MobileNetworkActivity extends SettingsActivity {
+
+        public static final String EXTRA_MMS_MESSAGE = "mms_message";
+        public static final String EXTRA_SHOW_CAPABILITY_DISCOVERY_OPT_IN =
+                "show_capability_discovery_opt_in";
+
+        @Override
+        public Intent getIntent() {
+            final Intent intent = new Intent(super.getIntent());
+            int subId = intent.getIntExtra(android.provider.Settings.EXTRA_SUB_ID,
+                    SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+            SubscriptionInfo subInfo = SubscriptionUtil.getSubscriptionOrDefault(
+                    getApplicationContext(), subId);
+            CharSequence title = SubscriptionUtil.getUniqueSubscriptionDisplayName(
+                    subInfo, getApplicationContext());
+            intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_TITLE, title);
+            intent.putExtra(android.provider.Settings.EXTRA_SUB_ID, subId);
+            if (android.provider.Settings.ACTION_MMS_MESSAGE_SETTING.equals(intent.getAction())) {
+                // highlight "mms_message" preference.
+                intent.putExtra(EXTRA_FRAGMENT_ARG_KEY, EXTRA_MMS_MESSAGE);
+            }
+
+            if (doesIntentContainOptInAction(intent)) {
+                intent.putExtra(EXTRA_SHOW_CAPABILITY_DISCOVERY_OPT_IN,
+                        maybeShowContactDiscoveryDialog(subId));
+            }
+
+            return intent;
+        }
+
+        private boolean maybeShowContactDiscoveryDialog(int subId) {
+            // If this activity was launched using ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN, show the
+            // associated dialog only if the opt-in has not been granted yet.
+            return MobileNetworkUtils.isContactDiscoveryVisible(getApplicationContext(), subId)
+                    // has the user already enabled this configuration?
+                    && !MobileNetworkUtils.isContactDiscoveryEnabled(
+                            getApplicationContext(), subId);
+        }
+
+        public static boolean doesIntentContainOptInAction(Intent intent) {
+            String intentAction = (intent != null ? intent.getAction() : null);
+            return TextUtils.equals(intentAction,
+                    ImsRcsManager.ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN);
+        }
+    }
 
     /**
      * Activity for BugReportHandlerPicker.
diff --git a/src/com/android/settings/network/MobileNetworkListController.java b/src/com/android/settings/network/MobileNetworkListController.java
index d7fc8b4..fd40c8f 100644
--- a/src/com/android/settings/network/MobileNetworkListController.java
+++ b/src/com/android/settings/network/MobileNetworkListController.java
@@ -16,6 +16,8 @@
 
 package com.android.settings.network;
 
+import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
+
 import static androidx.lifecycle.Lifecycle.Event.ON_PAUSE;
 import static androidx.lifecycle.Lifecycle.Event.ON_RESUME;
 
@@ -34,7 +36,6 @@
 
 import com.android.internal.annotations.VisibleForTesting;
 import com.android.settings.R;
-import com.android.settings.network.telephony.MobileNetworkActivity;
 import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settingslib.core.AbstractPreferenceController;
 
@@ -137,7 +138,8 @@
                         && !SubscriptionUtil.showToggleForPhysicalSim(mSubscriptionManager)) {
                     SubscriptionUtil.startToggleSubscriptionDialogActivity(mContext, subId, true);
                 } else {
-                    final Intent intent = new Intent(mContext, MobileNetworkActivity.class);
+                    final Intent intent = new Intent(Settings.ACTION_NETWORK_OPERATOR_SETTINGS);
+                    intent.setPackage(SETTINGS_PACKAGE_NAME);
                     intent.putExtra(Settings.EXTRA_SUB_ID, info.getSubscriptionId());
                     mContext.startActivity(intent);
                 }
diff --git a/src/com/android/settings/network/MobileNetworkPreferenceController.java b/src/com/android/settings/network/MobileNetworkPreferenceController.java
index 527a632..b49613a 100644
--- a/src/com/android/settings/network/MobileNetworkPreferenceController.java
+++ b/src/com/android/settings/network/MobileNetworkPreferenceController.java
@@ -18,6 +18,8 @@
 import static android.os.UserHandle.myUserId;
 import static android.os.UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS;
 
+import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
+
 import static androidx.lifecycle.Lifecycle.Event;
 
 import android.content.BroadcastReceiver;
@@ -38,7 +40,6 @@
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.core.PreferenceControllerMixin;
-import com.android.settings.network.telephony.MobileNetworkActivity;
 import com.android.settings.network.telephony.MobileNetworkUtils;
 import com.android.settingslib.RestrictedLockUtilsInternal;
 import com.android.settingslib.RestrictedPreference;
@@ -146,7 +147,8 @@
     @Override
     public boolean handlePreferenceTreeClick(Preference preference) {
         if (KEY_MOBILE_NETWORK_SETTINGS.equals(preference.getKey())) {
-            final Intent intent = new Intent(mContext, MobileNetworkActivity.class);
+            final Intent intent = new Intent(Settings.ACTION_NETWORK_OPERATOR_SETTINGS);
+            intent.setPackage(SETTINGS_PACKAGE_NAME);
             mContext.startActivity(intent);
             return true;
         }
diff --git a/src/com/android/settings/network/telephony/MobileDataSlice.java b/src/com/android/settings/network/telephony/MobileDataSlice.java
index 22bb581..d25ae65 100644
--- a/src/com/android/settings/network/telephony/MobileDataSlice.java
+++ b/src/com/android/settings/network/telephony/MobileDataSlice.java
@@ -18,6 +18,8 @@
 
 import static android.app.slice.Slice.EXTRA_TOGGLE_STATE;
 
+import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
+
 import android.annotation.ColorInt;
 import android.app.PendingIntent;
 import android.content.Context;
@@ -27,6 +29,7 @@
 import android.net.Uri;
 import android.os.Handler;
 import android.os.Looper;
+import android.provider.Settings;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
@@ -142,7 +145,8 @@
 
     @Override
     public Intent getIntent() {
-        return new Intent(mContext, MobileNetworkActivity.class);
+        return new Intent(Settings.ACTION_NETWORK_OPERATOR_SETTINGS).setPackage(
+                SETTINGS_PACKAGE_NAME);
     }
 
     @Override
diff --git a/src/com/android/settings/network/telephony/MobileNetworkActivity.java b/src/com/android/settings/network/telephony/MobileNetworkActivity.java
deleted file mode 100644
index d3ff546..0000000
--- a/src/com/android/settings/network/telephony/MobileNetworkActivity.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2018 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.telephony;
-
-import static com.android.settings.SettingsActivity.EXTRA_FRAGMENT_ARG_KEY;
-
-import android.app.Activity;
-import android.app.settings.SettingsEnums;
-import android.content.Intent;
-import android.os.Bundle;
-import android.os.UserManager;
-import android.provider.Settings;
-import android.telephony.SubscriptionInfo;
-import android.telephony.SubscriptionManager;
-import android.telephony.ims.ImsRcsManager;
-import android.text.TextUtils;
-import android.util.Log;
-
-
-import com.android.settings.SettingsActivity;
-import com.android.settings.Utils;
-import com.android.settings.activityembedding.ActivityEmbeddingUtils;
-import com.android.settings.network.SubscriptionUtil;
-
-/**
- * Activity for displaying MobileNetworkSettings.
- *
- * @Deprecated The MobileNetworkActivity should be removed in Android U. Instead of using the
- * singleTask activity which will cause an additional window transition when users launch the SIMs
- * page, using the {@link com.android.settings.Settings.SubscriptionSettingsActivity} which can be
- * managed by {@link SettingsActivity} and be migrated into the Settings architecture.
- */
-@Deprecated
-public class MobileNetworkActivity extends Activity {
-
-    private static final String TAG = "MobileNetworkActivity";
-    public static final String SHOW_CAPABILITY_DISCOVERY_OPT_IN =
-            "show_capability_discovery_opt_in";
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        final UserManager userManager = this.getSystemService(UserManager.class);
-        if (!userManager.isAdminUser()) {
-            this.finish();
-            return;
-        }
-
-        // TODO: Move these intent's extra into SubscriptionSettingsActivity if the
-        //  MobileNetworkActivity is removed in Android U.
-        Intent intent = getIntent();
-        if (intent == null) {
-            Log.d(TAG, "onCreate(), intent = null");
-            this.finish();
-            return;
-        }
-
-        Intent trampolineIntent;
-        final Intent subscriptionSettingsIntent = new Intent(this,
-                com.android.settings.Settings.SubscriptionSettingsActivity.class);
-        if (!ActivityEmbeddingUtils.isEmbeddingActivityEnabled(this) || !isTaskRoot()) {
-            trampolineIntent = subscriptionSettingsIntent;
-        } else {
-            trampolineIntent = new Intent(Settings.ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY)
-                    .setPackage(Utils.SETTINGS_PACKAGE_NAME);
-            trampolineIntent.putExtra(
-                    android.provider.Settings.EXTRA_SETTINGS_EMBEDDED_DEEP_LINK_INTENT_URI,
-                    subscriptionSettingsIntent.toUri(Intent.URI_INTENT_SCHEME));
-        }
-
-        int subId = intent.getIntExtra(Settings.EXTRA_SUB_ID,
-                SubscriptionManager.INVALID_SUBSCRIPTION_ID);
-        SubscriptionInfo subInfo = SubscriptionUtil.getSubscriptionOrDefault(this, subId);
-        CharSequence title = SubscriptionUtil.getUniqueSubscriptionDisplayName(subInfo, this);
-        trampolineIntent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_TITLE, title);
-        trampolineIntent.putExtra(Settings.EXTRA_SUB_ID, subId);
-        if (Settings.ACTION_MMS_MESSAGE_SETTING.equals(intent.getAction())) {
-            // highlight "mms_message" preference.
-            trampolineIntent.putExtra(EXTRA_FRAGMENT_ARG_KEY, "mms_message");
-        }
-
-        if (doesIntentContainOptInAction(intent)) {
-            trampolineIntent.putExtra(SHOW_CAPABILITY_DISCOVERY_OPT_IN,
-                    maybeShowContactDiscoveryDialog(subId));
-        }
-
-        startActivity(trampolineIntent);
-        if (isTaskRoot()) {
-            finishAndRemoveTask();
-        } else {
-            finish();
-        }
-    }
-
-    private boolean maybeShowContactDiscoveryDialog(int subId) {
-        // If this activity was launched using ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN, show the
-        // associated dialog only if the opt-in has not been granted yet.
-        return MobileNetworkUtils.isContactDiscoveryVisible(this, subId)
-                // has the user already enabled this configuration?
-                && !MobileNetworkUtils.isContactDiscoveryEnabled(this, subId);
-    }
-
-    public static boolean doesIntentContainOptInAction(Intent intent) {
-        String intentAction = (intent != null ? intent.getAction() : null);
-        return TextUtils.equals(intentAction,
-                ImsRcsManager.ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN);
-    }
-}
diff --git a/src/com/android/settings/network/telephony/MobileNetworkSettings.java b/src/com/android/settings/network/telephony/MobileNetworkSettings.java
index cf0f889..f1a4018 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkSettings.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkSettings.java
@@ -26,7 +26,6 @@
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
-import android.telephony.ims.ImsRcsManager;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.Menu;
@@ -37,6 +36,7 @@
 import androidx.preference.Preference;
 
 import com.android.settings.R;
+import com.android.settings.Settings.MobileNetworkActivity;
 import com.android.settings.datausage.BillingCyclePreferenceController;
 import com.android.settings.datausage.DataUsageSummaryPreferenceController;
 import com.android.settings.network.ActiveSubscriptionsListener;
diff --git a/src/com/android/settings/sim/SimSelectNotification.java b/src/com/android/settings/sim/SimSelectNotification.java
index 6d15737..5902b92 100644
--- a/src/com/android/settings/sim/SimSelectNotification.java
+++ b/src/com/android/settings/sim/SimSelectNotification.java
@@ -53,7 +53,6 @@
 import com.android.settings.HelpTrampoline;
 import com.android.settings.R;
 import com.android.settings.network.SubscriptionUtil;
-import com.android.settings.network.telephony.MobileNetworkActivity;
 
 public class SimSelectNotification extends BroadcastReceiver {
     private static final String TAG = "SimSelectNotification";
@@ -261,7 +260,7 @@
 
         // Create the pending intent that will lead to the subscription setting page.
         Intent resultIntent = new Intent(Settings.ACTION_MMS_MESSAGE_SETTING);
-        resultIntent.setClass(context, MobileNetworkActivity.class);
+        resultIntent.setPackage(SETTINGS_PACKAGE_NAME);
         resultIntent.putExtra(Settings.EXTRA_SUB_ID, subId);
         PendingIntent resultPendingIntent = PendingIntent.getActivity(context, 0, resultIntent,
                 PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
