Google pushing new Android feature that locks your device when it's not on you
Unfortunately, the simple method isn't able to recognize that it's you of all people holding your smartphone or tab in this very moment. It can only detect movement and understand whether the device is held, pocketed, or laying still.
Currently, the feature seems to be slowly rolling out on Android devices running Android 5.0 and later. It appears to be a part of the most recent Google Play Services version (7.0.97) and it's showing up on Nexus and non-Nexus devices alike, although the rollout is limited. Feel free to boast in the comments section if it lands on your device.
source: Android Police