Merge "Add text to RTT setting when roaming" am: c7e4274759 am: 2ab4f3283f
am: 17cfdf8b0b

Change-Id: I692790410108da8fcb86223010b173a4eb3b8621
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 938d714..f744bdf 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -62,6 +62,7 @@
     <protected-broadcast android:name= "com.android.internal.telephony.CARRIER_SIGNAL_RESET" />
     <protected-broadcast android:name= "com.android.internal.telephony.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE" />
     <protected-broadcast android:name= "com.android.internal.telephony.ACTION_LINE1_NUMBER_ERROR_DETECTED" />
+    <protected-broadcast android:name= "com.android.internal.telephony.ACTION_REPORT_RADIO_BUG" />
     <protected-broadcast android:name= "com.android.internal.provider.action.VOICEMAIL_SMS_RECEIVED" />
     <protected-broadcast android:name= "com.android.intent.isim_refresh" />
     <protected-broadcast android:name= "com.android.ims.ACTION_RCS_SERVICE_AVAILABLE" />
diff --git a/assets/eri_311480_BA01450000000000.xml b/assets/eri_311480_BA01450000000000.xml
new file mode 100644
index 0000000..ea18c73
--- /dev/null
+++ b/assets/eri_311480_BA01450000000000.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** 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.
+*/
+-->
+
+<!-- Note that IconMode can be only 0, ON or 1, FLASHING
+     The icon is turned OFF if then IconIndex = 1 -->
+
+<EriFile VersionNumber="7"
+    NumberOfEriEntries="7"
+    EriFileType="2">
+
+  <CallPromptId Id="0"
+      CallPromptText="CallPromptId0"/>
+
+  <CallPromptId Id="1"
+      CallPromptText="CallPromptId1"/>
+
+  <CallPromptId Id="2"
+      CallPromptText="CallPromptId2"/>
+
+  <EriInfo RoamingIndicator="64"
+      IconIndex="1"
+      IconMode="0"
+      EriText="Xfinity Mobile"
+      CallPromptId="0"
+      AlertId="0"
+      DataServiceSupport="1"/>
+
+  <EriInfo RoamingIndicator="65"
+      IconIndex="1"
+      IconMode="0"
+      EriText="Xfinity Mobile"
+      CallPromptId="0"
+      AlertId="0"
+      DataServiceSupport="1"/>
+
+  <EriInfo RoamingIndicator="66"
+      IconIndex="1"
+      IconMode="0"
+      EriText="Extended Network"
+      CallPromptId="0"
+      AlertId="4"
+      DataServiceSupport="0"/>
+
+  <EriInfo RoamingIndicator="67"
+      IconIndex="0"
+      IconMode="0"
+      EriText="Extended Network"
+      CallPromptId="0"
+      AlertId="4"
+      DataServiceSupport="0"/>
+
+  <EriInfo RoamingIndicator="68"
+      IconIndex="0"
+      IconMode="0"
+      EriText="Roaming"
+      CallPromptId="0"
+      AlertId="5"
+      DataServiceSupport="0"/>
+
+  <EriInfo RoamingIndicator="69"
+      IconIndex="2"
+      IconMode="0"
+      EriText="Extended Network"
+      CallPromptId="0"
+      AlertId="4"
+      DataServiceSupport="0"/>
+
+  <EriInfo RoamingIndicator="70"
+      IconIndex="2"
+      IconMode="0"
+      EriText="Roaming"
+      CallPromptId="0"
+      AlertId="5"
+      DataServiceSupport="0"/>
+
+</EriFile>
diff --git a/res/drawable/btn_emergency_information.xml b/res/drawable/btn_emergency_information.xml
index 29b4a7a..cd57bd3 100644
--- a/res/drawable/btn_emergency_information.xml
+++ b/res/drawable/btn_emergency_information.xml
@@ -16,7 +16,7 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
     <corners android:radius="8dp"/>
-    <!-- White, Opacity 16% -->
+    <solid android:color="@color/emergency_info_btn_background_color"/>
     <stroke android:width="1dp"
-            android:color="#40FFFFFF"/>
-</shape>
\ No newline at end of file
+            android:color="@color/emergency_info_btn_bolder"/>
+</shape>
diff --git a/res/drawable/btn_emergency_shortcuts.xml b/res/drawable/btn_emergency_shortcuts.xml
index 449e4e0..9717e81 100644
--- a/res/drawable/btn_emergency_shortcuts.xml
+++ b/res/drawable/btn_emergency_shortcuts.xml
@@ -17,4 +17,4 @@
        android:shape="rectangle">
     <corners android:radius="8dp"/>
     <solid android:color="@color/emergency_shortcut_button_background_color"/>
-</shape>
\ No newline at end of file
+</shape>
diff --git a/res/drawable/phone_type_icon_background.xml b/res/drawable/phone_type_icon_background.xml
index b51c3b2..352db2e 100644
--- a/res/drawable/phone_type_icon_background.xml
+++ b/res/drawable/phone_type_icon_background.xml
@@ -15,5 +15,5 @@
 -->
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval">
-    <solid android:color="@color/emergency_shortcut_confirm_button_background_color"/>
-</shape>
\ No newline at end of file
+    <solid android:color="@color/emergency_shortcut_phone_type_icon_color"/>
+</shape>
diff --git a/res/layout/emergency_dialer.xml b/res/layout/emergency_dialer.xml
index 6247379..bea01fe 100644
--- a/res/layout/emergency_dialer.xml
+++ b/res/layout/emergency_dialer.xml
@@ -46,7 +46,9 @@
                 android:layout_height="@dimen/dialpad_button_height"
                 android:background="@drawable/floating_action_button_red"
                 android:contentDescription="@string/description_dialpad_button"
-                android:src="@drawable/ic_dialpad_white_24"/>
+                android:src="@drawable/ic_dialpad_white_24"
+                android:scaleType="centerInside"
+                android:backgroundTint="@color/emergency_dialpad_fab_tint_color"/>
         </FrameLayout>
     </FrameLayout>
 
diff --git a/res/layout/emergency_information.xml b/res/layout/emergency_information.xml
index 524387f..3ed1748 100644
--- a/res/layout/emergency_information.xml
+++ b/res/layout/emergency_information.xml
@@ -19,7 +19,8 @@
     android:layout_height="@dimen/emergency_info_button_height"
     android:layout_width="match_parent"
     android:layout_marginHorizontal="@dimen/emergency_shortcut_buttons_margin_horizontal"
-    android:layout_marginVertical="@dimen/emergency_info_button_margin_vertical">
+    android:layout_marginTop="@dimen/emergency_info_button_margin_top"
+    android:layout_marginBottom="@dimen/emergency_info_button_margin_bottom">
     <FrameLayout
         android:id="@+id/emergency_info_view"
         android:layout_height="match_parent"
@@ -38,7 +39,7 @@
                 android:layout_marginEnd="@dimen/emergency_dialer_image_margin_end"
                 android:layout_height="@dimen/emergency_info_image_height"
                 android:layout_width="@dimen/emergency_info_image_width"
-                android:scaleType="centerCrop"/>
+                android:scaleType="centerInside"/>
             <LinearLayout
                 android:layout_height="wrap_content"
                 android:layout_width="match_parent"
@@ -53,8 +54,7 @@
                     android:maxLines="1"
                     android:ellipsize="end"
                     android:lineHeight="@dimen/emergency_info_name_line_height"
-                    android:fontFamily="@*android:string/config_headlineFontFamily"
-                    android:textAppearance="@style/HeadlineTextAppearance"/>
+                    android:textAppearance="@style/EmergencyInfoNameTextAppearance"/>
                 <TextView
                     android:id="@+id/emergency_info_hint"
                     android:layout_height="wrap_content"
@@ -62,8 +62,7 @@
                     android:maxLines="2"
                     android:ellipsize="end"
                     android:lineHeight="@dimen/emergency_info_hint_line_height"
-                    android:alpha="0.7"
-                    android:textAppearance="@style/SubtitleTextAppearance"
+                    android:textAppearance="@style/EmergencyInfoHintTextAppearance"
                     android:text="@string/emergency_information_hint"/>
             </LinearLayout>
         </LinearLayout>
@@ -88,7 +87,7 @@
                 android:layout_width="@dimen/emergency_info_image_width"
                 android:layout_marginStart="@dimen/emergency_dialer_image_margin_start"
                 android:layout_marginEnd="@dimen/emergency_dialer_image_margin_end"
-                android:scaleType="centerCrop"/>
+                android:scaleType="centerInside"/>
             <TextView
                 android:id="@+id/confirmed_emergency_info"
                 android:layout_height="wrap_content"
@@ -99,8 +98,7 @@
                 android:maxLines="2"
                 android:ellipsize="end"
                 android:lineHeight="@dimen/confirmed_emergency_info_line_height"
-                android:fontFamily="@*android:string/config_headlineFontFamily"
-                android:textAppearance="@style/PhoneCallHintTextAppearance"
+                android:textAppearance="@style/EmergencyInfoTapHintTextAppearance"
                 android:text="@string/emergency_information_confirm_hint"/>
         </LinearLayout>
     </FrameLayout>
diff --git a/res/layout/emergency_shortcut_button.xml b/res/layout/emergency_shortcut_button.xml
index 3c5eaa2..ce4d60e 100644
--- a/res/layout/emergency_shortcut_button.xml
+++ b/res/layout/emergency_shortcut_button.xml
@@ -16,7 +16,8 @@
 <com.android.phone.EmergencyShortcutButton
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_height="@dimen/emergency_shortcut_button_height"
-    android:layout_width="match_parent">
+    android:layout_width="match_parent"
+    android:layout_marginBottom="@dimen/emergency_shortcut_button_margin_bottom">
     <!-- Normal emergency call button view -->
     <FrameLayout
         android:id="@+id/emergency_call_number_info_view"
@@ -42,7 +43,8 @@
                     android:id="@+id/phone_type_icon"
                     android:layout_width="@dimen/phone_number_type_image_height"
                     android:layout_height="@dimen/phone_number_type_image_width"
-                    android:layout_gravity="center"/>
+                    android:layout_gravity="center"
+                    android:scaleType="centerInside"/>
             </FrameLayout>
             <LinearLayout
                 android:layout_height="wrap_content"
@@ -57,7 +59,6 @@
                     android:maxLines="1"
                     android:ellipsize="end"
                     android:lineHeight="@dimen/phone_number_line_height"
-                    android:fontFamily="@*android:string/config_headlineFontFamily"
                     android:textAppearance="@style/PhoneNumberTextAppearance"/>
                 <TextView
                     android:id="@+id/phone_number_description"
@@ -66,8 +67,7 @@
                     android:alpha="0.7"
                     android:maxLines="1"
                     android:ellipsize="end"
-                    android:fontFamily="sans-serif-medium"
-                    android:textAppearance="@style/SubtitleTextAppearance"/>
+                    android:textAppearance="@style/PhoneNumberTypeAppearance"/>
             </LinearLayout>
         </LinearLayout>
         <FrameLayout
@@ -79,7 +79,9 @@
                 android:id="@+id/microphone_icon"
                 android:layout_height="@dimen/phone_icon_height"
                 android:layout_width="@dimen/phone_icon_width"
-                android:src="@drawable/ic_emergency_callback_mode"/>
+                android:src="@drawable/ic_emergency_callback_mode"
+                android:tint="@color/emergency_call_icon_color"
+                android:scaleType="centerInside"/>
         </FrameLayout>
     </FrameLayout>
 
@@ -111,6 +113,7 @@
                     android:layout_width="@dimen/phone_number_type_image_height"
                     android:layout_height="@dimen/phone_number_type_image_width"
                     android:layout_gravity="center"
+                    android:scaleType="centerInside"
                     android:tint="@color/emergency_shortcut_confirm_button_background_color"/>
             </FrameLayout>
             <FrameLayout
@@ -124,8 +127,7 @@
                     android:maxLines="2"
                     android:ellipsize="end"
                     android:lineHeight="@dimen/phone_call_hint_line_height"
-                    android:fontFamily="@*android:string/config_headlineFontFamily"
-                    android:textAppearance="@style/PhoneCallHintTextAppearance"/>
+                    android:textAppearance="@style/PhoneNumberTapHintAppearance"/>
             </FrameLayout>
         </LinearLayout>
         <FrameLayout
@@ -137,7 +139,9 @@
             <ImageView
                 android:layout_height="@dimen/phone_icon_height"
                 android:layout_width="@dimen/phone_icon_width"
-                android:src="@drawable/ic_emergency_callback_mode"/>
+                android:src="@drawable/ic_emergency_callback_mode"
+                android:tint="@color/emergency_call_icon_color"
+                android:scaleType="centerInside"/>
         </FrameLayout>
     </FrameLayout>
 </com.android.phone.EmergencyShortcutButton>
diff --git a/res/layout/emergency_shortcut_buttons_group.xml b/res/layout/emergency_shortcut_buttons_group.xml
index 54563c9..8e2c256 100644
--- a/res/layout/emergency_shortcut_buttons_group.xml
+++ b/res/layout/emergency_shortcut_buttons_group.xml
@@ -37,8 +37,7 @@
                 android:maxLines="2"
                 android:ellipsize="end"
                 android:lineHeight="@dimen/emergency_number_title_line_height"
-                android:fontFamily="sans-serif-medium"
-                android:textColor="@android:color/white"
+                android:textAppearance="@style/ShortcutViewHintTextAppearance"
                 android:textSize="@dimen/emergency_number_title_text_size"
                 android:text="@string/single_emergency_number_title"/>
         </FrameLayout>
@@ -49,13 +48,13 @@
             android:layout_marginStart="@dimen/emergency_number_title_container_width"
             android:layout_gravity="center_vertical|end"
             android:gravity="center_vertical"
-            android:orientation="horizontal"
-            android:alpha="0.7">
+            android:orientation="horizontal">
             <ImageView
                 android:id="@+id/location_icon"
                 android:layout_width="@dimen/location_image_width"
                 android:layout_height="@dimen/location_image_height"
-                android:src="@drawable/place_gm2_24px"/>
+                android:src="@drawable/place_gm2_24px"
+                android:scaleType="centerInside"/>
             <TextView
                 android:id="@+id/location_text"
                 android:layout_height="wrap_content"
@@ -64,7 +63,7 @@
                 android:maxLines="2"
                 android:ellipsize="end"
                 android:lineHeight="@dimen/location_text_line_height"
-                android:textColor="@android:color/white"
+                android:textAppearance="@style/ShortcutViewHintTextAppearance"
                 android:textSize="@dimen/emergency_location_text_size"/>
         </LinearLayout>
     </FrameLayout>
@@ -73,8 +72,6 @@
         android:layout_height="wrap_content"
         android:layout_width="match_parent"
         android:layout_marginHorizontal="@dimen/emergency_shortcut_buttons_margin_horizontal"
-        android:orientation="vertical"
-        android:divider="@drawable/emergency_shortcuts_divider"
-        android:showDividers="middle">
+        android:orientation="vertical">
     </LinearLayout>
 </LinearLayout>
diff --git a/res/values-h535dp/dimens.xml b/res/values-h535dp/dimens.xml
new file mode 100644
index 0000000..c3b2341
--- /dev/null
+++ b/res/values-h535dp/dimens.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+
+<resources>
+    <!-- Height and vertical margin for the emergency information button. -->
+    <dimen name="emergency_info_button_height">80dp</dimen>
+    <dimen name="emergency_info_button_margin_top">35dp</dimen>
+    <dimen name="emergency_info_button_margin_bottom">40dp</dimen>
+
+    <!-- The text size of emergency info name and hint -->
+    <dimen name="emergency_info_name_text_size">18.3sp</dimen>
+    <dimen name="emergency_info_hint_text_size">13.3sp</dimen>
+    <dimen name="emergency_info_tap_hint_text_size">15sp</dimen>
+
+    <!-- The height for title of emergency number and location info. -->
+    <dimen name="emergency_number_title_height">40dp</dimen>
+    <!-- The text size for emergency number title.-->
+    <dimen name="emergency_number_title_text_size">11.6sp</dimen>
+
+    <!-- The height and width for the image of location info.-->
+    <dimen name="location_image_height">13.3dp</dimen>
+    <dimen name="location_image_width">13.3dp</dimen>
+
+    <!-- The text size for emergency location.-->
+    <dimen name="emergency_location_text_size">11.6sp</dimen>
+
+    <!-- The height and margin for button of emergency shortcut. -->
+    <dimen name="emergency_shortcut_button_height">80dp</dimen>
+    <dimen name="emergency_shortcut_button_margin_bottom">6.7dp</dimen>
+
+    <!-- The text size of emergency number, type and hint -->
+    <dimen name="emergency_shortcut_number_text_size">27sp</dimen>
+    <dimen name="emergency_shortcut_type_text_size">11.6sp</dimen>
+    <dimen name="emergency_shortcut_tap_hint_text_size">15sp</dimen>
+
+    <!-- The height and width for the image of phone number type.-->
+    <dimen name="phone_number_type_image_height">33dp</dimen>
+    <dimen name="phone_number_type_image_width">33dp</dimen>
+
+    <!-- The height and width of phone icon.-->
+    <dimen name="phone_icon_height">20dp</dimen>
+    <dimen name="phone_icon_width">20dp</dimen>
+
+    <!-- Margin of dialpad button -->
+    <dimen name="emergency_dialer_dialpad_button_margin">27dp</dimen>
+
+    <!-- The height and width for the dialpad button -->
+    <dimen name="dialpad_button_height">47dp</dimen>
+    <dimen name="dialpad_button_width">47dp</dimen>
+</resources>
diff --git a/res/values-h590dp/dimens.xml b/res/values-h590dp/dimens.xml
new file mode 100644
index 0000000..3684f4c
--- /dev/null
+++ b/res/values-h590dp/dimens.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+
+<resources>
+    <!-- Height and vertical margin for the emergency information button. -->
+    <dimen name="emergency_info_button_height">87dp</dimen>
+    <dimen name="emergency_info_button_margin_top">44dp</dimen>
+    <dimen name="emergency_info_button_margin_bottom">44dp</dimen>
+
+    <!-- The text size of emergency info name and hint -->
+    <dimen name="emergency_info_name_text_size">20sp</dimen>
+    <dimen name="emergency_info_hint_text_size">14.5sp</dimen>
+    <dimen name="emergency_info_tap_hint_text_size">16.4sp</dimen>
+
+    <!-- The height for title of emergency number and location info. -->
+    <dimen name="emergency_number_title_height">44dp</dimen>
+    <!-- The text size for emergency number title.-->
+    <dimen name="emergency_number_title_text_size">12.7sp</dimen>
+
+    <!-- The height and width for the image of location info.-->
+    <dimen name="location_image_height">14.5dp</dimen>
+    <dimen name="location_image_width">14.5dp</dimen>
+
+    <!-- The text size for emergency location.-->
+    <dimen name="emergency_location_text_size">12.7sp</dimen>
+
+    <!-- The height and margin for button of emergency shortcut. -->
+    <dimen name="emergency_shortcut_button_height">87dp</dimen>
+    <dimen name="emergency_shortcut_button_margin_bottom">7.3dp</dimen>
+
+    <!-- The text size of emergency number, type and hint -->
+    <dimen name="emergency_shortcut_number_text_size">29sp</dimen>
+    <dimen name="emergency_shortcut_type_text_size">12.7sp</dimen>
+    <dimen name="emergency_shortcut_tap_hint_text_size">16.4sp</dimen>
+
+    <!-- The height and width for the image of phone number type.-->
+    <dimen name="phone_number_type_image_height">36dp</dimen>
+    <dimen name="phone_number_type_image_width">36dp</dimen>
+
+    <!-- The height and width of phone icon.-->
+    <dimen name="phone_icon_height">22dp</dimen>
+    <dimen name="phone_icon_width">22dp</dimen>
+
+    <!-- Margin of dialpad button -->
+    <dimen name="emergency_dialer_dialpad_button_margin">29dp</dimen>
+
+    <!-- The height and width for the dialpad button -->
+    <dimen name="dialpad_button_height">51dp</dimen>
+    <dimen name="dialpad_button_width">51dp</dimen>
+</resources>
diff --git a/res/values-h720dp/dimens.xml b/res/values-h720dp/dimens.xml
new file mode 100644
index 0000000..7bb1f27
--- /dev/null
+++ b/res/values-h720dp/dimens.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+
+<resources>
+    <!-- Height and vertical margin for the emergency information button. -->
+    <dimen name="emergency_info_button_height">96dp</dimen>
+    <dimen name="emergency_info_button_margin_top">72dp</dimen>
+    <dimen name="emergency_info_button_margin_bottom">60dp</dimen>
+
+    <!-- The text size of emergency info name and hint -->
+    <dimen name="emergency_info_name_text_size">22sp</dimen>
+    <dimen name="emergency_info_hint_text_size">16sp</dimen>
+    <dimen name="emergency_info_tap_hint_text_size">18sp</dimen>
+
+    <!-- The height for title of emergency number and location info. -->
+    <dimen name="emergency_number_title_height">48dp</dimen>
+    <!-- The text size for emergency number title.-->
+    <dimen name="emergency_number_title_text_size">14sp</dimen>
+
+    <!-- The height and width for the image of location info.-->
+    <dimen name="location_image_height">16dp</dimen>
+    <dimen name="location_image_width">16dp</dimen>
+
+    <!-- The text size for emergency location.-->
+    <dimen name="emergency_location_text_size">14sp</dimen>
+
+    <!-- The height and margin for button of emergency shortcut. -->
+    <dimen name="emergency_shortcut_button_height">96dp</dimen>
+    <dimen name="emergency_shortcut_button_margin_bottom">8dp</dimen>
+
+    <!-- The text size of emergency number, type and hint -->
+    <dimen name="emergency_shortcut_number_text_size">32sp</dimen>
+    <dimen name="emergency_shortcut_type_text_size">14sp</dimen>
+    <dimen name="emergency_shortcut_tap_hint_text_size">18sp</dimen>
+
+    <!-- The height and width for the image of phone number type.-->
+    <dimen name="phone_number_type_image_height">40dp</dimen>
+    <dimen name="phone_number_type_image_width">40dp</dimen>
+
+    <!-- The height and width of phone icon.-->
+    <dimen name="phone_icon_height">24dp</dimen>
+    <dimen name="phone_icon_width">24dp</dimen>
+
+    <!-- Margin of dialpad button -->
+    <dimen name="emergency_dialer_dialpad_button_margin">64dp</dimen>
+
+    <!-- The height and width for the dialpad button -->
+    <dimen name="dialpad_button_height">56dp</dimen>
+    <dimen name="dialpad_button_width">56dp</dimen>
+</resources>
diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml
new file mode 100644
index 0000000..1f336b9
--- /dev/null
+++ b/res/values-night/colors.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+
+<resources>
+
+    <!-- Colors for shortcut view -->
+    <color name="emergency_info_btn_bolder">#85ffffff</color>
+    <color name="emergency_info_btn_background_color">#202124</color>
+    <color name="emergency_shortcut_button_background_color">#202124</color>
+    <color name="emergency_shortcut_phone_type_icon_color">#f28b82</color>
+    <color name="emergency_shortcut_confirm_button_background_color">#3c4043</color>
+    <color name="emergency_shortcut_confirm_phone_type_icon_color">#f28b82</color>
+    <color name="emergency_call_icon_color">#e8eaed</color>
+    <color name="emergency_dialpad_fab_tint_color">#f28b82</color>
+</resources>
diff --git a/res/values-night/styles.xml b/res/values-night/styles.xml
index 648ceeb..fa5c8a1 100644
--- a/res/values-night/styles.xml
+++ b/res/values-night/styles.xml
@@ -27,4 +27,44 @@
         <item name="android:dialogTheme">@style/DialerAlertDialogTheme</item>
     </style>
 
+    <style name="EmergencyInfoNameTextAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@android:color/white</item>
+        <item name="android:textSize">@dimen/emergency_info_name_text_size</item>
+    </style>
+
+    <style name="EmergencyInfoHintTextAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@color/white_70_percent</item>
+        <item name="android:textSize">@dimen/emergency_info_hint_text_size</item>
+    </style>
+
+    <style name="EmergencyInfoTapHintTextAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@android:color/white</item>
+        <item name="android:textSize">@dimen/emergency_info_tap_hint_text_size</item>
+    </style>
+
+    <style name="ShortcutViewHintTextAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@android:color/white</item>
+    </style>
+
+    <style name="PhoneNumberTextAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@android:color/white</item>
+        <item name="android:textSize">@dimen/emergency_shortcut_number_text_size</item>
+    </style>
+
+    <style name="PhoneNumberTypeAppearance">
+        <item name="android:fontFamily">roboto</item>
+        <item name="android:textColor">@color/white_70_percent</item>
+        <item name="android:textSize">@dimen/emergency_shortcut_type_text_size</item>
+    </style>
+
+    <style name="PhoneNumberTapHintAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@android:color/white</item>
+        <item name="android:textSize">@dimen/emergency_shortcut_tap_hint_text_size</item>
+    </style>
 </resources>
diff --git a/res/values-sw345dp/dimens.xml b/res/values-sw345dp/dimens.xml
deleted file mode 100644
index 84db80b..0000000
--- a/res/values-sw345dp/dimens.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2018 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
-  -->
-
-<resources>
-    <dimen name="emergency_info_button_height">88dp</dimen>
-    <dimen name="emergency_info_button_margin_vertical">48dp</dimen>
-    <dimen name="emergency_shortcut_button_height">88dp</dimen>
-    <dimen name="emergency_number_title_text_size">12sp</dimen>
-    <dimen name="emergency_location_text_size">12sp</dimen>
-</resources>
\ No newline at end of file
diff --git a/res/values-sw360dp/dimens.xml b/res/values-sw360dp/dimens.xml
deleted file mode 100644
index c578065..0000000
--- a/res/values-sw360dp/dimens.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2018 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
-  -->
-
-<resources>
-    <dimen name="emergency_info_button_height">96dp</dimen>
-    <dimen name="emergency_info_button_margin_vertical">56dp</dimen>
-    <dimen name="emergency_shortcut_button_height">96dp</dimen>
-    <dimen name="emergency_number_title_text_size">14sp</dimen>
-    <dimen name="emergency_location_text_size">14sp</dimen>
-</resources>
\ No newline at end of file
diff --git a/res/values/colors.xml b/res/values/colors.xml
index be3e2b8..b697ed8 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -54,8 +54,6 @@
 
     <color name="dialer_dialpad_touch_tint">#330288d1</color>
     <color name="floating_action_button_touch_tint">#80ffffff</color>
-    <color name="emergency_shortcut_button_background_color">#40FFFFFF</color>
-    <color name="emergency_shortcut_confirm_button_background_color">#E25142</color>
 
     <!-- Color matches dialer settings light M2 theme.-->
     <color name="dialer_background_color">#ffffff</color>
@@ -63,4 +61,14 @@
     <color name="dialer_primary_text_color">#202124</color>
     <color name="dialer_secondary_text_color">#5f6368</color>
 
+    <!-- Colors for shortcut view -->
+    <color name="emergency_info_btn_bolder">#40ffffff</color>
+    <color name="emergency_info_btn_background_color">@android:color/transparent</color>
+    <color name="emergency_shortcut_button_background_color">#eae8e9</color>
+    <color name="emergency_shortcut_phone_type_icon_color">#e25142</color>
+    <color name="emergency_shortcut_confirm_button_background_color">#e25142</color>
+    <color name="emergency_shortcut_confirm_phone_type_icon_color">#e25142</color>
+    <color name="emergency_call_icon_color">#3c4043</color>
+    <color name="emergency_dialpad_fab_tint_color">@null</color>
+    <color name="white_70_percent">#b3ffffff</color>
 </resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 23d20fc..e1742d8 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -118,20 +118,12 @@
     <dimen name="emergency_dialer_image_margin_start">20dp</dimen>
     <dimen name="emergency_dialer_image_margin_end">16dp</dimen>
 
-    <!-- Margin of dialpad button -->
-    <dimen name="emergency_dialer_dialpad_button_margin">40dp</dimen>
-
     <!-- Horizontal margin for button of emergency shortcut. -->
     <dimen name="emergency_shortcut_buttons_margin_horizontal">16dp</dimen>
 
     <!-- Horizontal padding for group of emergency number title-->
     <dimen name="emergency_number_title_group_padding_horizontal">16dp</dimen>
 
-    <!-- Height and vertical margin for the emergency information button. -->
-    <dimen name="emergency_info_button_height">80dp</dimen>
-    <dimen name="emergency_info_button_margin_vertical">40dp</dimen>
-    <dimen name="emergency_info_button_fix_margin_vertical">40dp</dimen>
-
     <!-- Margin for the emergency information button text. -->
     <dimen name="emergency_info_text_margin_end">20dp</dimen>
 
@@ -143,32 +135,10 @@
     <dimen name="emergency_shortcuts_function_icon_height">24dp</dimen>
     <dimen name="emergency_shortcuts_function_icon_width">24dp</dimen>
 
-    <!-- The height and width for the dialpad button -->
-    <dimen name="dialpad_button_height">56dp</dimen>
-    <dimen name="dialpad_button_width">56dp</dimen>
-
-    <!-- The height for title of emergency number and location info. -->
-    <dimen name="emergency_number_title_height">48dp</dimen>
-
-    <!-- The height and width for the image of location info.-->
-    <dimen name="location_image_height">16dp</dimen>
-    <dimen name="location_image_width">16dp</dimen>
-
-    <!-- The height for button of emergency shortcut. -->
-    <dimen name="emergency_shortcut_button_height">80dp</dimen>
-
     <!-- The height and width for the circle image of phone number type.-->
     <dimen name="phone_number_type_circle_image_height">40dp</dimen>
     <dimen name="phone_number_type_circle_image_width">40dp</dimen>
 
-    <!-- The height and width for the image of phone number type.-->
-    <dimen name="phone_number_type_image_height">24dp</dimen>
-    <dimen name="phone_number_type_image_width">24dp</dimen>
-
-    <!-- The height and width of phone icon.-->
-    <dimen name="phone_icon_height">24dp</dimen>
-    <dimen name="phone_icon_width">24dp</dimen>
-
     <!-- Margin for the emergency shortcut button.-->
     <dimen name="emergency_shortcuts_margin_end">60dp</dimen>
 
@@ -197,12 +167,6 @@
     <!-- The width for emergency number title container.-->
     <dimen name="emergency_number_title_container_width">210dp</dimen>
 
-    <!-- The text size for emergency number title.-->
-    <dimen name="emergency_number_title_text_size">13sp</dimen>
-
-    <!-- The text size for emergency location.-->
-    <dimen name="emergency_location_text_size">13sp</dimen>
-
     <!-- The text size for titles in settings page.-->
     <dimen name="dialer_head1_font_size">18dp</dimen>
 
@@ -211,4 +175,54 @@
 
     <!-- The text size for description in settings page.-->
     <dimen name="dialer_secondary_font_size">14dp</dimen>
+
+
+    <!-- Shortcut view vertical dimens. These values are tuned according to display
+         height in values-h<height>dp/dimens.xml -->
+    <!-- Height and vertical margin for the emergency information button. -->
+    <dimen name="emergency_info_button_height">74dp</dimen>
+    <dimen name="emergency_info_button_margin_top">32dp</dimen>
+    <dimen name="emergency_info_button_margin_bottom">37dp</dimen>
+
+    <!-- The text size of emergency info name and hint -->
+    <dimen name="emergency_info_name_text_size">16.9sp</dimen>
+    <dimen name="emergency_info_hint_text_size">12.3sp</dimen>
+    <dimen name="emergency_info_tap_hint_text_size">13.8sp</dimen>
+
+    <!-- The height for title of emergency number and location info. -->
+    <dimen name="emergency_number_title_height">37dp</dimen>
+    <!-- The text size for emergency number title.-->
+    <dimen name="emergency_number_title_text_size">10.7sp</dimen>
+
+    <!-- The height and width for the image of location info.-->
+    <dimen name="location_image_height">12.3dp</dimen>
+    <dimen name="location_image_width">12.3dp</dimen>
+
+    <!-- The text size for emergency location.-->
+    <dimen name="emergency_location_text_size">10.7sp</dimen>
+
+    <!-- The height and margin for button of emergency shortcut. -->
+    <dimen name="emergency_shortcut_button_height">74dp</dimen>
+    <dimen name="emergency_shortcut_button_margin_bottom">6.2dp</dimen>
+
+    <!-- The text size of emergency number, type and hint -->
+    <dimen name="emergency_shortcut_number_text_size">25sp</dimen>
+    <dimen name="emergency_shortcut_type_text_size">10.7sp</dimen>
+    <dimen name="emergency_shortcut_tap_hint_text_size">13.8sp</dimen>
+
+    <!-- The height and width for the image of phone number type.-->
+    <dimen name="phone_number_type_image_height">31dp</dimen>
+    <dimen name="phone_number_type_image_width">31dp</dimen>
+
+    <!-- The height and width of phone icon.-->
+    <dimen name="phone_icon_height">18.4dp</dimen>
+    <dimen name="phone_icon_width">18.4dp</dimen>
+
+    <!-- Margin of dialpad button -->
+    <dimen name="emergency_dialer_dialpad_button_margin">25dp</dimen>
+
+    <!-- The height and width for the dialpad button -->
+    <dimen name="dialpad_button_height">43dp</dimen>
+    <dimen name="dialpad_button_width">43dp</dimen>
+    <!-- End of Shortcut view vertical dimens. -->
 </resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index dec69df..c791968 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -335,25 +335,44 @@
         <item name="android:listDivider">@null</item>
     </style>
 
-    <style name="HeadlineTextAppearance">
-        <item name="android:textColor">@android:color/white</item>
-        <item name="android:textSize">22sp</item>
+    <style name="EmergencyInfoNameTextAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@*android:color/primary_text_default_material_dark</item>
+        <item name="android:textSize">@dimen/emergency_info_name_text_size</item>
     </style>
 
-    <style name="SubtitleTextAppearance" parent="@style/HeadlineTextAppearance">
-        <item name="android:textSize">14sp</item>
+    <style name="EmergencyInfoHintTextAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@*android:color/secondary_text_default_material_dark</item>
+        <item name="android:textSize">@dimen/emergency_info_hint_text_size</item>
+    </style>
+
+    <style name="EmergencyInfoTapHintTextAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@android:color/white</item>
+        <item name="android:textSize">@dimen/emergency_info_tap_hint_text_size</item>
+    </style>
+
+    <style name="ShortcutViewHintTextAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@*android:color/secondary_text_default_material_dark</item>
     </style>
 
     <style name="PhoneNumberTextAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
+        <item name="android:textColor">@*android:color/primary_text_default_material_light</item>
+        <item name="android:textSize">@dimen/emergency_shortcut_number_text_size</item>
+    </style>
+
+    <style name="PhoneNumberTypeAppearance">
+        <item name="android:fontFamily">roboto</item>
+        <item name="android:textColor">@*android:color/secondary_text_default_material_light</item>
+        <item name="android:textSize">@dimen/emergency_shortcut_type_text_size</item>
+    </style>
+
+    <style name="PhoneNumberTapHintAppearance">
+        <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
         <item name="android:textColor">@android:color/white</item>
-        <item name="android:textSize">32sp</item>
-    </style>
-
-    <style name="PhoneCallHintTextAppearance" parent="@style/PhoneNumberTextAppearance">
-        <item name="android:textSize">18sp</item>
-    </style>
-
-    <style name="ShortcutsHintTextAppearance" parent="@style/HeadlineTextAppearance">
-        <item name="android:textSize">16sp</item>
+        <item name="android:textSize">@dimen/emergency_shortcut_tap_hint_text_size</item>
     </style>
 </resources>
diff --git a/src/com/android/phone/EmergencyDialer.java b/src/com/android/phone/EmergencyDialer.java
index 3cf74c8..03a2e57 100644
--- a/src/com/android/phone/EmergencyDialer.java
+++ b/src/com/android/phone/EmergencyDialer.java
@@ -1097,11 +1097,6 @@
                 if (mEmergencyShortcutButtonList.size() > 1) {
                     emergencyNumberTitle.setText(getString(
                             R.string.numerous_emergency_numbers_title));
-                    // Update mEmergencyInfoGroup margin to avoid UI overlay when
-                    // emergency shortcut button more than 2.
-                    if (mEmergencyShortcutButtonList.size() > 2) {
-                        mEmergencyInfoGroup.updateLayoutMargin();
-                    }
                 } else {
                     emergencyNumberTitle.setText(getText(R.string.single_emergency_number_title));
                 }
diff --git a/src/com/android/phone/EmergencyInfoGroup.java b/src/com/android/phone/EmergencyInfoGroup.java
index 14c24d8..9f1c906 100644
--- a/src/com/android/phone/EmergencyInfoGroup.java
+++ b/src/com/android/phone/EmergencyInfoGroup.java
@@ -35,7 +35,6 @@
 import android.view.accessibility.AccessibilityManager;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import androidx.core.graphics.drawable.RoundedBitmapDrawable;
@@ -284,18 +283,4 @@
             hideSelectedButton();
         }
     };
-
-    /**
-     * Update layout margin when emergency shortcut button more than 2.
-     */
-    public void updateLayoutMargin() {
-        LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) getLayoutParams();
-
-        params.topMargin = getResources().getDimensionPixelSize(
-                R.dimen.emergency_info_button_fix_margin_vertical);
-        params.bottomMargin = getResources().getDimensionPixelSize(
-                R.dimen.emergency_info_button_fix_margin_vertical);
-
-        setLayoutParams(params);
-    }
 }
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 02669e0..cf8b83e 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -44,6 +44,7 @@
 import android.os.Looper;
 import android.os.Message;
 import android.os.Messenger;
+import android.os.ParcelUuid;
 import android.os.PersistableBundle;
 import android.os.RemoteException;
 import android.os.ResultReceiver;
@@ -5066,6 +5067,49 @@
     }
 
     @Override
+    public String[] getMergedSubscriberIdsFromGroup(int subId, String callingPackage) {
+        enforceReadPrivilegedPermission("getMergedSubscriberIdsFromGroup");
+
+        final long identity = Binder.clearCallingIdentity();
+        try {
+            final TelephonyManager telephonyManager = mApp.getSystemService(
+                    TelephonyManager.class);
+            String subscriberId = telephonyManager.getSubscriberId(subId);
+            if (subscriberId == null) {
+                if (DBG) {
+                    log("getMergedSubscriberIdsFromGroup can't find subscriberId for subId "
+                            + subId);
+                }
+                return null;
+            }
+
+            final SubscriptionInfo info = SubscriptionController.getInstance()
+                    .getSubscriptionInfo(subId);
+            final ParcelUuid groupUuid = info.getGroupUuid();
+            // If it doesn't belong to any group, return just subscriberId of itself.
+            if (groupUuid == null) {
+                return new String[]{subscriberId};
+            }
+
+            // Get all subscriberIds from the group.
+            final List<String> mergedSubscriberIds = new ArrayList<>();
+            final List<SubscriptionInfo> groupInfos = SubscriptionController.getInstance()
+                    .getSubscriptionsInGroup(groupUuid, mApp.getOpPackageName());
+            for (SubscriptionInfo subInfo : groupInfos) {
+                subscriberId = telephonyManager.getSubscriberId(subInfo.getSubscriptionId());
+                if (subscriberId != null) {
+                    mergedSubscriberIds.add(subscriberId);
+                }
+            }
+
+            return mergedSubscriberIds.toArray(new String[mergedSubscriberIds.size()]);
+        } finally {
+            Binder.restoreCallingIdentity(identity);
+
+        }
+    }
+
+    @Override
     public boolean setOperatorBrandOverride(int subId, String brand) {
         TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(
                 subId, "setOperatorBrandOverride");
diff --git a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
index 0846be1..aa6b155 100644
--- a/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
+++ b/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
@@ -8,7 +8,6 @@
 import android.graphics.drawable.Icon;
 import android.net.sip.SipManager;
 import android.os.Bundle;
-import android.os.PersistableBundle;
 import android.os.UserManager;
 import android.preference.ListPreference;
 import android.preference.Preference;
@@ -558,12 +557,18 @@
 
         List<SubscriptionInfo> subscriptions =
                 mSubscriptionManager.getActiveSubscriptionInfoList();
-        if ((subscriptions == null) || (subscriptions.size() <= 1)) {
+        if (subscriptions == null) {
             return null;
         }
 
-        List<String> componentNames = subscriptions
-                .stream()
+        List<SubscriptionInfo> effectiveSubscriptions = subscriptions.stream()
+                .filter(subInfo -> !subInfo.isOpportunistic())
+                .collect(Collectors.toList());
+        if (effectiveSubscriptions.size() < 2) {
+            return null;
+        }
+
+        List<String> componentNames = effectiveSubscriptions.stream()
                 .map(subInfo -> configManager.getConfigForSubId(subInfo.getSubscriptionId()))
                 .filter(bundle -> (bundle != null))
                 .map(bundle -> bundle.getString(
diff --git a/src/com/android/services/telephony/ImsConference.java b/src/com/android/services/telephony/ImsConference.java
index 245f2e8..bf0374f 100644
--- a/src/com/android/services/telephony/ImsConference.java
+++ b/src/com/android/services/telephony/ImsConference.java
@@ -212,6 +212,12 @@
 
         @Override
         public void onConnectionEvent(Connection c, String event, Bundle extras) {
+            if (Connection.EVENT_MERGE_START.equals(event)) {
+                // Do not pass a merge start event on the underlying host connection; we only
+                // indicate a merge has started on the connections which are merged into a
+                // conference.
+                return;
+            }
             sendConnectionEvent(event, extras);
         }
     };
@@ -744,6 +750,10 @@
             // Determine if the conference event package represents a single party conference.
             // A single party conference is one where there is no other participant other than the
             // conference host and one other participant.
+            // We purposely exclude participants which have a disconnected state in the conference
+            // event package; some carriers are known to keep a disconnected participant around in
+            // subsequent CEP updates with a state of disconnected, even though its no longer part
+            // of the conference.
             // Note: We consider 0 to still be a single party conference since some carriers will
             // send a conference event package with JUST the host in it when the conference is
             // disconnected.  We don't want to change back to conference mode prior to disconnection
@@ -751,7 +761,8 @@
             boolean isSinglePartyConference = participants.stream()
                     .filter(p -> {
                         Pair<Uri, Uri> pIdent = new Pair<>(p.getHandle(), p.getEndpoint());
-                        return !Objects.equals(mHostParticipantIdentity, pIdent);
+                        return !Objects.equals(mHostParticipantIdentity, pIdent)
+                                && p.getState() != Connection.STATE_DISCONNECTED;
                     })
                     .count() <= 1;
 
@@ -766,7 +777,14 @@
                     Pair<Uri, Uri> userEntity = new Pair<>(participant.getHandle(),
                             participant.getEndpoint());
 
-                    participantUserEntities.add(userEntity);
+                    // We will exclude disconnected participants from the hash set of tracked
+                    // participants.  Some carriers are known to leave disconnected participants in
+                    // the conference event package data which would cause them to be present in the
+                    // conference even though they're disconnected.  Removing them from the hash set
+                    // here means we'll clean them up below.
+                    if (participant.getState() != Connection.STATE_DISCONNECTED) {
+                        participantUserEntities.add(userEntity);
+                    }
                     if (!mConferenceParticipantConnections.containsKey(userEntity)) {
                         // Some carriers will also include the conference host in the CEP.  We will
                         // filter that out here.
diff --git a/tests/src/com/android/services/telephony/ImsConferenceTest.java b/tests/src/com/android/services/telephony/ImsConferenceTest.java
index 68b5b3b..eaec5b6 100644
--- a/tests/src/com/android/services/telephony/ImsConferenceTest.java
+++ b/tests/src/com/android/services/telephony/ImsConferenceTest.java
@@ -119,6 +119,189 @@
     }
 
     /**
+     * Tests CEPs with disconnected participants present with disconnected state.
+     */
+    @Test
+    @SmallTest
+    public void testDisconnectParticipantViaDisconnectState() {
+        when(mMockTelecomAccountRegistry.isUsingSimCallManager(any(PhoneAccountHandle.class)))
+                .thenReturn(false);
+
+        ImsConference imsConference = new ImsConference(mMockTelecomAccountRegistry,
+                mMockTelephonyConnectionServiceProxy, mConferenceHost,
+                null /* phoneAccountHandle */, () -> true /* featureFlagProxy */);
+
+        // Start off with 3 participants.
+        ConferenceParticipant participant1 = new ConferenceParticipant(
+                Uri.parse("tel:6505551212"),
+                "A",
+                Uri.parse("sip:6505551212@testims.com"),
+                Connection.STATE_ACTIVE,
+                Call.Details.DIRECTION_INCOMING);
+        ConferenceParticipant participant2 = new ConferenceParticipant(
+                Uri.parse("tel:6505551213"),
+                "A",
+                Uri.parse("sip:6505551213@testims.com"),
+                Connection.STATE_ACTIVE,
+                Call.Details.DIRECTION_INCOMING);
+
+        ConferenceParticipant participant3 = new ConferenceParticipant(
+                Uri.parse("tel:6505551214"),
+                "A",
+                Uri.parse("sip:6505551214@testims.com"),
+                Connection.STATE_ACTIVE,
+                Call.Details.DIRECTION_INCOMING);
+        imsConference.handleConferenceParticipantsUpdate(mConferenceHost,
+                Arrays.asList(participant1, participant2, participant3));
+        assertEquals(3, imsConference.getNumberOfParticipants());
+        verify(mMockTelephonyConnectionServiceProxy, times(3)).addExistingConnection(
+                any(PhoneAccountHandle.class), any(Connection.class),
+                eq(imsConference));
+
+
+        // Mark one participant as disconnected.
+        ConferenceParticipant participant3Disconnected = new ConferenceParticipant(
+                Uri.parse("tel:6505551214"),
+                "A",
+                Uri.parse("sip:6505551214@testims.com"),
+                Connection.STATE_DISCONNECTED,
+                Call.Details.DIRECTION_INCOMING);
+        imsConference.handleConferenceParticipantsUpdate(mConferenceHost,
+                Arrays.asList(participant1, participant2, participant3Disconnected));
+        assertEquals(2, imsConference.getNumberOfParticipants());
+        verify(mMockTelephonyConnectionServiceProxy, times(1)).removeConnection(
+                any(Connection.class));
+        reset(mMockTelephonyConnectionServiceProxy);
+
+        // Now remove it from another CEP update; should still be the same number of participants
+        // and no updates.
+        imsConference.handleConferenceParticipantsUpdate(mConferenceHost,
+                Arrays.asList(participant1, participant2));
+        assertEquals(2, imsConference.getNumberOfParticipants());
+        verify(mMockTelephonyConnectionServiceProxy, never()).removeConnection(
+                any(Connection.class));
+        verify(mMockTelephonyConnectionServiceProxy, never()).addExistingConnection(
+                any(PhoneAccountHandle.class), any(Connection.class),
+                any(Conference.class));
+    }
+
+    /**
+     * Tests CEPs with removed participants.
+     */
+    @Test
+    @SmallTest
+    public void testDisconnectParticipantViaRemoval() {
+        when(mMockTelecomAccountRegistry.isUsingSimCallManager(any(PhoneAccountHandle.class)))
+                .thenReturn(false);
+
+        ImsConference imsConference = new ImsConference(mMockTelecomAccountRegistry,
+                mMockTelephonyConnectionServiceProxy, mConferenceHost,
+                null /* phoneAccountHandle */, () -> true /* featureFlagProxy */);
+
+        // Start off with 3 participants.
+        ConferenceParticipant participant1 = new ConferenceParticipant(
+                Uri.parse("tel:6505551212"),
+                "A",
+                Uri.parse("sip:6505551212@testims.com"),
+                Connection.STATE_ACTIVE,
+                Call.Details.DIRECTION_INCOMING);
+        ConferenceParticipant participant2 = new ConferenceParticipant(
+                Uri.parse("tel:6505551213"),
+                "A",
+                Uri.parse("sip:6505551213@testims.com"),
+                Connection.STATE_ACTIVE,
+                Call.Details.DIRECTION_INCOMING);
+
+        ConferenceParticipant participant3 = new ConferenceParticipant(
+                Uri.parse("tel:6505551214"),
+                "A",
+                Uri.parse("sip:6505551214@testims.com"),
+                Connection.STATE_ACTIVE,
+                Call.Details.DIRECTION_INCOMING);
+        imsConference.handleConferenceParticipantsUpdate(mConferenceHost,
+                Arrays.asList(participant1, participant2, participant3));
+        assertEquals(3, imsConference.getNumberOfParticipants());
+        verify(mMockTelephonyConnectionServiceProxy, times(3)).addExistingConnection(
+                any(PhoneAccountHandle.class), any(Connection.class),
+                eq(imsConference));
+        reset(mMockTelephonyConnectionServiceProxy);
+
+        // Remove one from the CEP (don't disconnect first); should have 2 participants now.
+        imsConference.handleConferenceParticipantsUpdate(mConferenceHost,
+                Arrays.asList(participant1, participant2));
+        assertEquals(2, imsConference.getNumberOfParticipants());
+        verify(mMockTelephonyConnectionServiceProxy, times(1)).removeConnection(
+                any(Connection.class));
+        verify(mMockTelephonyConnectionServiceProxy, never()).addExistingConnection(
+                any(PhoneAccountHandle.class), any(Connection.class),
+                any(Conference.class));
+    }
+
+    /**
+     * Typically when a participant disconnects from a conference it is either:
+     * 1. Removed from a subsequent CEP update.
+     * 2. Marked as disconnected in a CEP update, and then removed from another CEP update.
+     *
+     * When a participant disconnects from a conference, some carriers will mark the disconnected
+     * participant as disconnected, but fail to send another CEP update with it removed.
+     *
+     * This test verifies that we can still enter single party emulation in this case.
+     */
+    @Test
+    @SmallTest
+    public void testSinglePartyEmulationEnterOnDisconnectParticipant() {
+        when(mMockTelecomAccountRegistry.isUsingSimCallManager(any(PhoneAccountHandle.class)))
+                .thenReturn(false);
+
+        ImsConference imsConference = new ImsConference(mMockTelecomAccountRegistry,
+                mMockTelephonyConnectionServiceProxy, mConferenceHost,
+                null /* phoneAccountHandle */, () -> true /* featureFlagProxy */);
+
+        // Setup the initial conference state with 2 participants.
+        ConferenceParticipant participant1 = new ConferenceParticipant(
+                Uri.parse("tel:6505551212"),
+                "A",
+                Uri.parse("sip:6505551212@testims.com"),
+                Connection.STATE_ACTIVE,
+                Call.Details.DIRECTION_INCOMING);
+        ConferenceParticipant participant2 = new ConferenceParticipant(
+                Uri.parse("tel:6505551213"),
+                "A",
+                Uri.parse("sip:6505551213@testims.com"),
+                Connection.STATE_ACTIVE,
+                Call.Details.DIRECTION_INCOMING);
+        imsConference.handleConferenceParticipantsUpdate(mConferenceHost,
+                Arrays.asList(participant1, participant2));
+        assertEquals(2, imsConference.getNumberOfParticipants());
+        verify(mMockTelephonyConnectionServiceProxy, times(2)).addExistingConnection(
+                any(PhoneAccountHandle.class), any(Connection.class),
+                eq(imsConference));
+
+        // Some carriers keep disconnected participants around in the CEP; this will cause problems
+        // when we want to enter single party conference mode. Verify that this case is handled.
+        ConferenceParticipant participant2Disconnected = new ConferenceParticipant(
+                Uri.parse("tel:6505551213"),
+                "A",
+                Uri.parse("sip:6505551213@testims.com"),
+                Connection.STATE_DISCONNECTED,
+                Call.Details.DIRECTION_INCOMING);
+        imsConference.handleConferenceParticipantsUpdate(mConferenceHost,
+                Arrays.asList(participant1, participant2Disconnected));
+        assertEquals(0, imsConference.getNumberOfParticipants());
+        verify(mMockTelephonyConnectionServiceProxy, times(2)).removeConnection(
+                any(Connection.class));
+        reset(mMockTelephonyConnectionServiceProxy);
+
+        // Pretend to merge someone else into the conference.
+        imsConference.handleConferenceParticipantsUpdate(mConferenceHost,
+                Arrays.asList(participant1, participant2));
+        assertEquals(2, imsConference.getNumberOfParticipants());
+        verify(mMockTelephonyConnectionServiceProxy, times(2)).addExistingConnection(
+                any(PhoneAccountHandle.class), any(Connection.class),
+                eq(imsConference));
+    }
+
+    /**
      * We have seen a scenario on a carrier where a conference event package comes in just prior to
      * the call disconnecting with only the conference host in it.  This caused a problem because
      * it triggered exiting single party conference mode (due to a bug) and caused the call to not