IMS-VT: Show call downgrade toast if MO Video call is converted to Volte

Show "Call downgraded toast" message if MO Video call is converted
to Volte due to remote user accepted Video call as Voice or
due to there are no Video capabilities for remote device.

Change-Id: Ib47ce7d2a598dd68ef873f7d23236c917288d4b6
CRs-Fixed: 1085411
diff --git a/InCallUI/res/values/qtistrings.xml b/InCallUI/res/values/qtistrings.xml
index afa29ab..c53ee42 100644
--- a/InCallUI/res/values/qtistrings.xml
+++ b/InCallUI/res/values/qtistrings.xml
@@ -141,6 +141,8 @@
     <string name="session_modify_cause_downgrade_lipsync">Call downgraded due to lipsync</string>
     <!-- Session modify cause code downgrade generic error -->
     <string name="session_modify_cause_downgrade_generic_error">Call downgraded due to generic error</string>
+    <!-- Session modify cause code downgrade generic -->
+    <string name="session_modify_cause_downgrade_generic">Video call changed to voice call</string>
 
     <!-- In-call screen: status label for an incoming conference call [CHAR LIMIT=25] -->
     <string name="card_title_incoming_conf_call">Incoming conference call</string>
diff --git a/InCallUI/src/com/android/incallui/InCallMessageController.java b/InCallUI/src/com/android/incallui/InCallMessageController.java
index aa5a57e..d7b7614 100644
--- a/InCallUI/src/com/android/incallui/InCallMessageController.java
+++ b/InCallUI/src/com/android/incallui/InCallMessageController.java
@@ -366,8 +366,14 @@
             return;
         }
 
-        QtiCallUtils.displayToast(mContext,
-                getSessionModificationCauseResourceId(sessionModificationCause));
+        if (sessionModificationCause ==
+                    QtiCallConstants.CAUSE_CODE_SESSION_MODIFY_DOWNGRADE_GENERIC) {
+            QtiCallUtils.displayLongToast(mContext,
+                    getSessionModificationCauseResourceId(sessionModificationCause));
+        } else {
+            QtiCallUtils.displayToast(mContext,
+                    getSessionModificationCauseResourceId(sessionModificationCause));
+        }
     }
 
     /**
@@ -398,6 +404,8 @@
                 return R.string.session_modify_cause_downgrade_thermal_mitigation;
             case QtiCallConstants.CAUSE_CODE_SESSION_MODIFY_DOWNGRADE_LIPSYNC:
                 return R.string.session_modify_cause_downgrade_lipsync;
+            case QtiCallConstants.CAUSE_CODE_SESSION_MODIFY_DOWNGRADE_GENERIC:
+                return R.string.session_modify_cause_downgrade_generic;
             case QtiCallConstants.CAUSE_CODE_SESSION_MODIFY_DOWNGRADE_GENERIC_ERROR:
             default:
                 return R.string.session_modify_cause_downgrade_generic_error;
diff --git a/InCallUI/src/com/android/incallui/QtiCallUtils.java b/InCallUI/src/com/android/incallui/QtiCallUtils.java
index 0e65bb4..d729d6c 100644
--- a/InCallUI/src/com/android/incallui/QtiCallUtils.java
+++ b/InCallUI/src/com/android/incallui/QtiCallUtils.java
@@ -131,6 +131,20 @@
     }
 
     /**
+     * Displays the message as a long Toast on the UI
+     */
+    public static void displayLongToast(Context context, String msg) {
+        Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
+    }
+
+    /**
+     * Displays the string corresponding to the resourceId as a long Toast on the UI
+     */
+    public static void displayLongToast(Context context, int resourceId) {
+        displayLongToast(context, context.getResources().getString(resourceId));
+    }
+
+    /**
      * The function is called when Modify Call button gets pressed. The function creates and
      * displays modify call options.
      */