Search in sources :

Example 51 with Registrant

use of android.os.Registrant in project android_frameworks_opt_telephony by LineageOS.

the class ServiceStateTracker method registerForDataRoamingOff.

/**
 * Registration point for roaming off of mobile data
 * 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
 * @param notifyNow notify upon registration if data roaming is off
 */
public void registerForDataRoamingOff(Handler h, int what, Object obj, boolean notifyNow) {
    Registrant r = new Registrant(h, what, obj);
    mDataRoamingOffRegistrants.add(r);
    if (notifyNow && !mSS.getDataRoaming()) {
        r.notifyRegistrant();
    }
}
Also used : Registrant(android.os.Registrant)

Example 52 with Registrant

use of android.os.Registrant in project android_frameworks_opt_telephony by LineageOS.

the class ServiceStateTracker method registerForNetworkDetached.

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

Example 53 with Registrant

use of android.os.Registrant in project android_frameworks_opt_telephony by LineageOS.

the class ServiceStateTracker method registerForNrStateChanged.

/**
 * Registers for 5G NR state changed.
 * @param h handler to notify
 * @param what what code of message when delivered
 * @param obj placed in Message.obj
 */
public void registerForNrStateChanged(Handler h, int what, Object obj) {
    Registrant r = new Registrant(h, what, obj);
    mNrStateChangedRegistrants.add(r);
}
Also used : Registrant(android.os.Registrant)

Example 54 with Registrant

use of android.os.Registrant in project android_frameworks_opt_telephony by LineageOS.

the class ServiceStateTracker method registerForDataConnectionDetached.

/**
 * Registration point for transition into DataConnection detached.
 * @param transport Transport type
 * @param h handler to notify
 * @param what what code of message when delivered
 * @param obj placed in Message.obj
 */
public void registerForDataConnectionDetached(@TransportType int transport, Handler h, int what, Object obj) {
    Registrant r = new Registrant(h, what, obj);
    if (mDetachedRegistrants.get(transport) == null) {
        mDetachedRegistrants.put(transport, new RegistrantList());
    }
    mDetachedRegistrants.get(transport).add(r);
    if (mSS != null) {
        NetworkRegistrationInfo netRegState = mSS.getNetworkRegistrationInfo(NetworkRegistrationInfo.DOMAIN_PS, transport);
        if (netRegState != null && !netRegState.isInService()) {
            r.notifyRegistrant();
        }
    }
}
Also used : NetworkRegistrationInfo(android.telephony.NetworkRegistrationInfo) RegistrantList(android.os.RegistrantList) Registrant(android.os.Registrant)

Example 55 with Registrant

use of android.os.Registrant in project android_frameworks_opt_telephony by LineageOS.

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)

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