Search in sources :

Example 31 with AsyncResult

use of android.os.AsyncResult in project XobotOS by xamarin.

the class PhoneBase method notifyDisconnectP.

/**
     * To be invoked when a voice call Connection disconnects.
     *
     * Subclasses of Phone probably want to replace this with a
     * version scoped to their packages
     */
protected void notifyDisconnectP(Connection cn) {
    AsyncResult ar = new AsyncResult(null, cn, null);
    mDisconnectRegistrants.notifyRegistrants(ar);
}
Also used : AsyncResult(android.os.AsyncResult)

Example 32 with AsyncResult

use of android.os.AsyncResult in project XobotOS by xamarin.

the class PhoneBase method notifyNewRingingConnectionP.

/**
     * Notify registrants of a new ringing Connection.
     * Subclasses of Phone probably want to replace this with a
     * version scoped to their packages
     */
protected void notifyNewRingingConnectionP(Connection cn) {
    if (!mIsVoiceCapable)
        return;
    AsyncResult ar = new AsyncResult(null, cn, null);
    mNewRingingConnectionRegistrants.notifyRegistrants(ar);
}
Also used : AsyncResult(android.os.AsyncResult)

Example 33 with AsyncResult

use of android.os.AsyncResult in project XobotOS by xamarin.

the class CdmaConnection method processNextPostDialChar.

void processNextPostDialChar() {
    char c = 0;
    Registrant postDialHandler;
    if (postDialState == PostDialState.CANCELLED) {
        releaseWakeLock();
        //Log.v("CDMA", "##### processNextPostDialChar: postDialState == CANCELLED, bail");
        return;
    }
    if (postDialString == null || postDialString.length() <= nextPostDialChar) {
        setPostDialState(PostDialState.COMPLETE);
        // We were holding a wake lock until pause-dial was complete, so give it up now
        releaseWakeLock();
        // notifyMessage.arg1 is 0 on complete
        c = 0;
    } else {
        boolean isValid;
        setPostDialState(PostDialState.STARTED);
        c = postDialString.charAt(nextPostDialChar++);
        isValid = processPostDialChar(c);
        if (!isValid) {
            // Will call processNextPostDialChar
            h.obtainMessage(EVENT_NEXT_POST_DIAL).sendToTarget();
            // Don't notify application
            Log.e("CDMA", "processNextPostDialChar: c=" + c + " isn't valid!");
            return;
        }
    }
    postDialHandler = owner.phone.mPostDialHandler;
    Message notifyMessage;
    if (postDialHandler != null && (notifyMessage = postDialHandler.messageForRegistrant()) != null) {
        // The AsyncResult.result is the Connection object
        PostDialState state = postDialState;
        AsyncResult ar = AsyncResult.forMessage(notifyMessage);
        ar.result = this;
        ar.userObj = state;
        // arg1 is the character that was/is being processed
        notifyMessage.arg1 = c;
        notifyMessage.sendToTarget();
    }
}
Also used : Message(android.os.Message) Registrant(android.os.Registrant) AsyncResult(android.os.AsyncResult)

Example 34 with AsyncResult

use of android.os.AsyncResult in project XobotOS by xamarin.

the class CdmaLteServiceStateTracker method handleMessage.

@Override
public void handleMessage(Message msg) {
    AsyncResult ar;
    int[] ints;
    String[] strings;
    switch(msg.what) {
        case EVENT_POLL_STATE_GPRS:
            if (DBG)
                log("handleMessage EVENT_POLL_STATE_GPRS");
            ar = (AsyncResult) msg.obj;
            handlePollStateResult(msg.what, ar);
            break;
        case EVENT_SIM_READY:
            if (DBG)
                log("handleMessage EVENT_SIM_READY");
            isSubscriptionFromRuim = false;
            // This is to avoid confilct with RUIM_READY scenario)
            if (mNeedToRegForSimLoaded) {
                phone.mIccRecords.registerForRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null);
                mNeedToRegForSimLoaded = false;
            }
            pollState();
            // Signal strength polling stops when radio is off.
            queueNextSignalStrengthPoll();
            // load ERI file
            phone.prepareEri();
            break;
        case EVENT_SIM_RECORDS_LOADED:
            CdmaLteUiccRecords sim = (CdmaLteUiccRecords) phone.mIccRecords;
            if ((sim != null) && sim.isProvisioned()) {
                mMdn = sim.getMdn();
                mMin = sim.getMin();
                parseSidNid(sim.getSid(), sim.getNid());
                mPrlVersion = sim.getPrlVersion();
                ;
                mIsMinInfoReady = true;
                updateOtaspState();
            }
            // SID/NID/PRL is loaded. Poll service state
            // again to update to the roaming state with
            // the latest variables.
            pollState();
            break;
        default:
            super.handleMessage(msg);
    }
}
Also used : AsyncResult(android.os.AsyncResult)

Example 35 with AsyncResult

use of android.os.AsyncResult in project XobotOS by xamarin.

the class IccRecords method handleMessage.

//***** Overridden from Handler
@Override
public void handleMessage(Message msg) {
    switch(msg.what) {
        case EVENT_GET_ICC_RECORD_DONE:
            try {
                AsyncResult ar = (AsyncResult) msg.obj;
                IccRecordLoaded recordLoaded = (IccRecordLoaded) ar.userObj;
                if (DBG)
                    log(recordLoaded.getEfName() + " LOADED");
                if (ar.exception != null) {
                    loge("Record Load Exception: " + ar.exception);
                } else {
                    recordLoaded.onRecordLoaded(ar);
                }
            } catch (RuntimeException exc) {
                // I don't want these exceptions to be fatal
                loge("Exception parsing SIM record: " + exc);
            } finally {
                // Count up record load responses even if they are fails
                onRecordLoaded();
            }
            break;
        default:
            super.handleMessage(msg);
    }
}
Also used : AsyncResult(android.os.AsyncResult)

Aggregations

AsyncResult (android.os.AsyncResult)42 Message (android.os.Message)10 Registrant (android.os.Registrant)5 SmsMessage (android.telephony.SmsMessage)2 GsmCellLocation (android.telephony.gsm.GsmCellLocation)2 AdnRecord (com.android.internal.telephony.AdnRecord)2 ArrayList (java.util.ArrayList)2 AlertDialog (android.app.AlertDialog)1 CanceledException (android.app.PendingIntent.CanceledException)1 AdnRecordLoader (com.android.internal.telephony.AdnRecordLoader)1 CallForwardInfo (com.android.internal.telephony.CallForwardInfo)1 IccException (com.android.internal.telephony.IccException)1 CdmaInformationRecords (com.android.internal.telephony.cdma.CdmaInformationRecords)1 GsmConnection (com.android.internal.telephony.gsm.GsmConnection)1 SuppServiceNotification (com.android.internal.telephony.gsm.SuppServiceNotification)1