Frameworks: Incoming Call in Background (3/3)

Patch ported from 4.2 which was done by our lovely HCP. A
very popular one so we bring it back and adapt it to 4.4

Allows user to set that Incoming Call UI will remain in background
if screen is on. Instead, a notification is added to StatusBar, which
can be used to bring up the Incoming Call UI. Ringtone and vibration
still occur as per system settings.

This has the same effect as apps marked as "immersive". It prevents
the incoming call from backgrounding the current activity.

Change-Id: I1eb0ae6b10ba02c3f1df95265d26a6c61db74aab

Conflicts:
	core/java/android/provider/Settings.java
Add zh-rCN Translation

Change-Id: If3a92da037d942d320ba6093b2c96f55ccfb5e41
Updated czech translation
frameworks/base: Fix the random UI corruption

On low memory device, when a view goes to background. Its HW layer cache
will be destroyed to release memory. There is a very rare case that the
hardware render is not valid when destroy the layer, so the layer is not
destroyed and reused when the view comes to foreground. But the GL
context has changed, so the view is not rendered correctly due to its
HW layer cache. To fix this issue, destroy the layer in a safelyRun. Make
sure the layer is destroyed correctly.

Change-Id: I1c714e1d53db7353d5169e874a7cd0f527c3f67b
CRs-Fixed: 623239
frameworks/base: Fix change propagating issue

destroyLayer() function has been modified in kk. It is not correct
to propagate the UI corruption fix from jb to kk without considering
the new changes made in kk. This change is to make it align with
the new code in kk.

Change-Id: I34d11b230b9390fe8a989ab6f9c7d3a48d586205
WallpaperManager: add NULL pointer check for getCropAndSetWallpaperIntent

Originally the api 'getCropAndSetWallpaperIntent' does not check
whether the parsed parameter is a NULL pointer, as leads to the
whole app crash if it call this api with a null parameter accidentally.
A null pointer check logic is added into its original parameter check
logic, so that this API will throw an IllegalArgumentException if it
is parsed with a null pointer

Change-Id: Ib7de40e571419d09e1a744edc969eb7162766b75
Signed-off-by: houst0nn <houstonn@gmail.com>
NULL previous background bitmap upon changing wallpaper

Step to reproduce it on Nexus 10 with 4.4.2(KOT49H):
1. Long press on home screen.
2. Choose wallpaper from Wallpapers.
3. Select new wallpaper and set it.
4. Repeat step 1-3 several times.
See black background instead of the wallpaper.

There are two binder objects who hold reference to the
ImageWallpaper$DrawableEngine, which keeps the big chunk
bitmap from being recycled.
One is WallpaperService$IWallpaperEngineWrapper. The client
references went away slowly, maybe several minutes after
changing wallpaper. Then the finalizer has to been executed
to GC it.
The other one is WallpaperService$Engine$BaseIWindow. Don't
know who still held reference to it even after the window
was removed.
Anyway, let the bitmap be GCed first.

Change-Id: I27f6971a3edd26472b69e59b542b27fd7c8e7b90
Signed-off-by: jshe32X<jianchunx.shen@intel.com>
Signed-off-by: Guobin Zhang <guobin.zhang@intel.com>
Signed-off-by: houst0nn <houstonn@gmail.com>
GlobalActions: Fix Airplane Mode on/off issue

Issue: Unable to turn off Airplane mode from power button
       after phone reboot

Fix: Initialize mHasTelephony before the PhoneStateListener is
     registered to the TelephonyManager so that correct value
     of mHasTelephony is reflected when onServiceStateChanged
     callback is called.

https://android.googlesource.com/platform/frameworks/base/+/c3b7e6fd44593c3974e989d8ccf2097b4471b2b7

Bug: 13697360
Change-Id: Ide8afd9c16ea90b98b5912dbff440c5fd67b178d
Signed-off-by: houst0nn <houstonn@gmail.com>
Always call super.onCreate().  Always.

Bug 12991134

Change-Id: Ife16ef93408253e3318a06dc0206ab4b88c7f367
Release DrmManagerClient resources

Call release for DrmManagerClient to avoid resource leaks

Introduced by following commit (5d143ad4a8f...),
"Media scanner support for FL(Forward Lock) DRM file types"

https://android-review.googlesource.com/#/c/91081/

Change-Id: Ic3c458579f4e99b3b072a2e13362d1996b982589
Signed-off-by: houst0nn <houstonn@gmail.com>
Launch floating notifications from notification panel (long click)

 * Status bar - long click on notification select 'floating mode' option

fix derp in floating notification launch

Notification long press fix
On-the-spot preference dialog: Switch back to notifications if user denies quick pulldown

Change-Id: I360ae8a64f28b0b25a4dbebbba2470f5b90eae2f
Signed-off-by: Parthipan Ramesh <parthipan.ramesh@gmail.com>
SystemUI: ES Translations

Change-Id: I3476ae05bff68c527f42d9d27d7b4727c77c96f7
Framework: Update IT Translation

Change-Id: Ifd1bfb0411f449388515ba919c9a78fb9bb9a551
Add support for NETWORK_TYPE_GSM

Add support for NETWORK_TYPE_GSM in TelephonyManager and
corresponding mapping in ServicState.java so that when
application queries for getVoiceNetworkType() and currently
camped rat is GSM, they get network mode as GSM instead
of network mode unknown.

Change-Id: Ibe4672b04a5044710d63499c4cf2b6ebe91444bf
Signed-off-by: houst0nn <houstonn@gmail.com>
Fix crash when clicking a file from recents or downloads

Change-Id: I6e1693d1d9f433b6baf25d3033245a56817ec16a
SystemUI: add missing catalan translations

Change-Id: Ib1ba7a9cf9f56aa25f7101d8209a890b44c4c96a
DocumentsUI: add zh-rCN translation

Change-Id: I7354fe7d42582eac263c322537f9f003b1fc29f4
PackageManager: Fix concurrent access to shared state

Stop multiple threads from all calling add on the same HashMap.

Cleanup the use of a boolean flag by removing concurrent writes
to it.

Change-Id: I8d61fe7294dcb67ee7d0d7de88d90d2051c310e6
Fix Javadoc link for getModifierBehavior()

Change-Id: I571db5147a081fcd7190483ba9e7a45b46db224d