use of android.telecom.DisconnectCause in project android_packages_apps_Dialer by LineageOS.
the class EnableWifiCallingPrompt method createDialog.
@Override
public Pair<Dialog, CharSequence> createDialog(@NonNull final Context context, DialerCall call) {
Assert.isNotNull(context);
DisconnectCause cause = call.getDisconnectCause();
CharSequence message = cause.getDescription();
Dialog dialog = new AlertDialog.Builder(context).setMessage(message).setPositiveButton(R.string.incall_enable_wifi_calling_button, (OnClickListener) (dialog1, which) -> openWifiCallingSettings(context)).setNegativeButton(android.R.string.cancel, null).create();
return new Pair<>(dialog, message);
}
use of android.telecom.DisconnectCause in project android_packages_apps_Dialer by LineageOS.
the class SimulatorConnection method onReject.
@Override
public void onReject() {
LogUtil.enterBlock("SimulatorConnection.onReject");
setDisconnected(new DisconnectCause(DisconnectCause.REJECTED));
}
use of android.telecom.DisconnectCause in project android_packages_apps_Dialer by LineageOS.
the class SimulatorConnection method onDisconnect.
@Override
public void onDisconnect() {
LogUtil.enterBlock("SimulatorConnection.onDisconnect");
setDisconnected(new DisconnectCause(DisconnectCause.LOCAL));
destroy();
}
use of android.telecom.DisconnectCause in project android_packages_apps_Dialer by MoKee.
the class CallList method clearOnDisconnect.
/**
* This is called when the service disconnects, either expectedly or unexpectedly.
* For the expected case, it's because we have no calls left. For the unexpected case,
* it is likely a crash of phone and we need to clean up our calls manually. Without phone,
* there can be no active calls, so this is relatively safe thing to do.
*/
public void clearOnDisconnect() {
for (Call call : mCallById.values()) {
final int state = call.getState();
if (state != Call.State.IDLE && state != Call.State.INVALID && state != Call.State.DISCONNECTED) {
call.setState(Call.State.DISCONNECTED);
call.setDisconnectCause(new DisconnectCause(DisconnectCause.UNKNOWN));
updateCallInMap(call);
}
}
notifyGenericListeners();
}
use of android.telecom.DisconnectCause in project android_packages_apps_Dialer by MoKee.
the class InCallPresenter method setDisconnectCauseForMissingAccounts.
/**
* Sets the DisconnectCause for a call that was disconnected because it was missing a
* PhoneAccount or PhoneAccounts to select from.
* @param call
*/
private void setDisconnectCauseForMissingAccounts(Call call) {
android.telecom.Call telecomCall = call.getTelecomCall();
Bundle extras = telecomCall.getDetails().getIntentExtras();
// Initialize the extras bundle to avoid NPE
if (extras == null) {
extras = new Bundle();
}
final List<PhoneAccountHandle> phoneAccountHandles = extras.getParcelableArrayList(android.telecom.Call.AVAILABLE_PHONE_ACCOUNTS);
if (phoneAccountHandles == null || phoneAccountHandles.isEmpty()) {
String scheme = telecomCall.getDetails().getHandle().getScheme();
final String errorMsg = PhoneAccount.SCHEME_TEL.equals(scheme) ? mContext.getString(R.string.callFailed_simError) : mContext.getString(R.string.incall_error_supp_service_unknown);
DisconnectCause disconnectCause = new DisconnectCause(DisconnectCause.ERROR, null, errorMsg, errorMsg);
call.setDisconnectCause(disconnectCause);
}
}
Aggregations