Search in sources :

Example 21 with UnsupportedAppUsage

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);
    }
}
Also used : PhoneConstants(com.android.internal.telephony.PhoneConstants) AsyncResult(android.os.AsyncResult) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 22 with UnsupportedAppUsage

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);
    }
}
Also used : Message(android.os.Message) ImsUtInterface(com.android.ims.ImsUtInterface) ImsException(com.android.ims.ImsException) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 23 with UnsupportedAppUsage

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();
    }
}
Also used : CommandException(com.android.internal.telephony.CommandException) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 24 with UnsupportedAppUsage

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);
    }
}
Also used : Message(android.os.Message) ImsUtInterface(com.android.ims.ImsUtInterface) ImsException(com.android.ims.ImsException) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 25 with UnsupportedAppUsage

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;
}
Also used : SmsMessage(android.telephony.SmsMessage) SmsCbMessage(android.telephony.SmsCbMessage) Message(android.os.Message) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Aggregations

UnsupportedAppUsage (android.compat.annotation.UnsupportedAppUsage)71 Message (android.os.Message)18 SmsMessage (android.telephony.SmsMessage)9 Intent (android.content.Intent)6 SipPhone (com.android.internal.telephony.sip.SipPhone)6 SmsCbMessage (android.telephony.SmsCbMessage)5 Cursor (android.database.Cursor)4 PendingIntent (android.app.PendingIntent)3 PackageManager (android.content.pm.PackageManager)3 AsyncResult (android.os.AsyncResult)3 PersistableBundle (android.os.PersistableBundle)3 CarrierConfigManager (android.telephony.CarrierConfigManager)3 SubscriptionInfo (android.telephony.SubscriptionInfo)3 SQLException (android.database.SQLException)2 SQLiteException (android.database.sqlite.SQLiteException)2 PowerManager (android.os.PowerManager)2 RadioAccessFamily (android.telephony.RadioAccessFamily)2 ImsException (com.android.ims.ImsException)2 ImsUtInterface (com.android.ims.ImsUtInterface)2 AppState (com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState)2