Merge "fix the issue of empty network selection notification"
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();
}