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
Merge branch 'kk4.4' of https://github.com/SlimRoms/frameworks_native into kk4.4
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