Google is rolling out a new feature to Android, the new feature is a new mode for smart lock called on-body detection.
The smart lock on-body detection uses the accelerometer on your Android device to work out whether your device is in your hand or your pocket or set down somewhere.
When you set you handset down the on-body detection system will automatically lock your handset, which could be handy if you leave your handset on your desk, a table or forget it somewhere.
As soon as you pick up your device again, you will need to enter your passcode, once this is done then your handset will remain unlocked whilst you are using it and when you put your device in your pocket it will also stay unlocked.
Google has apparently started rolling out this new smart lock on-body detection system to a number of devices including their Nexus range of handsets.
Source Android Police