Define your own global variable:
> Using my own variable seems to be working fine. I'm worried about the state of my variable desyncronizing with the state of my lock if, for instance, I decide to password lock my phone instead of pin locking with my button.
>
> Is there an event for pin/password set/unset that I can bind to set the variable?
Not as far as I know, you could look into the shell dumpsys command. The "device_policy" looks like it could help.
You Could have a display on profile that checks the status with the 'dumpsys' command then and will set the variable to the correct state.
On May 10, 2015 12:15 AM, "Dustin Mundy" <dustin....@gmail.com> wrote:
>
> The problem is I don't think there's a variable to check if a pin is set. Ideas?
You can check via Java:
Test (69)
A1: Java Function [ Return:(KeyguardManager) key_manager Class Or Object:CONTEXT Function:getSystemService
{Object} (String) Param:"keyguard" Param: Param: Param: Param: Param: Param: ]
A2: Java Function [ Return:%secure Class Or Object:key_manager Function:isKeyguardSecure
{boolean} () Param: Param: Param: Param: Param: Param: Param: ]
A3: Flash [ Text:%secure Long:Off ]
Thanks for the comment. At first execution the task goes directly to "else" and the variable is then set to "true".
But it is probably better to create and set the variable first in the "Vars"-tab (Switch off Beginner Mode).
This means that %PinSet can get out of sync with the actual state of the pin.