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