installd: Invert the default for dexopt-on-cache

The growth of /system apps and total /data space are making this
device-breaking (insufficient space to dexopt everything to
/cache), pointless (/data has more than enough room to hold
the cache), and in some cases, both.
The default behavior is now the same as mainline Android's: dexopt
everything to /data. Set dalvik.vm.dexopt-data-only=0 to change
that and dexopt /system apps to /cache. If you do that, make sure
your /cache can accomodate double the size of the dex classes in
system, since in some extreme cases that has been observed during
dex2oat

Change-Id: I8c793784af1fa804ccf84b442613d1000c9b7ce4
libs/ui: Fix crash issue because of null pointer access

- handle NULL check is required while flatten GraphicsBuffer

CRs-fixed: 579102

Change-Id: I292b4b25dc1f5320378cc9e4affbad326e1fdaed
frameworks/native: Add support for Secure Display

- Add secure UI layers to primary and remove other layers from
  internal and external list for Secure Display usecase.
- Dont let secure UI layers to be captured on screen

Change-Id: Iebdad5c56247308604ee90928f6d6460a1f69279
SurfaceFlinger: Add NULL check for buffer handling

Add buffer handling NULL check in dequeueBuffer and
verify whether the output data from binder is not NULL
in queueBuffer and connect api's to avoid SF crash

CRs-Fixed: 573088
CRs-Fixed: 572315

Change-Id: I41cebbc0cbcbbb0fd5ecb38db7ec7b0c91cdffe9
SurfaceFlinger: Enable Vsync trace for SF Composition

Enable traces to show s/w vsync which is used for composition
by surfaceflinger, this helps in identifying the start of
composition cycle in systrace

Change-Id: Id892ca03bacd9f0cfe5ca2c3f8bb5aa892b37231
SurfaceFlinger: Change to support framebuffer flip for 2D blitters

- Surfaceflinger does not flip framebuffers when there are
  no layers marked for HWC_FRAMEBUFFER
- This change checks for the HWC_BLIT flag and will request a flip
  to a new FB_TARGET buffer even if there are no FRAMEBUFFER layers

Change-Id: I1cb44389a05c9ec049d7f0d39c288feccb11a91c
libgui: Bring back support for mHeap-based screenshots

Older graphics libraries throw a hissy fit when trying to lock
buffers for Surface-based screenshots, on at least Tegra2/3 and
Exynos4 hardware.

This patch depends on the BOARD_USE_MHEAP_SCREENSHOT board flag
and requires the ro.bq.gpu_to_cpu_unsupported property set to 1
in order to work.

Change-Id: I7db955e2cdd120018e349c14290e975788e70ed3
surfaceflinger: don't handle EVENT_ORIENTATION when !HWC_DEVICE_API_VERSION_1_0

a184463 causes segfault on boot for the enrc2b (and probably others), this fixes it.

Change-Id: Ic4a7a05b44c8cc44a0d25c56def4acdf5b0939df
surfaceflinger: Apply bugfixes to the correct hwc code paths

Changes I2deaf2ed101e8ea76708862a6bb67751b6078794 and
I1cb44389a05c9ec049d7f0d39c288feccb11a91c, both meant to deal
with corner-case layer states, were mistakenly merged into
the pre-1.0-hwc code paths. Move them to their intended locations

Change-Id: Idd6b3513cc36dda21b552eee97f9ea91793df18f
Fix boot animation rotation problem when ro.sf.hwrotation is set to 90 or 270

Change-Id: I7ad3c83e23ce38280818ec5283d173d50c889531
surfaceflinger: Consolidate display orientation compensation hooks

Dedupe rotation calculation code and make rotation a statically
available property in the DisplayDevice
Change-Id: Ic517ab0d2c05026cd6fa46d664aab7926be17b62
SF: Avoid wormhole clear for BLIT calls

Do not call GPU clear from SF when composition
type is BLIT as it'll be taken care in HAL.

Change-Id: Ia613eb9b824c6484ecc8c8fa4ee883545d8541b8
Update HWUI config for xxhdpi/2GB devices

Change-Id: Ic9ba16b0360f2b755a1d23aa51eddc61beee2bac
Graphics:Add error check when create GraphicBuffer

Change-Id: Ib0ca59bf1dfe4ae0266c29c91c1dbe3d02c0904e
Author: Lingyun Zhu <lingyun.zhu@intel.com>
Signed-off-by: Lingyun Zhu <lingyun.zhu@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 50141
sf: Fix detection of 0.3 hwcomposer

The format was different, so look at the header bits too...

Change-Id: Ibc3d4c9f6bca74d6951041f92e2ecc6189e58c41
sf: Don't do premultiplied alpha blending on the statusbar for hwc <= 0.3

Blending the translucent statusbar with the limited alpha implementation
of older HWC versions is glitch-prone, so don't do that with the compositor
at all

Change-Id: I96b49823b837a5063960d39c0937caea8bb3116a
sensorservice: Set the rate for pre-1.1 HALs _after_ activation

We want to be sure these are applied in the same sequence they
used to be...

Change-Id: Ied2ba08ed3c4bed3a80bac6ab5471fcea9ba2c09
libgui: Add native window attributes to query usage

This is required to enable GL libraries to query usage
native window attributes to enable/disable tile rendering.

Change-Id: If752fa26ac3d8ffd7776cc5a16fe162af0742df5
native: TRDS 3.0 and new theme engine preparation (2/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
Change-Id: Ibc5aaec5661455477815043440fae86052a395ce
Correcting include path in installd test project's Android.mk

 installd project has moved from frameworks/base to frameworks/native
 and so its test project's c_include path defined in Android.mk
 has to match the change.

Change-Id: I597125ff659f51edbd9fc95371790e2d567c78be