Fix a Sholes-specific "stuck on the in-call screen while idle" bug

Fix one last loose end of bug 2072046 that I missed in my earlier fix
<https://android-git.corp.google.com/g/49023>.

The inital fix worked fine for GSM devices, but you could still get stuck
on the in-call screen on a Sholes device because of a long-standing bug
that caused syncWithPhoneState() to ALWAYS return "SUCCESS" on CDMA
phones, even if the phone truly was idle.

This change fixes that bug.  We now consider the phone to be "in use" only
if there's an active call, or if an MMI is in progress.

Tested: on Sholes, ran the "ultra-simple scenario" from bug 2072046,
verified that after unlocking you get bounced back to contacts (or
wherever you started from) after step (5).

Bug: 2072046
Change-Id: I7bc02b8d414faa264644ed67bc80d4269f32f681
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 230a480..116f254 100755
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -2445,8 +2445,6 @@
         // Make sure the Phone is "in use".  (If not, we shouldn't be on
         // this screen in the first place.)
 
-        // Need to treat running MMI codes as a connection as well.
-        // Do not check for getPendingMmiCodes when phone is a CDMA phone
         int phoneType = mPhone.getPhoneType();
 
         if ((phoneType == Phone.PHONE_TYPE_CDMA)
@@ -2457,9 +2455,13 @@
             return InCallInitStatus.SUCCESS;
         }
 
-        if ((phoneType == Phone.PHONE_TYPE_CDMA)
-                || !mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
-                || !mPhone.getPendingMmiCodes().isEmpty()) {
+        // Need to treat running MMI codes as a connection as well.
+        // Do not check for getPendingMmiCodes when phone is a CDMA phone
+        boolean hasPendingMmiCodes =
+                (phoneType == Phone.PHONE_TYPE_GSM) && !mPhone.getPendingMmiCodes().isEmpty();
+
+        if (!mForegroundCall.isIdle() || !mBackgroundCall.isIdle() || !mRingingCall.isIdle()
+                || hasPendingMmiCodes) {
             if (VDBG) log("syncWithPhoneState: it's ok to be here; update the screen...");
             updateScreen();
             return InCallInitStatus.SUCCESS;