NEXT, PREV, BATT, CALLLOG, SMSLOG,
LS, RM, CONTACTS, DISABLE, ENABLE,
POLL, HANGUP, ANSWER, LAUNCH, DATA,
NEXT, PREV, BATT, CALLLOG, SMSLOG,
LS, RM, CONTACTS, DISABLE, ENABLE,
POLL, HANGUP, ANSWER, LAUNCH, DATA,
- GPS, GLOCATION, REBOOT, SHUTDOWN, NOTIFY
+ GPS, GLOCATION, REBOOT, NOTIFY, SCREENCAP,
+ TORCH
*/
public static URL getServerURL(final Context context, final String path) throws MalformedURLException{
final String hostname=PreferenceManager.getDefaultSharedPreferences(context).getString("hostname", "fonbot.ieval.ro");
*/
public static URL getServerURL(final Context context, final String path) throws MalformedURLException{
final String hostname=PreferenceManager.getDefaultSharedPreferences(context).getString("hostname", "fonbot.ieval.ro");
final URL url=new URL("https", hostname, port, path);
return url;
}
/**
final URL url=new URL("https", hostname, port, path);
return url;
}
/**
new HttpCallExecutableRunnable("/get", null, context, new PollResultCallback(context), false).execute();
}
new HttpCallExecutableRunnable("/get", null, context, new PollResultCallback(context), false).execute();
}
+ /**
+ * Poll the server for pending commands from {@link FonBotMainService}. This function should be used from BroadcastReceviers instead of {@link #pollServer}
+ *
+ * @param context Context instance
+ */
+ public static void safePollServer(final Context context){
+ final Intent intent=new Intent(context, FonBotMainService.class);
+ intent.setAction(FonBotMainService.ACTION_TRIGGER_POLL);
+ context.startService(intent);
+ }
*/
private static void processCommand(final Context context, final Command cmd,final String[] args,final Address replyTo){
if(Heavy.isCommandDisabled(context, cmd)){
*/
private static void processCommand(final Context context, final Command cmd,final String[] args,final Address replyTo){
if(Heavy.isCommandDisabled(context, cmd)){
- sendMessage(context, replyTo, command_disabled);
+ sendMessage(context, replyTo, command_disabled, cmd.toString());
case NOTIFY:
if(args.length!=1 && args.length!=3){
Heavy.help(context, replyTo, toNonNull(Command.NOTIFY));
case NOTIFY:
if(args.length!=1 && args.length!=3){
Heavy.help(context, replyTo, toNonNull(Command.NOTIFY));
else
Heavy.notify(context, replyTo, id, toNonNull(args[1]), toNonNull(args[2]));
break;
else
Heavy.notify(context, replyTo, id, toNonNull(args[1]), toNonNull(args[2]));
break;
+
+ case SCREENCAP:
+ if(args.length != 1){
+ Heavy.help(context, replyTo, toNonNull(Command.SCREENCAP));
+ return;
+ }
+
+ Heavy.screencap(context, replyTo, args[0]);
+ break;
+
+ case TORCH:
+ Heavy.torch(context, replyTo);
+ break;