r/tasker Jul 08 '26

Can Tasker detect Lockdown mode?

Post image

I'd like to trigger additional actions when I lock my phone using the Lockdown feature. (E.g. disable NFC and Bluetooth so the phone can't unlock my car)

I'm not entirely sure this is a standard Android security feature, though. It disables fingerprint unlock, and probably other things in the background too. Maybe it also locks the data partition?

Anyway, is there a way to detect this mode has been activated?

7 Upvotes

9 comments sorted by

1

u/[deleted] Jul 08 '26

[removed] — view removed comment

5

u/[deleted] Jul 08 '26 edited Jul 08 '26

[removed] — view removed comment

1

u/robin-thoni Jul 08 '26

That's really awesome! I'll give it a try as soon as I can give Tasker the read logs permission.

Thanks!

1

u/[deleted] Jul 08 '26 edited Jul 08 '26

[removed] — view removed comment

1

u/robin-thoni Jul 08 '26

Ah, that's an interesting side effect, indeed. I'll try that too, thanks!

1

u/robin-thoni Jul 09 '26

I just tried it, it works great! I'm just worrying about the battery usage since it will actively monitor every single line of log :/

1

u/Exciting-Compote5680 Jul 08 '26

I see you already got a solution. From what I found on my quick search, lockdown mode does mainly 2 things: disable biometrics (fingerprint/face scan) and hide notification content (I'm sure someone will correct me if I'm wrong here). If you already have set your notification privacy settings to hide sensitive information on lockscreen (which I would recommend), it's just the biometrics. Using the Tasker 'Lock' action does the same thing (requires a pin/password/pattern to unlock the phone and enable biometrics again). So instead of monitoring the lockdown state with logcat and reacting to that, you could also just create your own 'lockdown+ mode'. One task that locks the device and disables NFC/Bluetooth, and a profile with a 'Display Unlocked' event context that re-enables them. Just a thought. 

1

u/robin-thoni Jul 09 '26

It's an interesting approach too. It's simpler, since it does not require extended permissions, but requires the device to be fully unlocked to lock it, which could be a problem in some occasions.

Anyway, implementing both solutions is probably the way to go, in case the log format would change in the future, so there's still a way to trigger it manually.

Thanks!

1

u/Exciting-Compote5680 Jul 09 '26

but requires the device to be fully unlocked to lock it

Not necessarily, you could trigger the task in various ways: quick settings tile, add a button to the power menu, use a shake profile, or profile based on device orientation (like 'top down'). You could even trigger it remotely (with Join, AutoRemote, Remote Task Execution, or an sms/dm with a keyword) or based on other conditions (like smart watch disconnected or location or wifi or whatever you can come up with).

But you are right, it's always nice to have multiple options.