use of android.telecom.DisconnectCause in project android_packages_apps_Dialer by MoKee.
the class InCallActivity method maybeShowErrorDialogOnDisconnect.
public void maybeShowErrorDialogOnDisconnect(Call call) {
Log.d(this, "maybeShowErrorDialogOnDisconnect");
if (isFinishing()) {
return;
}
DisconnectCause disconnectCause = call.getDisconnectCause();
int code = disconnectCause.getCode();
if (call.wasUnansweredForwarded()) {
showErrorDialog(getString(R.string.callUnanswered_forwarded));
} else if (call.missedBecauseIncomingCallsBarredRemotely()) {
showErrorDialog(getString(R.string.callFailed_incoming_cb_enabled));
} else if (!TextUtils.isEmpty(disconnectCause.getDescription()) && (code == DisconnectCause.ERROR || code == DisconnectCause.RESTRICTED)) {
showErrorDialog(disconnectCause.getDescription());
}
}
use of android.telecom.DisconnectCause in project android_packages_apps_Dialer by MoKee.
the class InCallVibrationHandler method handleCallEnd.
private void handleCallEnd(Call call) {
long durationMillis = System.currentTimeMillis() - call.getConnectTimeMillis();
DisconnectCause cause = call.getDisconnectCause();
boolean localDisconnect = // Disconnection not yet processed
call.getState() == Call.State.DISCONNECTING || // Disconnection already processed
(cause != null && cause.getCode() == DisconnectCause.LOCAL);
Log.d(this, "Ending active call: duration = " + durationMillis + ", locally disconnected = " + localDisconnect);
if (mPrefs.getBoolean(KEY_VIBRATE_HANGUP, true) && !localDisconnect && durationMillis > 500) {
vibrate(50, 100, 50);
}
// Stop 45-second vibration
removeMessages(MSG_VIBRATE_45_SEC);
}
Aggregations