Search in sources :

Example 16 with Registrant

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

the class ServiceStateTracker method registerForDataConnectionDetached.

/**
     * Registration point for transition into DataConnection detached.
     * @param h handler to notify
     * @param what what code of message when delivered
     * @param obj placed in Message.obj
     */
public void registerForDataConnectionDetached(Handler h, int what, Object obj) {
    Registrant r = new Registrant(h, what, obj);
    mDetachedRegistrants.add(r);
    if (getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE) {
        r.notifyRegistrant();
    }
}
Also used : Registrant(android.os.Registrant)

Example 17 with Registrant

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

the class ServiceStateTracker method registerForPsRestrictedEnabled.

/**
     * Registration point for transition into packet service restricted zone.
     * @param h handler to notify
     * @param what what code of message when delivered
     * @param obj placed in Message.obj
     */
public void registerForPsRestrictedEnabled(Handler h, int what, Object obj) {
    Registrant r = new Registrant(h, what, obj);
    mPsRestrictEnabledRegistrants.add(r);
    if (mRestrictedState.isPsRestricted()) {
        r.notifyRegistrant();
    }
}
Also used : Registrant(android.os.Registrant)

Example 18 with Registrant

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

the class ServiceStateTracker method registerForPsRestrictedDisabled.

/**
     * Registration point for transition out of packet service restricted zone.
     * @param h handler to notify
     * @param what what code of message when delivered
     * @param obj placed in Message.obj
     */
public void registerForPsRestrictedDisabled(Handler h, int what, Object obj) {
    Registrant r = new Registrant(h, what, obj);
    mPsRestrictDisabledRegistrants.add(r);
    if (mRestrictedState.isPsRestricted()) {
        r.notifyRegistrant();
    }
}
Also used : Registrant(android.os.Registrant)

Example 19 with Registrant

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

the class GsmCallTracker method registerForVoiceCallEnded.

public void registerForVoiceCallEnded(Handler h, int what, Object obj) {
    Registrant r = new Registrant(h, what, obj);
    voiceCallEndedRegistrants.add(r);
}
Also used : Registrant(android.os.Registrant)

Example 20 with Registrant

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

the class GsmConnection method processNextPostDialChar.

private void processNextPostDialChar() {
    char c = 0;
    Registrant postDialHandler;
    if (postDialState == PostDialState.CANCELLED) {
        //Log.v("GSM", "##### processNextPostDialChar: postDialState == CANCELLED, bail");
        return;
    }
    if (postDialString == null || postDialString.length() <= nextPostDialChar) {
        setPostDialState(PostDialState.COMPLETE);
        // 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("GSM", "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;
        //Log.v("GSM", "##### processNextPostDialChar: send msg to postDialHandler, arg1=" + c);
        notifyMessage.sendToTarget();
    }
}
Also used : Message(android.os.Message) Registrant(android.os.Registrant) AsyncResult(android.os.AsyncResult)

Aggregations

Registrant (android.os.Registrant)45 AsyncResult (android.os.AsyncResult)5 Message (android.os.Message)2