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/java/android/provider/Settings.java
	core/res/res/values/slim_symbols.xml
	services/java/com/android/server/UiModeManagerService.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
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
fb: TRDS dark base theme

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

Change-Id: Ie038c4a1aa535708c23f099fb5e836407e3d1603
Fix one and hide the other warnings from core/jni

Most of the warnings are unused parameter from skia functions.

Change-Id: I9df57718d117c26b96163f751ccb056ca86ac072
Don't try to set service.bootanim.exit

init has never allowed the bootanimation code to
set service.bootanim.exit, and has always generated the
dmesg error message

  <3>[   17.644615] init: sys_prop: permission denied uid:1003  name:service.bootanim.exit

Since setting this property has no effect and never worked, delete
the code which tries to do it.

Change-Id: Idacc5467d85479a8cf974702af8895011be585ea
Use java.util.Objects instead on internal API

Not needed since java.util.Objects implements all the needed
functionality.

Change-Id: Icd31d49a9801d1705427f028e9ac927d58e7d34c

Conflicts:
	services/java/com/android/server/am/ActivityStack.java
Fix to NullPointerException on move back in ActivityStack.

In ActivityTask.moveTaskToBackLocked NullPointerException may occur
when moving back with only current Activity in stack. This due to a
condition that may trigger despite a TaskRecord being null and then
attempt accessing the TaskRecord.mOnTopOfHome variable.

TaskRecord task may be set to null when no resumed activity remain.

Resolved by assuring that flag mOnTopOfHome is instead set to false
for current TaskRecord in case where there are no remaining activities
above home.

The above bug has already been corrected in the following commit,
ada62fca51d314cefe2c5da4e007df5b9abf320d, but it does not set the
cottect value to mTopOfHome for the current taks, see below.

Variable mOnTopOfHome will not be set to false in situations where
stack is of size 1 or less and task is null, perhaps from already
having finished current activity.

To avoid current TaskRecord maintaining value mOnTopOfHome to true
after launching Home this variable is set to false.

Impact should not be major due to correction earlier that makes sure
that there is always a TaskRecord.mOnTopOfHome set to true above Home
activity but if not correctly set for current task still gives a
possibility of bad behavior.

Change-Id: Ie86ad99c188aaa05b0de9d58eaa16c42b6fc4341
Clean up native AlarmManagerService tabs/spaces and unused parameter warnings

Change-Id: I64da1437dd0ed30957b43450c72b9d3797112a2e
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Don't pseudolocalize untranslatable strings.

bug: https://code.google.com/p/android/issues/detail?id=63004
Change-Id: I8e47a53d887144dc867111e42313d0e113b83ea1

Conflicts:
	tools/aapt/ResourceTable.cpp
DO NOT MERGE - Fix improper declaration/use of pointer.

https://code.google.com/p/android/issues/detail?id=61547

This variable is shadowing the outer "ptr" declaration, resulting in a
potential NULL pointer being passed to the message API.

Change-Id: If96bfae8d5e874e12597182678a180ba137b78da
MediaDrm#mNativeContext is a long, not int.

Therefore, we must use SetLongField and not SetIntField.

Change-Id: I2a805dd6b7c8e4905e742d8632d941f381a05930
Keydispatching timeout while finish Activity

If there is input to be handled during finish activity we can get a
keydispatching timeout ANR. The reason is that finish activity is some
times not possible, and the activity is instead put on a finish queue.
The activity will then be finished sometime in the future. When we add
the activity to the finish queue, key dispatching is paused, and there
is an ANR timer waiting for it to be resumed again. Since it can take a
long time before the activity is actually finished, we need to resume
the key dispatching to avoid the ANR.

Change-Id: Icea4ab3b5ad05c8bfbadf8f5cece1a59ec621469
TRDS: Dark DocumentsUI

for Downloads app

PS:
- fix settings

Change-Id: I87d49e97b8a0a67bd4d85f0137eb0960155428cb
Framework: QuickRecord Tile (1/2)

Images by kroz (thanks!)
Change-Id: I22f9de88d401a777e987ec2c1bbbf599dc840d5d

Conflicts:
	packages/SystemUI/AndroidManifest.xml
Framework: Chamber of Secrets (1/2) [WIP]

PS5: Add long settings.
PS6: Remove Chamber if setting
	not active. Also prevent
	alert from retracting
	when device is rotated.
PS7: Whitespace
PS8: Add color-parsing to integers.
	Allows you to use "red",
	"green", "#ff0099cc", etc
	as input-values.  Fancy.
PS9: String Change
PS10: Null string check.
PS11: Null string ::: don't process code.

Change-Id: I47d85ddcfb71c207a983584e08166bc85ab7d588