Update logic for hardware key settings

Change-Id: I87c5626ad91db8eaa8ba04c610392ce376e6ae83