Add null pointer check for ExifParser

Change-Id: I9a7eee8ebb571a186a57e5094e376e7a7d8ab4b8
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
framework:Thread synchronization for UI update

Issue : Framework reboot was observed due to out of sync between
        two threads which inturn causes Null pointer exception
        while updating airplanemode.
Fix : Handled Null pointer exception and the crash is not observed.
CRs-Fixed: 570122

Change-Id: I2e969f6e7726ffcf8648b366ebb54cb2b0afc292

Conflicts:
	policy/src/com/android/internal/policy/impl/GlobalActions.java
Fix NPE causing a hot reboot when pressing power button

Change-Id: I7331f1abf70d131af8e0c09694f174fffd5fb9ef
improve rotation handling

this commit was rewritten/inspired by one made to our jb 4.1 branch by sonicxml.

cheers buddy!

Change-Id: Ib3b46aa54e7bf6602f8c0557ed770624063af529
Kill floating activities running in the same thread when tapping outside

This change makes all activities from the same app to be finished when we tap outside the halo window. Other apps running in different threads
(floating or not) won't be finished.

Port from here: https://github.com/ParanoidAndroid/android_frameworks_base/commit/f489f45ab2ba5dd4991c241917f7f4b0fd74b884

Change-Id: Ie6d6f46b2e23be60f991520ed480c2866fb2d0e3
audio: Volume can't adjust during HFP call when screen is off.

PhoneWindowManager don't pass the key to the application when screen is
off. In handleVolumeKey(), the STREAM_VOICE_CALL volume was set, so the
STREAM_BLUETOOTH_SCO volume can't be adjusted.
Add a judgement to choose the correct stream to adjust when screen is off.

CRs-Fixed: 649548

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Change-Id: I1ab06617d59b9bf2eabed9ed8b6892bc20db75b9

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
audio: Volume can't adjust during HFP call when screen is off.

PhoneWindowManager don't pass the key to the application when screen is
off. In handleVolumeKey(), the STREAM_VOICE_CALL volume was set, so the
STREAM_BLUETOOTH_SCO volume can't be adjusted.
Add a judgement to choose the correct stream to adjust when screen is off.

CRs-Fixed: 649548

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Change-Id: I1ab06617d59b9bf2eabed9ed8b6892bc20db75b9

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java