Have a logic to disable "prohibited phone number" rule
TESTED:
- call prohibited number without setting "persist.radio.otaspdial"
- call prohibited number after setting the property to 1
- call prohibited number after setting the property to 0
Bug: 5350613
Change-Id: I2f3da31bf79f7f916eca6ab2c5c66d893b77b479
diff --git a/src/com/android/contacts/dialpad/DialpadFragment.java b/src/com/android/contacts/dialpad/DialpadFragment.java
index 412ceff..e9fbbbb 100644
--- a/src/com/android/contacts/dialpad/DialpadFragment.java
+++ b/src/com/android/contacts/dialpad/DialpadFragment.java
@@ -44,6 +44,7 @@
import android.os.Bundle;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.SystemProperties;
import android.provider.Contacts.Intents.Insert;
import android.provider.Contacts.People;
import android.provider.Contacts.Phones;
@@ -882,9 +883,13 @@
} else {
final String number = mDigits.getText().toString();
+ // "persist.radio.otaspdial" is a temporary hack needed for one carrier's automated
+ // test equipment.
+ // TODO: clean it up.
if (number != null
&& !TextUtils.isEmpty(mProhibitedPhoneNumberRegexp)
- && number.matches(mProhibitedPhoneNumberRegexp)) {
+ && number.matches(mProhibitedPhoneNumberRegexp)
+ && (SystemProperties.getInt("persist.radio.otaspdial", 0) != 1)) {
Log.i(TAG, "The phone number is prohibited explicitly by a rule.");
if (getActivity() != null) {
DialogFragment dialogFragment = CallProhibitedDialogFragment.newInstance();