libnativeloader: Make webviewchromium so file optional

Not all android devices ship with Webview. The requirement of
libwebviewchromium_plat_support.so to be loaded while initializing the
android namespace is therefore liable to cause a crash on devices that
don't support or use Webview. Therefore, this patch makes this
requirement conditional, but enabled by default.

To remove the dependency, device make files should add the following:

TARGET_IGNORE_WEBVIEW_CHROMIUM := true

Bug: 27336841
Bug: 27546414
Change-Id: Iaec1b58236356d981504ea8f716413ea334ca4f4
This commit is contained in:
Prashant Malani 2016-03-16 12:59:53 -07:00
parent 53263ffa00
commit 75dda7551f
2 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,9 @@ LOCAL_SHARED_LIBRARIES := libnativehelper liblog libcutils
LOCAL_STATIC_LIBRARIES := libbase
LOCAL_CLANG := true
LOCAL_CFLAGS += -Werror -Wall
ifeq ($(TARGET_IGNORE_WEBVIEW_CHROMIUM), true)
LOCAL_CFLAGS += -DIGNORE_WEBVIEW_CHROMIUM
endif
LOCAL_CPPFLAGS := -std=gnu++14 -fvisibility=hidden
LOCAL_LDFLAGS := -ldl
LOCAL_MULTILIB := both
@ -32,6 +35,9 @@ LOCAL_SHARED_LIBRARIES := libnativehelper liblog libcutils
LOCAL_STATIC_LIBRARIES := libbase
LOCAL_CLANG := true
LOCAL_CFLAGS += -Werror -Wall
ifeq ($(TARGET_IGNORE_WEBVIEW_CHROMIUM), true)
LOCAL_CFLAGS += -DIGNORE_WEBVIEW_CHROMIUM
endif
LOCAL_CPPFLAGS := -std=gnu++14 -fvisibility=hidden
LOCAL_LDFLAGS := -ldl
LOCAL_MULTILIB := both
@ -49,6 +55,9 @@ LOCAL_SRC_FILES:= $(NATIVE_LOADER_COMMON_SRC_FILES)
LOCAL_STATIC_LIBRARIES := libnativehelper libcutils liblog libbase
LOCAL_CLANG := true
LOCAL_CFLAGS += -Werror -Wall
ifeq ($(TARGET_IGNORE_WEBVIEW_CHROMIUM), true)
LOCAL_CFLAGS += -DIGNORE_WEBVIEW_CHROMIUM
endif
LOCAL_CPPFLAGS := -std=gnu++14 -fvisibility=hidden
LOCAL_LDFLAGS := -ldl
LOCAL_MULTILIB := both

View File

@ -55,7 +55,9 @@ static const char* kPublicNativeLibraries = "libandroid.so:"
"libRS.so:"
"libstdc++.so:"
"libvulkan.so:"
#if !defined(IGNORE_WEBVIEW_CHROMIUM)
"libwebviewchromium_plat_support.so:"
#endif
"libz.so";
class LibraryNamespaces {