Search in sources :

Example 41 with AsyncResult

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

the class AdnRecordCache method handleMessage.

//***** Overridden from Handler
public void handleMessage(Message msg) {
    AsyncResult ar;
    int efid;
    switch(msg.what) {
        case EVENT_LOAD_ALL_ADN_LIKE_DONE:
            /* arg1 is efid, obj.result is ArrayList<AdnRecord>*/
            ar = (AsyncResult) msg.obj;
            efid = msg.arg1;
            ArrayList<Message> waiters;
            waiters = adnLikeWaiters.get(efid);
            adnLikeWaiters.delete(efid);
            if (ar.exception == null) {
                adnLikeFiles.put(efid, (ArrayList<AdnRecord>) ar.result);
            }
            notifyWaiters(waiters, ar);
            break;
        case EVENT_UPDATE_ADN_DONE:
            ar = (AsyncResult) msg.obj;
            efid = msg.arg1;
            int index = msg.arg2;
            AdnRecord adn = (AdnRecord) (ar.userObj);
            if (ar.exception == null) {
                adnLikeFiles.get(efid).set(index - 1, adn);
                mUsimPhoneBookManager.invalidateCache();
            }
            Message response = userWriteResponse.get(efid);
            userWriteResponse.delete(efid);
            AsyncResult.forMessage(response, null, ar.exception);
            response.sendToTarget();
            break;
    }
}
Also used : Message(android.os.Message) AsyncResult(android.os.AsyncResult)

Example 42 with AsyncResult

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

the class BaseCommands method registerForRilConnected.

/**
     * {@inheritDoc}
     */
@Override
public void registerForRilConnected(Handler h, int what, Object obj) {
    Log.d(LOG_TAG, "registerForRilConnected h=" + h + " w=" + what);
    Registrant r = new Registrant(h, what, obj);
    mRilConnectedRegistrants.add(r);
    if (mRilVersion != -1) {
        Log.d(LOG_TAG, "Notifying: ril connected mRilVersion=" + mRilVersion);
        r.notifyRegistrant(new AsyncResult(null, new Integer(mRilVersion), null));
    }
}
Also used : Registrant(android.os.Registrant) AsyncResult(android.os.AsyncResult)

Aggregations

AsyncResult (android.os.AsyncResult)42 Message (android.os.Message)10 Registrant (android.os.Registrant)5 SmsMessage (android.telephony.SmsMessage)2 GsmCellLocation (android.telephony.gsm.GsmCellLocation)2 AdnRecord (com.android.internal.telephony.AdnRecord)2 ArrayList (java.util.ArrayList)2 AlertDialog (android.app.AlertDialog)1 CanceledException (android.app.PendingIntent.CanceledException)1 AdnRecordLoader (com.android.internal.telephony.AdnRecordLoader)1 CallForwardInfo (com.android.internal.telephony.CallForwardInfo)1 IccException (com.android.internal.telephony.IccException)1 CdmaInformationRecords (com.android.internal.telephony.cdma.CdmaInformationRecords)1 GsmConnection (com.android.internal.telephony.gsm.GsmConnection)1 SuppServiceNotification (com.android.internal.telephony.gsm.SuppServiceNotification)1