Send Media button events as foreground Intent

Send foreground intent for Media Button events to Music Player
so that there is no delay in handling these Intents after the
device is rebooted.

Change-Id: I952a8af93586cb96c0a9f6dc910bfb49287f4b9a
CRs-fixed: 611219
Media process is crashing with NullPointer exception

Sometime, while creating thumnails list of media files in
compose MMS->attach file,  filepath may be null due to
synchronization issue.
Adding NULL check to avoid NUllPointer exception.

Change-Id: Id6cf5612a959b3ae15b44bc60dbbcbe40c624f09
CRs-Fixed: 636494
WallpaperCropper: Fix crash when set .gif as wallpaper

It returns an equivalent scaled cropBounds as true
crop bounds, then it set the rounded rect by rounding
"out" the true crop rect, this make the rounded crop
rect may out range of the original bitmap, then an error
will happen.

We change to check the rounded crop rect, if it is out
the range of original bitmap, we set the original bitmap
bounds as rounded crop bounds.

CRs-Fixed: 622582

Change-Id: I215ef2a0165adaaadb05c62dee741a8ea6926144
Use checkOperation in BroadcastQueue.

ActivityManagerService uses NoteOperation before delivering a broadcast to
a package. NoteOperation can be blocking due to permisison dialog box.

Use non-blocking checkOperation in BroadcastQueue.

Change-Id: Iccded96217d99589aed771f2f3c15d0a39d9a340