Accessibility watchdog

by Casey Ng

Version 4 (July 23, 2023)

Download (44 downloads)

‼️IMPORTANT! Read HOW TO section.‼️

##Description
On some OS, accessibility will be disabled automatically even with battery optimisation disabled for automate. Flows that needs the privilege will then crash without warning nor indication.

This flow monitors the accessibility for automate. When it detects accessibility is disabled, it'll re-enable accessibility and also restarts those flows that are affected.

‼️HOW TO‼️

In order to use this, you need to edit block 23, set variable "accessibility_flows". The format is the variable is [{flow_id: [block_id1, block_id2, ...], ...}, total number of flows].

To get the flow_id and block_id, check the flow beginning block and look at the flow_uri. It is in the format of content://com.llamalab.automate.provider/flows/8/statements/28.

In this above example, 8 is the flow_id and 28 is the block_id.

Total number of flows is the sum of all flows that should be running. If a flow beginning spawns 2 children flows, then the total flows should be 3 (1 for parent and 2 for children). Then sum all the flows for the total number of flows.

‼️Example‼️
E.g. If you have 3 flows that have the following flow beginning blocks:
- flow 5 beginning block 1, 1 child flows,
- flow 22 beginning block 7, 3 child flows,
- flow 78 beginning blocks 3 and 44, 0 child flows

The accessibility_flows variable would be [{5: [1], 22: [7], 78: [3, 44]}, 8].

Total flows is 8 because there are 4 parent flows and 4 child flows.