use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.
the class CallCardPresenter method supports2ndCallOnHold.
private boolean supports2ndCallOnHold() {
DialerCall firstCall = CallList.getInstance().getActiveOrBackgroundCall();
DialerCall incomingCall = CallList.getInstance().getIncomingCall();
if (firstCall != null && incomingCall != null && firstCall != incomingCall) {
return incomingCall.can(Details.CAPABILITY_HOLD);
}
return true;
}
use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.
the class InCallVibrationHandler method onStateChange.
@Override
public void onStateChange(InCallState oldState, InCallState newState, CallList callList) {
DialerCall activeCall = callList.getActiveCall();
if (activeCall != null && mActiveCall == null) {
Log.d(this, "Transition to active call " + activeCall);
if (activeCall.isOutgoing()) {
handleOutgoingCallVibration(activeCall);
}
mActiveCall = activeCall;
} else if (activeCall != null && callList.getIncomingCall() != null && !callList.getIncomingCall().equals(activeCall)) {
Log.d(this, "New incoming call" + callList.getIncomingCall());
handleCallWaitingVibration(activeCall);
} else if (activeCall == null && mActiveCall != null) {
Log.d(this, "Transition from active call " + mActiveCall);
handleCallEnd(mActiveCall);
mActiveCall = null;
}
}
use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.
the class NotificationBroadcastReceiver method declineIncomingCall.
private void declineIncomingCall(Context context) {
CallList callList = InCallPresenter.getInstance().getCallList();
if (callList == null) {
StatusBarNotifier.clearAllCallNotifications(context);
LogUtil.e("NotificationBroadcastReceiver.declineIncomingCall", "call list is empty");
} else {
DialerCall call = callList.getIncomingCall();
if (call != null) {
call.reject(false, /* rejectWithMessage */
null);
}
}
}
use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.
the class ProximitySensor method onStateChange.
/**
* Called to keep track of the overall UI state.
*/
@Override
public void onStateChange(InCallState oldState, InCallState newState, CallList callList) {
// We ignore incoming state because we do not want to enable proximity
// sensor during incoming call screen. We check hasLiveCall() because a disconnected call
// can also put the in-call screen in the INCALL state.
boolean hasOngoingCall = InCallState.INCALL == newState && callList.hasLiveCall();
boolean isOffhook = (InCallState.OUTGOING == newState) || hasOngoingCall;
DialerCall activeCall = callList.getActiveCall();
boolean isVideoCall = activeCall != null && activeCall.isVideoCall();
if (isOffhook != mIsPhoneOffhook || mIsVideoCall != isVideoCall) {
mIsPhoneOffhook = isOffhook;
mIsVideoCall = isVideoCall;
mOrientation = AccelerometerListener.ORIENTATION_UNKNOWN;
mAccelerometerListener.enable(mIsPhoneOffhook);
updateProximitySensorMode();
}
}
use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.
the class NotificationBroadcastReceiver method answerIncomingCall.
private void answerIncomingCall(Context context, int videoState) {
CallList callList = InCallPresenter.getInstance().getCallList();
if (callList == null) {
StatusBarNotifier.clearAllCallNotifications(context);
LogUtil.e("NotificationBroadcastReceiver.answerIncomingCall", "call list is empty");
} else {
DialerCall call = callList.getIncomingCall();
if (call != null) {
call.answer(videoState);
InCallPresenter.getInstance().showInCall(false, /* showDialpad */
false);
}
}
}
Aggregations