Promotion of atel.lnx.2.0-00024.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1060346   I0ff2f3b2da2f0a7cfb0052f01c7a5d17054e0775   Adjust display name of call log for 4G conference call
1012878 979860   Ic3f35aeec95e662d2fab5b3dc7bb41d813fb39b6   IMS-VT: Auto fullscreen issues during UI rotation.
887207   I47b84fd823c6110dca87bcc372be1aaeb9888efa   IMS-VT: Use correct view size when device is rotated.
1011439   I0689270a1b59039121372de0e77b9cb28e3ea9db   Dialer:Fix FC when it disables READ/WIRTE CALL LOG permi
1068733   Ia33cd001424ff22fd874cf0aeb9320ed8db2e2c4   IMS: Get IMS Registration Status based on subId
1077951   Icf8422ae056b447b3b91710923f4d390be1d339a   Dialer: Add serveral simplized chinese strings for IMS c
1032198   I6b816482a8e981a8dae11799a7b7e5880476a6ea   IMS-VT: Fix issue of screen timing out after orientation
1072624   I735779df6d8a16fd79e2dc7227228546530f2496   Handle secret codes without pressing dial button
1078574   I2d436d592b3dba3c286631fe53f0b2842e567664   Dialer: fix the display issue for VT Call.
1035004   I6f5e7c83a8fb2460c45dd1036f6e02e07dddb419   IMS: Support to Dial ConfURI call from call log.
980314   I7f8ead20442eb5337a65b1d87cb55e2cb1468355   Don't depend on binding for initializing phonecount.
1075332   Id3bc8275b9315b32bde08b99aa344a3af42007c2   Dialer: fix video call UI issue.
1024387   Id5c2334146dbd21fe3fa14102a74d4976af1205a   IMS-VT: InCallUI fragment cropped in landscape

Change-Id: I329112a175d42f66d29e3c822ce58b16ddd6b9fb
CRs-Fixed: 1012878, 1072624, 1068733, 1060346, 1035004, 1075332, 1024387, 1011439, 979860, 980314, 1078574, 1077951, 1032198, 887207
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 715722b..70493df 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -325,7 +325,7 @@
                   android:label=""
                   android:excludeFromRecents="true"
                   android:launchMode="singleInstance"
-                  android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboardHidden"
+                  android:configChanges="smallestScreenSize|screenLayout|keyboardHidden"
                   android:exported="false"
                   android:screenOrientation="nosensor"
                   android:directBootAware="true"
diff --git a/InCallUI/res/layout-w500dp-land/call_card_fragment.xml b/InCallUI/res/layout-w500dp-land/call_card_fragment.xml
index 1efe527..049f41f 100644
--- a/InCallUI/res/layout-w500dp-land/call_card_fragment.xml
+++ b/InCallUI/res/layout-w500dp-land/call_card_fragment.xml
@@ -16,47 +16,13 @@
   ~ limitations under the License
   -->
 
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="horizontal">
-
-    <LinearLayout
-        android:id="@+id/primary_call_info_container"
-        android:layout_centerVertical="true"
-        android:layout_width="0dp"
-        android:layout_height="match_parent"
-        android:layout_weight="1"
-        android:orientation="vertical"
-        android:elevation="@dimen/primary_call_elevation"
-        android:background="@drawable/rounded_call_card_background"
-        android:paddingTop="@dimen/call_banner_primary_call_container_top_padding"
-        android:clipChildren="false"
-        android:clipToPadding="false"
-        android:alpha="0.9"
-        android:layout_margin="10dp">
-
-        <include layout="@layout/primary_call_info" />
-
-        <fragment android:name="com.android.incallui.CallButtonFragment"
-            android:id="@+id/callButtonFragment"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="bottom|center_horizontal"
-            android:layout_marginBottom="@dimen/call_buttons_bottom_margin" />
-
-        <!-- Secondary "Call info" block, for the background ("on hold") call. -->
-        <include layout="@layout/secondary_call_info"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_gravity="bottom" />
-
-    </LinearLayout>
+    android:layout_height="match_parent">
 
     <FrameLayout
         android:layout_height="match_parent"
-        android:layout_width="0dp"
-        android:layout_weight="1">
+        android:layout_width="match_parent">
 
         <FrameLayout
             android:layout_height="match_parent"
@@ -116,90 +82,127 @@
 
         </FrameLayout>
 
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            android:layout_centerHorizontal="true"
-            android:layout_below="@id/primary_call_info_container">
-
-            <include layout="@layout/manage_conference_call_button"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:elevation="5dp"
-                android:layout_alignParentBottom="true"/>
-
-            <!-- Volume boost and Volume enhancements in-call UI -->
-            <ImageButton android:id="@+id/volumeBoost"
-                android:layout_width="80dp"
-                android:layout_height="80dp"
-                android:visibility="gone"
-                android:soundEffectsEnabled="false"
-                android:background="@drawable/vb_normal"/>
-
-        </LinearLayout>
-
-        <!-- Call recorder infor -->
-        <RelativeLayout
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentBottom="true"
-            android:layout_alignParentLeft="true">
-
-            <TextView android:id="@+id/recordingIcon"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:layout_marginLeft="24dp"
-                android:drawableRight="@drawable/ic_recording_indicator"
-                android:paddingBottom="119dp"
-                android:visibility="invisible"/>
-
-            <TextView android:id="@+id/recordingTime"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="5dp"
-                android:layout_toRightOf="@id/recordingIcon"
-                android:paddingBottom="120dp"
-                android:singleLine="true"
-                android:text="@string/recording_time_text"
-                android:textAppearance="?android:attr/textAppearanceSmall"
-                android:textColor="@color/incall_call_banner_text_color"
-                android:visibility="invisible"/>
-        </RelativeLayout>
-
         <fragment android:name="com.android.incallui.VideoCallFragment"
             android:layout_alignParentStart="true"
             android:layout_gravity="start|center_vertical"
             android:id="@+id/videoCallFragment"
             android:layout_width="match_parent"
             android:layout_height="match_parent" />
+    </FrameLayout>
 
-        <!-- Placeholder for the dialpad which is replaced with the dialpad fragment when shown. -->
-        <FrameLayout
-            android:id="@+id/answer_and_dialpad_container"
-            android:layout_gravity="bottom"
+    <!-- Call recorder infor -->
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentLeft="true">
+
+        <TextView android:id="@+id/recordingIcon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentLeft="true"
+            android:layout_marginLeft="24dp"
+            android:drawableRight="@drawable/ic_recording_indicator"
+            android:paddingBottom="119dp"
+            android:visibility="invisible"/>
+
+        <TextView android:id="@+id/recordingTime"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="5dp"
+            android:layout_toRightOf="@id/recordingIcon"
+            android:paddingBottom="120dp"
+            android:singleLine="true"
+            android:text="@string/recording_time_text"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textColor="@color/incall_call_banner_text_color"
+            android:visibility="invisible"/>
+    </RelativeLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:layout_centerHorizontal="true">
+
+        <include layout="@layout/manage_conference_call_button"
             android:layout_width="match_parent"
-            android:layout_height="match_parent" />
+            android:layout_height="wrap_content"
+            android:elevation="5dp"
+            android:layout_alignParentBottom="true"/>
+
+        <!-- Volume boost and Volume enhancements in-call UI -->
+        <ImageButton android:id="@+id/volumeBoost"
+            android:layout_width="80dp"
+            android:layout_height="80dp"
+            android:visibility="gone"
+            android:soundEffectsEnabled="false"
+            android:background="@drawable/vb_normal"/>
+    </LinearLayout>
+
+    <!-- Secondary "Call info" block, for the background ("on hold") call. -->
+    <include layout="@layout/secondary_call_info"
+             android:id="@+id/secondary_call_info"
+             android:layout_width="match_parent"
+             android:layout_height="wrap_content"
+             android:layout_alignParentBottom="true" />
+
+    <LinearLayout
+        android:id="@+id/primary_call_info_container"
+        android:layout_alignParentStart="true"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_above="@id/secondary_call_info"
+        android:orientation="vertical"
+        android:elevation="@dimen/primary_call_elevation"
+        android:background="@drawable/rounded_call_card_background"
+        android:paddingTop="@dimen/call_banner_primary_call_container_top_padding"
+        android:clipChildren="false"
+        android:clipToPadding="false"
+        android:alpha="0.9"
+        android:layout_margin="10dp">
+
+        <include layout="@layout/primary_call_info" />
 
         <FrameLayout
-            android:id="@+id/floating_end_call_action_button_container"
-            android:layout_width="@dimen/end_call_floating_action_button_diameter"
-            android:layout_height="@dimen/end_call_floating_action_button_diameter"
-            android:background="@drawable/fab_red"
-            android:layout_gravity="bottom|center_horizontal"
-            android:layout_marginBottom="@dimen/end_call_button_margin_bottom">
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent" >
 
-            <ImageButton android:id="@+id/floating_end_call_action_button"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:background="@drawable/end_call_background"
-                android:src="@drawable/fab_ic_end_call"
-                android:scaleType="center"
-                android:contentDescription="@string/onscreenEndCallText" />
+            <fragment android:name="com.android.incallui.CallButtonFragment"
+                android:id="@+id/callButtonFragment"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="bottom" />
 
         </FrameLayout>
 
-    </FrameLayout>
+    </LinearLayout>
 
-</LinearLayout>
+    <!-- Placeholder for the dialpad which is replaced with the dialpad fragment when shown. -->
+    <FrameLayout
+        android:id="@+id/answer_and_dialpad_container"
+        android:layout_toEndOf="@id/primary_call_info_container"
+        android:layout_gravity="end|center_vertical"
+        android:layout_alignParentEnd="true"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
+     <FrameLayout
+        android:id="@+id/floating_end_call_action_button_container"
+        android:layout_width="@dimen/end_call_floating_action_button_diameter"
+        android:layout_height="@dimen/end_call_floating_action_button_diameter"
+        android:background="@drawable/fab_red"
+        android:layout_alignParentRight="true"
+        android:layout_alignParentBottom="true"
+        android:layout_marginRight="@dimen/end_call_button_margin_right"
+        android:layout_marginBottom="@dimen/end_call_button_margin_bottom">
+        <ImageButton android:id="@+id/floating_end_call_action_button"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="@drawable/end_call_background"
+            android:src="@drawable/fab_ic_end_call"
+            android:scaleType="center"
+            android:contentDescription="@string/onscreenEndCallText" />
+     </FrameLayout>
+
+</RelativeLayout>
diff --git a/InCallUI/res/layout/primary_call_info.xml b/InCallUI/res/layout/primary_call_info.xml
index a9ef075..2fa3b94 100644
--- a/InCallUI/res/layout/primary_call_info.xml
+++ b/InCallUI/res/layout/primary_call_info.xml
@@ -23,7 +23,7 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/primary_call_banner"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
+        android:layout_height="wrap_content"
         android:orientation="vertical"
         android:paddingStart="@dimen/call_banner_side_padding"
         android:paddingEnd="@dimen/call_banner_side_padding"
diff --git a/InCallUI/res/values-w500dp-land/dimens.xml b/InCallUI/res/values-w500dp-land/dimens.xml
index 112ec5f..01cf165 100644
--- a/InCallUI/res/values-w500dp-land/dimens.xml
+++ b/InCallUI/res/values-w500dp-land/dimens.xml
@@ -32,4 +32,6 @@
     <dimen name="dialpad_elevation">2dp</dimen>
 
     <dimen name="video_preview_margin">20dp</dimen>
+
+    <dimen name="end_call_button_margin_right">80dp</dimen>
 </resources>
diff --git a/InCallUI/res/values-zh-rCN/qtistrings.xml b/InCallUI/res/values-zh-rCN/qtistrings.xml
index 63af255..120af0a 100644
--- a/InCallUI/res/values-zh-rCN/qtistrings.xml
+++ b/InCallUI/res/values-zh-rCN/qtistrings.xml
@@ -47,4 +47,104 @@
     <string name="modify_call_option_vt_tx">视频发送</string>
     <string name="modify_call_option_vt_rx">视频接收</string>
     <string name="modify_call_option_voice">仅限语音</string>
+    <!-- Call substate label -->
+    <string name="call_substate_label">" 通话质量不佳 - \u000a"</string>
+    <!-- Call substate label for call resumed -->
+    <string name="call_substate_call_resumed">"通话继续\u000a"</string>
+    <!-- Call substate label for call connected suspended (audio) -->
+    <string name="call_substate_connected_suspended_audio">"暂停连接\u000a"</string>
+    <!-- Call substate label for call connected suspended (video) -->
+    <string name="call_substate_connected_suspended_video">"视频电话暂停\u000a"</string>
+    <!-- Call substate label for avp retry -->
+    <string name="call_substate_avp_retry">"AVP 重试\u000a"</string>
+    <!-- Video quality changed message -->
+    <string name="video_quality_changed">" 视频画质变为\u0020"</string>
+    <!-- Video quality High -->
+    <string name="video_quality_high">"高画质"</string>
+    <!-- Video quality Medium -->
+    <string name="video_quality_medium">"中画质"</string>
+    <!-- Video quality Low -->
+    <string name="video_quality_low">"低画质"</string>
+    <!-- Video quality Unknown -->
+    <string name="video_quality_unknown">"未知"</string>
+    <!-- Message indicating that Video Started flowing for IMS-VT calls -->
+    <string name="player_started">"播放器已启动"</string>
+    <!-- Message indicating that Video Stopped flowing for IMS-VT calls -->
+    <string name="player_stopped">"播放暂停"</string>
+    <!-- Message indicating that camera failure has occurred for the selected camera and
+         as result camera is not ready -->
+    <string name="camera_not_ready">"摄像头故障"</string>
+    <!-- Message indicating that camera is ready/available -->
+    <string name="camera_ready">"摄像头就绪"</string>
+    <!-- Message indicating unknown call session event -->
+    <string name="unknown_call_session_event">"未知电话"</string>
+    <!-- Message indicating data usage -->
+    <string name="data_usage_label">"流量使用: "</string>
+    <!-- Modify call error cause -->
+    <string name="modify_call_failed_due_to_low_battery">"由于电池电量不足,无法修改通话。"</string>
+    <!-- Message indicating video calls not allowed if user enabled TTY Mode -->
+    <string name="video_call_not_allowed_if_tty_enabled">"请关闭 TTY 模式以便升级到视频电话。"</string>
+    <!-- Text for the onscreen "Add Participant" button -->
+    <string name="onscreenAddParticipant">"添加参与者"</string>
+    <!-- Description of the deflect target in the Slide unlock screen. [CHAR LIMIT=NONE] -->
+    <string name="qti_description_target_deflect">"转移"</string>
+    <string name="qti_description_deflect_error">"号码未设置。通过 IMS 设置提供号码,然后重试。"</string>
+    <string name="qti_description_deflect_service_error">"不支持呼叫转移服务。"</string>
+    <!-- Message indicating call failed due to handover not feasible -->
+    <string name="call_failed_ho_not_feasible">"无法从 LTE 切换到 3G/2G,通话已结束。"</string>
+    <!-- Title of the IMS to CS redial dialog -->
+    <string name="cs_redial_option">"重拨选项"</string>
+    <!-- Message text of the IMS to CS redial dialog -->
+    <string name="cs_redial_msg">"无法拨打 IMS 视频通话,是否要拨打非 IMS 的语音通话?"</string>
+    <!-- Yes option of the IMS to CS redial dialog -->
+    <string name="cs_redial_yes">"是"</string>
+    <!-- No option of the IMS to CS redial dialog -->
+    <string name="cs_redial_no">"否"</string>
+    <!-- Session modify cause unspecified -->
+    <string name="session_modify_cause_unspecified"></string>
+    <!-- Session modify cause code upgrade local request -->
+    <string name="session_modify_cause_upgrade_local_request">"应用户请求,通话已升级"</string>
+    <!-- Session modify cause code upgrade remote request -->
+    <string name="session_modify_cause_upgrade_remote_request">"应远程用户请求,通话已升级"</string>
+    <!-- Session modify cause code downgrade local request -->
+    <string name="session_modify_cause_downgrade_local_request">"应用户请求,通话已降级"</string>
+    <!-- Session modify cause code downgrade remote request -->
+    <string name="session_modify_cause_downgrade_remote_request">"应远程用户请求,通话已降级"</string>
+    <!-- Session modify cause code downgrade rtp timeout -->
+    <string name="session_modify_cause_downgrade_rtp_timeout">"由于 RTP 超时,通话已降级"</string>
+    <!-- Session modify cause code downgrade qos -->
+    <string name="session_modify_cause_downgrade_qos">"由于服务质量,通话已降级"</string>
+    <!-- Session modify cause code downgrade packet loss -->
+    <string name="session_modify_cause_downgrade_packet_loss">"由于数据包丢失,通话已降级"</string>
+    <!-- Session modify cause code downgrade low thrput -->
+    <string name="session_modify_cause_downgrade_low_thrput">"由于吞吐量低,通话已降级"</string>
+    <!-- Session modify cause code downgrade thermal mitigation -->
+    <string name="session_modify_cause_downgrade_thermal_mitigation">"由于设备过热,通话已降级"</string>
+    <!-- Session modify cause code downgrade lipsync -->
+    <string name="session_modify_cause_downgrade_lipsync">"由于嘴唇同步功能,通话已降级"</string>
+    <!-- Session modify cause code downgrade generic error -->
+    <string name="session_modify_cause_downgrade_generic_error">"由于一般错误,通话已降级"</string>
+    <!-- Title for low battery alert dialogue -->
+    <string name="low_battery">"电池电量不足"</string>
+    <!-- Yes option of the low battery alert dialog -->
+    <string name="low_battery_yes">"是"</string>
+    <!-- No option of the low battery alert dialog -->
+    <string name="low_battery_no">"否"</string>
+    <!-- Message text of the low battery alert dialog in cases when video call can be downgraded to voice call -->
+    <string name="low_battery_downgrade_to_voice_msg">"要将视频通话转换为音频通话吗?"</string>
+    <!-- Message text of the low battery alert dialog in cases video call doesn't have downgrade capabilities -->
+    <string name="low_battery_hangup_msg">"要挂断电话吗?"</string>
+    <!-- Description of the call transfer related strings [CHAR LIMIT=NONE] -->
+    <string name="qti_ims_transfer_num_error">"号码未设置。通过 IMS 设置提供号码,然后重试。"</string>
+    <string name="qti_ims_transfer_request_error">"呼叫转移请求失败。"</string>
+    <string name="qti_ims_transfer_request_success">"呼叫转移请求成功。"</string>
+    <!-- Text for the onscreen "blind transfer" button -->
+    <string name="qti_ims_onscreenBlindTransfer">"无条件转移"</string>
+    <!-- Text for the onscreen "assured transfer" button -->
+    <string name="qti_ims_onscreenAssuredTransfer">"固定转移"</string>
+    <!-- Text for the onscreen "consultative transfer" button -->
+    <string name="qti_ims_onscreenConsultativeTransfer">"询问转移"</string>
+    <!-- Text for operator specific emergency number -->
+    <add-resource type="string" name="emergency_call_dialog_number_for_display_operator"/>
+    <string name="emergency_call_dialog_number_for_display_operator">"紧急呼救"</string>
 </resources>
diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
index ceae8c0..b5002db 100644
--- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java
@@ -525,10 +525,13 @@
         boolean showRx = false;
         boolean showVolte = false;
 
-        if (mEnhanceEnable && showUpgradeToVideo) {
+        if (mEnhanceEnable && hasVideoCallCapabilities(call)) {
             boolean isAudioAndVtCap = (VideoProfile.isAudioOnly(mCall.getVideoState()) &&
                     PresenceHelper.getVTCapability(call.getNumber()));
-            showRxTx = (VideoProfile.isReceptionEnabled(mCall.getVideoState()) || isAudioAndVtCap);
+            showRxTx = ((VideoProfile.isReceptionEnabled(mCall.getVideoState()) &&
+                    !VideoProfile.isBidirectional(mCall.getVideoState())) || isAudioAndVtCap);
+            //"hide me" show be show if call is video call or voice call only, "hide me"
+            //is mean that call can upgrade to Rx video call for voice call only.
             showRx = (VideoProfile.isBidirectional(mCall.getVideoState()) || isAudioAndVtCap);
             showVolte = VideoProfile.isVideo(mCall.getVideoState());
             Log.v(this, "updateButtonsState showRxTx = " + showRxTx +
@@ -544,7 +547,8 @@
         ui.showButton(BUTTON_UPGRADE_TO_VIDEO, showUpgradeToVideo && !mEnhanceEnable);
         ui.showButton(BUTTON_DOWNGRADE_TO_AUDIO, showDowngradeToAudio && !useExt);
         ui.showButton(BUTTON_SWITCH_CAMERA, isVideo);
-        ui.showButton(BUTTON_PAUSE_VIDEO, isVideo && !useExt && !useCustomVideoUi);
+        ui.showButton(BUTTON_PAUSE_VIDEO, isVideo && !useExt && !useCustomVideoUi &&
+                !mEnhanceEnable);
         ui.showButton(BUTTON_DIALPAD, true);
         ui.showButton(BUTTON_MERGE, showMerge);
         ui.showButton(BUTTON_ADD_PARTICIPANT, showAddParticipant && !mEnhanceEnable);
diff --git a/InCallUI/src/com/android/incallui/GlowPadAnswerFragment.java b/InCallUI/src/com/android/incallui/GlowPadAnswerFragment.java
index d9b4dda..98e797e 100644
--- a/InCallUI/src/com/android/incallui/GlowPadAnswerFragment.java
+++ b/InCallUI/src/com/android/incallui/GlowPadAnswerFragment.java
@@ -104,7 +104,12 @@
                 handleDrawableResourceId = R.drawable.ic_incall_audio_handle;
                 break;
             case TARGET_SET_FOR_VIDEO_WITHOUT_SMS:
-                targetResourceId = R.array.incoming_call_widget_video_without_sms_targets;
+                if (isEnhanceUIEnabled) {
+                    targetResourceId =
+                            R.array.enhance_incoming_call_widget_video_without_sms_targets;
+                } else {
+                    targetResourceId = R.array.incoming_call_widget_video_without_sms_targets;
+                }
                 targetDescriptionsResourceId =
                         R.array.incoming_call_widget_video_without_sms_target_descriptions;
                 directionDescriptionsResourceId =
@@ -112,7 +117,11 @@
                 handleDrawableResourceId = R.drawable.ic_incall_video_handle;
                 break;
             case TARGET_SET_FOR_VIDEO_WITH_SMS:
-                targetResourceId = R.array.incoming_call_widget_video_with_sms_targets;
+                if (isEnhanceUIEnabled) {
+                    targetResourceId = R.array.enhance_incoming_call_widget_video_with_sms_targets;
+                } else {
+                    targetResourceId = R.array.incoming_call_widget_video_with_sms_targets;
+                }
                 targetDescriptionsResourceId =
                         R.array.incoming_call_widget_video_with_sms_target_descriptions;
                 directionDescriptionsResourceId =
diff --git a/InCallUI/src/com/android/incallui/InCallActivity.java b/InCallUI/src/com/android/incallui/InCallActivity.java
index 3956f04..dd2af36 100644
--- a/InCallUI/src/com/android/incallui/InCallActivity.java
+++ b/InCallUI/src/com/android/incallui/InCallActivity.java
@@ -214,6 +214,10 @@
         // TODO(klp): Do we need to add this back when prox sensor is not available?
         // lp.inputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_DISABLE_USER_ACTIVITY;
 
+        // Since activity is created newly, clear full screen flag. This will ensure that
+        // the flag is in sync with actual UI when UI is recreated due to orientation change.
+        InCallPresenter.getInstance().clearFullscreen();
+
         setContentView(R.layout.incall_screen);
 
         internalResolveIntent(getIntent());
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index c92151b..d1a19e6 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -1865,21 +1865,6 @@
         }
     }
 
-    public void enableScreenTimeout(boolean enable) {
-        Log.v(this, "enableScreenTimeout: value=" + enable);
-        if (mInCallActivity == null) {
-            Log.e(this, "enableScreenTimeout: InCallActivity is null.");
-            return;
-        }
-
-        final Window window = mInCallActivity.getWindow();
-        if (enable) {
-            window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-        } else {
-            window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
-        }
-    }
-
     /**
      * Returns the space available beside the call card.
      *
diff --git a/InCallUI/src/com/android/incallui/InCallServiceImpl.java b/InCallUI/src/com/android/incallui/InCallServiceImpl.java
index 5ca721b..5c9f706 100644
--- a/InCallUI/src/com/android/incallui/InCallServiceImpl.java
+++ b/InCallUI/src/com/android/incallui/InCallServiceImpl.java
@@ -32,7 +32,7 @@
  */
 public class InCallServiceImpl extends InCallService {
 
-    static int sPhoneCount = 0;
+    static int sPhoneCount = TelephonyManager.getDefault().getPhoneCount();
 
     @Override
     public void onCallAudioStateChanged(CallAudioState audioState) {
@@ -63,7 +63,6 @@
     @Override
     public IBinder onBind(Intent intent) {
         final Context context = getApplicationContext();
-        sPhoneCount = QtiCallUtils.getPhoneCount(context);
         final ContactInfoCache contactInfoCache = ContactInfoCache.getInstance(context);
         InCallPresenter.getInstance().setUp(
                 getApplicationContext(),
diff --git a/InCallUI/src/com/android/incallui/VideoCallFragment.java b/InCallUI/src/com/android/incallui/VideoCallFragment.java
index cea9c4d..087f278 100644
--- a/InCallUI/src/com/android/incallui/VideoCallFragment.java
+++ b/InCallUI/src/com/android/incallui/VideoCallFragment.java
@@ -16,6 +16,7 @@
 
 package com.android.incallui;
 
+import android.app.Activity;
 import android.graphics.Matrix;
 import android.graphics.Point;
 import android.graphics.SurfaceTexture;
@@ -29,6 +30,8 @@
 import android.view.ViewGroup;
 import android.view.ViewStub;
 import android.view.ViewTreeObserver;
+import android.view.Window;
+import android.view.WindowManager;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
 
@@ -575,12 +578,15 @@
         if (mPreviewPhoto != null) {
             mPreviewPhoto.setVisibility(!previewPaused ? View.VISIBLE : View.INVISIBLE);
         }
+
+        enableScreenTimeout(false);
     }
 
     /**
      * Hide all video views.
      */
     public void hideVideoUi() {
+        enableScreenTimeout(true);
         inflateVideoUi(false);
     }
 
@@ -852,7 +858,12 @@
 
             Log.d(this, "inflateVideoCallViews: sVideoSurfacesInUse=" + sVideoSurfacesInUse);
             //If peer adjusted screen size is not available, set screen size to default display size
-            Point screenSize = sDisplaySize == null ? getScreenSize() : sDisplaySize;
+            Point screenSize = getScreenSize();
+            if (sDisplaySize != null) {
+                screenSize = VideoCallPresenter.resizeForAspectRatio(screenSize,
+                        sDisplaySize.x, sDisplaySize.y);
+            }
+
             setSurfaceSizeAndTranslation(displaySurface, screenSize);
 
             if (!sVideoSurfacesInUse) {
@@ -922,4 +933,23 @@
             centerDisplayView(textureView);
         }
     }
+
+    private void enableScreenTimeout(boolean enable) {
+        Log.v(this, "enableScreenTimeout: value=" + enable);
+        final Activity activity = getActivity();
+        if (activity == null) {
+            Log.e(this, "enableScreenTimeout: Activity is null.");
+            return;
+        }
+        final Window window = activity.getWindow();
+        if (window == null) {
+            Log.e(this, "enableScreenTimeout: window is null");
+            return;
+        }
+        if (enable) {
+            window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+        } else {
+            window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+        }
+    }
 }
diff --git a/InCallUI/src/com/android/incallui/VideoCallPresenter.java b/InCallUI/src/com/android/incallui/VideoCallPresenter.java
index e08f4d5..9a3e34b 100644
--- a/InCallUI/src/com/android/incallui/VideoCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/VideoCallPresenter.java
@@ -322,6 +322,7 @@
             CallList.getInstance().removeCallUpdateListener(mPrimaryCall.getId(), this);
         }
         mPictureModeHelper.tearDown(this);
+        cancelAutoFullScreen();
     }
 
     /**
@@ -884,9 +885,6 @@
         } else {
             ui.hideVideoUi();
         }
-
-        InCallPresenter.getInstance().enableScreenTimeout(
-                VideoProfile.isAudioOnly(videoState));
     }
 
     /**
@@ -1222,6 +1220,12 @@
         Point size = ui.getScreenSize();
         Log.v(this, "setDisplayVideoSize: windowmgr width=" + size.x
                 + " windowmgr height=" + size.y);
+        size = resizeForAspectRatio(size, width, height);
+        ui.setDisplayVideoSize(size.x, size.y);
+    }
+
+    public static Point resizeForAspectRatio(Point inSize, int width, int height) {
+        Point size = new Point(inSize);
         if (size.y * width > size.x * height) {
             // current display height is too much. Correct it
             size.y = (int) (size.x * height / width);
@@ -1229,7 +1233,7 @@
             // current display width is too much. Correct it
             size.x = (int) (size.y * width / height);
         }
-        ui.setDisplayVideoSize(size.x, size.y);
+        return size;
     }
 
     /**
@@ -1290,6 +1294,9 @@
         }
         Log.v(this, "cancelAutoFullScreen : cancelling pending");
         mAutoFullScreenPending = false;
+        if (mHandler != null) {
+            mHandler.removeCallbacks(mAutoFullscreenRunnable);
+        }
     }
 
     private static boolean isAudioRouteEnabled(int audioRoute, int audioRouteMask) {
diff --git a/res/values/qtistrings.xml b/res/values/qtistrings.xml
new file mode 100644
index 0000000..a11e5e5
--- /dev/null
+++ b/res/values/qtistrings.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ 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.
+  -->
+<!-- The xml contains Qti specific resource strings neede for any value added features. -->
+<resources>
+    <!-- OEM Key strings -->
+    <string name="oem_key_code_action"></string>
+    <string name="oem_code"></string>
+</resources>
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index 94c2f00..db4abe7 100644
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -283,10 +283,12 @@
                 if (TextUtils.isEmpty(mNumber)) {
                     return;
                 }
-                mContext.startActivity(
-                        new CallIntentBuilder(getDialableNumber())
-                                .setCallInitiationType(LogState.INITIATION_CALL_DETAILS)
-                                .build());
+                Intent dialIntent = new CallIntentBuilder(getDialableNumber())
+                        .setCallInitiationType(LogState.INITIATION_CALL_DETAILS).build();
+                if (DialerUtils.isConferenceURICallLog(mNumber, mPostDialDigits)) {
+                    dialIntent.putExtra("org.codeaurora.extra.DIAL_CONFERENCE_URI", true);
+                }
+                mContext.startActivity(dialIntent);
             }
         });
 
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index d7bb71f..6142d52 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -1553,7 +1553,7 @@
     }
 
     private void showVideoCallWelcomeDialog() {
-        if (DialerUtils.canShowWelcomeScreen(this)) {
+        if (DialerUtils.canShowWelcomeScreen(this) || DialerUtils.isFirstLaunch(this)) {
             final Intent intent = new Intent(this, VideoCallWelcomeActivity.class);
             startActivity(intent);
         }
diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java
index 55f3fd7..fff7d19 100644
--- a/src/com/android/dialer/SpecialCharSequenceMgr.java
+++ b/src/com/android/dialer/SpecialCharSequenceMgr.java
@@ -202,7 +202,15 @@
             context.sendBroadcast(intent);
             return true;
         }
-
+        if (!TextUtils.isEmpty(context.getString(R.string.oem_key_code_action))) {
+            if (len > 10 && !input.startsWith("*#*#")
+                   && input.startsWith("*#") && input.endsWith("#")) {
+                Intent intent = new Intent(context.getString(R.string.oem_key_code_action));
+                intent.putExtra(context.getString(R.string.oem_code), input);
+                context.sendBroadcast(intent);
+                return true;
+            }
+        }
         return false;
     }
 
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 48b4f55..462b036 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -60,6 +60,7 @@
 import com.android.dialer.logging.InteractionEvent;
 import com.android.dialer.logging.Logger;
 import com.android.dialer.service.ExtendedBlockingButtonRenderer;
+import com.android.dialer.util.DialerUtils;
 import com.android.dialer.util.PhoneNumberUtil;
 import com.android.dialer.voicemail.VoicemailPlaybackPresenter;
 
@@ -497,15 +498,15 @@
         }
 
         int count = getGroupSize(position);
-
         final String phoneNumber = c.getString(CallLogQuery.NUMBER);
         Pattern pattern = Pattern.compile("[,;]");
         String[] num = pattern.split(phoneNumber);
-        final String number = num.length > 0 ? num[0] : "";
         final String countryIso = c.getString(CallLogQuery.COUNTRY_ISO);
         final String postDialDigits = CompatUtils.isNCompatible()
                 && mActivityType != ACTIVITY_TYPE_ARCHIVE ?
                 c.getString(CallLogQuery.POST_DIAL_DIGITS) : "";
+        final String number = DialerUtils.isConferenceURICallLog(phoneNumber, postDialDigits) ?
+                phoneNumber : num.length > 0 ? num[0] : "";
         final String viaNumber = CompatUtils.isNCompatible()
                 && mActivityType != ACTIVITY_TYPE_ARCHIVE ?
                 c.getString(CallLogQuery.VIA_NUMBER) : "";
@@ -524,8 +525,11 @@
         ContactInfo info = ContactInfo.EMPTY;
         if (PhoneNumberUtil.canPlaceCallsTo(number, numberPresentation) && !isVoicemailNumber) {
             // Lookup contacts with this number
-            info = mContactInfoCache.getValue(number + postDialDigits,
-                    countryIso, cachedContactInfo);
+            boolean isConfCallLog = num != null && num.length > 1
+                    && DialerUtils.isConferenceURICallLog(phoneNumber, postDialDigits);
+            String queryNumber = isConfCallLog ? phoneNumber : number + postDialDigits;
+            info = mContactInfoCache.getValue(queryNumber,
+                    countryIso, cachedContactInfo, isConfCallLog);
         }
         CharSequence formattedNumber = info.formattedNumber == null
                 ? null : PhoneNumberUtilsCompat.createTtsSpannable(info.formattedNumber);
diff --git a/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java b/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java
index 34b2f0e..426615a 100644
--- a/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java
+++ b/src/com/android/dialer/calllog/CallLogAsyncTaskUtil.java
@@ -41,6 +41,7 @@
 import com.android.dialer.util.AsyncTaskExecutor;
 import com.android.dialer.util.AsyncTaskExecutors;
 import com.android.dialer.util.PhoneNumberUtil;
+import com.android.dialer.util.DialerUtils;
 import com.android.dialer.util.TelecomUtil;
 
 import java.util.ArrayList;
@@ -209,7 +210,8 @@
             ContactInfo info = ContactInfo.EMPTY;
 
             if (shouldLookupNumber) {
-                ContactInfo lookupInfo = contactInfoHelper.lookupNumber(number, countryIso);
+                ContactInfo lookupInfo = contactInfoHelper.lookupNumber(number, countryIso,
+                    DialerUtils.isConferenceURICallLog(number, postDialDigits));
                 info = lookupInfo != null ? lookupInfo : ContactInfo.EMPTY;
             }
 
diff --git a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
index 4036f10..d63531b 100644
--- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
+++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
@@ -710,6 +710,9 @@
             if (intentProvider != null) {
                 final Intent intent = intentProvider.getIntent(mContext);
                 // See IntentProvider.getCallDetailIntentProvider() for why this may be null.
+                if (DialerUtils.isConferenceURICallLog(number, postDialDigits)) {
+                    intent.putExtra("org.codeaurora.extra.DIAL_CONFERENCE_URI", true);
+                }
                 if (intent != null) {
                     DialerUtils.startActivityWithErrorToast(mContext, intent);
                 }
diff --git a/src/com/android/dialer/calllog/ContactInfoHelper.java b/src/com/android/dialer/calllog/ContactInfoHelper.java
index b0ef0ab..07db044 100644
--- a/src/com/android/dialer/calllog/ContactInfoHelper.java
+++ b/src/com/android/dialer/calllog/ContactInfoHelper.java
@@ -43,6 +43,8 @@
 import com.android.dialer.util.TelecomUtil;
 import com.android.dialerbind.ObjectFactory;
 
+import java.util.regex.Pattern;
+
 import org.json.JSONException;
 import org.json.JSONObject;
 
@@ -76,6 +78,24 @@
      */
     @Nullable
     public ContactInfo lookupNumber(String number, String countryIso) {
+        return lookupNumber(number, countryIso, false);
+    }
+
+    /**
+     * Returns the contact information for the given number.
+     * <p>
+     * If the number does not match any contact, returns a contact info containing only the number
+     * and the formatted number.
+     * <p>
+     * If an error occurs during the lookup, it returns null.
+     *
+     * @param number the number to look up
+     * @param countryIso the country associated with this number
+     * @param isConfUrlLog whether call log is for Conference URL call
+     */
+    @Nullable
+    public ContactInfo lookupNumber(String number, String countryIso, boolean isConfUrlCallLog) {
+
         if (TextUtils.isEmpty(number)) {
             return null;
         }
@@ -89,12 +109,13 @@
                 // If lookup failed, check if the "username" of the SIP address is a phone number.
                 String username = PhoneNumberHelper.getUsernameFromUriNumber(number);
                 if (PhoneNumberUtils.isGlobalPhoneNumber(username)) {
-                    info = queryContactInfoForPhoneNumber(username, countryIso, true);
+                    info = queryContactInfoForPhoneNumber(username, countryIso, true,
+                            isConfUrlCallLog);
                 }
             }
         } else {
             // Look for a contact that has the given phone number.
-            info = queryContactInfoForPhoneNumber(number, countryIso, false);
+            info = queryContactInfoForPhoneNumber(number, countryIso, false, isConfUrlCallLog);
         }
 
         final ContactInfo updatedInfo;
@@ -245,12 +266,38 @@
      * If the lookup fails for some other reason, it returns null.
      */
     private ContactInfo queryContactInfoForPhoneNumber(String number, String countryIso,
-                                                       boolean isSip) {
+            boolean isSip, boolean isConfUrlLog) {
         if (TextUtils.isEmpty(number)) {
             return null;
         }
 
         ContactInfo info = lookupContactFromUri(getContactInfoLookupUri(number), isSip);
+        if (isConfUrlLog) {
+            Pattern pattern = Pattern.compile("[,;]");
+            String[] nums = pattern.split(number);
+            if (nums != null && nums.length > 1) {
+                if (info == null || info == ContactInfo.EMPTY) {
+                    info = new ContactInfo();
+                    info.number = number;
+                    info.formattedNumber = formatPhoneNumber(number, null, countryIso);
+                    info.lookupUri = createTemporaryContactUri(info.formattedNumber);
+                    info.normalizedNumber = PhoneNumberUtils.formatNumberToE164(number,
+                            countryIso);
+                }
+                String combName = "";
+                for (String num : nums) {
+                    ContactInfo singleCi = lookupContactFromUri(getContactInfoLookupUri(num),
+                            isSip);
+                    if (TextUtils.isEmpty(singleCi.name)) {
+                        singleCi.name = formatPhoneNumber(num, null, countryIso);
+                    }
+                    combName += singleCi.name + ";";
+                }
+                if (!TextUtils.isEmpty(combName) && combName.length() > 1) {
+                    info.name = combName.substring(0, combName.length() - 1);
+                }
+            }
+        }
         if (info != null && info != ContactInfo.EMPTY) {
             info.formattedNumber = formatPhoneNumber(number, null, countryIso);
         } else if (mCachedNumberLookupService != null) {
diff --git a/src/com/android/dialer/contactinfo/ContactInfoCache.java b/src/com/android/dialer/contactinfo/ContactInfoCache.java
index 1e24579..af30c10 100644
--- a/src/com/android/dialer/contactinfo/ContactInfoCache.java
+++ b/src/com/android/dialer/contactinfo/ContactInfoCache.java
@@ -76,7 +76,8 @@
 
                 if (req != null) {
                     // Process the request. If the lookup succeeds, schedule a redraw.
-                    needRedraw |= queryContactInfo(req.number, req.countryIso, req.callLogInfo);
+                    needRedraw |= queryContactInfo(req.number, req.countryIso, req.callLogInfo,
+                            req.isConf);
                 } else {
                     // Throttle redraw rate by only sending them when there are
                     // more requests.
@@ -145,6 +146,11 @@
     }
 
     public ContactInfo getValue(String number, String countryIso, ContactInfo cachedContactInfo) {
+        return getValue(number, countryIso, cachedContactInfo, false);
+    }
+
+    public ContactInfo getValue(String number, String countryIso, ContactInfo cachedContactInfo,
+                boolean isConf) {
         NumberWithCountryIso numberCountryIso = new NumberWithCountryIso(number, countryIso);
         ExpirableCache.CachedValue<ContactInfo> cachedInfo =
                 mCache.getCachedValue(numberCountryIso);
@@ -155,19 +161,19 @@
             info = cachedContactInfo;
             // The db request should happen on a non-UI thread.
             // Request the contact details immediately since they are currently missing.
-            enqueueRequest(number, countryIso, cachedContactInfo, true);
+            enqueueRequest(number, countryIso, cachedContactInfo, true, isConf);
             // We will format the phone number when we make the background request.
         } else {
             if (cachedInfo.isExpired()) {
                 // The contact info is no longer up to date, we should request it. However, we
                 // do not need to request them immediately.
-                enqueueRequest(number, countryIso, cachedContactInfo, false);
+                enqueueRequest(number, countryIso, cachedContactInfo, false, isConf);
             } else if (!callLogInfoMatches(cachedContactInfo, info)) {
                 // The call log information does not match the one we have, look it up again.
                 // We could simply update the call log directly, but that needs to be done in a
                 // background thread, so it is easier to simply request a new lookup, which will, as
                 // a side-effect, update the call log.
-                enqueueRequest(number, countryIso, cachedContactInfo, false);
+                enqueueRequest(number, countryIso, cachedContactInfo, false, isConf);
             }
 
             if (info == ContactInfo.EMPTY) {
@@ -189,8 +195,9 @@
      * It returns true if it updated the content of the cache and we should therefore tell the
      * view to update its content.
      */
-    private boolean queryContactInfo(String number, String countryIso, ContactInfo callLogInfo) {
-        final ContactInfo info = mContactInfoHelper.lookupNumber(number, countryIso);
+    private boolean queryContactInfo(String number, String countryIso, ContactInfo callLogInfo,
+            boolean isConf) {
+        final ContactInfo info = mContactInfoHelper.lookupNumber(number, countryIso, isConf);
 
         if (info == null) {
             // The lookup failed, just return without requesting to update the view.
@@ -293,7 +300,23 @@
      */
     protected void enqueueRequest(String number, String countryIso, ContactInfo callLogInfo,
             boolean immediate) {
-        ContactInfoRequest request = new ContactInfoRequest(number, countryIso, callLogInfo);
+        enqueueRequest(number, countryIso, callLogInfo, immediate, false);
+    }
+
+    /**
+     * Enqueues a request to look up the contact details for the given phone number.
+     * <p>
+     * It also provides the current contact info stored in the call log for this number.
+     * <p>
+     * If the {@code immediate} parameter is true, it will start immediately the thread that looks
+     * up the contact information (if it has not been already started). Otherwise, it will be
+     * started with a delay. See {@link #START_PROCESSING_REQUESTS_DELAY_MILLIS}.
+     * @param isConf indicate whether call log is for Conference Url call
+     */
+    protected void enqueueRequest(String number, String countryIso, ContactInfo callLogInfo,
+            boolean immediate, boolean isConf) {
+        ContactInfoRequest request = new ContactInfoRequest(number, countryIso, callLogInfo,
+                isConf);
         synchronized (mRequests) {
             if (!mRequests.contains(request)) {
                 mRequests.add(request);
diff --git a/src/com/android/dialer/contactinfo/ContactInfoRequest.java b/src/com/android/dialer/contactinfo/ContactInfoRequest.java
index ec5c119..1171dcf 100644
--- a/src/com/android/dialer/contactinfo/ContactInfoRequest.java
+++ b/src/com/android/dialer/contactinfo/ContactInfoRequest.java
@@ -31,11 +31,18 @@
     public final String countryIso;
     /** The cached contact information stored in the call log. */
     public final ContactInfo callLogInfo;
+    public final boolean isConf;
 
     public ContactInfoRequest(String number, String countryIso, ContactInfo callLogInfo) {
+        this(number, countryIso, callLogInfo, false);
+    }
+
+    public ContactInfoRequest(String number, String countryIso, ContactInfo callLogInfo,
+            boolean isConf) {
         this.number = number;
         this.countryIso = countryIso;
         this.callLogInfo = callLogInfo;
+        this.isConf = isConf;
     }
 
     @Override
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index 8dab294..0e89101 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -99,6 +99,9 @@
 import com.android.phone.common.dialpad.DialpadKeyButton;
 import com.android.phone.common.dialpad.DialpadView;
 
+import static android.Manifest.permission.READ_CALL_LOG;
+import static android.Manifest.permission.WRITE_CALL_LOG;
+
 import java.util.HashSet;
 import java.util.List;
 
@@ -113,8 +116,9 @@
         DialpadKeyButton.OnPressedListener {
     private static final String TAG = "DialpadFragment";
 
-    /* define for Activity permission request for Android6.0 */
+    /* define for Activity permission request for Android >= 6.0 */
     private static final int PERMISSION_REQUEST_CODE_LOCATION = 2;
+    private static final int READ_WRITE_CALL_LOG_PERMISSION_REQUEST_CODE = 3;
     /**
      * LinearLayout with getter and setter methods for the translationY property using floats,
      * for animation purposes.
@@ -192,7 +196,6 @@
     /** Stream type used to play the DTMF tones off call, and mapped to the volume control keys */
     private static final int DIAL_TONE_STREAM_TYPE = AudioManager.STREAM_DTMF;
 
-
     private OnDialpadQueryChangedListener mDialpadQueryListener;
 
     private DialpadView mDialpadView;
@@ -265,6 +268,8 @@
 
     private CallStateReceiver mCallStateReceiver;
 
+    private boolean mHasReadAndWriteCallLogPermission = false;
+
     private class CallStateReceiver extends BroadcastReceiver {
         /**
          * Receive call state changes so that we can take down the
@@ -752,8 +757,16 @@
         final StopWatch stopWatch = StopWatch.start("Dialpad.onResume");
 
         // Query the last dialed number. Do it first because hitting
+        mHasReadAndWriteCallLogPermission =
+                PermissionsUtil.hasPermission(getActivity(), READ_CALL_LOG) &&
+                PermissionsUtil.hasPermission(getActivity(), WRITE_CALL_LOG);
         // the DB is 'slow'. This call is asynchronous.
-        queryLastOutgoingCall();
+        if (mHasReadAndWriteCallLogPermission){
+            queryLastOutgoingCall();
+        } else {
+            ActivityCompat.requestPermissions(getActivity(), new String[] {READ_CALL_LOG,
+                    WRITE_CALL_LOG}, READ_WRITE_CALL_LOG_PERMISSION_REQUEST_CODE);
+        }
 
         stopWatch.lap("qloc");
 
@@ -2045,6 +2058,15 @@
                     handleDialButtonPressed();
                 }
                 break;
+            case READ_WRITE_CALL_LOG_PERMISSION_REQUEST_CODE:
+                for (int i = 0; i < grantResults.length; i++) {
+                    mHasReadAndWriteCallLogPermission &=
+                            PackageManager.PERMISSION_GRANTED == grantResults[i];
+                }
+                if (mHasReadAndWriteCallLogPermission) {
+                    queryLastOutgoingCall();
+                }
+                break;
             default:
                 super.onRequestPermissionsResult(requestCode, permissions, grantResults);
         }
diff --git a/src/com/android/dialer/util/DialerUtils.java b/src/com/android/dialer/util/DialerUtils.java
index 08827df..f2b04f9 100644
--- a/src/com/android/dialer/util/DialerUtils.java
+++ b/src/com/android/dialer/util/DialerUtils.java
@@ -51,6 +51,7 @@
 
     private static final String PREFS_MESSAGE = "video_call_welcome";
     private static final String KEY_STATE = "message-repeat";
+    private static final String KEY_FIRST_LAUNCH = "first-launch";
     /**
      * Attempts to start an activity and displays a toast with the default error message if the
      * activity is not found, instead of throwing an exception.
@@ -198,12 +199,25 @@
 
 
     /**
+     * @return true if it is the first launch.
+     */
+    public static boolean isFirstLaunch(Context context) {
+        final SharedPreferences prefs = context.getSharedPreferences(
+                PREFS_MESSAGE, Context.MODE_PRIVATE);
+        boolean isFirstLaunch = prefs.getBoolean(KEY_FIRST_LAUNCH, true);
+        if (isFirstLaunch) {
+            prefs.edit().putBoolean(KEY_FIRST_LAUNCH, false).apply();
+        }
+        return isFirstLaunch;
+    }
+
+    /**
      * @return true if the Welcome Screen shall be presented to the user, false otherwise.
      */
     public static boolean canShowWelcomeScreen(Context context) {
         final SharedPreferences prefs = context.getSharedPreferences(
                 PREFS_MESSAGE, Context.MODE_PRIVATE);
-        return prefs.getBoolean(KEY_STATE, true);
+        return prefs.getBoolean(KEY_STATE, false);
     }
 
 
@@ -218,4 +232,13 @@
                 PREFS_MESSAGE, Context.MODE_PRIVATE);
         prefs.edit().putBoolean(KEY_STATE, show).apply();
     }
+
+    /**
+     * @return true if calllog inserted earlier when dial a ConfURI call.
+     */
+    public static boolean isConferenceURICallLog(String number, String postDialDigits) {
+        return (number == null || number.contains(";") || number.contains(",")) &&
+                (postDialDigits == null || postDialDigits.equals(""));
+    }
+
 }
diff --git a/src/com/android/dialer/util/IntentUtil.java b/src/com/android/dialer/util/IntentUtil.java
index 8d47075..bb87a49 100644
--- a/src/com/android/dialer/util/IntentUtil.java
+++ b/src/com/android/dialer/util/IntentUtil.java
@@ -177,7 +177,8 @@
                     if (subRes.getBoolean(R.bool.config_enable_conference_dialer)) {
                         TelephonyManager telephonyMgr = (TelephonyManager) context.
                                 getSystemService(Context.TELEPHONY_SERVICE);
-                        isEnabled = telephonyMgr.isImsRegistered();
+                        isEnabled = telephonyMgr.isImsRegisteredForSubscriber(subInfo
+                                .getSubscriptionId());
                         if (isEnabled) {
                             break;
                         }