packages/apps/Music: Fix for ANR while opening an album in Music app.

- While opening an album using Music app, force close error is seen.
- There was no check whether 'mIndexer' is null before using it.
- Fixed by performing null check before using 'mIndexer'.

Change-Id: I240863b01098038250b26202ad7f42f4717a9c65
CRs-Fixed: 280854
Music: Fix to make progress bar update for fast forward and rewind while in suspend

- While playback, press suspend key. While in suspend press fast forward
  continuously. UI screen activates and starts fast forward from the
  beginning of the playback.
- While in suspend, the first fast forward key press is activating the UI
  screen. On second fast forward key press, reset the seek position and
  moves back to starting of the playback.
- Changes are done to seek from the same position of playback while in suspend.

CRs-Fixed: 335626
(cherry picked from commit a061e4f7a30565fbf0aa6ebde15325dad60f402c)

Change-Id: Ieb4d44c53a17a7c17d83dd920db938177cf0013b
packages/apps/Music: Fix for the clip skip at the end of playback

-While playing a clip, during the last 2-3 seconds playabck if the
user selects the same clip from the playlist, next clip is getting
selected by skipping the playback of last 2-3 seconds of the current
clip.

-In Music App, when play is called, a check is done on the
current clip duration. If the current clip has 2 seconds of playback
time remaining, the next clip is getting selected for playback.
Because of this the last 2-3 seconds of playback is getting skipped
for the current clip.

-Fixing this issue by reducing the check on remaining time duration
to 1 sec for the curernt clip.

CRs-Fixed: 332750
(cherry picked from commit 42437c48842a461a269e79e6a0a37373aafa06d7)

Change-Id: I9c8a3c82c02d13ce3e1865ca263b1966104c7e49
Music: Fix to make progress bar update while suspend/resume

- While playback, press fast forward continuously. Then press
  suspend and resume while still pressing FF. Release the
  fast forward button, the scroll bar moves back.
- On resume the key down and up times are updated and the
  same values are used while calculating delta on last fast forward
  release. This give a wrong value and scroll bar moves back.
- Changes are done to return from on key up event if seek
  time is in negative and seek flag is false.

CRs-Fixed: 332155
(cherry picked from commit 3d57e706411ada78f6729174d48e797a67d48380)

Change-Id: I412582f332bcdef438077bf9794143627793c939
Music: Fix to handle prev and next commands on Music app

- By keeping unsupported clip in the middle of two supported
  clips, rewind doesn't happen to previous clip.

- When the playlist contain invalid content, the current
  logic to store number of track failed to open, and
  adjusting the track number accordingly on PREV command,
  do not handle all the scenarios of NEXT and PREV.

- Fix is to make sure that if previous track is failed to open,
  then it will try to open track before previous but not
  next to failed track.

Change-Id: I9e2e401ac237a6a5daf9a157bbd3e259bb309432
CRs-fixed: 300167
packages/apps/Music: Corrupted audio clips in repeat mode result in an ANR

-The corrupted WMA audio clips in repeat mode fail repeatedly
resulting in application not responding.
-MediaPlayerService calls getDuration repeatedly.
-Releasing and creating the media player object when error occurs.

Change-Id: I35ecee7e9ac7d80409eacd2000a5cebb6c4b1ce0
CRs-Fixed: 294586
/platform/packages/apps/Music: Do not load component when unplug headset

- Whenever headset is unplugged, the broadcastreceiver started the
  MediaPlayerService, resulting in re-loading the component if it is not
  running.
- Ensure that the intent is propogated only when the service is running to
  avoid unnecessary loading of components.
- This might not impact software decoders, but have lot of load when hardware
  decoders are used.

Change-Id: I2c64636bfed89915138a9b2925382279669abb83
packages/apps/Music: Fix blinking of disc in Music application

- At start of playback, disc symbol in Music app appears and disappears.
- Albumart is set twice even in cases where it has been set in the first
  attempt. This is due to wrong update of Albumid and leads to appearance
  and dissapearance of the disc in the music application.
- Update Albumid only in case of error to prevent setting of Albumart in
  case already set succesfully.

Change-Id: Ib334bbdd2750e7bc9831fd7684ce760a52b07258
CRs-Fixed: 328069
packages/apps/Music: Fix for Music App continuous crash
packages/apps/Music: Add log to print the name of audio clip
packages/apps/Music: Eliminate wakeup events for screen refresh
packages/apps/Music: Fix for incorrect current position