use of android.os.AsyncResult in project XobotOS by xamarin.
the class PhoneBase method notifyDisconnectP.
/**
* To be invoked when a voice call Connection disconnects.
*
* Subclasses of Phone probably want to replace this with a
* version scoped to their packages
*/
protected void notifyDisconnectP(Connection cn) {
AsyncResult ar = new AsyncResult(null, cn, null);
mDisconnectRegistrants.notifyRegistrants(ar);
}
use of android.os.AsyncResult in project XobotOS by xamarin.
the class PhoneBase method notifyNewRingingConnectionP.
/**
* Notify registrants of a new ringing Connection.
* Subclasses of Phone probably want to replace this with a
* version scoped to their packages
*/
protected void notifyNewRingingConnectionP(Connection cn) {
if (!mIsVoiceCapable)
return;
AsyncResult ar = new AsyncResult(null, cn, null);
mNewRingingConnectionRegistrants.notifyRegistrants(ar);
}
use of android.os.AsyncResult 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();
}
}
use of android.os.AsyncResult in project XobotOS by xamarin.
the class CdmaLteServiceStateTracker method handleMessage.
@Override
public void handleMessage(Message msg) {
AsyncResult ar;
int[] ints;
String[] strings;
switch(msg.what) {
case EVENT_POLL_STATE_GPRS:
if (DBG)
log("handleMessage EVENT_POLL_STATE_GPRS");
ar = (AsyncResult) msg.obj;
handlePollStateResult(msg.what, ar);
break;
case EVENT_SIM_READY:
if (DBG)
log("handleMessage EVENT_SIM_READY");
isSubscriptionFromRuim = false;
// This is to avoid confilct with RUIM_READY scenario)
if (mNeedToRegForSimLoaded) {
phone.mIccRecords.registerForRecordsLoaded(this, EVENT_SIM_RECORDS_LOADED, null);
mNeedToRegForSimLoaded = false;
}
pollState();
// Signal strength polling stops when radio is off.
queueNextSignalStrengthPoll();
// load ERI file
phone.prepareEri();
break;
case EVENT_SIM_RECORDS_LOADED:
CdmaLteUiccRecords sim = (CdmaLteUiccRecords) phone.mIccRecords;
if ((sim != null) && sim.isProvisioned()) {
mMdn = sim.getMdn();
mMin = sim.getMin();
parseSidNid(sim.getSid(), sim.getNid());
mPrlVersion = sim.getPrlVersion();
;
mIsMinInfoReady = true;
updateOtaspState();
}
// SID/NID/PRL is loaded. Poll service state
// again to update to the roaming state with
// the latest variables.
pollState();
break;
default:
super.handleMessage(msg);
}
}
use of android.os.AsyncResult in project XobotOS by xamarin.
the class IccRecords method handleMessage.
//***** Overridden from Handler
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
case EVENT_GET_ICC_RECORD_DONE:
try {
AsyncResult ar = (AsyncResult) msg.obj;
IccRecordLoaded recordLoaded = (IccRecordLoaded) ar.userObj;
if (DBG)
log(recordLoaded.getEfName() + " LOADED");
if (ar.exception != null) {
loge("Record Load Exception: " + ar.exception);
} else {
recordLoaded.onRecordLoaded(ar);
}
} catch (RuntimeException exc) {
// I don't want these exceptions to be fatal
loge("Exception parsing SIM record: " + exc);
} finally {
// Count up record load responses even if they are fails
onRecordLoaded();
}
break;
default:
super.handleMessage(msg);
}
}
Aggregations