fix the issue of empty network selection notification

if fails to camp on selected network, we should show network
from sharedference in stead of network indicator which is always
empty.

Bug: 78016330
Test: Manual
Change-Id: I0813dc6951e274f07c418102822e730723159a62
(cherry picked from commit 996a1c343eb1608e7fa56cc4b3728080b22ad34f)
Merged-in: I0813dc6951e274f07c418102822e730723159a62
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index f790c07..cbf964c 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -613,27 +613,24 @@
                 PhoneFactory.getPhone(phoneId) : PhoneFactory.getDefaultPhone();
         if (TelephonyCapabilities.supportsNetworkSelection(phone)) {
             if (SubscriptionManager.isValidSubscriptionId(subId)) {
+                SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
+                String selectedNetworkOperatorName =
+                        sp.getString(Phone.NETWORK_SELECTION_NAME_KEY + subId, "");
+                // get the shared preference of network_selection.
+                // empty is auto mode, otherwise it is the operator alpha name
+                // in case there is no operator name, check the operator numeric
+                if (TextUtils.isEmpty(selectedNetworkOperatorName)) {
+                    selectedNetworkOperatorName =
+                            sp.getString(Phone.NETWORK_SELECTION_KEY + subId, "");
+                }
+                boolean isManualSelection;
                 // if restoring manual selection is controlled by framework, then get network
                 // selection from shared preference, otherwise get from real network indicators.
                 boolean restoreSelection = !mContext.getResources().getBoolean(
                         com.android.internal.R.bool.skip_restoring_network_selection);
-                String selectedNetworkOperatorName;
-                boolean isManualSelection;
                 if (restoreSelection) {
-                    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
-                    selectedNetworkOperatorName =
-                            sp.getString(Phone.NETWORK_SELECTION_NAME_KEY + subId, "");
-                    // get the shared preference of network_selection.
-                    // empty is auto mode, otherwise it is the operator alpha name
-                    // in case there is no operator name, check the operator numeric
-                    if (TextUtils.isEmpty(selectedNetworkOperatorName)) {
-                        selectedNetworkOperatorName =
-                                sp.getString(Phone.NETWORK_SELECTION_KEY + subId, "");
-                    }
                     isManualSelection = !TextUtils.isEmpty(selectedNetworkOperatorName);
                 } else {
-                    selectedNetworkOperatorName = phone.getServiceStateTracker().mSS
-                            .getOperatorAlpha();
                     isManualSelection = phone.getServiceStateTracker().mSS.getIsManualSelection();
                 }