com.android.reverse.request.CommandHandler Java Examples

The following examples show how to use com.android.reverse.request.CommandHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommandBroadcastReceiver.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Override
public void onReceive(final Context arg0, Intent arg1) {
	if (INTENT_ACTION.equals(arg1.getAction())) {
		try {
			int pid = arg1.getIntExtra(TARGET_KEY, 0);
			if (pid == android.os.Process.myPid()) {
				String cmd = arg1.getStringExtra(COMMAND_NAME_KEY);
				final CommandHandler handler = CommandHandlerParser
						.parserCommand(cmd);
				if (handler != null) {
					new Thread(new Runnable() {
						@Override
						public void run() {
							handler.doAction();
						}
					}).start();
				}else{
					Logger.log("the cmd is invalid");
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
 
Example #2
Source File: CommandBroadcastReceiver.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
@Override
public void onReceive(final Context arg0, Intent arg1) {
	// TODO Auto-generated method stub
	if (INTENT_ACTION.equals(arg1.getAction())) {
		try {
			int pid = arg1.getIntExtra(TARGET_KEY, 0);
			if (pid == android.os.Process.myPid()) {
				String cmd = arg1.getStringExtra(COMMAND_NAME_KEY);
				final CommandHandler handler = CommandHandlerParser
						.parserCommand(cmd);
				if (handler != null) {
					new Thread(new Runnable() {
						@Override
						public void run() {
							// TODO Auto-generated method stub
							handler.doAction();
						}
					}).start();
				}else{
					Logger.log("the cmd is invalid");
				}
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
 
Example #3
Source File: CommandBroadcastReceiver.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
@Override
public void onReceive(final Context arg0, Intent arg1) {
	// TODO Auto-generated method stub
	if (INTENT_ACTION.equals(arg1.getAction())) {
		try {
			int pid = arg1.getIntExtra(TARGET_KEY, 0);
			if (pid == android.os.Process.myPid()) {
				String cmd = arg1.getStringExtra(COMMAND_NAME_KEY);
				final CommandHandler handler = CommandHandlerParser
						.parserCommand(cmd);
				if (handler != null) {
					new Thread(new Runnable() {
						@Override
						public void run() {
							// TODO Auto-generated method stub
							handler.doAction();
						}
					}).start();
				}else{
					Logger.log("the cmd is invalid");
				}
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
 
Example #4
Source File: CommandBroadcastReceiver.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
@Override
public void onReceive(final Context arg0, Intent arg1) {
	// TODO Auto-generated method stub
	if (INTENT_ACTION.equals(arg1.getAction())) {
		try {
			int pid = arg1.getIntExtra(TARGET_KEY, 0);
			if (pid == android.os.Process.myPid()) {
				String cmd = arg1.getStringExtra(COMMAND_NAME_KEY);
				final CommandHandler handler = CommandHandlerParser
						.parserCommand(cmd);
				if (handler != null) {
					new Thread(new Runnable() {
						@Override
						public void run() {
							// TODO Auto-generated method stub
							handler.doAction();
						}
					}).start();
				}else{
					Logger.log("the cmd is invalid");
				}
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}