Show incall UI correctly.

Change I39f9b042990c7c1136fd7471cd292d5a679505cc removed what we
need. In GB we explicitly used phoneIsInUse(), so using it again
would be appropriate.

Also use "inverse" color so texts should be visble at least

Change-Id: I401bcb25d1d75a4eda5c1747e724293e93d87d68
diff --git a/res/layout/dialpad_chooser_list_item.xml b/res/layout/dialpad_chooser_list_item.xml
index 853ca47..ecd4285 100644
--- a/res/layout/dialpad_chooser_list_item.xml
+++ b/res/layout/dialpad_chooser_list_item.xml
@@ -26,7 +26,7 @@
         android:scaleType="center" />
 
     <TextView android:id="@+id/text"
-        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:textAppearance="?android:attr/textAppearanceMediumInverse"
         android:layout_gravity="center_vertical"
         android:layout_width="0dip"
         android:layout_weight="1"
diff --git a/src/com/android/contacts/activities/DialtactsActivity.java b/src/com/android/contacts/activities/DialtactsActivity.java
index c912c2e..32e85b3 100644
--- a/src/com/android/contacts/activities/DialtactsActivity.java
+++ b/src/com/android/contacts/activities/DialtactsActivity.java
@@ -361,7 +361,9 @@
         // overwritten by one of the programmatic tab selections
         final int savedTabIndex = mLastManuallySelectedTab;
 
-        if (recentCallsRequest) {
+        if (DialpadFragment.phoneIsInUse()) {
+            getActionBar().selectTab(getActionBar().getTabAt(TAB_INDEX_DIALER));
+        } else if (recentCallsRequest) {
             getActionBar().selectTab(getActionBar().getTabAt(TAB_INDEX_CALL_LOG));
         } else {
             getActionBar().selectTab(getActionBar().getTabAt(mLastManuallySelectedTab));
@@ -508,10 +510,13 @@
             ft.show(mFragment);
             ft.hide(mPhoneNumberPickerFragment);
 
-            // Remember this tab index. This function is also called, if the tab is set
-            // automatically in which case the setter (setCurrentTab) has to set this to its old
-            // value afterwards
-            mLastManuallySelectedTab = tab.getPosition();
+            // During the call, we don't remember the tab position.
+            if (!DialpadFragment.phoneIsInUse()) {
+                // Remember this tab index. This function is also called, if the tab is set
+                // automatically in which case the setter (setCurrentTab) has to set this to its old
+                // value afterwards
+                mLastManuallySelectedTab = tab.getPosition();
+            }
         }
 
         @Override
@@ -650,7 +655,9 @@
         final ActionBar actionBar = getActionBar();
 
         final Tab tab = actionBar.getSelectedTab();
-        if (tab != null) {
+
+        // User can search during the call, but we don't want to remember the status.
+        if (tab != null && !DialpadFragment.phoneIsInUse()) {
             mLastManuallySelectedTab = tab.getPosition();
         }
 
diff --git a/src/com/android/contacts/dialpad/DialpadFragment.java b/src/com/android/contacts/dialpad/DialpadFragment.java
index 7be16f5..fd557d5 100644
--- a/src/com/android/contacts/dialpad/DialpadFragment.java
+++ b/src/com/android/contacts/dialpad/DialpadFragment.java
@@ -1030,7 +1030,7 @@
      * @return true if the phone is "in use", meaning that at least one line
      *              is active (ie. off hook or ringing or dialing).
      */
-    private boolean phoneIsInUse() {
+    public static boolean phoneIsInUse() {
         boolean phoneInUse = false;
         try {
             ITelephony phone = ITelephony.Stub.asInterface(ServiceManager.checkService("phone"));