Enable timer in emergency call.

"This phone's number: xxx" is shown for emergency call which replaces in call
timer. This change move it to under emergency location service so timer could
be shown again.

Bug: 69810801
Test: manual
PiperOrigin-RevId: 177363955
Change-Id: I543fbbee869923800ffd92a5799819b712f0b953
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java
index f3c2af6..eb52216 100644
--- a/java/com/android/incallui/CallCardPresenter.java
+++ b/java/com/android/incallui/CallCardPresenter.java
@@ -212,7 +212,7 @@
 
     // Showing the location may have been skipped if the UI wasn't ready during previous layout.
     if (shouldShowLocation()) {
-      updatePrimaryDisplayInfo();
+      mInCallScreen.showLocationUi(getLocationFragment());
 
       // Log location impressions
       if (!hasLocationPermission()) {
@@ -801,33 +801,7 @@
   }
 
   private Fragment getLocationFragment() {
-    if (!ConfigProviderBindings.get(mContext)
-        .getBoolean(CONFIG_ENABLE_EMERGENCY_LOCATION, CONFIG_ENABLE_EMERGENCY_LOCATION_DEFAULT)) {
-      LogUtil.i("CallCardPresenter.getLocationFragment", "disabled by config.");
-      return null;
-    }
     if (!shouldShowLocation()) {
-      LogUtil.i("CallCardPresenter.getLocationFragment", "shouldn't show location");
-      return null;
-    }
-    if (!hasLocationPermission()) {
-      LogUtil.i("CallCardPresenter.getLocationFragment", "no location permission.");
-      return null;
-    }
-    if (isBatteryTooLowForEmergencyLocation()) {
-      LogUtil.i("CallCardPresenter.getLocationFragment", "low battery.");
-      return null;
-    }
-    if (ActivityCompat.isInMultiWindowMode(mInCallScreen.getInCallScreenFragment().getActivity())) {
-      LogUtil.i("CallCardPresenter.getLocationFragment", "in multi-window mode");
-      return null;
-    }
-    if (mPrimary.isVideoCall()) {
-      LogUtil.i("CallCardPresenter.getLocationFragment", "emergency video calls not supported");
-      return null;
-    }
-    if (!callLocation.canGetLocation(mContext)) {
-      LogUtil.i("CallCardPresenter.getLocationFragment", "can't get current location");
       return null;
     }
     LogUtil.i("CallCardPresenter.getLocationFragment", "returning location fragment");
@@ -835,6 +809,39 @@
   }
 
   private boolean shouldShowLocation() {
+    if (!ConfigProviderBindings.get(mContext)
+        .getBoolean(CONFIG_ENABLE_EMERGENCY_LOCATION, CONFIG_ENABLE_EMERGENCY_LOCATION_DEFAULT)) {
+      LogUtil.i("CallCardPresenter.getLocationFragment", "disabled by config.");
+      return false;
+    }
+    if (!isPotentialEmergencyCall()) {
+      LogUtil.i("CallCardPresenter.getLocationFragment", "shouldn't show location");
+      return false;
+    }
+    if (!hasLocationPermission()) {
+      LogUtil.i("CallCardPresenter.getLocationFragment", "no location permission.");
+      return false;
+    }
+    if (isBatteryTooLowForEmergencyLocation()) {
+      LogUtil.i("CallCardPresenter.getLocationFragment", "low battery.");
+      return false;
+    }
+    if (ActivityCompat.isInMultiWindowMode(mInCallScreen.getInCallScreenFragment().getActivity())) {
+      LogUtil.i("CallCardPresenter.getLocationFragment", "in multi-window mode");
+      return false;
+    }
+    if (mPrimary.isVideoCall()) {
+      LogUtil.i("CallCardPresenter.getLocationFragment", "emergency video calls not supported");
+      return false;
+    }
+    if (!callLocation.canGetLocation(mContext)) {
+      LogUtil.i("CallCardPresenter.getLocationFragment", "can't get current location");
+      return false;
+    }
+    return true;
+  }
+
+  private boolean isPotentialEmergencyCall() {
     if (isOutgoingEmergencyCall(mPrimary)) {
       LogUtil.i("CallCardPresenter.shouldShowLocation", "new emergency call");
       return true;
diff --git a/java/com/android/incallui/answer/impl/AnswerFragment.java b/java/com/android/incallui/answer/impl/AnswerFragment.java
index 4362a99..d687b6e 100644
--- a/java/com/android/incallui/answer/impl/AnswerFragment.java
+++ b/java/com/android/incallui/answer/impl/AnswerFragment.java
@@ -694,6 +694,8 @@
     updateImportanceBadgeVisibility();
 
     contactGridManager = new ContactGridManager(view, null, 0, false /* showAnonymousAvatar */);
+    boolean isInMultiWindowMode = ActivityCompat.isInMultiWindowMode(getActivity());
+    contactGridManager.onMultiWindowModeChanged(isInMultiWindowMode);
 
     Fragment answerMethod =
         getChildFragmentManager().findFragmentById(R.id.answer_method_container);
@@ -712,7 +714,7 @@
     initSecondaryButton();
 
     int flags = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
-    if (!ActivityCompat.isInMultiWindowMode(getActivity())
+    if (!isInMultiWindowMode
         && (getActivity().checkSelfPermission(permission.STATUS_BAR)
             == PackageManager.PERMISSION_GRANTED)) {
       LogUtil.i("AnswerFragment.onCreateView", "STATUS_BAR permission granted, disabling nav bar");
diff --git a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml
index d79da88..b17fc73 100644
--- a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml
+++ b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml
@@ -131,6 +131,11 @@
           android:layout_width="match_parent"
           android:layout_height="wrap_content"/>
 
+      <include
+          layout="@layout/device_number_row"
+          android:layout_width="match_parent"
+          android:layout_height="wrap_content"/>
+
       <FrameLayout
           android:id="@+id/incall_data_container"
           android:layout_width="match_parent"
diff --git a/java/com/android/incallui/calllocation/impl/res/layout/location_fragment.xml b/java/com/android/incallui/calllocation/impl/res/layout/location_fragment.xml
index 53188eb..b1601f9 100644
--- a/java/com/android/incallui/calllocation/impl/res/layout/location_fragment.xml
+++ b/java/com/android/incallui/calllocation/impl/res/layout/location_fragment.xml
@@ -17,117 +17,116 @@
 -->
 
 <ViewAnimator xmlns:android="http://schemas.android.com/apk/res/android"
-  xmlns:tools="http://schemas.android.com/tools"
-  android:id="@+id/location_view_animator"
-  android:layout_width="match_parent"
-  android:layout_height="wrap_content"
-  android:layout_marginTop="16dp"
-  android:layout_marginBottom="16dp"
-  android:background="@drawable/bg_location_card"
-  android:elevation="2dp"
-  android:inAnimation="@android:anim/fade_in"
-  android:measureAllChildren="true"
-  android:outAnimation="@android:anim/fade_out">
-
-  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/location_loading_layout"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/location_view_animator"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:layout_gravity="center_vertical"
-    android:orientation="vertical">
+    android:layout_marginTop="16dp"
+    android:background="@drawable/bg_location_card"
+    android:elevation="2dp"
+    android:inAnimation="@android:anim/fade_in"
+    android:measureAllChildren="true"
+    android:outAnimation="@android:anim/fade_out">
+
+  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+      android:id="@+id/location_loading_layout"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_gravity="center_vertical"
+      android:orientation="vertical">
 
     <ProgressBar
-      android:id="@+id/location_loading_spinner"
-      android:layout_width="wrap_content"
-      android:layout_height="wrap_content"
-      android:layout_marginTop="28dp"
-      android:layout_marginBottom="12dp"
-      android:layout_gravity="center_horizontal"/>
+        android:id="@+id/location_loading_spinner"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="28dp"
+        android:layout_marginBottom="12dp"
+        android:layout_gravity="center_horizontal"/>
 
     <TextView
-      android:id="@+id/location_loading_text"
-      style="@style/LocationLoadingTextStyle"
-      android:layout_width="match_parent"
-      android:layout_height="24sp"
-      android:layout_marginBottom="20dp"
-      android:layout_marginStart="24dp"
-      android:layout_marginEnd="24dp"
-      android:gravity="center"
-      android:text="@string/location_loading"/>
+        android:id="@+id/location_loading_text"
+        style="@style/LocationLoadingTextStyle"
+        android:layout_width="match_parent"
+        android:layout_height="24sp"
+        android:layout_marginBottom="20dp"
+        android:layout_marginStart="24dp"
+        android:layout_marginEnd="24dp"
+        android:gravity="center"
+        android:text="@string/location_loading"/>
 
   </LinearLayout>
 
   <GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/location_layout"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:layout_gravity="center"
-    android:columnCount="2"
-    android:orientation="horizontal">
+      android:id="@+id/location_layout"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_gravity="center"
+      android:columnCount="2"
+      android:orientation="horizontal">
 
     <TextView
-      android:id="@+id/location_address_title"
-      style="@style/LocationAddressTitleTextStyle"
-      android:layout_width="0dp"
-      android:layout_height="20sp"
-      android:layout_marginTop="16dp"
-      android:layout_marginBottom="4dp"
-      android:layout_marginStart="16dp"
-      android:layout_columnWeight="1"
-      android:text="@string/location_title"/>
+        android:id="@+id/location_address_title"
+        style="@style/LocationAddressTitleTextStyle"
+        android:layout_width="0dp"
+        android:layout_height="20sp"
+        android:layout_marginTop="16dp"
+        android:layout_marginBottom="4dp"
+        android:layout_marginStart="16dp"
+        android:layout_columnWeight="1"
+        android:text="@string/location_title"/>
 
     <ImageView
-      android:id="@+id/location_map"
-      android:layout_width="@dimen/location_map_width"
-      android:layout_height="@dimen/location_map_height"
-      android:layout_margin="16dp"
-      android:layout_gravity="end|center_vertical"
-      android:layout_rowSpan="4"
-      android:contentDescription="@string/location_map_description"
-      android:scaleType="centerCrop"
-      android:visibility="invisible"
-      tools:src="?android:colorPrimaryDark"
-      tools:visibility="visible"/>
+        android:id="@+id/location_map"
+        android:layout_width="@dimen/location_map_width"
+        android:layout_height="@dimen/location_map_height"
+        android:layout_margin="16dp"
+        android:layout_gravity="end|center_vertical"
+        android:layout_rowSpan="4"
+        android:contentDescription="@string/location_map_description"
+        android:scaleType="centerCrop"
+        android:visibility="invisible"
+        tools:src="?android:colorPrimaryDark"
+        tools:visibility="visible"/>
 
     <TextView
-      android:id="@+id/address_line_one"
-      style="@style/LocationAddressTextStyle"
-      android:layout_width="0dp"
-      android:layout_height="24sp"
-      android:layout_marginStart="16dp"
-      android:layout_columnWeight="1"
-      android:ellipsize="end"
-      android:lines="1"
-      android:visibility="invisible"
-      tools:text="1600 Amphitheatre Pkwy And a bit"
-      tools:visibility="visible"/>
+        android:id="@+id/address_line_one"
+        style="@style/LocationAddressTextStyle"
+        android:layout_width="0dp"
+        android:layout_height="24sp"
+        android:layout_marginStart="16dp"
+        android:layout_columnWeight="1"
+        android:ellipsize="end"
+        android:lines="1"
+        android:visibility="invisible"
+        tools:text="1600 Amphitheatre Pkwy And a bit"
+        tools:visibility="visible"/>
 
     <TextView
-      android:id="@+id/address_line_two"
-      style="@style/LocationAddressTextStyle"
-      android:layout_width="0dp"
-      android:layout_height="24sp"
-      android:layout_marginStart="16dp"
-      android:layout_columnWeight="1"
-      android:ellipsize="end"
-      android:lines="1"
-      android:visibility="invisible"
-      tools:text="Mountain View, CA 94043"
-      tools:visibility="visible"/>
+        android:id="@+id/address_line_two"
+        style="@style/LocationAddressTextStyle"
+        android:layout_width="0dp"
+        android:layout_height="24sp"
+        android:layout_marginStart="16dp"
+        android:layout_columnWeight="1"
+        android:ellipsize="end"
+        android:lines="1"
+        android:visibility="invisible"
+        tools:text="Mountain View, CA 94043"
+        tools:visibility="visible"/>
 
     <TextView
-      android:id="@+id/lat_long_line"
-      style="@style/LocationLatLongTextStyle"
-      android:layout_width="0dp"
-      android:layout_height="24sp"
-      android:layout_marginBottom="12dp"
-      android:layout_marginStart="16dp"
-      android:layout_columnWeight="1"
-      android:ellipsize="end"
-      android:lines="1"
-      android:visibility="invisible"
-      tools:text="Lat: 37.421719, Long: -122.085297"
-      tools:visibility="visible"/>
+        android:id="@+id/lat_long_line"
+        style="@style/LocationLatLongTextStyle"
+        android:layout_width="0dp"
+        android:layout_height="24sp"
+        android:layout_marginBottom="12dp"
+        android:layout_marginStart="16dp"
+        android:layout_columnWeight="1"
+        android:ellipsize="end"
+        android:lines="1"
+        android:visibility="invisible"
+        tools:text="Lat: 37.421719, Long: -122.085297"
+        tools:visibility="visible"/>
 
   </GridLayout>
 
diff --git a/java/com/android/incallui/contactgrid/BottomRow.java b/java/com/android/incallui/contactgrid/BottomRow.java
index a0d1185..f9fc870 100644
--- a/java/com/android/incallui/contactgrid/BottomRow.java
+++ b/java/com/android/incallui/contactgrid/BottomRow.java
@@ -97,10 +97,6 @@
       if (TextUtils.isEmpty(label)) {
         label = context.getString(R.string.incall_call_ended);
       }
-    } else if (!TextUtils.isEmpty(state.callbackNumber)) {
-      // This is used for carriers like Project Fi to show the callback number for emergency calls.
-      label = context.getString(R.string.contact_grid_callback_number, state.callbackNumber);
-      isTimerVisible = false;
     } else {
       label = getLabelForPhoneNumber(primaryInfo);
       shouldPopulateAccessibilityEvent = primaryInfo.nameIsNumber;
diff --git a/java/com/android/incallui/contactgrid/ContactGridManager.java b/java/com/android/incallui/contactgrid/ContactGridManager.java
index 8deee82..1bac978 100644
--- a/java/com/android/incallui/contactgrid/ContactGridManager.java
+++ b/java/com/android/incallui/contactgrid/ContactGridManager.java
@@ -81,9 +81,14 @@
   private boolean middleRowVisible = true;
   private boolean isTimerStarted;
 
+  // Row in emergency call: This phone's number: +1 (650) 253-0000
+  private final TextView deviceNumberTextView;
+  private final View deviceNumberDivider;
+
   private PrimaryInfo primaryInfo = PrimaryInfo.createEmptyPrimaryInfo();
   private PrimaryCallState primaryCallState = PrimaryCallState.createEmptyPrimaryCallState();
   private final LetterTileDrawable letterTile;
+  private boolean isInMultiWindowMode;
 
   public ContactGridManager(
       View view, @Nullable ImageView avatarImageView, int avatarSize, boolean showAnonymousAvatar) {
@@ -109,6 +114,9 @@
     contactGridLayout = (View) contactNameTextView.getParent();
     letterTile = new LetterTileDrawable(context.getResources());
     isTimerStarted = false;
+
+    deviceNumberTextView = view.findViewById(R.id.contactgrid_device_number_text);
+    deviceNumberDivider = view.findViewById(R.id.contactgrid_location_divider);
   }
 
   public void show() {
@@ -148,6 +156,7 @@
     this.primaryInfo = primaryInfo;
     updatePrimaryNameAndPhoto();
     updateBottomRow();
+    updateDeviceNumberRow();
   }
 
   public void setCallState(PrimaryCallState primaryCallState) {
@@ -155,6 +164,7 @@
     updatePrimaryNameAndPhoto();
     updateBottomRow();
     updateTopRow();
+    updateDeviceNumberRow();
   }
 
   public void dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
@@ -174,6 +184,14 @@
     updatePrimaryNameAndPhoto();
   }
 
+  public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
+    if (this.isInMultiWindowMode == isInMultiWindowMode) {
+      return;
+    }
+    this.isInMultiWindowMode = isInMultiWindowMode;
+    updateDeviceNumberRow();
+  }
+
   private void dispatchPopulateAccessibilityEvent(AccessibilityEvent event, View view) {
     final List<CharSequence> eventText = event.getText();
     int size = eventText.size();
@@ -379,4 +397,19 @@
       isTimerStarted = false;
     }
   }
+
+  private void updateDeviceNumberRow() {
+    if (isInMultiWindowMode || TextUtils.isEmpty(primaryCallState.callbackNumber)) {
+      deviceNumberTextView.setVisibility(View.GONE);
+      deviceNumberDivider.setVisibility(View.GONE);
+      return;
+    }
+    // This is used for carriers like Project Fi to show the callback number for emergency calls.
+    deviceNumberTextView.setText(
+        context.getString(R.string.contact_grid_callback_number, primaryCallState.callbackNumber));
+    deviceNumberTextView.setVisibility(View.VISIBLE);
+    if (primaryInfo.shouldShowLocation) {
+      deviceNumberDivider.setVisibility(View.VISIBLE);
+    }
+  }
 }
diff --git a/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml b/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml
new file mode 100644
index 0000000..4f8bbad
--- /dev/null
+++ b/java/com/android/incallui/contactgrid/res/layout/device_number_row.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2017 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+  <View
+      android:id="@+id/contactgrid_location_divider"
+      android:layout_width="match_parent"
+      android:layout_height="1dp"
+      android:layout_gravity="bottom"
+      android:background="#D8D8D8"
+      android:visibility="gone"/>
+
+  <TextView
+      android:id="@+id/contactgrid_device_number_text"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_marginBottom="16dp"
+      android:padding="16dp"
+      android:background="@android:color/white"
+      android:elevation="2dp"
+      android:gravity="start"
+      android:orientation="vertical"
+      android:textColor="#DD000000"
+      android:textSize="16sp"
+      android:visibility="gone"/>
+</merge>
\ No newline at end of file
diff --git a/java/com/android/incallui/contactgrid/res/values/ids.xml b/java/com/android/incallui/contactgrid/res/values/ids.xml
index f3b111a..03f5a3d 100644
--- a/java/com/android/incallui/contactgrid/res/values/ids.xml
+++ b/java/com/android/incallui/contactgrid/res/values/ids.xml
@@ -29,4 +29,6 @@
   <item name="contactgrid_top_row" type="id"/>
   <item name="contactgrid_bottom_row" type="id"/>
   <item name="contactgrid_top_row_space" type="id"/>
+  <item name="contactgrid_location_divider" type="id"/>
+  <item name="contactgrid_device_number_text" type="id"/>
 </resources>
diff --git a/java/com/android/incallui/incall/impl/InCallFragment.java b/java/com/android/incallui/incall/impl/InCallFragment.java
index 73b414d..a4dcd72 100644
--- a/java/com/android/incallui/incall/impl/InCallFragment.java
+++ b/java/com/android/incallui/incall/impl/InCallFragment.java
@@ -42,6 +42,7 @@
 import com.android.dialer.common.Assert;
 import com.android.dialer.common.FragmentUtils;
 import com.android.dialer.common.LogUtil;
+import com.android.dialer.compat.ActivityCompat;
 import com.android.dialer.logging.DialerImpression;
 import com.android.dialer.logging.Logger;
 import com.android.dialer.multimedia.MultimediaData;
@@ -153,6 +154,7 @@
             (ImageView) view.findViewById(R.id.contactgrid_avatar),
             getResources().getDimensionPixelSize(R.dimen.incall_avatar_size),
             true /* showAnonymousAvatar */);
+    contactGridManager.onMultiWindowModeChanged(ActivityCompat.isInMultiWindowMode(getActivity()));
 
     paginator = (InCallPaginator) view.findViewById(R.id.incall_paginator);
     pager = (LockableViewPager) view.findViewById(R.id.incall_pager);
@@ -258,18 +260,9 @@
       // Hide the avatar to make room for location
       contactGridManager.setAvatarHidden(true);
 
-      // Need to widen the contact grid to fit location information
-      View contactGridView = getView().findViewById(R.id.incall_contact_grid);
-      ViewGroup.LayoutParams params = contactGridView.getLayoutParams();
-      if (params instanceof ViewGroup.MarginLayoutParams) {
-        ((ViewGroup.MarginLayoutParams) params).setMarginStart(0);
-        ((ViewGroup.MarginLayoutParams) params).setMarginEnd(0);
-      }
-      contactGridView.setLayoutParams(params);
-
       // Need to let the dialpad move up a little further when location info is being shown
       View dialpadView = getView().findViewById(R.id.incall_dialpad_container);
-      params = dialpadView.getLayoutParams();
+      ViewGroup.LayoutParams params = dialpadView.getLayoutParams();
       if (params instanceof RelativeLayout.LayoutParams) {
         ((RelativeLayout.LayoutParams) params).removeRule(RelativeLayout.BELOW);
       }
@@ -560,6 +553,7 @@
       // Need to show or hide location
       showLocationUi(isInMultiWindowMode ? null : getLocationFragment());
     }
+    contactGridManager.onMultiWindowModeChanged(isInMultiWindowMode);
   }
 
   private Fragment getLocationFragment() {
diff --git a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml
index 73b9c26..ccec8a4 100644
--- a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml
+++ b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml
@@ -36,8 +36,6 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginTop="12dp"
-        android:layout_marginStart="@dimen/incall_window_margin_horizontal"
-        android:layout_marginEnd="@dimen/incall_window_margin_horizontal"
         android:gravity="center_horizontal"
         android:orientation="vertical">
 
@@ -51,7 +49,9 @@
       <include
           layout="@layout/incall_contactgrid_top_row"
           android:layout_width="wrap_content"
-          android:layout_height="wrap_content"/>
+          android:layout_height="wrap_content"
+          android:layout_marginStart="@dimen/incall_window_margin_horizontal"
+          android:layout_marginEnd="@dimen/incall_window_margin_horizontal"/>
 
       <!-- We have to keep deprecated singleLine to allow long text being truncated with ellipses.
                  a bug -->
@@ -60,6 +60,8 @@
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_marginBottom="4dp"
+          android:layout_marginStart="@dimen/incall_window_margin_horizontal"
+          android:layout_marginEnd="@dimen/incall_window_margin_horizontal"
           android:singleLine="true"
           android:textAppearance="@style/Dialer.Incall.TextAppearance.Large"
           app:autoResizeText_minTextSize="28sp"
@@ -69,12 +71,19 @@
       <include
           layout="@layout/incall_contactgrid_bottom_row"
           android:layout_width="wrap_content"
-          android:layout_height="wrap_content"/>
+          android:layout_height="wrap_content"
+          android:layout_marginStart="@dimen/incall_window_margin_horizontal"
+          android:layout_marginEnd="@dimen/incall_window_margin_horizontal"/>
 
       <FrameLayout
           android:id="@+id/incall_location_holder"
           android:layout_width="match_parent"
           android:layout_height="match_parent"/>
+
+      <include
+          layout="@layout/device_number_row"
+          android:layout_width="match_parent"
+          android:layout_height="wrap_content"/>
     </LinearLayout>
 
     <com.android.dialer.widget.LockableViewPager
@@ -123,6 +132,6 @@
       android:layout_width="match_parent"
       android:layout_height="0dp"
       android:layout_gravity="bottom"
-      android:visibility="gone"
-      android:background="@android:color/background_dark"/>
+      android:background="@android:color/background_dark"
+      android:visibility="gone"/>
 </FrameLayout>