Revert "Immersive: Fix black bar in some games"

This reverts commit 73e32d9422c7790a8f9a95f93e224ea6f73ac79f.

Reason why: https://plus.google.com/102019442526033938148/posts/T2DgbKfwWHC

Sadly is due to apps' developers.
So if they don't add full immersive support just disable forced mode.
I may send a mail to them @kevdliu :)

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Fix: onBoot brightness

When device boots the brightness is always on highest level.

PS1: workaround it
PS2: apply to all devices
PS3: fix blur issue
PS5: sorry, update old file
PS6: remove whitespaces thx Carlo

Bug: https://paranoidandroid.atlassian.net/browse/AOSPA-56

Signed-off-by: Matthias Freund <matthias88freund@gmail.com>
Change-Id: I9535e2c22132539e0ad7e9d718b5d0732ba53571
Base: NFC toggle

Jira: http://jira.omnirom.org/browse/OMNI-553
Icons from Cyanogenmod.

Change-Id: I3230978211bdd25e84a919fe2ba3ceb8f8b79c83

Conflicts:
	packages/SystemUI/res/values-de/custom_strings.xml
	packages/SystemUI/res/values/custom_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
Solve three memory leaks related to PatchCache

A Patch can be fairly large, holding bitmap data, but
is also frequently leaked which adds to the severity.
The feature is used in many important processes such
as Home, SystemUI and Chrome.

The following leaks are solved:

1. The Patch itself was not always freed.
PatchCache::removeDeferred() can mark patches to be
cared for by PatchCache::clearGarbage(). But
mCache.remove() would only destroy the container
and the pointer, not the Patch object itself.

2. The vertices stored in the Patch at Patch::createMesh()
would always leak. The empty/default destructor in Patch
would not properly destroy "vertices" since it's just a
pointer.

3. A BufferBlock that's added to the mFreeBlocks
in PatchCache could leak. The leak happened when a
patch later needed the entire free block, because the
object was removed from the list but never deleted
in PatchCache::setupMesh().

Change-Id: I41e60824479230b67426fc546d3dbff294c8891f
Alarm: Add one more RTC alarm type for poweroff alarm.

Now we use type of RTC_WAKEUP for the poweroff alarm.
Actually lots of other applications also use this type.
But these applications never expect the device will
power on after it has been shut down. So we need to
add dedicated alarm type for the Deskclock or similar
applications.

Change-Id: I5df2465c46de8fe875d1581bdefe26021c8ffb33

Conflicts:
	services/java/com/android/server/AlarmManagerService.java
ActiveDisplay: fix possible add>remove>add(nothing happens) condition

Change-Id: I7bb444eced5de0856f60dda7804ee4864546bc9d

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
Avoid SystemUI crash due to NPE

BaseStatusBar.createNotificationViews() returns null
when it reports handleNotificationError(), leading to
a forced crash of the misbehaving app. However, it
should not add a null object of Notification.Entry
since it will also crash SystemUI (crashing at compare).

Change-Id: I86678c8024e931420b0fbab1f36b330e7e75d581
Fix Tethering reboot on exception

The CAF commit caused a reboot on Illegal State Exception because it de-genericized
exception handling. Added Illegal State exception but may consider reducing it to
just 'Exception' if this happens again.

Change-Id: Ib19d24ca25791fae7a996f8d96d828bef7d8a691
Merge remote-tracking branch 'th/kitkat' into kitkat