diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index 3c7b321..4fb96a2 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -878,7 +878,9 @@
                             + (isManualSelection ? selectedNetworkOperatorName : ""));
                 }
 
-                if (isManualSelection) {
+                if (isManualSelection
+                        && isSubscriptionVisibleToUser(
+                              mSubscriptionManager.getActiveSubscriptionInfo(subId))) {
                     mSelectedNetworkOperatorName.put(subId, selectedNetworkOperatorName);
                     shouldShowNotification(serviceState, subId);
                 } else {
@@ -934,7 +936,9 @@
                             + (isManualSelection ? selectedNetworkOperatorName : ""));
                 }
 
-                if (isManualSelection) {
+                if (isManualSelection
+                        && isSubscriptionVisibleToUser(
+                              mSubscriptionManager.getActiveSubscriptionInfo(subId))) {
                     mSelectedNetworkOperatorName.put(subId, selectedNetworkOperatorName);
                     shouldShowNotification(serviceState, subId);
                 } else {
@@ -949,6 +953,12 @@
         }
     }
 
+    // TODO(b/261916533) This should be handled by SubscriptionManager#isSubscriptionVisible(),
+    // but that method doesn't support system callers, so here we are.
+    private boolean isSubscriptionVisibleToUser(SubscriptionInfo subInfo) {
+        return subInfo != null && (!subInfo.isOpportunistic() || subInfo.getGroupUuid() == null);
+    }
+
     private void dismissNetworkSelectionNotification(int subId) {
         if (mSelectedUnavailableNotify.get(subId, false)) {
             cancelNetworkSelection(subId);
diff --git a/tests/src/com/android/phone/NotificationMgrTest.java b/tests/src/com/android/phone/NotificationMgrTest.java
index 98c6a4a..2b0ff94 100644
--- a/tests/src/com/android/phone/NotificationMgrTest.java
+++ b/tests/src/com/android/phone/NotificationMgrTest.java
@@ -59,6 +59,7 @@
 import android.content.pm.ApplicationInfo;
 import android.content.res.Resources;
 import android.os.Build;
+import android.os.ParcelUuid;
 import android.os.PersistableBundle;
 import android.os.SystemClock;
 import android.os.UserHandle;
@@ -409,6 +410,35 @@
     }
 
     @Test
+    public void testUpdateNetworkSelection_opportunisticSubscription_notificationNotSent()
+            throws Exception {
+        prepareResourcesForNetworkSelection();
+        when(mSubscriptionManager.getActiveSubscriptionInfo(eq(TEST_SUB_ID))).thenReturn(
+                mSubscriptionInfo);
+
+        when(mTelephonyManager.isManualNetworkSelectionAllowed()).thenReturn(true);
+        PersistableBundle config = new PersistableBundle();
+        config.putBoolean(CarrierConfigManager.KEY_OPERATOR_SELECTION_EXPAND_BOOL, true);
+        config.putBoolean(CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL, false);
+        config.putBoolean(CarrierConfigManager.KEY_CSP_ENABLED_BOOL, false);
+        config.putBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL, true);
+        when(mCarrierConfigManager.getConfigForSubId(TEST_SUB_ID)).thenReturn(config);
+
+        when(mSubscriptionInfo.isOpportunistic()).thenReturn(true);
+        when(mSubscriptionInfo.getGroupUuid()).thenReturn(
+                ParcelUuid.fromString("5be5c5f3-3412-452e-86a0-6f18558ae8c8"));
+
+        mNotificationMgr.updateNetworkSelection(ServiceState.STATE_OUT_OF_SERVICE, TEST_SUB_ID);
+        try {
+            Thread.sleep(10000);
+        } catch (InterruptedException ignored) {
+        }
+        mNotificationMgr.updateNetworkSelection(ServiceState.STATE_OUT_OF_SERVICE, TEST_SUB_ID);
+
+        verify(mNotificationManager, never()).notify(any(), anyInt(), any());
+    }
+
+    @Test
     public void testUpdateNetworkSelection_worldMode_userSetLTE_notificationNotSent() {
         prepareResourcesForNetworkSelection();
 
@@ -632,6 +662,8 @@
         when(mApp.getString(R.string.mobile_network_settings_class)).thenReturn(
                 MOBILE_NETWORK_SELECTION_CLASS);
         when(mSubscriptionManager.isActiveSubId(anyInt())).thenReturn(true);
+        when(mSubscriptionManager.getActiveSubscriptionInfo(eq(TEST_SUB_ID))).thenReturn(
+                mSubscriptionInfo);
     }
 
     private void moveTimeForward(long seconds) {
