SystemUI: prevent NPE on clear recents double press

Pressing Clear all button twice fast or while the list
is clearing but not yet fully cleared causes sysui to crash due to
mRecentTaskDescriptions being null: (http://pastebin.com/2gRFvf8k)

Change-Id: I23d10edfd336041739fe80352ee01987e671dbd7
NotificationHelper: We shouldn't use logical here, one case is enough no matter the order

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I586e481f5475be3e9bde75f5a943b9d5719c7b59
Keyguard: Avoid unneeded SIM dialog show() calls

https://paranoidandroid.atlassian.net/browse/AOSPA-465

This commit makes the progress dialog's show() get called only once
each time the SIM unlock process is started.

It was reported that a phone can be frozen by entering the PIN code
for the SIM card "too quickly". This leaves the user with a device on
which the screen is filled with a non-cancellable dialog box saying
that the SIM card is being unlocked. The logs inform that Keyguard
experienced a success and no explicit errors could be seen there and
only the dialog stayed around, all leading to believe the issue is
with how the progress dialog is being showed and later hidden (or
simply dismissed), in which case this show() call reduction might be
benefitial.

Change-Id: Ibbb4b725598c95e2b2ee9689f6bf50247ad235ac
TextView: Check also for mLayoutParams before calling checkForRelayout

Cherry-picked from OmniROM.

http://jira.omnirom.org/browse/OMNI-976

This was introduced with
https://github.com/omnirom/android_frameworks_base/commit/b3670c54e60387fde633fb91c649c5b896f8b962

Change-Id: I06c1926c5b8102b336d128d9b411f74a9eff3ded
Merge changes I06c1926c,Ibbb4b725,I586e481f,I23d10edf into kitkat

* changes:
  TextView: Check also for mLayoutParams before calling checkForRelayout
  Keyguard: Avoid unneeded SIM dialog show() calls
  NotificationHelper: We shouldn't use logical here, one case is enough no matter the order
  SystemUI: prevent NPE on clear recents double press