Search in sources :

Example 66 with Registrant

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

the class ServiceStateTracker method registerForRoamingOff.

/**
     * Registration point for combined roaming off
     * combined roaming is true when roaming is true and ONS differs SPN
     *
     * @param h handler to notify
     * @param what what code of message when delivered
     * @param obj placed in Message.obj
     */
public void registerForRoamingOff(Handler h, int what, Object obj) {
    Registrant r = new Registrant(h, what, obj);
    mRoamingOffRegistrants.add(r);
    if (!ss.getRoaming()) {
        r.notifyRegistrant();
    }
}
Also used : Registrant(android.os.Registrant)

Example 67 with Registrant

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

the class ServiceStateTracker method registerForNetworkAttached.

/**
     * Registration point for transition into network attached.
     * @param h handler to notify
     * @param what what code of message when delivered
     * @param obj in Message.obj
     */
public void registerForNetworkAttached(Handler h, int what, Object obj) {
    Registrant r = new Registrant(h, what, obj);
    mNetworkAttachedRegistrants.add(r);
    if (ss.getState() == ServiceState.STATE_IN_SERVICE) {
        r.notifyRegistrant();
    }
}
Also used : Registrant(android.os.Registrant)

Example 68 with Registrant

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

the class CDMAPhone method registerForEriFileLoaded.

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

Example 69 with Registrant

use of android.os.Registrant 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 70 with Registrant

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

the class IccRecords method registerForRecordsLoaded.

public void registerForRecordsLoaded(Handler h, int what, Object obj) {
    Registrant r = new Registrant(h, what, obj);
    recordsLoadedRegistrants.add(r);
    if (recordsToLoad == 0 && recordsRequested == true) {
        r.notifyRegistrant(new AsyncResult(null, null, null));
    }
}
Also used : Registrant(android.os.Registrant) AsyncResult(android.os.AsyncResult)

Aggregations

Registrant (android.os.Registrant)139 AsyncResult (android.os.AsyncResult)19 Message (android.os.Message)5 RegistrantList (android.os.RegistrantList)4 NetworkRegistrationInfo (android.telephony.NetworkRegistrationInfo)2 IllegalArgumentException (java.lang.IllegalArgumentException)2 UnsupportedAppUsage (android.compat.annotation.UnsupportedAppUsage)1 PhysicalChannelConfig (android.telephony.PhysicalChannelConfig)1 SubscriptionInfo (android.telephony.SubscriptionInfo)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1