Hey guys, sorry for the late reply.
@Brandon
I replaced the Display State Off with Display Off Event but that didn't work - the profile never became activated.
@Jacob
1. I tried the WiFi Off task disabled - WiFi never came on. It stays off.
2. I checked the profile settings, there is no option for Restore Settings :? It only has:
- Launched Task Priority (5)
- Cooldown Time (00:00:00:00)
- Limit Repeats (Unchecked)
- Enforce Task Order (Checked)
- Show In Notification Pulldown (Checked)
Also, one more thing. I have disabled the Tasker Notification from Application Manager as I don't want a permanent icon in my notifications - I understand that this can cause problems if Android closes Tasker. But, Tasker's settings are still set to Run In Foreground (Checked).
Other testing I've performed
I created another Profile involving WiFi life this:
Profile
Name: WiFi On When In Use
Display State On
Task: WiFi On
WiFi Set: On
Task: WiFi Off
WiFi Set: Off
This profile works every time, WiFi comes on when screen switched On and WiFi goes off when screen switches Off. Reason I think why it works is because when Screen goes On or turns Off, CPU is becomes awake OR remains awake shortly after screen goes off.
Run Log shows that ALL the actions executes without any errors including the WiFi set ON and WiFi set OFF actions... So I'm not sure what the problem is... Could be the "Keep Device Awake" fault inside Task Properties or Android 4.1.2 firmware issue.