Search in sources :

Example 81 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class IntentService method onStart.

@Override
public void onStart(Intent intent, int startId) {
    Message msg = mServiceHandler.obtainMessage();
    msg.arg1 = startId;
    msg.obj = intent;
    mServiceHandler.sendMessage(msg);
}
Also used : Message(android.os.Message)

Example 82 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class AsyncQueryHandler method startDelete.

/**
     * This method begins an asynchronous delete. When the delete operation is
     * done {@link #onDeleteComplete} is called.
     *
     * @param token A token passed into {@link #onDeleteComplete} to identify
     *  the delete operation.
     * @param cookie An object that gets passed into {@link #onDeleteComplete}
     * @param uri the Uri passed to the delete operation.
     * @param selection the where clause.
     */
public final void startDelete(int token, Object cookie, Uri uri, String selection, String[] selectionArgs) {
    // Use the token as what so cancelOperations works properly
    Message msg = mWorkerThreadHandler.obtainMessage(token);
    msg.arg1 = EVENT_ARG_DELETE;
    WorkerArgs args = new WorkerArgs();
    args.handler = this;
    args.uri = uri;
    args.cookie = cookie;
    args.selection = selection;
    args.selectionArgs = selectionArgs;
    msg.obj = args;
    mWorkerThreadHandler.sendMessage(msg);
}
Also used : Message(android.os.Message)

Example 83 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class AsyncQueryHandler method startInsert.

/**
     * This method begins an asynchronous insert. When the insert operation is
     * done {@link #onInsertComplete} is called.
     *
     * @param token A token passed into {@link #onInsertComplete} to identify
     *  the insert operation.
     * @param cookie An object that gets passed into {@link #onInsertComplete}
     * @param uri the Uri passed to the insert operation.
     * @param initialValues the ContentValues parameter passed to the insert operation.
     */
public final void startInsert(int token, Object cookie, Uri uri, ContentValues initialValues) {
    // Use the token as what so cancelOperations works properly
    Message msg = mWorkerThreadHandler.obtainMessage(token);
    msg.arg1 = EVENT_ARG_INSERT;
    WorkerArgs args = new WorkerArgs();
    args.handler = this;
    args.uri = uri;
    args.cookie = cookie;
    args.values = initialValues;
    msg.obj = args;
    mWorkerThreadHandler.sendMessage(msg);
}
Also used : Message(android.os.Message)

Example 84 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class Camera method postEventFromNative.

private static void postEventFromNative(Object camera_ref, int what, int arg1, int arg2, Object obj) {
    Camera c = (Camera) ((WeakReference) camera_ref).get();
    if (c == null)
        return;
    if (c.mEventHandler != null) {
        Message m = c.mEventHandler.obtainMessage(what, arg1, arg2, obj);
        c.mEventHandler.sendMessage(m);
    }
}
Also used : Message(android.os.Message)

Example 85 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class GeofenceHardwareImpl method unregisterForMonitorStateChangeCallback.

public boolean unregisterForMonitorStateChangeCallback(int monitoringType, IGeofenceHardwareMonitorCallback callback) {
    Message m = mCallbacksHandler.obtainMessage(CALLBACK_REMOVE, callback);
    m.arg1 = monitoringType;
    mCallbacksHandler.sendMessage(m);
    return true;
}
Also used : Message(android.os.Message)

Aggregations

Message (android.os.Message)3198 Handler (android.os.Handler)347 RemoteException (android.os.RemoteException)263 Bundle (android.os.Bundle)210 Test (org.junit.Test)144 Intent (android.content.Intent)130 IOException (java.io.IOException)124 Point (android.graphics.Point)86 HashMap (java.util.HashMap)77 SomeArgs (com.android.internal.os.SomeArgs)67 SmallTest (android.test.suitebuilder.annotation.SmallTest)64 Messenger (android.os.Messenger)63 ArrayList (java.util.ArrayList)59 View (android.view.View)52 File (java.io.File)50 MediumTest (android.test.suitebuilder.annotation.MediumTest)43 TextView (android.widget.TextView)41 IBinder (android.os.IBinder)38 Map (java.util.Map)37 PendingIntent (android.app.PendingIntent)33