SGS2 i9100 Tasker + WidgetLocker
Lock screen management/manual lock.
When you unlock the screen, the lock will be paused.
So you don't have to unlock the screen over and over if at home. (screen off only)
Before putting the phone in pocket, you press a shortcut that resumes the lock
and locks the screen simultaneously.
This also triggers a task that ensures if the phone gets unlocked by accident inside pocket, it will immediately lock again.
Tasks:
Pocket Security
1. Task -> Wait 200 MS
2. 3rd Party -> WidgetLocker -> Resume
3. Display -> System Lock
4. Task -> Wait 3 Seconds 500 MS
5. Tasker -> Profile Status -> Pocket Security -> Set Off
6. Tasker -> Profile Status -> Pocket Security -> Set On
Pocket Security On
1. Tasker -> Profile Status -> Pocket Security -> Set On
Pocket Security Off
1. 3rd Party -> WidgetLocker -> Suspend
2. Task -> Wait 8 Seconds
3. Tasker -> Profile Status -> Pocket Security -> Set Off
Lock the Screen
1. 3rd Party -> WidgetLocker -> Resume
2. Display -> System Lock
Profiles:
Pocket Security
First Context -> State -> Sensor -> Proximity Sensor
Add 2nd Context (long press the first) -> State -> Phone -> Incoming Call - Check Invert!
Assigned task: Pocket Security
Turn this profile off after creating!
Pocket Security On
Context -> Event -> 3rd Party -> WidgetLocker -> Locked
Assigned task: Pocket Security On
Pocket Security Off
Context -> Event -> 3rd Party -> WidgetLocker -> Unlocked
Assigned task: Pocket Security Off
Now for the toggle:
Create a shortcut on your home screen and select Task Cut.
Assign the "Lock the Screen" task.
You have to assign an icon inside Tasker.
(when the shortcut is finished, you can use icons sets compatible with your launcher)
I have this shortcut inside my dock, so i can lock from any home screen.
Note: After unlocking the screen, don't cover the proximity sensor for 8 seconds.
Then the sensor gets turned off.
And don't forget to press the lock toggle before putting the phone in your pocket!
You could also activate it based on your location... i personally don't like
location based events.
Explanation for step 4-6 of the Pocket Security task:
If the event was triggered and the sensor is still covered, it will not trigger
the event again till you reveal the sensor and cover again.
You can test this by taking out step 4 to 6 from this task.
Just lock the screen and turn it on several times while covering the sensor with your finger.
The wait and profile restart is a workaround for this.
This way if it fails the first time it will lock max. 5 seconds later.
(try to make a call within this time...
)
Don't set the wait shorter than 3 seconds, or it won't work properly.
When waking from deep sleep, it can take a few secs till things get active.
I've tested this for several hours, 3.5 secs is a save value.