use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhoneCallTracker method updatePhoneState.
@UnsupportedAppUsage
private void updatePhoneState() {
PhoneConstants.State oldState = mState;
boolean isPendingMOIdle = mPendingMO == null || !mPendingMO.getState().isAlive();
if (mRingingCall.isRinging()) {
mState = PhoneConstants.State.RINGING;
} else if (!isPendingMOIdle || !mForegroundCall.isIdle() || !mBackgroundCall.isIdle()) {
// There is a non-idle call, so we're off the hook.
mState = PhoneConstants.State.OFFHOOK;
} else {
mState = PhoneConstants.State.IDLE;
}
if (mState == PhoneConstants.State.IDLE && oldState != mState) {
mVoiceCallEndedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
} else if (oldState == PhoneConstants.State.IDLE && oldState != mState) {
mVoiceCallStartedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
}
if (DBG) {
log("updatePhoneState pendingMo = " + (mPendingMO == null ? "null" : mPendingMO.getState()) + ", fg= " + mForegroundCall.getState() + "(" + mForegroundCall.getConnectionsCount() + "), bg= " + mBackgroundCall.getState() + "(" + mBackgroundCall.getConnectionsCount() + ")");
log("updatePhoneState oldState=" + oldState + ", newState=" + mState);
}
if (mState != oldState) {
mPhone.notifyPhoneStateChanged();
mMetrics.writePhoneState(mPhone.getPhoneId(), mState);
notifyPhoneStateChanged(oldState, mState);
}
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhone method setCallForwardingOption.
@UnsupportedAppUsage
@Override
public void setCallForwardingOption(int commandInterfaceCFAction, int commandInterfaceCFReason, String dialingNumber, int serviceClass, int timerSeconds, Message onComplete) {
if (DBG) {
logd("setCallForwardingOption action=" + commandInterfaceCFAction + ", reason=" + commandInterfaceCFReason + " serviceClass=" + serviceClass);
}
if ((isValidCommandInterfaceCFAction(commandInterfaceCFAction)) && (isValidCommandInterfaceCFReason(commandInterfaceCFReason))) {
Message resp;
Cf cf = new Cf(dialingNumber, GsmMmiCode.isVoiceUnconditionalForwarding(commandInterfaceCFReason, serviceClass), onComplete);
resp = obtainMessage(EVENT_SET_CALL_FORWARD_DONE, isCfEnable(commandInterfaceCFAction) ? 1 : 0, 0, cf);
try {
ImsUtInterface ut = mCT.getUtInterface();
ut.updateCallForward(getActionFromCFAction(commandInterfaceCFAction), getConditionFromCFReason(commandInterfaceCFReason), dialingNumber, serviceClass, timerSeconds, resp);
} catch (ImsException e) {
sendErrorResponse(onComplete, e);
}
} else if (onComplete != null) {
sendErrorResponse(onComplete);
}
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhone method sendErrorResponse.
@UnsupportedAppUsage
private void sendErrorResponse(Message onComplete) {
logd("sendErrorResponse");
if (onComplete != null) {
AsyncResult.forMessage(onComplete, null, new CommandException(CommandException.Error.GENERIC_FAILURE));
onComplete.sendToTarget();
}
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhone method getCallWaiting.
@UnsupportedAppUsage
@Override
public void getCallWaiting(Message onComplete) {
if (DBG)
logd("getCallWaiting");
Message resp;
resp = obtainMessage(EVENT_GET_CALL_WAITING_DONE, onComplete);
try {
ImsUtInterface ut = mCT.getUtInterface();
ut.queryCallWaiting(resp);
} catch (ImsException e) {
sendErrorResponse(onComplete, e);
}
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class IccSmsInterfaceManager method setCdmaBroadcastConfig.
@UnsupportedAppUsage
private boolean setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs) {
if (DBG) {
log("Calling setCdmaBroadcastConfig with " + configs.length + " configurations");
}
enforceNotOnHandlerThread("setCdmaBroadcastConfig");
synchronized (mLock) {
Message response = mHandler.obtainMessage(EVENT_SET_BROADCAST_CONFIG_DONE);
mSuccess = false;
mPhone.mCi.setCdmaBroadcastConfig(configs, response);
try {
mLock.wait();
} catch (InterruptedException e) {
loge("interrupted while trying to set cdma broadcast config");
}
}
return mSuccess;
}
Aggregations