by Antonio Roji
The flow has two starting points. Leave Main running all the time to automate everything.
You can also create a Home Screen Shortcut pointing to Secondary to skip the Activity Detection point and run the flow (while main is running).
-Turns off WiFi.
-Checks if/when phone is charging, then continues:
-Greenifies the phone (Requires Greenify app).
-Sets screen orientation to Portrait.
-Turns on Bluetooth, if Bluetooth doesn't connect in 5 minutes, turns it off.
-If/when headphones are connected, starts music app (Apple Music. Haven't been able to make it start playing music automatically).
-Starts maps app (Waze).
After driving, checks if phone is charging, if not:
-Asks if you are still driving, if not (or no input after three minutes):
-If/when Bluetooth is disconnected, turns it off.
-If/when headphones are disconnected stops music app.
-Turns on WiFi.
-Stops maps app.
Needs root. If you find any problems, let me know on the comments.
-I actually found a small error with screen orientation and fixed it.
-I fixed the recursion problem. Everything should be working OK now. This should be the final version, I can't think of anything else to add or change. Not a lot of people have downloaded the whole thing, but if you want to request anything, let me know in the comments. Anyway, although everything works perfectly, the flow is a mess (this is my first flow and I was learning how to work with Automate while I was doing it), if I actually upload another version, it will be a total rewriting of the flow.
-Nothing new, just more fixing. Is still creating some Recursions if you leave the Bluetooth and/or the headphones connected when you stop driving and start driving again but they do no damage and they disappear after you stop driving again. I'll fix that this weekend.
-Minor modifications to the flow.
-Fixed a little mistake I made with the conditions to turn off the Bluetooth after the flow ends.
-The Activity block takes some time to detect when you are driving, so I added the possibility to start the flow with a Home Screen Shortcut.
-Just changed the sensibility of the Activity block .
-The confirmation dialog to stop the flow I added in V 2.0 was getting annoying, so I changed the way it works. As long as the cellphone is charging the flow will keep running. If the cellphone is not charging, it will display the confirmation dialog.
-I was finally able to move "Disable WiFi" to the top of the flow. This means that if you are in a moving car and you do not charge the phone, Automate will turn the WiFi off anyway and once you stop, it will turn it on again without running any other fiber.