Call notification not displayed at SIM query UI

When the SIM slection query UI is launched from InCallActivty and
when the device receives incoming call, the current state of call ui
considered as IN_CALL, due to this notification is not displaying.
Audio is not heard due to the mismatch in the foreground call. check
whether SIM selection ui is diplayed and when the call state is
SELECT_PHONE_ACCOUNT return false for isAlive query.

CRs-Fixed: 1014066
Change-Id: I09ba2bae4d3348d774c78311ef96fc396f85823f
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java
index eca79f8..dd32f4a 100644
--- a/InCallUI/src/com/android/incallui/InCallActivity.java
+++ b/InCallUI/src/com/android/incallui/InCallActivity.java
@@ -133,6 +133,7 @@
     private Animation mSlideIn;
     private Animation mSlideOut;
     private boolean mDismissKeyguard = false;
+    private boolean isSelectPhoneaccDialogShown = false;
 
     AnimationListenerAdapter mSlideOutListener = new AnimationListenerAdapter() {
         @Override
@@ -147,12 +148,14 @@
         @Override
         public void onPhoneAccountSelected(PhoneAccountHandle selectedAccountHandle,
                 boolean setDefault) {
+            isSelectPhoneaccDialogShown = false;
             InCallPresenter.getInstance().handleAccountSelection(selectedAccountHandle,
                     setDefault);
         }
 
         @Override
         public void onDialogDismissed() {
+            isSelectPhoneaccDialogShown = false;
             InCallPresenter.getInstance().cancelAccountSelection();
         }
     };
@@ -652,6 +655,7 @@
                         R.string.select_phone_account_for_calls, true, phoneAccountHandles,
                         mSelectAcctListener);
                 dialogFragment.show(getFragmentManager(), TAG_SELECT_ACCT_FRAGMENT);
+                isSelectPhoneaccDialogShown = true;
             } else if (!newOutgoingCall) {
                 showCallCardFragment(true);
             }
@@ -961,4 +965,8 @@
             mInCallOrientationEventListener.disable();
         }
     }
+
+    public boolean isPhoneAccDialogFragmentShown() {
+        return isSelectPhoneaccDialogShown;
+    }
 }
diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
index 3a3544c..eded5f2 100644
--- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java
+++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java
@@ -334,7 +334,9 @@
 
         // Set the intent as a full screen intent as well if a call is incoming
         if (notificationType == NOTIFICATION_INCOMING_CALL
-                && !InCallPresenter.getInstance().isShowingInCallUi()) {
+                && (!InCallPresenter.getInstance().isShowingInCallUi() ||
+                   InCallPresenter.getInstance().getActivity().
+                   isPhoneAccDialogFragmentShown())) {
             configureFullScreenIntent(builder, inCallPendingIntent, call);
             // Set the notification category for incoming calls
             builder.setCategory(Notification.CATEGORY_CALL);