Requirements
This project requires that you have installed the Secure Settings plug-in (required for enabling/disabling the PIN lock), and my Extended Variables & States project (required for maintaining the variables used as contexts in this project).
What does this project do?
This project includes 3 profiles which, when added to those in the Extended Variables & States project, work together to enable/disable the PIN lock on your device when you're connected to a "trusted" Wifi network, or when you're in your car. The profiles in this project are relatively simple, since most of the work is done in the profiles included in the Extended Variables & States project. Variables from the Extended Variables & States project that are used by this project are: %myTRUSTEDWIFI, %myDISPLAY, and %myUIMODE. See the Extended Variables & States project for information on these variables.
Included Profiles
Trusted - this profile disables the PIN lock on your device if you're connected to a "trusted" Wifi network and your device is already unlocked. This means that once you've connected to a "trusted" Wifi network, you'll still need to unlock your device once before the PIN lock will be disabled. Why must the device be unlocked once? Because I'm more comfortable knowing that someone finding my device can't just walk near my house and have the device magically unlock for them. By default, you're still considered to be "connected" to a "trusted" Wifi network if you were connected to one within the past minute. This allows you to walk out of range briefly without having the PIN lock re-enabled, and in my case it gives me time to get to my car and enter "car mode" (see below) without having to re-enter my PIN.
Car Mode - this profile disables the PIN lock on your device if you're device is in "car mode", as defined by the conditions used in the related profiles in the Extended Variables & States project and the device is already unlocked. By default, "car mode" is entered when the device is powered and upright (portrait orientation), and it will remain in "car mode" until power is removed. This behavior can be changed by modifying the related profiles in the Extended Variables & States project.
UnTrusted - this profile locks the device with your specified PIN once you're no longer connected to a "trusted" Wifi network and not in "car mode".
Things you'll need to change
Because Secure Settings encrypts its configuration information using a key unique to each device, you'll need to edit the Trusted Unlock task in this project and edit the one action in the task, entering your own PIN number.