use of com.android.internal.telephony.CallStateException in project XobotOS by xamarin.
the class CdmaCallTracker method acceptCall.
void acceptCall() throws CallStateException {
if (ringingCall.getState() == CdmaCall.State.INCOMING) {
Log.i("phone", "acceptCall: incoming...");
// Always unmute when answering a new call
setMute(false);
cm.acceptCall(obtainCompleteMessage());
} else if (ringingCall.getState() == CdmaCall.State.WAITING) {
CdmaConnection cwConn = (CdmaConnection) (ringingCall.getLatestConnection());
// Since there is no network response for supplimentary
// service for CDMA, we assume call waiting is answered.
// ringing Call state change to idle is in CdmaCall.detach
// triggered by updateParent.
cwConn.updateParent(ringingCall, foregroundCall);
cwConn.onConnectedInOrOut();
updatePhoneState();
switchWaitingOrHoldingAndActive();
} else {
throw new CallStateException("phone not ringing");
}
}
use of com.android.internal.telephony.CallStateException in project XobotOS by xamarin.
the class GsmCallTracker method hangupAllConnections.
void hangupAllConnections(GsmCall call) throws CallStateException {
try {
int count = call.connections.size();
for (int i = 0; i < count; i++) {
GsmConnection cn = (GsmConnection) call.connections.get(i);
cm.hangupConnection(cn.getGSMIndex(), obtainCompleteMessage());
}
} catch (CallStateException ex) {
Log.e(LOG_TAG, "hangupConnectionByIndex caught " + ex);
}
}
use of com.android.internal.telephony.CallStateException in project XobotOS by xamarin.
the class SipPhone method dialInternal.
private Connection dialInternal(String dialString) throws CallStateException {
clearDisconnected();
if (!canDial()) {
throw new CallStateException("cannot dial in current state");
}
if (foregroundCall.getState() == SipCall.State.ACTIVE) {
switchHoldingAndActive();
}
if (foregroundCall.getState() != SipCall.State.IDLE) {
//we should have failed in !canDial() above before we get here
throw new CallStateException("cannot dial in current state");
}
foregroundCall.setMute(false);
try {
Connection c = foregroundCall.dial(dialString);
return c;
} catch (SipException e) {
Log.e(LOG_TAG, "dial()", e);
throw new CallStateException("dial error: " + e);
}
}
use of com.android.internal.telephony.CallStateException in project XobotOS by xamarin.
the class GsmCallTracker method acceptCall.
void acceptCall() throws CallStateException {
if (ringingCall.getState() == GsmCall.State.INCOMING) {
Log.i("phone", "acceptCall: incoming...");
// Always unmute when answering a new call
setMute(false);
cm.acceptCall(obtainCompleteMessage());
} else if (ringingCall.getState() == GsmCall.State.WAITING) {
setMute(false);
switchWaitingOrHoldingAndActive();
} else {
throw new CallStateException("phone not ringing");
}
}
use of com.android.internal.telephony.CallStateException in project XobotOS by xamarin.
the class GsmCallTracker method dispose.
public void dispose() {
//Unregister for all events
cm.unregisterForCallStateChanged(this);
cm.unregisterForOn(this);
cm.unregisterForNotAvailable(this);
for (GsmConnection c : connections) {
try {
if (c != null)
hangup(c);
} catch (CallStateException ex) {
Log.e(LOG_TAG, "unexpected error on hangup during dispose");
}
}
try {
if (pendingMO != null)
hangup(pendingMO);
} catch (CallStateException ex) {
Log.e(LOG_TAG, "unexpected error on hangup during dispose");
}
clearDisconnected();
}
Aggregations