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>
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
Merge branch 'kitkat' of https://github.com/AOSPA/android_frameworks_base into kitkat