Update the network unavailable message when selection fails
Add a call to updateNetworkSelection in NotificationMgr when
NetworkSettings is notified that the manual network selection failed.
Bug: 25453688
Change-Id: I901218b31a767e4aeb2afeabae796b615e3c9050
diff --git a/src/com/android/phone/NetworkSetting.java b/src/com/android/phone/NetworkSetting.java
index a08bd40..a09c5c5 100644
--- a/src/com/android/phone/NetworkSetting.java
+++ b/src/com/android/phone/NetworkSetting.java
@@ -34,6 +34,8 @@
import android.preference.PreferenceActivity;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
+import android.telephony.ServiceState;
+import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.telephony.SubscriptionManager;
@@ -388,6 +390,15 @@
final PhoneGlobals app = PhoneGlobals.getInstance();
app.notificationMgr.postTransientNotification(
NotificationMgr.NETWORK_SELECTION_NOTIFICATION, status);
+
+ TelephonyManager tm = (TelephonyManager) app.getSystemService(Context.TELEPHONY_SERVICE);
+ Phone phone = PhoneFactory.getPhone(mPhoneId);
+ if (phone != null) {
+ ServiceState ss = tm.getServiceStateForSubscriber(phone.getSubId());
+ if (ss != null) {
+ app.notificationMgr.updateNetworkSelection(ss.getState());
+ }
+ }
}
private void displayNetworkSelectionSucceeded() {
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index f32d8d5..0a583a0 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -590,10 +590,8 @@
if (serviceState == ServiceState.STATE_OUT_OF_SERVICE
&& !TextUtils.isEmpty(networkSelection)) {
- if (!mSelectedUnavailableNotify) {
- showNetworkSelection(networkSelection);
- mSelectedUnavailableNotify = true;
- }
+ showNetworkSelection(networkSelection);
+ mSelectedUnavailableNotify = true;
} else {
if (mSelectedUnavailableNotify) {
cancelNetworkSelection();