Loading src/com/android/contacts/dialpad/DialpadFragment.java +44 −29 Original line number Diff line number Diff line Loading @@ -280,6 +280,7 @@ public class DialpadFragment extends Fragment mDialButton = fragmentView.findViewById(R.id.dialButton); if (r.getBoolean(R.bool.config_show_onscreen_dial_button)) { mDialButton.setOnClickListener(this); mDialButton.setOnLongClickListener(this); } else { mDialButton.setVisibility(View.GONE); // It's VISIBLE by default mDialButton = null; Loading Loading @@ -906,6 +907,16 @@ public class DialpadFragment extends Fragment mDigits.setCursorVisible(true); return false; } case R.id.dialButton: { if (isDigitsEmpty()) { handleDialButtonClickWithEmptyDigits(); // This event should be consumed so that onClick() won't do the exactly same // thing. return true; } else { return false; } } } return false; } Loading Loading @@ -997,6 +1008,38 @@ public class DialpadFragment extends Fragment */ public void dialButtonPressed() { if (isDigitsEmpty()) { // No number entered. handleDialButtonClickWithEmptyDigits(); } 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) && (SystemProperties.getInt("persist.radio.otaspdial", 0) != 1)) { Log.i(TAG, "The phone number is prohibited explicitly by a rule."); if (getActivity() != null) { DialogFragment dialogFragment = ErrorDialogFragment.newInstance( R.string.dialog_phone_call_prohibited_message); dialogFragment.show(getFragmentManager(), "phone_prohibited_dialog"); } // Clear the digits just in case. mDigits.getText().clear(); } else { final Intent intent = ContactsUtils.getCallIntent(number, (getActivity() instanceof DialtactsActivity ? ((DialtactsActivity)getActivity()).getCallOrigin() : null)); startActivity(intent); mClearDigitsOnStop = true; getActivity().finish(); } } } private void handleDialButtonClickWithEmptyDigits() { if (phoneIsCdma() && phoneIsOffhook()) { // This is really CDMA specific. On GSM is it possible // to be off hook and wanted to add a 3rd party using Loading Loading @@ -1026,34 +1069,6 @@ public class DialpadFragment extends Fragment playTone(ToneGenerator.TONE_PROP_NACK); } } } 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) && (SystemProperties.getInt("persist.radio.otaspdial", 0) != 1)) { Log.i(TAG, "The phone number is prohibited explicitly by a rule."); if (getActivity() != null) { DialogFragment dialogFragment = ErrorDialogFragment.newInstance( R.string.dialog_phone_call_prohibited_message); dialogFragment.show(getFragmentManager(), "phone_prohibited_dialog"); } // Clear the digits just in case. mDigits.getText().clear(); } else { final Intent intent = ContactsUtils.getCallIntent(number, (getActivity() instanceof DialtactsActivity ? ((DialtactsActivity)getActivity()).getCallOrigin() : null)); startActivity(intent); mClearDigitsOnStop = true; getActivity().finish(); } } } /** Loading Loading
src/com/android/contacts/dialpad/DialpadFragment.java +44 −29 Original line number Diff line number Diff line Loading @@ -280,6 +280,7 @@ public class DialpadFragment extends Fragment mDialButton = fragmentView.findViewById(R.id.dialButton); if (r.getBoolean(R.bool.config_show_onscreen_dial_button)) { mDialButton.setOnClickListener(this); mDialButton.setOnLongClickListener(this); } else { mDialButton.setVisibility(View.GONE); // It's VISIBLE by default mDialButton = null; Loading Loading @@ -906,6 +907,16 @@ public class DialpadFragment extends Fragment mDigits.setCursorVisible(true); return false; } case R.id.dialButton: { if (isDigitsEmpty()) { handleDialButtonClickWithEmptyDigits(); // This event should be consumed so that onClick() won't do the exactly same // thing. return true; } else { return false; } } } return false; } Loading Loading @@ -997,6 +1008,38 @@ public class DialpadFragment extends Fragment */ public void dialButtonPressed() { if (isDigitsEmpty()) { // No number entered. handleDialButtonClickWithEmptyDigits(); } 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) && (SystemProperties.getInt("persist.radio.otaspdial", 0) != 1)) { Log.i(TAG, "The phone number is prohibited explicitly by a rule."); if (getActivity() != null) { DialogFragment dialogFragment = ErrorDialogFragment.newInstance( R.string.dialog_phone_call_prohibited_message); dialogFragment.show(getFragmentManager(), "phone_prohibited_dialog"); } // Clear the digits just in case. mDigits.getText().clear(); } else { final Intent intent = ContactsUtils.getCallIntent(number, (getActivity() instanceof DialtactsActivity ? ((DialtactsActivity)getActivity()).getCallOrigin() : null)); startActivity(intent); mClearDigitsOnStop = true; getActivity().finish(); } } } private void handleDialButtonClickWithEmptyDigits() { if (phoneIsCdma() && phoneIsOffhook()) { // This is really CDMA specific. On GSM is it possible // to be off hook and wanted to add a 3rd party using Loading Loading @@ -1026,34 +1069,6 @@ public class DialpadFragment extends Fragment playTone(ToneGenerator.TONE_PROP_NACK); } } } 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) && (SystemProperties.getInt("persist.radio.otaspdial", 0) != 1)) { Log.i(TAG, "The phone number is prohibited explicitly by a rule."); if (getActivity() != null) { DialogFragment dialogFragment = ErrorDialogFragment.newInstance( R.string.dialog_phone_call_prohibited_message); dialogFragment.show(getFragmentManager(), "phone_prohibited_dialog"); } // Clear the digits just in case. mDigits.getText().clear(); } else { final Intent intent = ContactsUtils.getCallIntent(number, (getActivity() instanceof DialtactsActivity ? ((DialtactsActivity)getActivity()).getCallOrigin() : null)); startActivity(intent); mClearDigitsOnStop = true; getActivity().finish(); } } } /** Loading