Search in sources :

Example 71 with Message

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

the class EventSenderImpl method fireKeyboardEventsToElement.

public void fireKeyboardEventsToElement(int domNode) {
    Message msg = mEventSenderHandler.obtainMessage(MSG_FIRE_KEYBOARD_EVENTS_TO_ELEMENT);
    msg.arg1 = domNode;
    msg.sendToTarget();
}
Also used : Message(android.os.Message)

Example 72 with Message

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

the class EventSenderImpl method cancelTouchPoint.

public void cancelTouchPoint(int id) {
    Message msg = mEventSenderHandler.obtainMessage(MSG_CANCEL_TOUCH_POINT);
    msg.arg1 = id;
    msg.sendToTarget();
}
Also used : Message(android.os.Message)

Example 73 with Message

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

the class SerialChat method run.

public void run() {
    Log.d(TAG, "run");
    int ret = 0;
    byte[] buffer = new byte[1024];
    while (ret >= 0) {
        try {
            Log.d(TAG, "calling read");
            mInputBuffer.clear();
            ret = mSerialPort.read(mInputBuffer);
            Log.d(TAG, "read returned " + ret);
            mInputBuffer.get(buffer, 0, ret);
        } catch (IOException e) {
            Log.e(TAG, "read failed", e);
            break;
        }
        if (ret > 0) {
            Message m = Message.obtain(mHandler, MESSAGE_LOG);
            String text = new String(buffer, 0, ret);
            Log.d(TAG, "chat: " + text);
            m.obj = text;
            mHandler.sendMessage(m);
        }
    }
    Log.d(TAG, "thread out");
}
Also used : Message(android.os.Message) IOException(java.io.IOException)

Example 74 with Message

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

the class WifiMonitor method notifyNetworkStateChange.

/**
     * Send the state machine a notification that the state of Wifi connectivity
     * has changed.
     * @param networkId the configured network on which the state change occurred
     * @param newState the new network state
     * @param BSSID when the new state is {@link DetailedState#CONNECTED
     * NetworkInfo.DetailedState.CONNECTED},
     * this is the MAC address of the access point. Otherwise, it
     * is {@code null}.
     */
void notifyNetworkStateChange(NetworkInfo.DetailedState newState, String BSSID, int netId) {
    if (newState == NetworkInfo.DetailedState.CONNECTED) {
        Message m = mStateMachine.obtainMessage(NETWORK_CONNECTION_EVENT, netId, 0, BSSID);
        mStateMachine.sendMessage(m);
    } else {
        Message m = mStateMachine.obtainMessage(NETWORK_DISCONNECTION_EVENT, netId, 0, BSSID);
        mStateMachine.sendMessage(m);
    }
}
Also used : Message(android.os.Message)

Example 75 with Message

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

the class WifiStateMachine method syncAddOrUpdateNetwork.

/**
     * Add a network synchronously
     *
     * @return network id of the new network
     */
public int syncAddOrUpdateNetwork(AsyncChannel channel, WifiConfiguration config) {
    Message resultMsg = channel.sendMessageSynchronously(CMD_ADD_OR_UPDATE_NETWORK, config);
    int result = resultMsg.arg1;
    resultMsg.recycle();
    return result;
}
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