</string>
<string name="flash_help">
Usage: flash on/off\n
- Turns the flashlight on or off\n
+ Turns the flashlight on or off. This is unreliable. If you have the Torch app installed, use the torch command instead.\n
Example: flash on
</string>
<string name="echo_help">
<string name="screencap_successful">Screencap successful</string>
<string name="screencap_failed">Screencap failed. Remember: the screencap command requires root access</string>
<string name="screencap_help">
- Usage: screencap filename
- Takes a screen capture and saves it to the given filename as a PNG image file.
+ Usage: screencap filename\n
+ Takes a screen capture and saves it to the given filename as a PNG image file. This requires root access.\n
Example: screencap /storage/sdcard0/screencap.png
</string>
+ <string name="torch_help">
+ Usage: torch\n
+ Toggles the torch (flashlight). This is reliable but requires the Torch app. If you don\'t have the Torch app installed, use the flash command instead.\n
+ Example: torch
+ </string>
+ <string name="toggling_torch_state">Toggling torch stateā¦</string>
</resources>
case SCREENCAP:
Utils.sendMessage(context, replyTo, screencap_help);
break;
+ case TORCH:
+ Utils.sendMessage(context, replyTo, torch_help);
+ break;
}
}
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);
+ }
}
NEXT, PREV, BATT, CALLLOG, SMSLOG,
LS, RM, CONTACTS, DISABLE, ENABLE,
POLL, HANGUP, ANSWER, LAUNCH, DATA,
- GPS, GLOCATION, REBOOT, NOTIFY, SCREENCAP
+ GPS, GLOCATION, REBOOT, NOTIFY, SCREENCAP,
+ TORCH
}
/**
Heavy.screencap(context, replyTo, args[0]);
break;
+
+ case TORCH:
+ Heavy.torch(context, replyTo);
+ break;
}
}