Fix MWI missing on blocked VVM3 SIM

Previously MWI will be suppressed if the notification channel state
(phone signal) is active. This will only work if VVM is fully active
or fully disabled. In VVM3 there is a new state that the VVM client is
enabled but the carrier has blocked the service. The notification
channel state will be active, but VVM SMS will not be sent and MWI will
continue as usual and mistakenly be suppressed by VVM client.

After this CL, instead of checking the notification state to suppress
MWI, the configuration state which determines if the service is actually
active will be used.

Change-Id: Id55a88ff3c188113f1f40f56503d2b61dd5c0c40
Fixes: 30883795
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index 0932cce..9504f34 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -47,13 +47,11 @@
 import android.util.ArrayMap;
 import android.util.Log;
 import android.widget.Toast;
-
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.TelephonyCapabilities;
+import com.android.phone.settings.VoicemailNotificationSettingsUtil;
 import com.android.phone.settings.VoicemailSettingsActivity;
 import com.android.phone.vvm.omtp.sync.VoicemailStatusQueryHelper;
-import com.android.phone.settings.VoicemailNotificationSettingsUtil;
-
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
@@ -231,8 +229,13 @@
         if (visible && phone != null) {
             VoicemailStatusQueryHelper queryHelper = new VoicemailStatusQueryHelper(mContext);
             PhoneAccountHandle phoneAccount = PhoneUtils.makePstnPhoneAccountHandle(phone);
-            if (queryHelper.isNotificationsChannelActive(phoneAccount)) {
-                Log.v(LOG_TAG, "Notifications channel active for visual voicemail, hiding mwi.");
+            if (queryHelper.isVoicemailSourceConfigured(phoneAccount)) {
+                Log.v(LOG_TAG, "Source configured for visual voicemail, hiding mwi.");
+                // MWI may not be suppressed if the PIN is not set on VVM3 because it is also a
+                // "Not OK" configuration state. But VVM3 never send a MWI after the service is
+                // activated so this should be fine.
+                // TODO(twyen): once unbundled the client should be able to set a flag to suppress
+                // MWI, instead of letting the NotificationMgr try to interpret the states.
                 visible = false;
             }
         }