fb: TRDS 3.0 and new theme engine preparation (1/4)

For the one who do not know this feature see as reference
the first two versions here:

https://github.com/SlimRoms/frameworks_base/commit/b330fde28306286572ba390e451a72539c0c3576

https://github.com/SlimRoms/frameworks_base/commit/3194015737b7944b4185fca007b8d167a0675cd8

we got now over a year now a lot experience how to handle the qualifier fallback
as well how to theme it and how to handle other apps. Based on this knowledge we
redid some parts of TRDS engine with following new features/additions and fixes
to have now a final perfect working TRDS

- compared to the old versions where it was needed on some apps to restart them
  in background this is not needed any more. All is handled about the internal
  AOSP resource handling and on qualifier change the caches are cleared
  and the apps get an onconfigurationchanged to restart the activity
  like it is doing on orientation change eg
- inverted folder is now depreciated and the new folders are holodark
  and hololight which allows on the one hand a dark theme (at least
  how TRDS started) and a light based theme hololight
- This name change is mainly because of the new theme engine which
  will come which uses this as base to add 2 external themes at the same
  time and give the user the ability to switch between them. But this is
  still in early stages and this commit is just the preparation for it
- Two new automodes are now integrated. User can enable the twilight modus
  which enables/disables holodark/hololight depending on the daytime...means
  on the evening it switches to holodark on normal day it is hololight.
  The other automode is based on light conditions....means that if it is
  dark outside it switches to holodark....if we have bright light conditions
  it switches immediatelly to hololight. Due of the resource cache handling now
  this happens immediatelly for the user and feels completly system integrated
  and happens without delay. A bit comparable to some navigation tool for cars
  which can switch automatically from dark to light and back
- currently the auto modes as well the manual mode switches between holodark
  and hololight. Due that we do not have currently anything hololight themed
  in the source hololight = stock theme. We will give the user the ability
  later when done to choose between which modes the user want to switch
  (stock/holodark/hololight). But this does not make sense at the moment.
  As soon as we have done the light theme or theme engine (lets see what
  comes first) we will open the ability to choose it. This is only a small code change
- a lot small tweaks and fixes went as well into the new version

Whatever this commit as usual adds the support for it. The themeing is done in the
other commits by kroz which is as well way more extended then on the older versions

cheers

PatchSets:
- minor code cleanup

PatchSet5:
- use one value for auto modes

PatchSet6:
- kill resource caches on configuration change

PatchSet7:
- register settings observer lol

PatchSet8:
- fix not assigment of config mode change (typo lol)

PatchsSet 9 -11:
- playing around aosp qualifier is not that flexible then I thought
whatever back in most parts to original implementation handling

PatchSet 12:
- now no restarts of any application needed any more like it was on 4.3...yeaaah
- fix wrong shifting in native adapter
- fix wrong call of twilightmode
- disable debug
- cleanup

PatchSet 13:
- fix lightsensor

Patchset 14:
- no need currently to recreate the navbar we can do if a theme needs it

Patchset 16:
- synchronize on sending config change
- only send if system is ready
- fire first update when system is ready

-rebase

Change-Id: Ic88838247c47d2a92b55d1cb1b00330f2d62fb88

Conflicts:
	core/java/android/app/ResourcesManager.java
	core/java/android/content/res/Resources.java
	core/res/res/values/slim_symbols.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
	services/java/com/android/server/UiModeManagerService.java

Conflicts:
	core/java/android/content/res/Resources.java
fb: add theme switch (TRDS) to navbar and navring

and show toast if a mode is running wich does not support
lightsensors

- rebase

Change-Id: Ie89589e1e0343e734728f0db00171a4e137370bb

Conflicts:
	core/res/res/values/slim_strings.xml
	core/res/res/values/slim_symbols.xml
QS: add theme switcher tile (TRDS) 1/2

this adds a theme switcher tile

normal click: turn on/off dark/light theme
longpress: switch between the auto modes (manual/light sensor/twilight)

Change-Id: I62b8e11b5714c179ccbf1c1e341b47c84da0fb56

Conflicts:
	packages/SystemUI/res/values/liquid_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsController.java
Keyguard: disable statusbar clock for dashclock, lockclock and desclock

afaik this was an original commit from Danesh and we extended it later.
Whatever thanks to him in this case :)

Change-Id: I67a370b0a76f938fa3e022e8c467f2d6ebca87c0
Keyguard: fix not shown overlay widgets from system

google derp....due that if widgets are disabled current AOSP
code just add the default widget. Then checkAppWidgetConsistency()
detects a widget which was added and the complete method is non op.
Whatever lets handle the whole process over checkAppWidgetConsistency()
on widget disabled it tries to bind the default widget over overlay if
this is without sucess it falls back to the system one.
Safemode falls always to the system one

This fixes as well an issue that the saved default id in LockPatternUtils
is not reseted back to default if all widgets were deleted from the user.
Based on an old patch from danesh. Thanks for the
suggestion

Change-Id: Ic8543e0b5e83114e57942225935870f45deda97e
fb: TRDS dark base theme

Change-Id: Ie25abfbf5258ac479ca8bc91033f6892bbbc6741
trds:[framework] dark images adjustments

Change-Id: Ie038c4a1aa535708c23f099fb5e836407e3d1603
Frameworks: new dark liquid default wallpapers
SystemUI: Add double tap to sleep gesture

Change-Id: I4c54718e8ec8774677d13917b3a7ffa3b4b18cb5
spelling error "status bra"

Change-Id: I0914af77cbd957024300f4ad621a1dd380edb13d
Fix Immersive confirmation in expanded mode.

The confirmation should come only once.

Change-Id: I5914d655bd5f9315ac4cc6fc7d70cc4ee45bb7b2
Fix ResTable_config::CONFIG_* typo (MCC vs MNC)

In commit 08d5b8f, the ResTable_config::CONFIG_* enum was incorrectly
changed to assign the same value to both CONFIG_MCC and CONFIG_MNC:
    - CONFIG_MCC = 0x0001,
    - CONFIG_MNC = 0x0002,
    + CONFIG_MCC = ACONFIGURATION_MCC,
    + CONFIG_MNC = ACONFIGURATION_MCC,

This commit assigns CONFIG_MNC the value ACONFIGURATION_MNC, as
intended.

Change-Id: I3b8799914a55debdb3ff30a82ada7ad990c49970
KeyguardServiceDelegate: disable DEBUG

Change-Id: Ia5476563f6ed7f9e3175233994676c038b3a8f67
[1/3] base: allow disabling non intrusive incall ui

Change-Id: Ibe9c65f1fe024a859d98d96fd86199607a1060de

Conflicts:
	core/java/android/provider/Settings.java
Fix theme tile and duplicate theme code
TRDS: Dark DocumentsUI

for Downloads app

PS:
- fix settings

Change-Id: I87d49e97b8a0a67bd4d85f0137eb0960155428cb
Separate Android Encryption Password from Lockscreen Password

This permits the use of a different (hopefully longer and more complex!) encryption
password, while using a simpler (and easier to type) lockscreen password.

Change-Id: Ia35fdcc769eee8fd7891678a532dafa0f4b3ba04
fb: lock statusbar recreation and release after ticker is done

In rare cases it happens that the ticker call just happened and a recreation
was called which results in a crah due of the missing binder.
To avoid it lock the recreation when a ticker call is in progress
and release it after it is done and notify the recreation to go ahead

Change-Id: Iedbf858bdb2ac2ad97563e344a571b384e17cfc7

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
fb: use SlimActions for torch tile and send as qualified user

the broadcast and do not collape the panel bar

as well send with qualified user the IME switcher broadcast.

Change-Id: Ibad8b4f908e6d701999712f58b9996cd7a805fc4

Conflicts:
	packages/SystemUI/src/com/android/systemui/quicksettings/TorchTile.java
systemUI: fix notification dissapearing during recreation and possible

app crashes due that binded notifications are not there anymore

as well small cleanup

Change-Id: Ieed143088a55693fc56e6526e6b349d72b7b25cc