So my question actually is: Could I just cancel a task that is being waited or do I have to use a workaround like this?
> Guess I'll have to experiments, I'll report on the results for future reference
From the guide....
Stop
Stop execution of one or more tasks after any currently running action has finished.
If a task is specified, then all tasks with the same name currently executing are stopped.
If no task is specified, the current task is stopped (but not other tasks with the same name).
If With Error is checked, the task(s) are marked as finished due to an error.
Note: to stop a different task will often require that it has a lower priority than the task with the Stop action, since otherwise the Stop action will perhaps never be executed.
********
Currently running actions in a different task will not be interupted by a Stop action, with the exception of Play Ringtone and a non-root Run Shell.
**********
So.. it is not clear what actually happens to the wait action itself , However I can confirm the task itself is stopped (exited) as soon as the stop action is preformed.
#!/system/bin/sh
[[ $# -gt 0 ]] && {
sleep ${1}
}
exit 0
/system/bin/sh /sdcard/wait-script N
/system/xbin/pkill wait-script
> won't that method of waiting one second kill the battery?
> I need to wait for 4 hours every time, I can't have my phone keep
> being awake to process wait events
Search this forum for a post with the t 'how to cancel an task' in the title. Then see Juergen's response. It is the best approach for this.. IMHO..
Then to cancel you would just disable the profile...
The post should not be very far down the forum list, it was a recent post..
Ooppps. Got my titles mixed up. It should be
'how to create an task'
Any way here is a copy of the post... hope Juergen does not mind...
For a 90 minute delay I would prefer a profile with time context.
Task started by shortcut:
StartTimer (2)
A1: Silent Mode [ Mode:On ]
A2: Variable Set [ Name:%EndTime To:%TIMES + 5400 Do Maths:On Append:Off ]
A3: Profile Status [ Name:Timer Set:On ]
Profile and Enter Task:
Profile: Timer (24)
Time: From %EndTime Till %EndTime
Enter: Anon (25)
A1: Profile Status [ Name:Timer Set:Off ]
A2: Silent Mode [ Mode:Off ]
Juergen.