Added device specific hacks.

Added device specific hacks and fixed bug of the app not working properly after lock button press.