by Manu
Version 1 (January 26, 2025)
Download (17 downloads)
*originally created by Oleg OP7.
Since it has a breaking issue and is quite old, I've fixed it and uploaded it here, while giving proper credits.
Technical details:
the foreground app check block currently seems to have an issue, when all variables are left blank. It's supposed to grab the app package name string of the app currently in foregound, but somehow falls back to the Automate main activity and puts its package name into any variable, that you attempt to store through the check. Therefor I've added two additional checks with appropriate delays blocks, to ensure, that the actual opened app in foreground has its package string stored properly into the following variable.
ORIGINAL DESCRIPTION:
Uses automate via the assist dialog menu to enable or disable app Pinning.
App pinning will lock an app to the foreground so the app can neither be closed nor swapped to another unless a pin is entered to disable it.
Note: other that stated by Oleg, you cannot lock yourself out of your device with this flow, because you easily can stop all flows by using the Automate notification.
⚠ ⚠ ⚠ Proceed with caution with this flow! ⚠ ⚠ ⚠
If you set automate to run on start-up, and an app was left pinned, it could lead to you being locked out of your phone although this is very unlikely.
As a fail-safe, you should set up another flow to automatically disable this one after a boot-up broadcast is received. If somehow you manage to lock yourself out of your phone, you can disable this flow and others by rebooting into safe mode and deleting this flow.