diff options
Diffstat (limited to 'java/com/android/dialer/oem/MotorolaUtils.java')
-rw-r--r-- | java/com/android/dialer/oem/MotorolaUtils.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/java/com/android/dialer/oem/MotorolaUtils.java b/java/com/android/dialer/oem/MotorolaUtils.java index 1446a0219..993078d95 100644 --- a/java/com/android/dialer/oem/MotorolaUtils.java +++ b/java/com/android/dialer/oem/MotorolaUtils.java @@ -36,6 +36,9 @@ public class MotorolaUtils { private static final String CONFIG_WIFI_CALL_SHOW_ICON_IN_CALL_LOG_ENABLED = "wifi_call_show_icon_in_call_log_enabled"; + @VisibleForTesting + static final String CONFIG_DISABLE_PHONE_NUMBER_FORMATTING = "disable_phone_number_formatting"; + // This is used to check if a Motorola device supports HD voice call feature, which comes from // system feature setting. private static final String HD_CALL_FEATRURE = "com.motorola.software.sprint.hd_call"; @@ -46,6 +49,7 @@ public class MotorolaUtils { @VisibleForTesting static final String HIDDEN_MENU_FEATURE = "com.motorola.software.sprint.hidden_menu"; + private static Boolean disablePhoneNumberFormattingForTest = null; private static boolean hasCheckedSprintWifiCall; private static boolean supportSprintWifiCall; @@ -87,6 +91,16 @@ public class MotorolaUtils { && isSupportingSprintWifiCall(context); } + public static boolean shouldDisablePhoneNumberFormatting(Context context) { + if (disablePhoneNumberFormattingForTest != null) { + return disablePhoneNumberFormattingForTest; + } + + return ConfigProviderBindings.get(context) + .getBoolean(CONFIG_DISABLE_PHONE_NUMBER_FORMATTING, true) + && context.getResources().getBoolean(R.bool.motorola_disable_phone_number_formatting); + } + /** * Handle special char sequence entered in dialpad. This may launch special intent based on input. * @@ -129,6 +143,11 @@ public class MotorolaUtils { return supportSprintWifiCall; } + @VisibleForTesting(otherwise = VisibleForTesting.NONE) + public static void setDisablePhoneNumberFormattingForTest(boolean disablePhoneNumberFormatting) { + disablePhoneNumberFormattingForTest = disablePhoneNumberFormatting; + } + @VisibleForTesting public static void resetForTest() { hasCheckedSprintWifiCall = false; |