Port AutoHide from Slim

modified and fit in

Change-Id: I5a823c3cbdfd3a6849a6a5b7de75f8cb8ada680a