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
Allow disabling the IME selector notification (1/2)

Credit CM

Signed-off-by: Ricky Salinas <rsalinas1@mail.usf.edu>
Fix double finger when 'Quick pull down' is disabled.

If "Quick pull down" is disabled, never do the function "switchToSettings()" and the stock double-finger feature doesn't work.
The OTS preferences only need to check the "statusbar portion" code.

Change-Id: I245854922f2e643e317f7aadd45043542e2f9871
Framework: Create "on-the-spot" preference dialog only if needed

Right now a new instance of the "on-the-spot" preference dialog gets created
each time when the user taps on the immersive tile or each time when the
user pulls the statusbar from the right side. It should only be created if
it's really needed.

PS2: RecentsActivity clear all
PS3: Made method static and check is in SettingConfirmationHelper
	(thanks to Yamil!) + rebase ("Long press recents to switch to last
	 app"
PS4: Removed unneeded variable

Change-Id: I464edebbfec9e3452d36876ed8ef69ab915fd872
Signed-off-by: Parthipan Ramesh <parthipan.ramesh@gmail.com>
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
Updated czech translation
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
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>
Merge "Allow disabling the IME selector notification (1/2)" into kitkat
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>
Merge "Fix double finger when 'Quick pull down' is disabled." into kitkat
Merge "Media process is crashing with NullPointer exception" into kitkat
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>
Merge "Kill floating activities running in the same thread when tapping outside" into kitkat
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