When you enter *#0*# into the phone's dialer, the device enters service mode and brings up a diagnostics menu. From this screen, you can view and run multiple diagnostics to test device hardware like buttons, sensors, and cameras.