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.
Bring DownloadManager API inline with AOSPA

Change-Id: I9468e59617e2e6fd01a622c1c499ee52a096d291