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");
}
}
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;
}
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));
}
}
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);
}
}
}
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);
}
Aggregations