Revert "add BoardConfig flag TARGET_USES_OPENGLES_FOR_SCREEN_CAPTURE"

This reverts commit db66fbf4acbe098dc52534378ed33694a63f3ffd.
Turns out the test results in the GN were skewed by another bug. We _can_ just remove the useReadPixels check and do away with the need for a board flag

Change-Id: I084e7bbf4c2435b9656fa30e7ce130237b7f57c5
sf: Always use opengles for screen capture

Go back to the usage of GRALLOC_USAGE_HW_TEXTURE and GRALLOC_USAGE_HW_RENDERER
in captureScreenImplLocked regardless of useReadPixels value

This fixes the EGL_NO_IMAGE_KHR error returned from
eglCreateImageKHR (blank images returned from screenshot path)

Change-Id: I62fe90a081607b9e89c67f3dcfd34c84efc89d35
sf: work around for no EGL_RENDERABLE_TYPE support

Conflicts:
	services/surfaceflinger/SurfaceFlinger.cpp

Change-Id: I04de379c73fc349526527ded9ddd3dd07f1998a0
GlES2: Add NULL check

Check for NULL before calling thread specific glGetString.

CRs-fixed: 569609

Change-Id: Ifee8257152ba7ca7a05df5d7b113171b71d16c82
surfaceflinger: Set max acquired buffer count

If triple framebuffers are enabled, the number of acquired
buffers isn't increased by default. Set the count to one less
than the max buffers to make sure all three buffers come into
play.

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

- handle NULL check is required while flatten GraphicsBuffer

CRs-fixed: 579102

Change-Id: I292b4b25dc1f5320378cc9e4affbad326e1fdaed
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
Merge "native: TRDS 3.0 and new theme engine preparation (2/4)" into kk4.4
sensorservice: Fix init sequence for pre-1.1 API sensor HALs

The sensors API introduced a new flush() method that older binaries
won't have. For those, replace the firstFlush invocation with a
setDelay call since a lot of implementations interpreted that as
the initialization step.
We also don't want any kind of call to flush() to happen when it
isn't there, since it'll either hit a random OEM extension or
a memory address we really don't want to execute.

Change-Id: I26ce923fe385751fed7d1c483a53c074249f0620
Not needed anymore for t0lte devices

Revert "SensorEventQueue: Allow setRate on sensor enable"

This reverts commit 24e8e8fed698c644f42bf832423258e3598bb419.

Change-Id: Iad67e28502bf250d4523240089cc0b1edc77672d
Signed-off-by: Josue Rivera <prbassplayer@gmail.com>
native: added null check and remove EGL fallback

Change-Id: I589a1b0eae4c885ada1ee58a69bf2bcace822a45
native: go back to default heap sizes

causes on some devices to much problems. The one which want
to have a higher value can set it in device tree

Change-Id: Ie9fcd45ce5ea7ba34690c6c9d9320bb7b76bb7a5
Merge "Not needed anymore for t0lte devices" into kk4.4
surfaceflinger: Apply bugfixes to the correct hwc code paths

Patches to deal with corner-case layer states were mistakenly merged into
the pre-1.0-hwc code paths. Move them to their intended locations

thanks ricardo for the correction

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

Big thanks to steven676 who found this commit to fix
graphics issues on many devices

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
Merge "Graphics:Add error check when create GraphicBuffer" into kk4.4
Update HWUI config for xxhdpi/2GB devices

Change-Id: Ic9ba16b0360f2b755a1d23aa51eddc61beee2bac
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
native: go back to our custom heap sizes

after eliminating the problems we had we can go back

This reverts commit 5ee007698de14ae5491f5f124c3e2f8fa11520be.

Change-Id: I4a06f890ef36142732d26e0c88355c70e39a9f35
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