Fix headset detection.

Original CM Commit below by Shelnutt2
Services.jar: Reworked computeNewHeadsetState function to set state in a

manor used in ics. This allows states such as 129 and 130, which are
used for 35MM_HEADSET to be correctly registered as a new state.

Change-Id: I3bd1ec17d0cd184593edf330f482f09396785e76
GLSurfaceView: add property to default to RGB565

Some legacy devices (like the Xoom) are not capable of handling
RGB888 surfaces, which is now the default. This results in some
OpenGL apps crashing with "No config chosen" errors.

Set ro.opengles.surface.rgb565=true to go back to the old default
of RGB565 surfaces.

Credit to dreamcwli for the original patch.

Change-Id: I5ad9aa8e98eb6fd554b01022439141fe4a55bd70