use of com.android.internal.telephony.GsmCdmaPhone in project packages_services_Telephony by Evolution-X.
the class GsmUmtsCallBarringOptions method updatePWChangeState.
/**
* Attempt to change the password for call barring settings.
*/
private void updatePWChangeState(boolean positiveResult) {
if (!positiveResult) {
// Reset the state on cancel
resetPwChangeState();
return;
}
// appears with text to indicate what the issue is.
switch(mPwChangeState) {
case PW_CHANGE_OLD:
mOldPassword = mButtonChangePW.getText();
mButtonChangePW.setText("");
if (validatePassword(mOldPassword)) {
mPwChangeState = PW_CHANGE_NEW;
displayPwChangeDialog();
} else {
displayPwChangeDialog(R.string.call_barring_right_pwd_number, true);
}
break;
case PW_CHANGE_NEW:
mNewPassword = mButtonChangePW.getText();
mButtonChangePW.setText("");
if (validatePassword(mNewPassword)) {
mPwChangeState = PW_CHANGE_REENTER;
displayPwChangeDialog();
} else {
displayPwChangeDialog(R.string.call_barring_right_pwd_number, true);
}
break;
case PW_CHANGE_REENTER:
// and reset the state.
if (!mNewPassword.equals(mButtonChangePW.getText())) {
mPwChangeState = PW_CHANGE_NEW;
mButtonChangePW.setText("");
displayPwChangeDialog(R.string.call_barring_pwd_not_match, true);
} else {
// If the password is valid, then submit the change password request
mButtonChangePW.setText("");
Message onComplete = mHandler.obtainMessage(EVENT_PW_CHANGE_COMPLETE);
((GsmCdmaPhone) mPhone).changeCallBarringPassword(CommandsInterface.CB_FACILITY_BA_ALL, mOldPassword, mNewPassword, onComplete);
this.onStarted(mButtonChangePW, false);
}
break;
default:
if (DBG) {
Log.d(LOG_TAG, "updatePWChangeState: Unknown password change state: " + mPwChangeState);
}
break;
}
}
use of com.android.internal.telephony.GsmCdmaPhone in project packages_services_Telephony by Evolution-X.
the class TelephonyConnectionService method maybeSendInternationalCallEvent.
/**
* For outgoing dialed calls, potentially send a ConnectionEvent if the user is on WFC and is
* dialing an international number.
* @param telephonyConnection The connection.
*/
private void maybeSendInternationalCallEvent(TelephonyConnection telephonyConnection) {
if (telephonyConnection == null || telephonyConnection.getPhone() == null || telephonyConnection.getPhone().getDefaultPhone() == null) {
return;
}
Phone phone = telephonyConnection.getPhone().getDefaultPhone();
if (phone instanceof GsmCdmaPhone) {
GsmCdmaPhone gsmCdmaPhone = (GsmCdmaPhone) phone;
if (telephonyConnection.isOutgoingCall() && gsmCdmaPhone.isNotificationOfWfcCallRequired(telephonyConnection.getOriginalConnection().getOrigDialString())) {
// Send connection event to InCall UI to inform the user of the fact they
// are potentially placing an international call on WFC.
Log.i(this, "placeOutgoingConnection - sending international call on WFC " + "confirmation event");
telephonyConnection.sendTelephonyConnectionEvent(TelephonyManager.EVENT_NOTIFY_INTERNATIONAL_CALL_ON_WFC, null);
}
}
}
use of com.android.internal.telephony.GsmCdmaPhone in project packages_services_Telephony by Evolution-X.
the class PstnIncomingCallNotifier method maybeSwapWithUnknownConnection.
private boolean maybeSwapWithUnknownConnection(TelephonyConnection telephonyConnection, Connection unknown) {
Connection original = telephonyConnection.getOriginalConnection();
if (original != null && !original.isIncoming() && Objects.equals(original.getAddress(), unknown.getAddress())) {
// to disconnect.
if (unknown instanceof ImsExternalConnection && !(telephonyConnection.getOriginalConnection() instanceof ImsExternalConnection)) {
Log.v(this, "maybeSwapWithUnknownConnection - not swapping regular connection " + "with external connection.");
return false;
}
telephonyConnection.setOriginalConnection(unknown);
// not supported.
if (original instanceof ImsExternalConnection) {
return true;
}
// call stuck in the call tracker preventing other calls from being placed.
if (original.getCall() != null && original.getCall().getPhone() != null && original.getCall().getPhone() instanceof GsmCdmaPhone) {
GsmCdmaPhone phone = (GsmCdmaPhone) original.getCall().getPhone();
phone.getCallTracker().cleanupCalls();
Log.i(this, "maybeSwapWithUnknownConnection - Invoking call tracker cleanup " + "for connection: " + original);
}
return true;
}
return false;
}
use of com.android.internal.telephony.GsmCdmaPhone in project android_frameworks_opt_telephony by LineageOS.
the class GsmMmiCodeTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp(getClass().getSimpleName());
doReturn(mExecutor).when(mContext).getMainExecutor();
mGsmCdmaPhoneUT = new GsmCdmaPhone(mContext, mSimulatedCommands, mNotifier, true, 0, PhoneConstants.PHONE_TYPE_GSM, mTelephonyComponentFactory, (c, p) -> mImsManager);
setCarrierSupportsCallerIdVerticalServiceCodesCarrierConfig();
}
use of com.android.internal.telephony.GsmCdmaPhone in project packages_services_Telephony by Evolution-X.
the class PhoneInterfaceManager method startEmergencyCallbackMode.
/**
* Start emergency callback mode for GsmCdmaPhone for testing.
*/
@Override
public void startEmergencyCallbackMode() {
TelephonyPermissions.enforceShellOnly(Binder.getCallingUid(), "startEmergencyCallbackMode");
enforceModifyPermission();
final long identity = Binder.clearCallingIdentity();
try {
for (Phone phone : PhoneFactory.getPhones()) {
Rlog.d(LOG_TAG, "startEmergencyCallbackMode phone type: " + phone.getPhoneType());
if (phone != null && ((phone.getPhoneType() == PHONE_TYPE_GSM) || (phone.getPhoneType() == PHONE_TYPE_CDMA))) {
GsmCdmaPhone gsmCdmaPhone = (GsmCdmaPhone) phone;
gsmCdmaPhone.obtainMessage(GsmCdmaPhone.EVENT_EMERGENCY_CALLBACK_MODE_ENTER).sendToTarget();
Rlog.d(LOG_TAG, "startEmergencyCallbackMode: triggered");
}
}
} finally {
Binder.restoreCallingIdentity(identity);
}
}
Aggregations