Merge "Rename SliceStore to SlicePurchaseController"
diff --git a/src/com/android/services/telephony/TelephonyConferenceController.java b/src/com/android/services/telephony/TelephonyConferenceController.java
index 9aa3dbe..f0aa641 100644
--- a/src/com/android/services/telephony/TelephonyConferenceController.java
+++ b/src/com/android/services/telephony/TelephonyConferenceController.java
@@ -20,6 +20,8 @@
 import android.telecom.Connection;
 import android.telecom.DisconnectCause;
 import android.telecom.PhoneAccountHandle;
+import android.text.TextUtils;
+import android.util.Patterns;
 
 import com.android.internal.telephony.Call;
 import com.android.phone.PhoneUtils;
@@ -40,7 +42,6 @@
  */
 final class TelephonyConferenceController {
     private static final int TELEPHONY_CONFERENCE_MAX_SIZE = 5;
-    private static final String RIL_REPORTED_CONFERENCE_CALL_STRING = "Conference Call";
 
     private final TelephonyConnection.TelephonyConnectionListener mTelephonyConnectionListener =
             new TelephonyConnection.TelephonyConnectionListener() {
@@ -271,13 +272,13 @@
                             // Remove all instances of PROPERTY_IS_DOWNGRADED_CONFERENCE. This
                             // property should only be set on the parent call (i.e. the newly
                             // created TelephonyConference.
-                            // This doesn't apply to a connection whose address is "Conference
-                            // Call", which may be updated by some modem to create a connection
-                            // to represent a merged conference connection in SRVCC.
+                            // This doesn't apply to a connection whose address is not an
+                            // identifiable phone number, which may be updated by some modem
+                            // to create a connection to represent a merged conference connection
+                            // in SRVCC.
                             if (connection.getAddress() == null
-                                    || !connection.getAddress().getSchemeSpecificPart()
-                                            .equalsIgnoreCase(
-                                                    RIL_REPORTED_CONFERENCE_CALL_STRING)) {
+                                    || isPhoneNumber(
+                                            connection.getAddress().getSchemeSpecificPart())) {
                                 Log.d(this, "Removing PROPERTY_IS_DOWNGRADED_CONFERENCE"
                                         + " from connection %s", connection);
                                 int newProperties = connection.getConnectionProperties()
@@ -320,4 +321,11 @@
             }
         }
     }
+
+    private boolean isPhoneNumber(String number) {
+        if (TextUtils.isEmpty(number)) {
+            return false;
+        }
+        return Patterns.PHONE.matcher(number).matches();
+    }
 }
diff --git a/tests/src/com/android/phone/CarrierConfigLoaderTest.java b/tests/src/com/android/phone/CarrierConfigLoaderTest.java
index 60c3a84..9c425d6 100644
--- a/tests/src/com/android/phone/CarrierConfigLoaderTest.java
+++ b/tests/src/com/android/phone/CarrierConfigLoaderTest.java
@@ -192,6 +192,7 @@
      * will return the right config in the XML.
      */
     @Test
+    @Ignore("b/257169357")
     public void testUpdateConfigForPhoneId_simLoaded_withCachedConfigInXml() throws Exception {
         // Bypass case if default subId is not supported by device to reduce flakiness
         if (!SubscriptionManager.isValidPhoneId(SubscriptionManager.getPhoneId(DEFAULT_SUB_ID))) {
diff --git a/tests/src/com/android/phone/NotificationMgrTest.java b/tests/src/com/android/phone/NotificationMgrTest.java
index 6d979d6..3e8cf28 100644
--- a/tests/src/com/android/phone/NotificationMgrTest.java
+++ b/tests/src/com/android/phone/NotificationMgrTest.java
@@ -62,6 +62,7 @@
 import android.os.UserManager;
 import android.telecom.TelecomManager;
 import android.telephony.CarrierConfigManager;
+import android.telephony.NetworkRegistrationInfo;
 import android.telephony.ServiceState;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
@@ -73,6 +74,8 @@
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneConstants;
 import com.android.internal.telephony.PhoneFactory;
+import com.android.internal.telephony.ServiceStateTracker;
+import com.android.internal.telephony.SignalStrengthController;
 import com.android.internal.telephony.data.DataConfigManager;
 import com.android.internal.telephony.data.DataNetworkController;
 import com.android.internal.telephony.data.DataSettingsManager;
@@ -115,11 +118,13 @@
     @Mock SubscriptionInfo mSubscriptionInfo;
     @Mock Resources mResources;
     @Mock Context mMockedContext;
+    @Mock ServiceStateTracker mServiceStateTracker;
     @Mock ServiceState mServiceState;
     @Mock CarrierConfigManager mCarrierConfigManager;
     @Mock DataNetworkController mDataNetworkController;
     @Mock DataSettingsManager mDataSettingsManager;
     @Mock DataConfigManager mDataConfigManager;
+    @Mock SignalStrengthController mSignalStrengthController;
 
     private Phone[] mPhones;
     private NotificationMgr mNotificationMgr;
@@ -133,6 +138,14 @@
         when(mPhone.getContext()).thenReturn(mMockedContext);
         when(mMockedContext.getResources()).thenReturn(mResources);
         when(mPhone.getServiceState()).thenReturn(mServiceState);
+        when(mServiceState.getNetworkRegistrationInfo(anyInt(), anyInt())).thenReturn(
+                new NetworkRegistrationInfo.Builder()
+                        .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_LTE)
+                        .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME)
+                        .build());
+        when(mPhone.getServiceStateTracker()).thenReturn(mServiceStateTracker);
+        mServiceStateTracker.mSS = mServiceState;
+        when(mPhone.getSignalStrengthController()).thenReturn(mSignalStrengthController);
         when(mPhone.getDataNetworkController()).thenReturn(mDataNetworkController);
         when(mDataNetworkController.getInternetDataDisallowedReasons()).thenReturn(
                 Collections.emptyList());