diff options
| author | 2017-07-06 14:02:29 -0700 | |
|---|---|---|
| committer | 2017-07-12 20:44:31 +0000 | |
| commit | eeb4ac7c26038ee3b9771f3b8802c96ef7d8a374 (patch) | |
| tree | 599f90fbb50d1fde14794b96222258b80f194327 /libs/ui/GraphicBufferMapper.cpp | |
| parent | 0db05d3448f7e2dc8051987de504ecabbd9be252 (diff) | |
Add GraphicBufferMapper::preloadHal
Plumbing to allow Zygote to explicitly preload the a.h.graphics.mapper
HAL. An earlier attempt did this implicitly with a static initializer in
libui.so, but the library is also used by non-Zygote processes that
don't have access to HALs. This way, the HIDL libraries and HAL are only
loaded in Zygote and its children, not random other processes.
Bug: 62353585
Test: check that a.h.graphics.mapper is in /proc/`pid zygote64`/maps
Change-Id: I4989c8089e3a4cfd627f8940f5552950c1c617fc
(cherry picked from commit 5dac7819ac9461c14f0b7c208597579c5c3fb814)
Diffstat (limited to 'libs/ui/GraphicBufferMapper.cpp')
| -rw-r--r-- | libs/ui/GraphicBufferMapper.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp index b9fa6400f5..d52c508003 100644 --- a/libs/ui/GraphicBufferMapper.cpp +++ b/libs/ui/GraphicBufferMapper.cpp @@ -42,6 +42,10 @@ namespace android { ANDROID_SINGLETON_STATIC_INSTANCE( GraphicBufferMapper ) +void GraphicBufferMapper::preloadHal() { + Gralloc2::Mapper::preload(); +} + GraphicBufferMapper::GraphicBufferMapper() : mMapper(std::make_unique<const Gralloc2::Mapper>()) { |