IMS: CallLogs:FR33084_VoWiFi_Phonebook

Shows various icons in call logs to imply that the call made
is a CS, VoLTE, VoWifi or Video call.

Change-Id: Ic505011cf141e36db50c412163e151fc6fcbebf7
CRs-Fixed: 958886
diff --git a/res/drawable/volte_video.xml b/res/drawable/volte_video.xml
new file mode 100644
index 0000000..0008559
--- /dev/null
+++ b/res/drawable/volte_video.xml
@@ -0,0 +1,36 @@
+<!--Copyright (c) 2016, The Linux Foundation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of The Linux Foundation nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="13dp"
+    android:height="11dp"
+    android:autoMirrored="true"
+    android:viewportHeight="11.0"
+    android:viewportWidth="13.0">
+    <path
+        android:fillColor="#FFFFFF"
+        android:pathData="M6.627,8.712c-0.404,0 -0.992,-0.063 -1.357,-0.185c-0.113,-0.039 -0.244,-0.01 -0.332,0.076L4.221,9.322C3.3,8.85 2.544,7.968 2.076,7.047l0.716,-0.718c0.091,-0.09 0.117,-0.218 0.081,-0.332c-0.12,-0.364 -0.186,-0.755 -0.186,-1.162c0,-0.181 -0.146,-0.326 -0.326,-0.326H1.223c-0.18,0 -0.326,0.146 -0.326,0.326c0,3.058 2.615,5.665 5.672,5.665c0.179,0 0.324,-0.146 0.324,-0.326V9.037C6.895,8.859 6.807,8.712 6.627,8.712zM10.857,0.5H4.212c-0.453,0 -0.683,0.379 -0.683,0.814v6.33c0,0.192 0.05,0.306 0.132,0.465C3.84,8.259 3.928,8.343 4.425,8.343l0.483,-0.483c0.188,-0.186 0.477,-0.254 0.725,-0.17C5.95,7.794 6.286,7.848 6.629,7.848c0.391,0 0.708,0.551 0.708,0.94v0.022h3.595c0.221,0 0.596,-0.19 0.596,-0.554V1.246C11.527,0.893 11.25,0.5 10.857,0.5zM4.561,7.166V1.514h5.972l0.001,5.652H4.561zM7.555,4.229c0.598,0 1.078,-0.48 1.078,-1.078c0,-0.599 -0.48,-1.137 -1.078,-1.137c-0.599,0 -1.08,0.538 -1.08,1.137C6.475,3.748 6.955,4.229 7.555,4.229zM8.178,4.877c-0.121,0 -1.02,-0.027 -1.186,-0.027c-0.506,0 -1.746,0.789 -1.746,0.899v0.76L9.87,6.492V5.746C9.869,5.624 8.504,4.877 8.178,4.877z" />
+</vector>
diff --git a/res/drawable/volte_voice.xml b/res/drawable/volte_voice.xml
new file mode 100644
index 0000000..1ce76fb
--- /dev/null
+++ b/res/drawable/volte_voice.xml
@@ -0,0 +1,36 @@
+<!--Copyright (c) 2016, The Linux Foundation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of The Linux Foundation nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="13dp"
+    android:height="11dp"
+    android:autoMirrored="true"
+    android:viewportHeight="11.0"
+    android:viewportWidth="13.0">
+    <path
+        android:fillColor="#FFFFFF"
+        android:pathData="M8.336,7.479c-0.574,0 -1.091,-0.093 -1.609,-0.264C6.564,7.158 6.379,7.199 6.254,7.326l-1.02,1.021C3.922,7.674 2.848,6.604 2.178,5.291L3.198,4.27c0.129,-0.13 0.167,-0.311 0.116,-0.475C3.143,3.276 3.05,2.586 3.05,2.006c0,-0.256 -0.209,-0.465 -0.464,-0.465H0.964C0.709,1.541 0.5,1.75 0.5,2.006c0,4.353 3.482,8.017 7.836,8.017c0.255,0 0.464,-0.21 0.464,-0.465V7.942C8.8,7.687 8.591,7.479 8.336,7.479zM5.453,4.054l0.689,-2.511H5.604l-0.402,1.82l-0.4,-1.82H4.266L4.95,4.054H5.453zM6.426,3.854c0.063,0.077 0.139,0.135 0.227,0.174c0.09,0.039 0.188,0.06 0.3,0.06c0.108,0 0.208,-0.021 0.296,-0.06c0.089,-0.039 0.165,-0.098 0.227,-0.174c0.063,-0.076 0.11,-0.171 0.145,-0.284c0.033,-0.113 0.05,-0.242 0.05,-0.389V3.059c0,-0.146 -0.019,-0.275 -0.052,-0.389C7.584,2.558 7.536,2.463 7.473,2.386C7.41,2.31 7.336,2.25 7.246,2.211c-0.088,-0.041 -0.188,-0.06 -0.298,-0.06c-0.109,0 -0.208,0.021 -0.296,0.06S6.488,2.31 6.426,2.386C6.364,2.463 6.316,2.558 6.282,2.67C6.248,2.783 6.23,2.912 6.23,3.059v0.123c0,0.146 0.018,0.277 0.052,0.389C6.316,3.684 6.364,3.777 6.426,3.854zM6.697,3.06c0,-0.17 0.021,-0.297 0.066,-0.378C6.809,2.6 6.87,2.558 6.949,2.558c0.082,0 0.145,0.042 0.189,0.124S7.205,2.89 7.205,3.06v0.123c0,0.173 -0.021,0.3 -0.063,0.38c-0.043,0.08 -0.106,0.12 -0.191,0.12c-0.08,0 -0.143,-0.041 -0.188,-0.12c-0.046,-0.08 -0.068,-0.207 -0.068,-0.38V3.06H6.697zM8.479,1.541H7.997v2.512h1.329v-0.42H8.48L8.479,1.541L8.479,1.541zM9.178,1.965h0.58v2.089h0.484V1.965h0.59V1.543H9.177L9.178,1.965L9.178,1.965zM11.609,3.633V2.967h0.75V2.558h-0.75V1.965h0.886V1.543h-1.368v2.511h1.372V3.633H11.609L11.609,3.633z" />
+</vector>
diff --git a/res/drawable/wifi_calling.xml b/res/drawable/wifi_calling.xml
new file mode 100644
index 0000000..87849c5
--- /dev/null
+++ b/res/drawable/wifi_calling.xml
@@ -0,0 +1,36 @@
+<!--Copyright (c) 2016, The Linux Foundation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of The Linux Foundation nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="13dp"
+    android:height="11dp"
+    android:autoMirrored="true"
+    android:viewportHeight="11.0"
+    android:viewportWidth="13.75">
+    <path
+        android:fillColor="#FFFFFF"
+        android:pathData="M8.608,7.242c-0.598,0 -1.223,-0.095 -1.762,-0.272C6.679,6.912 6.485,6.955 6.354,7.084L5.294,8.146C3.931,7.447 2.813,6.332 2.118,4.97l1.061,-1.062C3.313,3.774 3.352,3.586 3.3,3.416C3.122,2.877 3.024,2.299 3.024,1.697c0,-0.266 -0.217,-0.482 -0.48,-0.482H0.856c-0.266,0 -0.48,0.217 -0.48,0.482c0,4.525 3.707,8.193 8.233,8.193c0.265,0 0.481,-0.217 0.481,-0.482V7.727C9.089,7.459 8.874,7.242 8.608,7.242zM5.136,3.783l0.705,-2.574H5.29L4.878,3.076L4.466,1.209H3.919L4.62,3.783H5.136zM6.134,3.58c0.063,0.078 0.142,0.139 0.232,0.179c0.09,0.04 0.191,0.06 0.305,0.06s0.215,-0.02 0.305,-0.06c0.091,-0.04 0.168,-0.101 0.232,-0.179C7.271,3.5 7.319,3.404 7.354,3.289C7.389,3.174 7.405,3.041 7.405,2.89V2.765c0,-0.149 -0.018,-0.282 -0.052,-0.397C7.318,2.252 7.27,2.154 7.206,2.076c-0.063,-0.08 -0.143,-0.14 -0.232,-0.181C6.882,1.854 6.78,1.834 6.667,1.834c-0.111,0 -0.213,0.021 -0.304,0.062c-0.09,0.041 -0.167,0.101 -0.231,0.181C6.069,2.154 6.02,2.252 5.984,2.367C5.95,2.483 5.933,2.615 5.933,2.765V2.89c0,0.151 0.018,0.284 0.052,0.399C6.02,3.404 6.069,3.502 6.134,3.58zM6.411,2.766c0,-0.174 0.021,-0.305 0.067,-0.389s0.108,-0.125 0.188,-0.125c0.084,0 0.149,0.041 0.195,0.125c0.047,0.084 0.068,0.215 0.068,0.389v0.125c0,0.178 -0.021,0.309 -0.064,0.391C6.822,3.363 6.757,3.404 6.671,3.404c-0.082,0 -0.146,-0.041 -0.192,-0.123S6.409,3.068 6.409,2.891V2.766H6.411zM9.333,2.828L9.046,1.211H8.63L8.344,2.826L8.112,1.211H7.62l0.438,2.574h0.497l0.283,-1.518l0.285,1.518H9.62l0.437,-2.574h-0.49L9.333,2.828zM10.764,1.185c-0.022,-0.022 -0.05,-0.042 -0.081,-0.054C10.65,1.117 10.614,1.11 10.575,1.11s-0.074,0.007 -0.105,0.021c-0.031,0.013 -0.061,0.031 -0.081,0.054c-0.022,0.024 -0.041,0.052 -0.054,0.084s-0.019,0.067 -0.019,0.106s0.006,0.076 0.019,0.107c0.013,0.032 0.029,0.061 0.054,0.085c0.021,0.023 0.049,0.042 0.081,0.056c0.031,0.013 0.066,0.02 0.105,0.02s0.075,-0.006 0.107,-0.02c0.031,-0.014 0.059,-0.032 0.081,-0.056c0.022,-0.024 0.04,-0.053 0.052,-0.085c0.014,-0.033 0.02,-0.068 0.02,-0.107s-0.006,-0.074 -0.02,-0.106C10.804,1.236 10.786,1.209 10.764,1.185zM10.339,3.783h0.478V1.871h-0.478V3.783zM11.226,3.783h0.493v-1.05h0.769V2.303h-0.769v-0.66h0.862V1.209h-1.355V3.783zM13.356,1.269c-0.013,-0.033 -0.029,-0.062 -0.053,-0.084c-0.021,-0.022 -0.049,-0.042 -0.081,-0.054C13.19,1.117 13.155,1.11 13.116,1.11S13.04,1.117 13.01,1.131c-0.031,0.013 -0.06,0.031 -0.081,0.054c-0.021,0.024 -0.04,0.052 -0.053,0.084c-0.013,0.033 -0.019,0.067 -0.019,0.106s0.006,0.076 0.019,0.107c0.013,0.032 0.029,0.061 0.053,0.085c0.021,0.023 0.05,0.042 0.081,0.056c0.032,0.013 0.067,0.02 0.106,0.02s0.075,-0.006 0.106,-0.02c0.032,-0.014 0.06,-0.032 0.081,-0.056c0.021,-0.024 0.04,-0.053 0.053,-0.085c0.012,-0.033 0.018,-0.068 0.018,-0.107S13.368,1.302 13.356,1.269zM12.878,3.783h0.479V1.871h-0.479V3.783z" />
+</vector>
diff --git a/res/layout/call_log_list_item_actions.xml b/res/layout/call_log_list_item_actions.xml
index 78203b7..4cce073 100644
--- a/res/layout/call_log_list_item_actions.xml
+++ b/res/layout/call_log_list_item_actions.xml
@@ -64,6 +64,7 @@
         style="@style/CallLogActionStyle">
 
         <ImageView
+            android:id="@+id/videoCallIcon"
             style="@style/CallLogActionIconStyle"
             android:src="@drawable/ic_videocam_24dp" />
 
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e54433d..6d94d8e 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -370,12 +370,39 @@
     <!-- Title for incoming 4G voice call in call details screen [CHAR LIMIT=60] -->
     <string name="type_incoming_volte">Incoming 4G voice call</string>
 
+     <!-- Title for incoming 4G video call in call details screen [CHAR LIMIT=60] -->
+    <string name="type_incoming_video_lte">Incoming 4G video call</string>
+
     <!-- Title for outgoing 4G voice call in call details screen [CHAR LIMIT=60] -->
     <string name="type_outgoing_volte">Outgoing 4G voice call</string>
 
+     <!-- Title for incoming 4G video call in call details screen [CHAR LIMIT=60] -->
+    <string name="type_outgoing_video_lte">Outgoing 4G video call</string>
+
     <!-- Title for missed 4G voice call in call details screen [CHAR LIMIT=60] -->
     <string name="type_missed_volte">Missed 4G voice call</string>
 
+     <!-- Title for missed 4G video call in call details screen [CHAR LIMIT=60] -->
+    <string name="type_missed_video_lte">Missed 4G video call</string>
+
+    <!-- Title for incoming wifi voice call in call details screen [CHAR LIMIT=60] -->
+    <string name="type_incoming_vowifi">Incoming WiFi voice call</string>
+
+     <!-- Title for incoming wifi video call in call details screen [CHAR LIMIT=60] -->
+     <string name="type_incoming_video_wifi">Incoming WiFi video call</string>
+
+    <!-- Title for outgoing wifi voice call in call details screen [CHAR LIMIT=60] -->
+    <string name="type_outgoing_vowifi">Outgoing WiFi voice call</string>
+
+     <!-- Title for outgoing wifi video call in call details screen [CHAR LIMIT=60] -->
+     <string name="type_outgoing_video_wifi">Outgoing WiFi video call</string>
+
+    <!-- Title for missed wifi voice call in call details screen [CHAR LIMIT=60] -->
+    <string name="type_missed_vowifi">Missed WiFi voice call</string>
+
+     <!-- Title for missed wifi video call in call details screen [CHAR LIMIT=60] -->
+     <string name="type_missed_video_wifi">Missed WiFi video call</string>
+
     <!-- Title for voicemail details screen -->
     <string name="type_voicemail">Voicemail</string>
 
diff --git a/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java b/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
index 8b9b8fc..bbd632c 100644
--- a/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
+++ b/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
@@ -36,6 +36,9 @@
 import com.google.common.collect.Lists;
 
 import java.util.ArrayList;
+
+import org.codeaurora.ims.utils.QtiImsExtUtils;
+
 /**
  * Adapter for a ListView containing history items from the details of a call.
  */
@@ -109,34 +112,22 @@
         int callType = details.callTypes[0];
         boolean isPresenceEnabled = mContext.getResources().getBoolean(
                 R.bool.config_regional_presence_enable);
-        boolean isVideoCall = (details.features & Calls.FEATURES_VIDEO)
-                == Calls.FEATURES_VIDEO && CallUtil.isVideoEnabled(mContext);
+        boolean isVideoCall = (details.features & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO;
         if (isPresenceEnabled) {
             isVideoCall &= PresenceHelper.startAvailabilityFetch(details.number.toString());
         }
-        boolean isVoLTE = (callType == AppCompatConstants.INCOMING_IMS_TYPE) ||
-                          (callType == AppCompatConstants.OUTGOING_IMS_TYPE) ||
-                          (callType == AppCompatConstants.MISSED_IMS_TYPE);
         Log.d("CallDetailHistoryAdapter", "isVideoCall = " + isVideoCall
-                    + ", isVoLTE = " + isVoLTE);
+                    + ", callType = " + callType);
         callTypeIconView.clear();
         callTypeIconView.add(callType);
-        callTypeIconView.setShowVideo(isVideoCall);
-        boolean imsCallLogEnabled = mContext.getResources()
-                .getBoolean(R.bool.ims_call_type_enabled);
-        if (!imsCallLogEnabled && isVoLTE) {
-            switch (callType) {
-                case AppCompatConstants.INCOMING_IMS_TYPE:
-                    callType = Calls.INCOMING_TYPE;
-                    break;
-                case AppCompatConstants.OUTGOING_IMS_TYPE:
-                    callType = Calls.OUTGOING_TYPE;
-                    break;
-                case AppCompatConstants.MISSED_IMS_TYPE:
-                    callType = Calls.MISSED_TYPE;
-                    break;
-                default:
-            }
+        /**
+         * Ims icon(VoLTE/VoWifi) or CarrierOne video icon will be shown if carrierOne is supported
+         * otherwise, default video icon will be shown if it is a video call.
+         */
+        if (QtiImsExtUtils.isCarrierOneSupported()) {
+             callTypeIconView.addImsOrVideoIcon(callType, isVideoCall);
+        } else {
+             callTypeIconView.setShowVideo(isVideoCall);
         }
         callTypeTextView.setText(mCallTypeHelper.getCallTypeText(callType, isVideoCall));
         // Set the date.
diff --git a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
index e27ea78..4036f10 100644
--- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
+++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
@@ -20,6 +20,8 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.Resources;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.provider.CallLog;
 import android.provider.CallLog.Calls;
@@ -68,6 +70,7 @@
 
 import java.util.List;
 
+import org.codeaurora.ims.utils.QtiImsExtUtils;
 import org.codeaurora.presenceserv.IPresenceService;
 
 /**
@@ -107,6 +110,7 @@
     public View detailsButtonView;
     public View callWithNoteButtonView;
     public ImageView workIconView;
+    public ImageView videoCallIconView;
 
     /**
      * The row Id for the first call associated with the call log entry.  Used as a key for the
@@ -421,6 +425,8 @@
             videoCallButtonView = actionsView.findViewById(R.id.video_call_action);
             videoCallButtonView.setOnClickListener(this);
 
+            videoCallIconView = (ImageView) actionsView.findViewById(R.id.videoCallIcon);
+
             createNewContactButtonView = actionsView.findViewById(R.id.create_new_contact_action);
             createNewContactButtonView.setOnClickListener(this);
 
@@ -517,6 +523,12 @@
         if (mCallLogCache.isVideoEnabled() && canPlaceCallToNumber && showVideoCallBtn) {
             videoCallButtonView.setTag(IntentProvider.getReturnVideoCallIntentProvider(number));
             videoCallButtonView.setVisibility(View.VISIBLE);
+            if (QtiImsExtUtils.isCarrierOneSupported()) {
+                Drawable drawable =  mContext.getResources().getDrawable(R.drawable.volte_video);
+                drawable.setColorFilter(mContext.getResources().getColor(
+                    R.color.dialtacts_secondary_text_color), PorterDuff.Mode.MULTIPLY);
+                videoCallIconView.setImageDrawable(drawable);
+            }
         } else {
             videoCallButtonView.setVisibility(View.GONE);
         }
diff --git a/src/com/android/dialer/calllog/CallLogQueryHandler.java b/src/com/android/dialer/calllog/CallLogQueryHandler.java
index f026420..116d9ef 100644
--- a/src/com/android/dialer/calllog/CallLogQueryHandler.java
+++ b/src/com/android/dialer/calllog/CallLogQueryHandler.java
@@ -231,18 +231,21 @@
 
             if ((callType == Calls.INCOMING_TYPE) || (callType == Calls.OUTGOING_TYPE)
                     || (callType == Calls.MISSED_TYPE)) {
-                where.append(String.format("(%s = ? OR %s = ?)",
-                        Calls.TYPE, Calls.TYPE));
+                where.append(String.format("(%s = ? OR %s = ? OR %s = ?)",
+                        Calls.TYPE, Calls.TYPE, Calls.TYPE));
             } else {
                 where.append(String.format("(%s = ?)", Calls.TYPE));
             }
             selectionArgs.add(Integer.toString(callType));
             if (callType == Calls.INCOMING_TYPE) {
                 selectionArgs.add(Integer.toString(AppCompatConstants.INCOMING_IMS_TYPE));
+                selectionArgs.add(Integer.toString(AppCompatConstants.INCOMING_WIFI_TYPE));
             } else if (callType == Calls.OUTGOING_TYPE) {
                 selectionArgs.add(Integer.toString(AppCompatConstants.OUTGOING_IMS_TYPE));
+                selectionArgs.add(Integer.toString(AppCompatConstants.OUTGOING_WIFI_TYPE));
             } else if (callType == Calls.MISSED_TYPE) {
                 selectionArgs.add(Integer.toString(AppCompatConstants.MISSED_IMS_TYPE));
+                selectionArgs.add(Integer.toString(AppCompatConstants.MISSED_WIFI_TYPE));
             }
         } else {
             // Add a clause to fetch only items of type voicemail.
@@ -285,8 +288,26 @@
 
         if (callType > CALL_TYPE_ALL) {
             where.append(" AND ");
-            where.append(String.format("(%s = ?)", Calls.TYPE));
+            if ((callType == Calls.INCOMING_TYPE) || (callType == Calls.OUTGOING_TYPE)
+                    || (callType == Calls.MISSED_TYPE)) {
+                where.append(String.format("(%s = ? OR %s = ? OR %s = ?)",
+                        Calls.TYPE, Calls.TYPE, Calls.TYPE));
+            } else {
+                // Add a clause to fetch only items of type voicemail.
+                where.append(String.format("(%s = ?)", Calls.TYPE));
+            }
+            // Add a clause to fetch only items newer than the requested date
             selectionArgs.add(Integer.toString(callType));
+            if (callType == Calls.INCOMING_TYPE) {
+                selectionArgs.add(Integer.toString(AppCompatConstants.INCOMING_IMS_TYPE));
+                selectionArgs.add(Integer.toString(AppCompatConstants.INCOMING_WIFI_TYPE));
+            } else if (callType == Calls.OUTGOING_TYPE) {
+                selectionArgs.add(Integer.toString(AppCompatConstants.OUTGOING_IMS_TYPE));
+                selectionArgs.add(Integer.toString(AppCompatConstants.OUTGOING_WIFI_TYPE));
+            } else if (callType == Calls.MISSED_TYPE) {
+                selectionArgs.add(Integer.toString(AppCompatConstants.MISSED_IMS_TYPE));
+                selectionArgs.add(Integer.toString(AppCompatConstants.MISSED_WIFI_TYPE));
+            }
         } else {
             where.append(" AND NOT ");
             where.append("(" + Calls.TYPE + " = " + Calls.VOICEMAIL_TYPE + ")");
diff --git a/src/com/android/dialer/calllog/CallTypeHelper.java b/src/com/android/dialer/calllog/CallTypeHelper.java
index 10736b2..045b604 100644
--- a/src/com/android/dialer/calllog/CallTypeHelper.java
+++ b/src/com/android/dialer/calllog/CallTypeHelper.java
@@ -43,6 +43,24 @@
     private final CharSequence mOutgoingVoLTEName;
     /** Name used to identify missed video calls. */
     private final CharSequence mMissedVoLTEName;
+    /** Name used to identify incoming videoLTE calls. */
+    private final CharSequence mIncomingVideoLTEName;
+    /** Name used to identify outgoing videoLTE calls. */
+    private final CharSequence mOutgoingVideoLTEName;
+    /** Name used to identify missed videoLTE calls. */
+    private final CharSequence mMissedVideoLTEName;
+    /** Name used to identify incoming VoWifi calls. */
+    private final CharSequence mIncomingVoWifiName;
+    /** Name used to identify outgoing VoWifi calls. */
+    private final CharSequence mOutgoingVoWifiName;
+    /** Name used to identify missed VoWifi calls. */
+    private final CharSequence mMissedVoWifiName;
+    /** Name used to identify incoming video wifi calls. */
+    private final CharSequence mIncomingVideoWifiName;
+    /** Name used to identify outgoing video wifi calls. */
+    private final CharSequence mOutgoingVideoWifiName;
+    /** Name used to identify missed video wifi calls. */
+    private final CharSequence mMissedVideoWifiName;
     /** Name used to identify voicemail calls. */
     private final CharSequence mVoicemailName;
     /** Name used to identify rejected calls. */
@@ -65,6 +83,15 @@
         mIncomingVoLTEName = resources.getString(R.string.type_incoming_volte);
         mOutgoingVoLTEName = resources.getString(R.string.type_outgoing_volte);
         mMissedVoLTEName = resources.getString(R.string.type_missed_volte);
+        mIncomingVideoLTEName = resources.getString(R.string.type_incoming_video_lte);
+        mOutgoingVideoLTEName = resources.getString(R.string.type_outgoing_video_lte);
+        mMissedVideoLTEName = resources.getString(R.string.type_missed_video_lte);
+        mIncomingVoWifiName = resources.getString(R.string.type_incoming_vowifi);
+        mOutgoingVoWifiName = resources.getString(R.string.type_outgoing_vowifi);
+        mMissedVoWifiName = resources.getString(R.string.type_missed_vowifi);
+        mIncomingVideoWifiName = resources.getString(R.string.type_incoming_video_wifi);
+        mOutgoingVideoWifiName = resources.getString(R.string.type_outgoing_video_wifi);
+        mMissedVideoWifiName = resources.getString(R.string.type_missed_video_wifi);
         mVoicemailName = resources.getString(R.string.type_voicemail);
         mRejectedName = resources.getString(R.string.type_rejected);
         mBlockedName = resources.getString(R.string.type_blocked);
@@ -84,11 +111,18 @@
 
             case AppCompatConstants.INCOMING_IMS_TYPE:
                 if (isVideoCall) {
-                    return mIncomingVideoName;
+                    return mIncomingVideoLTEName;
                 } else {
                     return mIncomingVoLTEName;
                 }
 
+            case AppCompatConstants.INCOMING_WIFI_TYPE:
+                if (isVideoCall) {
+                    return mIncomingVideoWifiName;
+                } else {
+                    return mIncomingVoWifiName;
+                }
+
             case AppCompatConstants.CALLS_OUTGOING_TYPE:
                 if (isVideoCall) {
                     return mOutgoingVideoName;
@@ -98,11 +132,18 @@
 
             case AppCompatConstants.OUTGOING_IMS_TYPE:
                 if (isVideoCall) {
-                    return mOutgoingVideoName;
+                    return mOutgoingVideoLTEName;
                 } else {
                     return mOutgoingVoLTEName;
                 }
 
+            case AppCompatConstants.OUTGOING_WIFI_TYPE:
+                if (isVideoCall) {
+                    return mOutgoingVideoWifiName;
+                } else {
+                    return mOutgoingVoWifiName;
+                }
+
             case AppCompatConstants.CALLS_MISSED_TYPE:
                 if (isVideoCall) {
                     return mMissedVideoName;
@@ -112,11 +153,18 @@
 
             case AppCompatConstants.MISSED_IMS_TYPE:
                 if (isVideoCall) {
-                    return mMissedVideoName;
+                    return mMissedVideoLTEName;
                 } else {
                     return mMissedVoLTEName;
                 }
 
+            case AppCompatConstants.MISSED_WIFI_TYPE:
+                if (isVideoCall) {
+                    return mMissedVideoWifiName;
+                } else {
+                    return mMissedVoWifiName;
+                }
+
             case AppCompatConstants.CALLS_VOICEMAIL_TYPE:
                 return mVoicemailName;
 
@@ -136,16 +184,19 @@
         switch (callType) {
             case AppCompatConstants.CALLS_INCOMING_TYPE:
             case AppCompatConstants.INCOMING_IMS_TYPE:
+            case AppCompatConstants.INCOMING_WIFI_TYPE:
                 // New incoming calls are not highlighted.
                 return null;
 
             case AppCompatConstants.CALLS_OUTGOING_TYPE:
             case AppCompatConstants.OUTGOING_IMS_TYPE:
+            case AppCompatConstants.OUTGOING_WIFI_TYPE:
                 // New outgoing calls are not highlighted.
                 return null;
 
             case AppCompatConstants.CALLS_MISSED_TYPE:
             case AppCompatConstants.MISSED_IMS_TYPE:
+            case AppCompatConstants.MISSED_WIFI_TYPE:
                 return mNewMissedColor;
 
             case AppCompatConstants.CALLS_VOICEMAIL_TYPE:
@@ -164,6 +215,8 @@
                 && callType != AppCompatConstants.CALLS_OUTGOING_TYPE
                 && callType != AppCompatConstants.INCOMING_IMS_TYPE
                 && callType != AppCompatConstants.OUTGOING_IMS_TYPE
+                && callType != AppCompatConstants.INCOMING_WIFI_TYPE
+                && callType != AppCompatConstants.OUTGOING_WIFI_TYPE
                 && callType != AppCompatConstants.CALLS_VOICEMAIL_TYPE);
     }
 }
diff --git a/src/com/android/dialer/calllog/CallTypeIconsView.java b/src/com/android/dialer/calllog/CallTypeIconsView.java
index b272ff6..56bd605 100644
--- a/src/com/android/dialer/calllog/CallTypeIconsView.java
+++ b/src/com/android/dialer/calllog/CallTypeIconsView.java
@@ -34,6 +34,8 @@
 
 import java.util.List;
 
+import org.codeaurora.ims.utils.QtiImsExtUtils;
+
 /**
  * View that draws one or more symbols for different types of calls (missed calls, outgoing etc).
  * The symbols are set up horizontally. As this view doesn't create subviews, it is better suited
@@ -47,12 +49,15 @@
 
     private static Resources sResources;
 
+    private static boolean mIsCarrierOneSupported = false;
+
     public CallTypeIconsView(Context context) {
         this(context, null);
     }
 
     public CallTypeIconsView(Context context, AttributeSet attrs) {
         super(context, attrs);
+        mIsCarrierOneSupported = QtiImsExtUtils.isCarrierOneSupported();
         if (sResources == null) {
           sResources = new Resources(context);
         }
@@ -74,6 +79,40 @@
         invalidate();
     }
 
+    public void addImsOrVideoIcon(int callType, boolean showVideo) {
+        mShowVideo = showVideo;
+        if (showVideo) {
+            mWidth += sResources.videoCall.getIntrinsicWidth();
+            mHeight = Math.max(mHeight, sResources.videoCall.getIntrinsicHeight());
+            invalidate();
+        } else {
+            final Drawable drawable = getImsOrWifiDrawable(callType);
+            if (drawable != null) {
+                // calculating drawable's width and adding it to total width for correct position
+                // of icon.
+                // calculating height by max of drawable height and other icons' height.
+                mWidth += drawable.getIntrinsicWidth();
+                mHeight = Math.max(mHeight, drawable.getIntrinsicHeight());
+                invalidate();
+            }
+        }
+    }
+
+    private Drawable getImsOrWifiDrawable(int callType) {
+       switch(callType) {
+         case AppCompatConstants.INCOMING_IMS_TYPE:
+         case AppCompatConstants.OUTGOING_IMS_TYPE:
+         case AppCompatConstants.MISSED_IMS_TYPE:
+              return sResources.imsCall;
+         case AppCompatConstants.INCOMING_WIFI_TYPE:
+         case AppCompatConstants.OUTGOING_WIFI_TYPE:
+         case AppCompatConstants.MISSED_WIFI_TYPE:
+              return sResources.wifiCall;
+         default:
+              return null;
+       }
+    }
+
     /**
      * Determines whether the video call icon will be shown.
      *
@@ -81,6 +120,12 @@
      */
     public void setShowVideo(boolean showVideo) {
         mShowVideo = showVideo;
+        if (mIsCarrierOneSupported) {
+            //  Don't show video icon in call log item. For CarrierOne, show more precise icon
+            //  based on call type in call detail history.
+            return;
+        }
+
         if (showVideo) {
             mWidth += sResources.videoCall.getIntrinsicWidth();
             mHeight = Math.max(mHeight, sResources.videoCall.getIntrinsicHeight());
@@ -111,12 +156,15 @@
         switch (callType) {
             case AppCompatConstants.CALLS_INCOMING_TYPE:
             case AppCompatConstants.INCOMING_IMS_TYPE:
+            case AppCompatConstants.INCOMING_WIFI_TYPE:
                 return sResources.incoming;
             case AppCompatConstants.CALLS_OUTGOING_TYPE:
             case AppCompatConstants.OUTGOING_IMS_TYPE:
+            case AppCompatConstants.OUTGOING_WIFI_TYPE:
                 return sResources.outgoing;
             case AppCompatConstants.CALLS_MISSED_TYPE:
             case AppCompatConstants.MISSED_IMS_TYPE:
+            case AppCompatConstants.MISSED_WIFI_TYPE:
                 return sResources.missed;
             case AppCompatConstants.CALLS_VOICEMAIL_TYPE:
                 return sResources.voicemail;
@@ -150,9 +198,19 @@
         // If showing the video call icon, draw it scaled appropriately.
         if (mShowVideo) {
             final Drawable drawable = sResources.videoCall;
-            final int right = left + sResources.videoCall.getIntrinsicWidth();
-            drawable.setBounds(left, 0, right, sResources.videoCall.getIntrinsicHeight());
+            final int right = left + drawable.getIntrinsicWidth();
+            drawable.setBounds(left, 0, right, drawable.getIntrinsicHeight());
             drawable.draw(canvas);
+            left = right + sResources.iconMargin;
+        }
+
+        for (Integer callType : mCallTypes) {
+            final Drawable drawableIms = getImsOrWifiDrawable(callType);
+            if (drawableIms != null) {
+                final int right = left + drawableIms.getIntrinsicWidth();
+                drawableIms.setBounds(left, 0, right, drawableIms.getIntrinsicHeight());
+                drawableIms.draw(canvas);
+            }
         }
     }
 
@@ -182,6 +240,15 @@
         public final int iconMargin;
 
         /**
+         * Drawable repesenting a wifi call.
+         */
+        public final Drawable wifiCall;
+
+        /**
+         * Drawable repesenting a IMS call.
+         */
+        public final Drawable imsCall;
+        /**
          * Configures the call icon drawables.
          * A single white call arrow which points down and left is used as a basis for all of the
          * call arrow icons, applying rotation and colors as needed.
@@ -208,11 +275,26 @@
             blocked = getScaledBitmap(context, R.drawable.ic_block_24dp);
             blocked.setColorFilter(r.getColor(R.color.blocked_call), PorterDuff.Mode.MULTIPLY);
 
-            videoCall = getScaledBitmap(context, R.drawable.ic_videocam_24dp);
+            if (mIsCarrierOneSupported) {
+                videoCall = r.getDrawable(R.drawable.volte_video).mutate();
+            } else {
+            // Get the video call icon, scaled to match the height of the call arrows.
+            // We want the video call icon to be the same height as the call arrows, while keeping
+            // the same width aspect ratio.
+                videoCall = getScaledBitmap(context, R.drawable.ic_videocam_24dp);
+            }
             videoCall.setColorFilter(r.getColor(R.color.dialtacts_secondary_text_color),
                     PorterDuff.Mode.MULTIPLY);
 
             iconMargin = r.getDimensionPixelSize(R.dimen.call_log_icon_margin);
+
+            wifiCall = r.getDrawable(R.drawable.wifi_calling).mutate();
+            wifiCall.setColorFilter(r.getColor(R.color.dialtacts_secondary_text_color),
+                    PorterDuff.Mode.MULTIPLY);
+
+            imsCall = r.getDrawable(R.drawable.volte_voice).mutate();
+            imsCall.setColorFilter(r.getColor(R.color.dialtacts_secondary_text_color),
+                    PorterDuff.Mode.MULTIPLY);
         }
 
         // Gets the icon, scaled to the height of the call type icons. This helps display all the
diff --git a/src/com/android/dialer/util/AppCompatConstants.java b/src/com/android/dialer/util/AppCompatConstants.java
index 15c1460..dd6c024 100644
--- a/src/com/android/dialer/util/AppCompatConstants.java
+++ b/src/com/android/dialer/util/AppCompatConstants.java
@@ -30,4 +30,7 @@
     public static final int INCOMING_IMS_TYPE = 8;
     public static final int OUTGOING_IMS_TYPE = 9;
     public static final int MISSED_IMS_TYPE = 10;
+    public static final int INCOMING_WIFI_TYPE = Calls.INCOMING_WIFI_TYPE;
+    public static final int OUTGOING_WIFI_TYPE = Calls.OUTGOING_WIFI_TYPE;
+    public static final int MISSED_WIFI_TYPE = Calls.MISSED_WIFI_TYPE;
 }