Google added a feature called Device Protection in Android 5.1 Lollipop, but it neglected to explain much about how it works. The feature is essentially a reaction to laws being enacted across the U.S. that require smartphones to have factory reset and anti-theft features.
Android's new Device Protection system can keep a thief from using your phone, but it won't work without the proper settings. In addition, it can backfire if you sell your phone without disabling Device Protection first. There are definitely some things you need to know.
There are no toggles or switches to turn on device protection in Android 5.1. If your phone or tablet supports this feature, it's enabled automatically based on your settings. As for which devices are supported, it will mostly be future phones and tablets that ship with Android 5.1. However, Google has added Device Protection to the Nexus 6 and Nexus 9 in the 5.1 update. Motorola has also rolled Device Protection out to the 2014 Moto X in the 5.1 over-the-air update.
Device Protection is basically an enhancement of the secure lock screen. If you enable that feature and have a Google account on your phone, that account is needed to access the device after a factory reset. This step will occur after selecting a Wi-Fi network in the first-run setup. To finish the setup process, you must enter the Google account information last associated with the device before it was reset. So if someone takes your phone and tries to reset it, they won't be able to get past the setup, thus reducing the incentive to steal phones in the first place.
An unlocked bootloader allows a user to flash anything to the phone from recovery, like a system image that would overwrite Device Protection. Because that workaround exists, Device Protection features are not available on unlocked phones and tablets.
When the time comes to sell an old device with Device Protection, you must make sure to reset it in the correct way; otherwise the next owner won't be able to use the phone they just bought. The correct way to reset a device without triggering Device Protection is to turn off your secure lock screen first. Just set it to "swipe" or "none" before beginning a factory reset. You can also remove your Google account from the Accounts section of the settings, then reset the phone. Whatever you do, try it out first to make sure the phone's new owner can get in without your Google account credentials.
Keep all this in mind and Device Protection will be your best friend rather than your greatest enemy.