I have a flow that takes a photo and emails it whenever an attempt to unlock the phone has failed. The problem is that this happens several times a day when I accidentally enter the wrong bloody pattern, and then I have to go in and delete the photo and email. The worst part is having to look at my hideous damned face.
I'd like to have the flow take the photo, then WAIT and:
1. Send the photo as normal if the phone has not been unlocked within a certain period of time; or
2. Delete the photo and of course NOT send an email if the phone has been unlocked within aforementioned period of time.
I want it to continue taking a photo on the first failed unlock... I don't want it waiting for any retries... I just don't want it to be emailed straight away.
How can I go about this?
Emailing a photo on failed unlocks... Works a bit too well...
Moderator: Martin
Emailing a photo on failed unlocks... Works a bit too well...
Samsung Galaxy S9+ (unrooted and cannot/will not root), Android 9.0
Latest stable Automagic version, always
Latest stable Automagic version, always
Re: Emailing a photo on failed unlocks... Works a bit too well...
Retain your flow structure until taking photo. Then split the sending email section into new flow. The new buffer flow act as the timer and unlock check.
Main Flow
-----
- Take picture
- Enable buffer flow
Buffer Flow
Trigger 1 : Periodic timer : 5 minutes (change to your desired time)
Trigger 2 : User Present
Action : disable buffer flow (disable itself after execution)
Expression : trigger == "User present"
True : Delete the photo and Show toast message that the photo not sent anymore
False : Send the photo via email
So everytime main flow triggered by the fail unlock event, it will take picture and enable the buffer flow. The buffer flow wait as long as the timer you specified. If during this time interval, you successfully unlock the phone, the buffer flow continue with true and delete the photo. But if no successful unlock, continue with false and send the photo. Both branch will disable the flow so it only activated after the unsuccessful unlock.
Main Flow
-----
- Take picture
- Enable buffer flow
Buffer Flow
Trigger 1 : Periodic timer : 5 minutes (change to your desired time)
Trigger 2 : User Present
Action : disable buffer flow (disable itself after execution)
Expression : trigger == "User present"
True : Delete the photo and Show toast message that the photo not sent anymore
False : Send the photo via email
So everytime main flow triggered by the fail unlock event, it will take picture and enable the buffer flow. The buffer flow wait as long as the timer you specified. If during this time interval, you successfully unlock the phone, the buffer flow continue with true and delete the photo. But if no successful unlock, continue with false and send the photo. Both branch will disable the flow so it only activated after the unsuccessful unlock.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Emailing a photo on failed unlocks... Works a bit too well...
Thank you--"User present" is the main piece I couldn't recall. I have not worked with flows much lately.
Thanks!
Thanks!
Samsung Galaxy S9+ (unrooted and cannot/will not root), Android 9.0
Latest stable Automagic version, always
Latest stable Automagic version, always
Re: Emailing a photo on failed unlocks... Works a bit too well...
.. or, simply ...
Leave your main flow as it was but insert a sleep action before the photo is actually sent (to give you time to enter the code).
Then in a second flow use trigger "user present" with an action "stop flows" to stop the main flow
.. or even more simply ..
In your main flow use the trigger "Login attempt" with the parameter 'On the Nth failed attempt'. This is what I use to deal with fat fingers I agree this doesn't meet your requirement "I want it to continue taking a photo on the first failed unlock... I don't want it waiting for any retries..." I have it set to 2, on the basis that anyone who doesn't know the unlok code will almost certainly give it a second attempt.
Leave your main flow as it was but insert a sleep action before the photo is actually sent (to give you time to enter the code).
Then in a second flow use trigger "user present" with an action "stop flows" to stop the main flow
.. or even more simply ..
In your main flow use the trigger "Login attempt" with the parameter 'On the Nth failed attempt'. This is what I use to deal with fat fingers I agree this doesn't meet your requirement "I want it to continue taking a photo on the first failed unlock... I don't want it waiting for any retries..." I have it set to 2, on the basis that anyone who doesn't know the unlok code will almost certainly give it a second attempt.