Add torch command
[fonbot.git] / src / ro / ieval / fonbot / Heavy.java
index c5c6de7462450b04f5529aaf38dc6621216e7991..f1afb0b3842f4f458ea489b74a94813c8be46247 100644 (file)
@@ -503,6 +503,9 @@ final class Heavy {
                case SCREENCAP:
                        Utils.sendMessage(context, replyTo, screencap_help);
                        break;
+               case TORCH:
+                       Utils.sendMessage(context, replyTo, torch_help);
+                       break;
                }
        }
 
@@ -1791,4 +1794,15 @@ final class Heavy {
        public static void screencap(final Context context, final Address replyTo, final String filename){
                new Thread(new ScreencapRunnable(context, replyTo, filename)).start();
        }
+
+       /**
+        * Toggle the torch state using the Torch (net.cactii.torch2) app.
+        *
+        * @param context Context instance
+        * @param replyTo reply Address
+        */
+       public static void torch(final Context context, final Address replyTo){
+               context.sendBroadcast(new Intent("net.cactii.flash2.TOGGLE_FLASHLIGHT"));
+               Utils.sendMessage(context, replyTo, toggling_torch_state);
+       }
 }
This page took 0.00958 seconds and 4 git commands to generate.