Was struggling with this issue for a while, tasker tricks didn't help and autoinput looked not very reliable/convenient.
Solution I found -
1. just install GoodLock from Galaxy Store: http://apps.samsung.com/appquery/app...droid.goodlock
2. In the application main menu Enable/Install "Routines"...