use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.
the class NotificationBroadcastReceiver method declineUpgradeRequest.
private void declineUpgradeRequest(Context context) {
CallList callList = InCallPresenter.getInstance().getCallList();
if (callList == null) {
StatusBarNotifier.clearAllCallNotifications(context);
LogUtil.e("NotificationBroadcastReceiver.declineUpgradeRequest", "call list is empty");
} else {
DialerCall call = callList.getVideoUpgradeRequestCall();
if (call != null) {
call.getVideoTech().declineVideoRequest();
}
}
}
use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.
the class NotificationBroadcastReceiver method hangUpOngoingCall.
private void hangUpOngoingCall(Context context) {
CallList callList = InCallPresenter.getInstance().getCallList();
if (callList == null) {
StatusBarNotifier.clearAllCallNotifications(context);
LogUtil.e("NotificationBroadcastReceiver.hangUpOngoingCall", "call list is empty");
} else {
DialerCall call = callList.getOutgoingCall();
if (call == null) {
call = callList.getActiveOrBackgroundCall();
}
LogUtil.i("NotificationBroadcastReceiver.hangUpOngoingCall", "disconnecting call, call: " + call);
if (call != null) {
call.disconnect();
}
}
}
use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.
the class NotificationBroadcastReceiver method acceptUpgradeRequest.
private void acceptUpgradeRequest(Context context) {
CallList callList = InCallPresenter.getInstance().getCallList();
if (callList == null) {
StatusBarNotifier.clearAllCallNotifications(context);
LogUtil.e("NotificationBroadcastReceiver.acceptUpgradeRequest", "call list is empty");
} else {
DialerCall call = callList.getVideoUpgradeRequestCall();
if (call != null) {
call.getVideoTech().acceptVideoRequest();
}
}
}
use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.
the class CallCardPresenter method getCallToDisplay.
/**
* Get the highest priority call to display. Goes through the calls and chooses which to return
* based on priority of which type of call to display to the user. Callers can use the "ignore"
* feature to get the second best call by passing a previously found primary call as ignore.
*
* @param ignore A call to ignore if found.
*/
private DialerCall getCallToDisplay(CallList callList, DialerCall ignore, boolean skipDisconnected) {
// Active calls come second. An active call always gets precedent.
DialerCall retval = callList.getActiveCall();
if (retval != null && retval != ignore) {
return retval;
}
// Sometimes there is intemediate state that two calls are in active even one is about
// to be on hold.
retval = callList.getSecondActiveCall();
if (retval != null && retval != ignore) {
return retval;
}
// calls are very short lived.
if (!skipDisconnected) {
retval = callList.getDisconnectingCall();
if (retval != null && retval != ignore) {
return retval;
}
retval = callList.getDisconnectedCall();
if (retval != null && retval != ignore) {
return retval;
}
}
// Then we go to background call (calls on hold)
retval = callList.getBackgroundCall();
if (retval != null && retval != ignore) {
return retval;
}
// Lastly, we go to a second background call.
retval = callList.getSecondBackgroundCall();
return retval;
}
use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.
the class CallCardPresenter method onContactInfoComplete.
private void onContactInfoComplete(String callId, ContactCacheEntry entry, boolean isPrimary) {
final boolean entryMatchesExistingCall = (isPrimary && mPrimary != null && TextUtils.equals(callId, mPrimary.getId())) || (!isPrimary && mSecondary != null && TextUtils.equals(callId, mSecondary.getId()));
if (entryMatchesExistingCall) {
updateContactEntry(entry, isPrimary);
} else {
LogUtil.e("CallCardPresenter.onContactInfoComplete", "dropping stale contact lookup info for " + callId);
}
final DialerCall call = CallList.getInstance().getCallById(callId);
if (call != null) {
call.getLogState().contactLookupResult = entry.contactLookupResult;
}
if (entry.contactUri != null) {
CallerInfoUtils.sendViewNotification(mContext, entry.contactUri);
}
}
Aggregations