Merge changes I5b45f043,I1ebe7fc3 into nyc-mr1-dev

* changes:
  Remove NOOP in VVM connection
  Set message count to 0 while clearing MWI
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 808a5d6..4ff8d8e 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -34,10 +34,8 @@
 import android.os.Message;
 import android.os.PersistableBundle;
 import android.os.PowerManager;
-import android.os.ServiceManager;
 import android.os.SystemClock;
 import android.os.SystemProperties;
-import android.os.SystemService;
 import android.os.UpdateLock;
 import android.os.UserManager;
 import android.preference.PreferenceManager;
@@ -59,7 +57,6 @@
 import com.android.internal.telephony.TelephonyIntents;
 import com.android.phone.common.CallLogAsync;
 import com.android.phone.settings.SettingsConstants;
-import com.android.server.sip.SipService;
 import com.android.services.telephony.activation.SimActivationManager;
 import com.android.services.telephony.sip.SipUtil;
 
@@ -851,6 +848,8 @@
      * @param subId the subscription id we should dismiss the notification for.
      */
     public void clearMwiIndicator(int subId) {
-        notificationMgr.updateMwi(subId, false);
+        // Setting voiceMessageCount to 0 will remove the current notification and clear the system
+        // cached value.
+        getPhone(subId).setVoiceMessageCount(0);
     }
 }
diff --git a/src/com/android/phone/common/mail/store/ImapFolder.java b/src/com/android/phone/common/mail/store/ImapFolder.java
index 9b51f34..4abb7f5 100644
--- a/src/com/android/phone/common/mail/store/ImapFolder.java
+++ b/src/com/android/phone/common/mail/store/ImapFolder.java
@@ -94,23 +94,7 @@
     public void open(String mode) throws MessagingException {
         try {
             if (isOpen()) {
-                if (mMode == mode) {
-                    // Make sure the connection is valid.
-                    // If it's not we'll close it down and continue on to get a new one.
-                    try {
-                        mConnection.executeSimpleCommand(ImapConstants.NOOP);
-                        return;
-
-                    } catch (IOException ioe) {
-                        mStore.getImapHelper().handleEvent(OmtpEvents.DATA_GENERIC_IMAP_IOE);
-                        ioExceptionHandler(mConnection, ioe);
-                    } finally {
-                        destroyResponses();
-                    }
-                } else {
-                    // Return the connection to the pool, if exists.
-                    close(false);
-                }
+                throw new AssertionError("Duplicated open on ImapFolder");
             }
             synchronized (this) {
                 mConnection = mStore.getConnection();