Search in sources :

Example 51 with AsyncResult

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

the class GsmCdmaPhone method sendUssdResponse.

@Override
public void sendUssdResponse(String ussdMessge) {
    if (isPhoneTypeGsm()) {
        GsmMmiCode mmi = GsmMmiCode.newFromUssdUserInput(ussdMessge, this, mUiccApplication.get());
        mPendingMMIs.add(mmi);
        mMmiRegistrants.notifyRegistrants(new AsyncResult(null, mmi, null));
        mmi.sendUssd(ussdMessge);
    } else {
        loge("sendUssdResponse: not possible in CDMA");
    }
}
Also used : GsmMmiCode(com.android.internal.telephony.gsm.GsmMmiCode) AsyncResult(android.os.AsyncResult)

Example 52 with AsyncResult

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

the class GsmCdmaPhone method handleExitEmergencyCallbackMode.

// CDMA
private void handleExitEmergencyCallbackMode(Message msg) {
    AsyncResult ar = (AsyncResult) msg.obj;
    if (DBG) {
        Rlog.d(LOG_TAG, "handleExitEmergencyCallbackMode,ar.exception , isInEcm=" + ar.exception + isInEcm());
    }
    // Remove pending exit Ecm runnable, if any
    removeCallbacks(mExitEcmRunnable);
    if (mEcmExitRespRegistrant != null) {
        mEcmExitRespRegistrant.notifyRegistrant(ar);
    }
    // exit, which may occur in some IRadio implementations.
    if (ar.exception == null || mIsTestingEmergencyCallbackMode) {
        if (isInEcm()) {
            setIsInEcm(false);
        }
        // release wakeLock
        if (mWakeLock.isHeld()) {
            mWakeLock.release();
        }
        // send an Intent
        sendEmergencyCallbackModeChange();
        // Re-initiate data connection
        mDataEnabledSettings.setInternalDataEnabled(true);
        notifyEmergencyCallRegistrants(false);
    }
    mIsTestingEmergencyCallbackMode = false;
}
Also used : AsyncResult(android.os.AsyncResult)

Example 53 with AsyncResult

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

the class BaseCommands method registerForEmergencyNumberList.

@Override
public void registerForEmergencyNumberList(Handler h, int what, Object obj) {
    mEmergencyNumberListRegistrants.addUnique(h, what, obj);
    // Notify the last emergency number list from radio to new registrants because they may
    // miss the latest indication (e.g. constructed in a delay after HAL is registrated).
    List<EmergencyNumber> lastEmergencyNumberListIndication = getLastEmergencyNumberListIndication();
    if (lastEmergencyNumberListIndication != null) {
        mEmergencyNumberListRegistrants.notifyRegistrants(new AsyncResult(null, lastEmergencyNumberListIndication, null));
    }
}
Also used : EmergencyNumber(android.telephony.emergency.EmergencyNumber) AsyncResult(android.os.AsyncResult)

Example 54 with AsyncResult

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

the class SmsDispatchersController method handleMessage.

/**
 * Handles events coming from the phone stack. Overridden from handler.
 *
 * @param msg the message to handle
 */
@Override
public void handleMessage(Message msg) {
    AsyncResult ar;
    switch(msg.what) {
        case EVENT_RADIO_ON:
        case // received unsol
        EVENT_IMS_STATE_CHANGED:
            mCi.getImsRegistrationState(this.obtainMessage(EVENT_IMS_STATE_DONE));
            break;
        case EVENT_IMS_STATE_DONE:
            ar = (AsyncResult) msg.obj;
            if (ar.exception == null) {
                updateImsInfo(ar);
            } else {
                Rlog.e(TAG, "IMS State query failed with exp " + ar.exception);
            }
            break;
        case EVENT_SERVICE_STATE_CHANGED:
        case EVENT_SMS_HANDLER_EXITING_WAITING_STATE:
            reevaluateTimerStatus();
            break;
        case EVENT_PARTIAL_SEGMENT_TIMER_EXPIRY:
            handlePartialSegmentTimerExpiry((Long) msg.obj);
            break;
        case EVENT_USER_UNLOCKED:
            if (VDBG) {
                logd("handleMessage: EVENT_USER_UNLOCKED");
            }
            mPhone.registerForServiceStateChanged(this, EVENT_SERVICE_STATE_CHANGED, null);
            resetPartialSegmentWaitTimer();
            break;
        default:
            if (isCdmaMo()) {
                mCdmaDispatcher.handleMessage(msg);
            } else {
                mGsmDispatcher.handleMessage(msg);
            }
    }
}
Also used : AsyncResult(android.os.AsyncResult)

Example 55 with AsyncResult

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

the class TelephonyDevController method registerRIL.

/**
 * each RIL call this interface to register/unregister the unsolicited hardware
 * configuration callback data it can provide.
 */
public static void registerRIL(CommandsInterface cmdsIf) {
    /* get the current configuration from this ril... */
    cmdsIf.getHardwareConfig(sRilHardwareConfig);
    /* ... process it ... */
    if (sRilHardwareConfig != null) {
        AsyncResult ar = (AsyncResult) sRilHardwareConfig.obj;
        if (ar.exception == null) {
            handleGetHardwareConfigChanged(ar);
        }
    }
    /* and register for async device configuration change. */
    cmdsIf.registerForHardwareConfigChanged(sTelephonyDevController, EVENT_HARDWARE_CONFIG_CHANGED, null);
}
Also used : AsyncResult(android.os.AsyncResult)

Aggregations

AsyncResult (android.os.AsyncResult)267 Test (org.junit.Test)60 Message (android.os.Message)57 TelephonyTest (com.android.internal.telephony.TelephonyTest)45 SmallTest (android.test.suitebuilder.annotation.SmallTest)26 ArrayList (java.util.ArrayList)21 Registrant (android.os.Registrant)19 FlakyTest (androidx.test.filters.FlakyTest)17 Intent (android.content.Intent)13 CellInfo (android.telephony.CellInfo)12 MediumTest (android.test.suitebuilder.annotation.MediumTest)12 SmallTest (androidx.test.filters.SmallTest)11 NetworkRegistrationInfo (android.telephony.NetworkRegistrationInfo)9 List (java.util.List)7 Mockito.anyString (org.mockito.Mockito.anyString)6 InvocationOnMock (org.mockito.invocation.InvocationOnMock)6 FlakyTest (android.support.test.filters.FlakyTest)5 MediumTest (android.support.test.filters.MediumTest)5 LteVopsSupportInfo (android.telephony.LteVopsSupportInfo)5 SmsMessage (android.telephony.SmsMessage)5