fastboot: Add routines for unlock and lock device

Add support for functions to request unlock and lock of devices in
response to fastboot oem unlock/lock commands. Unlock operation is
equivalent to enabling dev mode and lock operation is equivalent to
leaving dev mode. It is the responsibility of the caller to ensure
that user confirmation is obtained before unlock/lock operations.

TEST=Compiles successfully and fastboot lock/unlock operations work as
expected on smaug. Added tests to ensure lock/unlock operations are
covered. Verified using make -j runtests.

Change-Id: Ibafe75abdd1202473009208a414f3996d537db4f
Signed-off-by: Furquan Shaikh <>
Reviewed-by: Furquan Shaikh <>
Tested-by: Furquan Shaikh <>
Reviewed-by: Randall Spangler <>
Commit-Queue: Furquan Shaikh <>
Trybot-Ready: Furquan Shaikh <>
4 files changed