Import translations. DO NOT MERGE
am: dfb6ca8235  -s ours

Change-Id: I8071ddb3aeae68102c7ac699adc6092370c9946a
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index b5fd399..f611706 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -585,6 +585,7 @@
 
         <activity android:name="com.android.phone.settings.VoicemailSettingsActivity"
             android:label="@string/voicemail"
+            android:configChanges="orientation|screenSize|keyboardHidden"
             android:theme="@style/DialerSettingsLight">
             <intent-filter >
                 <!-- DO NOT RENAME. There are existing apps which use this string. -->
diff --git a/res/values/config.xml b/res/values/config.xml
index 1f23c6b..12b35c4 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -210,6 +210,9 @@
     <!-- Flag to enable VVM3 visual voicemail. VVM3 is used by Verizon Wireless. -->
     <bool name="vvm3_enabled">false</bool>
 
+    <!-- Component for custom voicemail notification handling. [DO NOT TRANSLATE] -->
+    <string name="config_customVoicemailComponent">@null</string>
+
     <!-- Flag indicating whether to allow pstn phone accounts [DO NOT TRANSLATE] -->
     <bool name="config_pstn_phone_accounts_enabled">true</bool>
 
diff --git a/sip/res/values-my-rMM/strings.xml b/sip/res/values-my-rMM/strings.xml
index 6703596..e893b90 100644
--- a/sip/res/values-my-rMM/strings.xml
+++ b/sip/res/values-my-rMM/strings.xml
@@ -32,7 +32,7 @@
     <string name="saving_account" msgid="5336529880235177448">"အကောင့်ကို သိမ်းဆည်းနေ…"</string>
     <string name="removing_account" msgid="5537351356808985756">"အကောင့်ကို ဖယ်ရှားနေ…"</string>
     <string name="sip_menu_save" msgid="7882219814563869225">"သိမ်းပါ"</string>
-    <string name="sip_menu_discard" msgid="2350421645423888438">"ဖယ်ပစ်ရန်"</string>
+    <string name="sip_menu_discard" msgid="2350421645423888438">"စွန့်ပစ်ရန်"</string>
     <string name="alert_dialog_close" msgid="1326011828713435134">"ပရိုဖိုင်ကို ပိတ်ရန်"</string>
     <string name="alert_dialog_ok" msgid="4752048404605388940">"အိုကေ"</string>
     <string name="close_profile" msgid="3122414058856309881">"ပိတ်ရန်"</string>
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 111e263..b5e8026 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -284,7 +284,9 @@
 
         if (ImsManager.isVtEnabledByPlatform(mPhone.getContext()) &&
                 ImsManager.isVtProvisionedOnDevice(mPhone.getContext()) &&
-                mPhone.mDcTracker.isDataEnabled(true)) {
+                (carrierConfig.getBoolean(
+                        CarrierConfigManager.KEY_IGNORE_DATA_ENABLED_CHANGED_FOR_VIDEO_CALLS)
+                        || mPhone.mDcTracker.isDataEnabled(true))) {
             boolean currentValue =
                     ImsManager.isEnhanced4gLteModeSettingEnabledByUser(mPhone.getContext())
                     ? PhoneGlobals.getInstance().phoneMgr.isVideoCallingEnabled(
diff --git a/src/com/android/phone/NetworkSetting.java b/src/com/android/phone/NetworkSetting.java
index a09c5c5..29608da 100644
--- a/src/com/android/phone/NetworkSetting.java
+++ b/src/com/android/phone/NetworkSetting.java
@@ -161,8 +161,6 @@
         public void onServiceConnected(ComponentName className, IBinder service) {
             if (DBG) log("connection created, binding local service.");
             mNetworkQueryService = ((NetworkQueryService.LocalBinder) service).getService();
-            // as soon as it is bound, run a query.
-            loadNetworksList();
         }
 
         /** Handle the task of cleaning up the local binding */
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index abe5397..d40b08e 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -16,8 +16,6 @@
 
 package com.android.phone;
 
-import static android.Manifest.permission.READ_PHONE_STATE;
-
 import android.app.Notification;
 import android.app.NotificationManager;
 import android.app.PendingIntent;
@@ -26,7 +24,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
-import android.content.pm.ResolveInfo;
 import android.content.pm.UserInfo;
 import android.content.res.Resources;
 import android.net.Uri;
@@ -36,7 +33,6 @@
 import android.os.UserManager;
 import android.preference.PreferenceManager;
 import android.provider.ContactsContract.PhoneLookup;
-import android.telecom.DefaultDialerManager;
 import android.telecom.PhoneAccount;
 import android.telecom.PhoneAccountHandle;
 import android.telecom.TelecomManager;
@@ -97,6 +93,7 @@
 
     private Context mContext;
     private NotificationManager mNotificationManager;
+    private final ComponentName mNotificationComponent;
     private StatusBarManager mStatusBarManager;
     private UserManager mUserManager;
     private Toast mToast;
@@ -127,6 +124,12 @@
         mTelecomManager = TelecomManager.from(mContext);
         mTelephonyManager = (TelephonyManager) app.getSystemService(Context.TELEPHONY_SERVICE);
 
+        final String notificationComponent = mContext.getString(
+                R.string.config_customVoicemailComponent);
+
+        mNotificationComponent = notificationComponent != null
+                ? ComponentName.unflattenFromString(notificationComponent) : null;
+
         mSubscriptionManager.addOnSubscriptionsChangedListener(
                 new OnSubscriptionsChangedListener() {
                     @Override
@@ -380,8 +383,8 @@
                 if (!mUserManager.hasUserRestriction(
                         UserManager.DISALLOW_OUTGOING_CALLS, userHandle)
                         && !user.isManagedProfile()) {
-                    if (!maybeSendVoicemailNotificationUsingDefaultDialer(vmCount, vmNumber,
-                            pendingIntent, isSettingsIntent, userHandle)) {
+                    if (!sendNotificationCustomComponent(vmCount, vmNumber, pendingIntent,
+                            isSettingsIntent)) {
                         mNotificationManager.notifyAsUser(
                                 Integer.toString(subId) /* tag */,
                                 VOICEMAIL_NOTIFICATION,
@@ -391,29 +394,19 @@
                 }
             }
         } else {
-            List<UserInfo> users = mUserManager.getUsers(true /* excludeDying */);
-            for (int i = 0; i < users.size(); i++) {
-                final UserInfo user = users.get(i);
-                final UserHandle userHandle = user.getUserHandle();
-                if (!mUserManager.hasUserRestriction(
-                        UserManager.DISALLOW_OUTGOING_CALLS, userHandle)
-                        && !user.isManagedProfile()) {
-                    if (!maybeSendVoicemailNotificationUsingDefaultDialer(0, null, null, false,
-                            userHandle)) {
-                        mNotificationManager.cancelAsUser(
-                                Integer.toString(subId) /* tag */,
-                                VOICEMAIL_NOTIFICATION,
-                                userHandle);
-                    }
-                }
+            if (!sendNotificationCustomComponent(0, null, null, false)) {
+                mNotificationManager.cancelAsUser(
+                        Integer.toString(subId) /* tag */,
+                        VOICEMAIL_NOTIFICATION,
+                        UserHandle.ALL);
             }
         }
     }
 
     /**
-     * Sends a broadcast with the voicemail notification information to the default dialer. This
-     * method is also used to indicate to the default dialer when to clear the
-     * notification. A pending intent can be passed to the default dialer to indicate an action to
+     * Sends a broadcast with the voicemail notification information to a custom component to
+     * handle. This method is also used to indicate to the custom component when to clear the
+     * notification. A pending intent can be passed to the custom component to indicate an action to
      * be taken as it would by a notification produced in this class.
      * @param count The number of pending voicemail messages to indicate on the notification. A
      *              Value of 0 is passed here to indicate that the notification should be cleared.
@@ -421,16 +414,14 @@
      * @param pendingIntent The intent that should be passed as the action to be taken.
      * @param isSettingsIntent {@code true} to indicate the pending intent is to launch settings.
      *                         otherwise, {@code false} to indicate the intent launches voicemail.
-     * @param userHandle The user to receive the notification. Each user can have their own default
-     *                   dialer.
-     * @return {@code true} if the default was notified of the notification.
+     * @return {@code true} if a custom component was notified of the notification.
      */
-    private boolean maybeSendVoicemailNotificationUsingDefaultDialer(Integer count, String number,
-            PendingIntent pendingIntent, boolean isSettingsIntent, UserHandle userHandle) {
-
-        if (shouldManageNotificationThroughDefaultDialer(userHandle)) {
-            Intent intent = getShowVoicemailIntentForDefaultDialer(userHandle);
+    private boolean sendNotificationCustomComponent(Integer count, String number,
+            PendingIntent pendingIntent, boolean isSettingsIntent) {
+        if (mNotificationComponent != null) {
+            Intent intent = new Intent();
             intent.setFlags(Intent.FLAG_RECEIVER_FOREGROUND);
+            intent.setComponent(mNotificationComponent);
             intent.setAction(TelephonyManager.ACTION_SHOW_VOICEMAIL_NOTIFICATION);
 
             if (count != null) {
@@ -452,31 +443,14 @@
                             pendingIntent);
                 }
             }
-            mContext.sendBroadcastAsUser(intent, userHandle, READ_PHONE_STATE);
+
+            mContext.sendBroadcast(intent);
             return true;
         }
 
         return false;
     }
 
-    private Intent getShowVoicemailIntentForDefaultDialer(UserHandle userHandle) {
-        String dialerPackage = DefaultDialerManager
-                .getDefaultDialerApplication(mContext, userHandle.getIdentifier());
-        return new Intent(TelephonyManager.ACTION_SHOW_VOICEMAIL_NOTIFICATION)
-                .setPackage(dialerPackage);
-    }
-
-    private boolean shouldManageNotificationThroughDefaultDialer(UserHandle userHandle) {
-        Intent intent = getShowVoicemailIntentForDefaultDialer(userHandle);
-        if (intent == null) {
-            return false;
-        }
-
-        List<ResolveInfo> receivers = mContext.getPackageManager()
-                .queryBroadcastReceivers(intent, 0);
-        return receivers.size() > 0;
-    }
-
     /**
      * Updates the message call forwarding indicator notification.
      *
diff --git a/src/com/android/phone/settings/AccessibilitySettingsFragment.java b/src/com/android/phone/settings/AccessibilitySettingsFragment.java
index ea19f75..0c186a9 100644
--- a/src/com/android/phone/settings/AccessibilitySettingsFragment.java
+++ b/src/com/android/phone/settings/AccessibilitySettingsFragment.java
@@ -24,7 +24,6 @@
 import android.preference.PreferenceFragment;
 import android.preference.PreferenceScreen;
 import android.provider.Settings;
-import android.telecom.TelecomManager;
 import android.telephony.CarrierConfigManager;
 import android.telephony.PhoneStateListener;
 import android.telephony.TelephonyManager;
@@ -35,9 +34,6 @@
 import com.android.internal.telephony.PhoneFactory;
 import com.android.phone.PhoneGlobals;
 import com.android.phone.R;
-import com.android.phone.settings.TtyModeListPreference;
-
-import java.util.List;
 
 public class AccessibilitySettingsFragment extends PreferenceFragment {
     private static final String LOG_TAG = AccessibilitySettingsFragment.class.getSimpleName();
@@ -60,7 +56,7 @@
             if (pref != null) {
                 final boolean isVolteTtySupported = ImsManager.isVolteEnabledByPlatform(mContext)
                         && getVolteTtySupported();
-                pref.setEnabled((isVolteTtySupported && !isVideoCallInProgress()) ||
+                pref.setEnabled((isVolteTtySupported && !isVideoCallOrConferenceInProgress()) ||
                         (state == TelephonyManager.CALL_STATE_IDLE));
             }
         }
@@ -144,15 +140,15 @@
                 CarrierConfigManager.KEY_CARRIER_VOLTE_TTY_SUPPORTED_BOOL);
     }
 
-    private boolean isVideoCallInProgress() {
+    private boolean isVideoCallOrConferenceInProgress() {
         final Phone[] phones = PhoneFactory.getPhones();
         if (phones == null) {
-            if (DBG) Log.d(LOG_TAG, "isVideoCallInProgress: No phones found. Return false");
+            if (DBG) Log.d(LOG_TAG, "isVideoCallOrConferenceInProgress: No phones found.");
             return false;
         }
 
         for (Phone phone : phones) {
-            if (phone.isVideoCallPresent()) {
+            if (phone.isImsVideoCallOrConferencePresent()) {
                 return true;
             }
         }
diff --git a/src/com/android/phone/settings/VoicemailSettingsActivity.java b/src/com/android/phone/settings/VoicemailSettingsActivity.java
index 35d9a1c..6bb481f 100644
--- a/src/com/android/phone/settings/VoicemailSettingsActivity.java
+++ b/src/com/android/phone/settings/VoicemailSettingsActivity.java
@@ -537,7 +537,11 @@
                     if (DBG) log("onActivityResult: bad contact data, no results found.");
                     return;
                 }
-                mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));
+                if (mSubMenuVoicemailSettings != null) {
+                    mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0));
+                } else {
+                    Log.w(LOG_TAG, "VoicemailSettingsActivity destroyed while setting contacts.");
+                }
                 return;
             } finally {
                 if (cursor != null) {
diff --git a/src/com/android/phone/vvm/omtp/ActivationTask.java b/src/com/android/phone/vvm/omtp/ActivationTask.java
index 72f1f54..6fd42fd 100644
--- a/src/com/android/phone/vvm/omtp/ActivationTask.java
+++ b/src/com/android/phone/vvm/omtp/ActivationTask.java
@@ -27,7 +27,6 @@
 import android.telecom.PhoneAccountHandle;
 import android.telephony.ServiceState;
 import android.telephony.TelephonyManager;
-
 import com.android.phone.Assert;
 import com.android.phone.PhoneGlobals;
 import com.android.phone.VoicemailStatus;
@@ -40,7 +39,6 @@
 import com.android.phone.vvm.omtp.sync.OmtpVvmSyncService;
 import com.android.phone.vvm.omtp.sync.SyncTask;
 import com.android.phone.vvm.omtp.utils.PhoneAccountHandleConverter;
-
 import java.io.IOException;
 import java.util.HashSet;
 import java.util.Set;
@@ -135,7 +133,7 @@
         OmtpVvmCarrierConfigHelper helper = new OmtpVvmCarrierConfigHelper(getContext(), subId);
         if (!helper.isValid()) {
             VvmLog.i(TAG, "VVM not supported on subId " + subId);
-            VoicemailStatus.disable(getContext(), phoneAccountHandle);
+            OmtpVvmSourceManager.getInstance(getContext()).removeSource(phoneAccountHandle);
             return;
         }
 
diff --git a/src/com/android/phone/vvm/omtp/SimChangeReceiver.java b/src/com/android/phone/vvm/omtp/SimChangeReceiver.java
index 25c27db..5b201aa 100644
--- a/src/com/android/phone/vvm/omtp/SimChangeReceiver.java
+++ b/src/com/android/phone/vvm/omtp/SimChangeReceiver.java
@@ -26,10 +26,10 @@
 import android.telephony.CarrierConfigManager;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
+import android.text.TextUtils;
 import com.android.internal.telephony.IccCardConstants;
 import com.android.internal.telephony.PhoneConstants;
 import com.android.internal.telephony.TelephonyIntents;
-import com.android.phone.VoicemailStatus;
 import com.android.phone.settings.VisualVoicemailSettingsUtil;
 import com.android.phone.vvm.omtp.sync.OmtpVvmSourceManager;
 import com.android.phone.vvm.omtp.utils.PhoneAccountHandleConverter;
@@ -70,6 +70,25 @@
                     VvmLog.i(TAG, "Received SIM change for invalid subscription id.");
                     return;
                 }
+
+                TelephonyManager telephonyManager = context
+                        .getSystemService(TelephonyManager.class);
+                if(TextUtils.isEmpty(telephonyManager.getSimOperator())){
+                    VvmLog.e(TAG,
+                            "Empty MCCMNC, possible modem crash."
+                                    + " Ignoring carrier config changed event");
+                    return;
+                }
+
+                PhoneAccountHandle phoneAccountHandle = PhoneAccountHandleConverter
+                        .fromSubId(subId);
+                if("null".equals(phoneAccountHandle.getId())){
+                    VvmLog.e(TAG,
+                            "null phone account handle ID, possible modem crash."
+                                    + " Ignoring carrier config changed event");
+                    return;
+                }
+
                 VvmLog.d(TAG, "Carrier config changed");
                 if (UserManager.get(context).isUserUnlocked() && !isCryptKeeperMode()) {
                     processSubId(context, subId);
@@ -115,7 +134,7 @@
             String mccMnc = context.getSystemService(TelephonyManager.class).getSimOperator(subId);
             VvmLog.d(TAG,
                     "visual voicemail not supported for carrier " + mccMnc + " on subId " + subId);
-            VoicemailStatus.disable(context, phoneAccount);
+            OmtpVvmSourceManager.getInstance(context).removeSource(phoneAccount);
         }
     }
 
diff --git a/src/com/android/services/telephony/DisconnectCauseUtil.java b/src/com/android/services/telephony/DisconnectCauseUtil.java
index 6eb4a4e..92f202a 100644
--- a/src/com/android/services/telephony/DisconnectCauseUtil.java
+++ b/src/com/android/services/telephony/DisconnectCauseUtil.java
@@ -27,11 +27,10 @@
 public class DisconnectCauseUtil {
 
    /**
-    * Converts from a disconnect code in {@link android.telephony.DisconnectCause} into a more generic
-    * {@link android.telecom.DisconnectCause}.object, possibly populated with a localized message
-    * and tone.
+    * Converts from a disconnect code in {@link android.telephony.DisconnectCause} into a more
+    * generic {@link android.telecom.DisconnectCause} object, possibly populated with a localized
+    * message and tone.
     *
-    * @param context The context.
     * @param telephonyDisconnectCause The code for the reason for the disconnect.
     */
     public static DisconnectCause toTelecomDisconnectCause(int telephonyDisconnectCause) {
@@ -39,11 +38,10 @@
     }
 
    /**
-    * Converts from a disconnect code in {@link android.telephony.DisconnectCause} into a more generic
-    * {@link android.telecom.DisconnectCause}.object, possibly populated with a localized message
-    * and tone.
+    * Converts from a disconnect code in {@link android.telephony.DisconnectCause} into a more
+    * generic {@link android.telecom.DisconnectCause}.object, possibly populated with a localized
+    * message and tone.
     *
-    * @param context The context.
     * @param telephonyDisconnectCause The code for the reason for the disconnect.
     * @param reason Description of the reason for the disconnect, not intended for the user to see..
     */
@@ -54,7 +52,7 @@
                 toTelecomDisconnectCauseCode(telephonyDisconnectCause),
                 toTelecomDisconnectCauseLabel(context, telephonyDisconnectCause),
                 toTelecomDisconnectCauseDescription(context, telephonyDisconnectCause),
-                toTelecomDisconnectReason(telephonyDisconnectCause, reason),
+                toTelecomDisconnectReason(context,telephonyDisconnectCause, reason),
                 toTelecomDisconnectCauseTone(telephonyDisconnectCause));
     }
 
@@ -129,6 +127,7 @@
             case android.telephony.DisconnectCause.DATA_DISABLED:
             case android.telephony.DisconnectCause.DATA_LIMIT_REACHED:
             case android.telephony.DisconnectCause.DIALED_ON_WRONG_SLOT:
+            case android.telephony.DisconnectCause.DIALED_CALL_FORWARDING_WHILE_ROAMING:
                 return DisconnectCause.ERROR;
 
             case android.telephony.DisconnectCause.DIALED_MMI:
@@ -380,6 +379,9 @@
             case android.telephony.DisconnectCause.DATA_LIMIT_REACHED:
                 resourceId = R.string.callFailed_data_limit_reached_description;
                 break;
+            case android.telephony.DisconnectCause.DIALED_CALL_FORWARDING_WHILE_ROAMING:
+                resourceId = com.android.internal.R.string.mmiErrorWhileRoaming;
+                break;
 
             default:
                 break;
@@ -387,7 +389,36 @@
         return resourceId == null ? "" : context.getResources().getString(resourceId);
     }
 
-    private static String toTelecomDisconnectReason(int telephonyDisconnectCause, String reason) {
+    /**
+     * Maps the telephony {@link android.telephony.DisconnectCause} into a reason string which is
+     * returned in the Telecom {@link DisconnectCause#getReason()}.
+     *
+     * @param context The current context.
+     * @param telephonyDisconnectCause The {@link android.telephony.DisconnectCause} code.
+     * @param reason A reason provided by the caller; only used if a more specific reason cannot
+     *               be determined here.
+     * @return The disconnect reason.
+     */
+    private static String toTelecomDisconnectReason(Context context, int telephonyDisconnectCause,
+            String reason) {
+
+        if (context == null) {
+            return "";
+        }
+
+        switch (telephonyDisconnectCause) {
+            case android.telephony.DisconnectCause.POWER_OFF:
+                // Airplane mode (radio off)
+                // intentional fall-through
+            case android.telephony.DisconnectCause.OUT_OF_SERVICE:
+                // No network connection.
+                if (ImsUtil.shouldPromoteWfc(context)) {
+                    return android.telecom.DisconnectCause.REASON_WIFI_ON_BUT_WFC_OFF;
+                }
+                break;
+        }
+
+        // If no specific code-mapping found, then fall back to using the reason.
         String causeAsString = android.telephony.DisconnectCause.toString(telephonyDisconnectCause);
         if (reason == null) {
             return causeAsString;
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index c4f9c9a..4199d5d 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -960,6 +960,12 @@
                 b != null && b.getBoolean(CarrierConfigManager.KEY_WIFI_CALLS_CAN_BE_HD_AUDIO);
         boolean canVideoCallsBeHdAudio =
                 b != null && b.getBoolean(CarrierConfigManager.KEY_VIDEO_CALLS_CAN_BE_HD_AUDIO);
+        boolean shouldDisplayHdAudio =
+                b != null && b.getBoolean(CarrierConfigManager.KEY_DISPLAY_HD_AUDIO_PROPERTY_BOOL);
+
+        if (!shouldDisplayHdAudio) {
+            return false;
+        }
 
         if (isVideoCall && !canVideoCallsBeHdAudio) {
             return false;
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index 5afdd72..a52bb4b 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -436,6 +436,15 @@
             return failedConnection;
         }
 
+        // Check roaming status to see if we should block custom call forwarding codes
+        if (blockCallForwardingNumberWhileRoaming(phone, number)) {
+            return Connection.createFailedConnection(
+                    DisconnectCauseUtil.toTelecomDisconnectCause(
+                            android.telephony.DisconnectCause.DIALED_CALL_FORWARDING_WHILE_ROAMING,
+                            "Call forwarding while roaming"));
+        }
+
+
         final TelephonyConnection connection =
                 createConnectionFor(phone, null, true /* isOutgoing */, request.getAccountHandle(),
                         request.getTelecomCallId(), request.getAddress(), request.getVideoState());
@@ -647,6 +656,28 @@
         }
     }
 
+    private boolean blockCallForwardingNumberWhileRoaming(Phone phone, String number) {
+        if (phone == null || TextUtils.isEmpty(number) || !phone.getServiceState().getRoaming()) {
+            return false;
+        }
+        String[] blockPrefixes = null;
+        CarrierConfigManager cfgManager = (CarrierConfigManager)
+                phone.getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);
+        if (cfgManager != null) {
+            blockPrefixes = cfgManager.getConfigForSubId(phone.getSubId()).getStringArray(
+                    CarrierConfigManager.KEY_CALL_FORWARDING_BLOCKS_WHILE_ROAMING_STRING_ARRAY);
+        }
+
+        if (blockPrefixes != null) {
+            for (String prefix : blockPrefixes) {
+                if (number.startsWith(prefix)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
     private boolean isRadioOn() {
         boolean result = false;
         for (Phone phone : PhoneFactory.getPhones()) {