BOARD_USE_LEGACY_UI := true
-BOARD_SYSTEMIMAGE_PARTITION_SIZE = $(if $(MKSQUASHFS),0,1610612736)
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736
+BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := squashfs
+BOARD_SYSTEMIMAGE_SQUASHFS_COMPRESSOR := gzip
+#TARGET_USERIMAGES_SPARSE_SQUASHFS_DISABLED := true
# customize the malloced address to be 16-byte aligned
BOARD_MALLOC_ALIGNMENT := 16
ifneq ($(filter efi_img,$(MAKECMDGOALS)),)
TARGET_KERNEL_ARCH ?= x86_64
endif
-TARGET_USES_64_BIT_BINDER := $(if $(filter x86_64,$(TARGET_ARCH) $(TARGET_KERNEL_ARCH)),true)
+TARGET_USES_64_BIT_BINDER := true
BOARD_USES_GENERIC_AUDIO ?= false
BOARD_USES_ALSA_AUDIO ?= true
USE_OPENGL_RENDERER := true
NUM_FRAMEBUFFER_SURFACE_BUFFERS ?= 3
BOARD_USES_DRM_HWCOMPOSER ?= true
+SF_START_GRAPHICS_ALLOCATOR_SERVICE := true
USE_CAMERA_STUB ?= false
# This enables the wpa wireless driver
BOARD_WPA_SUPPLICANT_DRIVER ?= NL80211
-BOARD_WPA_SUPPLICANT_PRIVATE_LIB ?= private_lib_driver_cmd
WPA_SUPPLICANT_VERSION ?= VER_2_1_DEVEL
-WIFI_DRIVER_MODULE_PATH ?= auto
BOARD_GPU_DRIVERS ?= i915 i965 nouveau r300g r600g radeonsi virgl vmwgfx
ifneq ($(strip $(BOARD_GPU_DRIVERS)),)
COMPATIBILITY_ENHANCEMENT_PACKAGE := true
PRC_COMPATIBILITY_PACKAGE := true
ZIP_OPTIMIZATION_NO_INTEGRITY := true
+
+DEVICE_MANIFEST_FILE := device/generic/common/manifest.xml
--- /dev/null
+$(call add-clean-step, rm -f $(TARGET_OUT_VENDOR)/*/*/android.hardware.graphics.allocator@2.0-service*)
+$(call add-clean-step, rm -rf $(TARGET_OUT_APPS_PRIVILEGED)/Telecom)
+$(call add-clean-step, rm -f $(TARGET_OUT_VENDOR)/*/*/android.hardware.bluetooth@1.0-service* $(TARGET_OUT)/lib*/libbt-vendor.so)
+$(call add-clean-step, rm -f $(TARGET_OUT_VENDOR)/lib*/hw/android.hardware.bluetooth@1.0-impl.so)
--- /dev/null
+#
+# Copyright (C) 2014-2017 The Android-x86 Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+ifneq ($(TARGET_NO_KERNEL),true)
+ifeq ($(TARGET_PREBUILT_KERNEL),)
+
+KERNEL_DIR ?= kernel
+
+ifneq ($(filter x86%,$(TARGET_ARCH)),)
+TARGET_KERNEL_ARCH ?= $(TARGET_ARCH)
+KERNEL_TARGET := bzImage
+TARGET_KERNEL_CONFIG ?= android-$(TARGET_KERNEL_ARCH)_defconfig
+KERNEL_CONFIG_DIR := arch/x86/configs
+endif
+ifeq ($(TARGET_ARCH),arm)
+KERNEL_TARGET := zImage
+TARGET_KERNEL_CONFIG ?= goldfish_defconfig
+KERNEL_CONFIG_DIR := arch/arm/configs
+endif
+
+ifeq ($(TARGET_KERNEL_ARCH),x86_64)
+CROSS_COMPILE ?= $(abspath prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin)/x86_64-linux-
+else
+CROSS_COMPILE ?= $(abspath $(TARGET_TOOLS_PREFIX))
+endif
+KBUILD_OUTPUT := $(abspath $(TARGET_OUT_INTERMEDIATES)/kernel)
+mk_kernel := + $(hide) $(MAKE) -C $(KERNEL_DIR) O=$(KBUILD_OUTPUT) ARCH=$(TARGET_ARCH) CROSS_COMPILE="$(abspath $(CC_WRAPPER)) $(CROSS_COMPILE)" $(if $(SHOW_COMMANDS),V=1)
+
+KERNEL_CONFIG_FILE := $(if $(wildcard $(TARGET_KERNEL_CONFIG)),$(TARGET_KERNEL_CONFIG),$(KERNEL_DIR)/$(KERNEL_CONFIG_DIR)/$(TARGET_KERNEL_CONFIG))
+
+MOD_ENABLED := $(shell grep ^CONFIG_MODULES=y $(KERNEL_CONFIG_FILE))
+FIRMWARE_ENABLED := $(shell grep ^CONFIG_FIRMWARE_IN_KERNEL=y $(KERNEL_CONFIG_FILE))
+
+# I understand Android build system discourage to use submake,
+# but I don't want to write a complex Android.mk to build kernel.
+# This is the simplest way I can think.
+KERNEL_DOTCONFIG_FILE := $(KBUILD_OUTPUT)/.config
+KERNEL_ARCH_CHANGED := $(if $(filter 0,$(shell grep -s ^$(if $(filter x86,$(TARGET_KERNEL_ARCH)),\#.)CONFIG_64BIT $(KERNEL_DOTCONFIG_FILE) | wc -l)),FORCE)
+$(KERNEL_DOTCONFIG_FILE): $(KERNEL_CONFIG_FILE) $(wildcard $(TARGET_KERNEL_DIFFCONFIG)) $(KERNEL_ARCH_CHANGED)
+ $(hide) mkdir -p $(@D) && cat $(wildcard $^) > $@
+ $(mk_kernel) oldnoconfig
+
+# bison is needed to build kernel and external modules from source
+BISON := $(HOST_OUT_EXECUTABLES)/bison$(HOST_EXECUTABLE_SUFFIX)
+
+BUILT_KERNEL_TARGET := $(KBUILD_OUTPUT)/arch/$(TARGET_ARCH)/boot/$(KERNEL_TARGET)
+$(BUILT_KERNEL_TARGET): $(KERNEL_DOTCONFIG_FILE) | $(BISON)
+ $(mk_kernel) $(KERNEL_TARGET) $(if $(MOD_ENABLED),modules)
+ $(if $(FIRMWARE_ENABLED),$(mk_kernel) INSTALL_MOD_PATH=$(abspath $(TARGET_OUT)) firmware_install)
+
+ifneq ($(MOD_ENABLED),)
+KERNEL_MODULES_DEP := $(firstword $(wildcard $(TARGET_OUT)/lib/modules/*/modules.dep))
+KERNEL_MODULES_DEP := $(if $(KERNEL_MODULES_DEP),$(KERNEL_MODULES_DEP),$(TARGET_OUT)/lib/modules)
+
+ALL_EXTRA_MODULES := $(patsubst %,$(TARGET_OUT_INTERMEDIATES)/kmodule/%,$(TARGET_EXTRA_KERNEL_MODULES))
+$(ALL_EXTRA_MODULES): $(TARGET_OUT_INTERMEDIATES)/kmodule/%: $(BUILT_KERNEL_TARGET)
+ @echo Building additional kernel module $*
+ $(hide) mkdir -p $(@D) && $(ACP) -fr $(EXTRA_KERNEL_MODULE_PATH_$*) $(@D)
+ $(mk_kernel) M=$(abspath $@) modules
+
+$(KERNEL_MODULES_DEP): $(BUILT_KERNEL_TARGET) $(ALL_EXTRA_MODULES)
+ $(hide) rm -rf $(TARGET_OUT)/lib/modules
+ $(mk_kernel) INSTALL_MOD_PATH=$(abspath $(TARGET_OUT)) modules_install
+ + $(hide) for kmod in $(TARGET_EXTRA_KERNEL_MODULES) ; do \
+ echo Installing additional kernel module $${kmod} ; \
+ $(subst +,,$(subst $(hide),,$(mk_kernel))) INSTALL_MOD_PATH=$(abspath $(TARGET_OUT)) M=$(abspath $(TARGET_OUT_INTERMEDIATES))/kmodule/$${kmod} modules_install ; \
+ done
+ $(hide) rm -f $(TARGET_OUT)/lib/modules/*/{build,source}
+endif
+
+$(BUILT_SYSTEMIMAGE): $(KERNEL_MODULES_DEP)
+
+# rules to get source of Broadcom 802.11a/b/g/n hybrid device driver
+# based on broadcomsetup.sh of Kyle Evans
+WL_PATH := $(KERNEL_DIR)/drivers/net/wireless/broadcom/wl
+ifeq ($(wildcard $(WL_PATH)/build.mk),)
+WL_PATH := $(KERNEL_DIR)/drivers/net/wireless/wl
+endif
+-include $(WL_PATH)/build.mk
+
+installclean: FILES += $(KBUILD_OUTPUT) $(INSTALLED_KERNEL_TARGET)
+
+TARGET_PREBUILT_KERNEL := $(BUILT_KERNEL_TARGET)
+
+.PHONY: kernel $(if $(KERNEL_ARCH_CHANGED),$(KERNEL_HEADERS_COMMON)/linux/binder.h)
+kernel: $(INSTALLED_KERNEL_TARGET)
+
+endif # TARGET_PREBUILT_KERNEL
+
+ifndef LINEAGE_BUILD
+$(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP)
+ $(copy-file-to-new-target)
+ifdef TARGET_PREBUILT_MODULES
+ mkdir -p $(TARGET_OUT)/lib
+ $(hide) cp -r $(TARGET_PREBUILT_MODULES) $(TARGET_OUT)/lib
+endif
+endif # LINEAGE_BUILD
+endif # KBUILD_OUTPUT
--- /dev/null
+$(PRODUCT_OUT)/build.prop: $(INSTALLED_BUILD_PROP_TARGET)
+ sed -E '/ro.product.manufacturer|ro.product.model/d' $< > $@ && cat $@ > $<
+
+$(BUILT_SYSTEMIMAGE): $(PRODUCT_OUT)/build.prop
+
+ifneq ($(MKSQUASHFS),)
+$(PRODUCT_OUT)/system.sfs: $(BUILT_SYSTEMIMAGE) | $(SIMG2IMG)
+ $(hide) $(SIMG2IMG) $< $@
+endif
$(if $(wildcard $(PRODUCT_DIR)modules.blacklist),$(PRODUCT_DIR),$(LOCAL_PATH)/)modules.blacklist:system/etc/modules.blacklist \
$(if $(wildcard $(PRODUCT_DIR)fstab.$(TARGET_PRODUCT)),$(PRODUCT_DIR)fstab.$(TARGET_PRODUCT),$(LOCAL_PATH)/fstab.x86):root/fstab.$(TARGET_PRODUCT) \
$(if $(wildcard $(PRODUCT_DIR)wpa_supplicant.conf),$(PRODUCT_DIR),$(LOCAL_PATH)/)wpa_supplicant.conf:system/etc/wifi/wpa_supplicant.conf \
+ $(if $(wildcard $(PRODUCT_DIR)wpa_supplicant_overlay.conf),$(PRODUCT_DIR),$(LOCAL_PATH)/)wpa_supplicant_overlay.conf:system/etc/wifi/wpa_supplicant_overlay.conf \
$(if $(wildcard $(PRODUCT_DIR)excluded-input-devices.xml),$(PRODUCT_DIR),$(LOCAL_PATH)/)excluded-input-devices.xml:system/etc/excluded-input-devices.xml \
$(if $(wildcard $(PRODUCT_DIR)init.$(TARGET_PRODUCT).rc),$(PRODUCT_DIR)init.$(TARGET_PRODUCT).rc,$(LOCAL_PATH)/init.x86.rc):root/init.$(TARGET_PRODUCT).rc \
$(if $(wildcard $(PRODUCT_DIR)ueventd.$(TARGET_PRODUCT).rc),$(PRODUCT_DIR)ueventd.$(TARGET_PRODUCT).rc,$(LOCAL_PATH)/ueventd.x86.rc):root/ueventd.$(TARGET_PRODUCT).rc \
device/sample/etc/old-apns-conf.xml:system/etc/old-apns-conf.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \
- frameworks/base/compiled-classes-phone:system/etc/compiled-classes \
+ frameworks/base/config/compiled-classes-phone:system/etc/compiled-classes \
frameworks/native/data/etc/tablet_core_hardware.xml:system/etc/permissions/tablet_core_hardware.xml \
frameworks/native/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
DEVICE_PACKAGE_OVERLAYS := $(LOCAL_PATH)/overlay
+# Get Android 8.0 HIDL HALs
+$(call inherit-product,$(LOCAL_PATH)/treble.mk)
+
# Get the firmwares
$(call inherit-product,device/generic/firmware/firmware.mk)
# workaround for h.265 slowness
setprop sys.media.vdec.drop 0
-service wpa_supplicant /system/bin/wpa_supplicant -c/data/misc/wifi/wpa_supplicant.conf \
- -iwlan0 -Dnl80211 \
+service wpa_supplicant /vendor/bin/hw/wpa_supplicant -dd \
+ -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
+ -I/system/etc/wifi/wpa_supplicant_overlay.conf \
-O/data/misc/wifi/sockets \
-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
# we will start as root and wpa_supplicant will switch to user wifi
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
+ oneshot
service nativebridge /system/bin/enable_nativebridge
class main
--- /dev/null
+<manifest version="1.0" type="device">
+ <hal format="hidl">
+ <name>android.hardware.audio</name>
+ <transport>hwbinder</transport>
+ <version>2.0</version>
+ <interface>
+ <name>IDevicesFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.audio.effect</name>
+ <transport>hwbinder</transport>
+ <version>2.0</version>
+ <interface>
+ <name>IEffectsFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.bluetooth</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IBluetoothHci</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.camera.provider</name>
+ <transport>hwbinder</transport>
+ <version>2.4</version>
+ <interface>
+ <name>ICameraProvider</name>
+ <instance>legacy/0</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.cas</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IMediaCasService</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.configstore</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>ISurfaceFlingerConfigs</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.dumpstate</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IDumpstateDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.graphics.allocator</name>
+ <transport arch="32+64">passthrough</transport>
+ <version>2.0</version>
+ <interface>
+ <name>IAllocator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.graphics.mapper</name>
+ <transport arch="32+64">passthrough</transport>
+ <version>2.0</version>
+ <interface>
+ <name>IMapper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.light</name>
+ <transport>hwbinder</transport>
+ <version>2.0</version>
+ <interface>
+ <name>ILight</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.media.omx</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IOmx</name>
+ <instance>default</instance>
+ </interface>
+ <interface>
+ <name>IOmxStore</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.power</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IPower</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.renderscript</name>
+ <transport arch="32+64">passthrough</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.sensors</name>
+ <transport arch="32+64">passthrough</transport>
+ <version>1.0</version>
+ <interface>
+ <name>ISensors</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.usb</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IUsb</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.wifi.supplicant</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>ISupplicant</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</manifest>
-->
<MediaCodecs>
- <Include href="media_codecs_ffmpeg.xml" />
<Include href="media_codecs_google_audio.xml" />
<Include href="media_codecs_google_video.xml" />
</MediaCodecs>
LOCAL_CFLAGS := -Werror -Wall
LOCAL_CPPFLAGS := -std=c++11
LOCAL_SHARED_LIBRARIES := libcutils libdl liblog
+LOCAL_C_INCLUDES := system/core/libnativebridge/include
LOCAL_MULTILIB := both
LOCAL_POST_INSTALL_CMD := $(hide) \
rm -rf $(TARGET_OUT)/*/{arm*,*houdini*} {$(TARGET_OUT),$(PRODUCT_OUT)}/vendor/{*/arm*,*/*houdini*}; \
if [ -z "$1" ]; then
if [ "`uname -m`" = "x86_64" ]; then
- v=7_y
- url=http://goo.gl/SBU3is
+ v=8_y
+ url=http://goo.gl/v6c4Co
else
- v=7_x
- url=http://goo.gl/0IJs40
+ v=8_x
+ url=http://goo.gl/96BPKe
fi
else
- v=7_z
- url=http://goo.gl/FDrxVN
+ v=8_z
+ url=http://goo.gl/CtKjxx
fi
if [ -s /system/lib$1/libhoudini.so ]; then
# this is to add the supported binary formats via binfmt_misc
if [ ! -e $binfmt_misc_dir/register ]; then
+ modprobe binfmt_misc
mount -t binfmt_misc none $binfmt_misc_dir
fi
/*
- * Copyright (C) 2015 The Android-x86 Open Source Project
+ * Copyright (C) 2015-2017 The Android-x86 Open Source Project
*
* by Chih-Wei Huang <cwhuang@linux.org.tw>
*
#include <cutils/properties.h>
#include "nativebridge/native_bridge.h"
+#define DBG 0
+#if DBG
+#define LOGV ALOGD
+#else
+#define LOGV ALOGV
+#endif
+
namespace android {
static void *native_handle = nullptr;
+static bool is_native_bridge_enabled()
+{
+ return property_get_bool("persist.sys.nativebridge", 0);
+}
+
static NativeBridgeCallbacks *get_callbacks()
{
static NativeBridgeCallbacks *callbacks = nullptr;
}
}
callbacks = reinterpret_cast<NativeBridgeCallbacks *>(dlsym(native_handle, "NativeBridgeItf"));
+ ALOGI("Found %s version %u", libnb, callbacks ? callbacks->version : 0);
}
return callbacks;
}
const char *app_code_cache_dir,
const char *isa)
{
- ALOGV("enter native_bridge2_initialize %s %s", app_code_cache_dir, isa);
- if (property_get_bool("persist.sys.nativebridge", 0)) {
+ LOGV("enter native_bridge2_initialize %s %s", app_code_cache_dir, isa);
+ if (is_native_bridge_enabled()) {
if (NativeBridgeCallbacks *cb = get_callbacks()) {
return cb->initialize(art_cbs, app_code_cache_dir, isa);
}
+ ALOGW("Native bridge is enabled but callbacks not found");
} else {
ALOGW("Native bridge is disabled");
}
static void *native_bridge2_loadLibrary(const char *libpath, int flag)
{
- ALOGV("enter native_bridge2_loadLibrary %s", libpath);
+ LOGV("enter native_bridge2_loadLibrary %s", libpath);
NativeBridgeCallbacks *cb = get_callbacks();
return cb ? cb->loadLibrary(libpath, flag) : nullptr;
}
static void *native_bridge2_getTrampoline(void *handle, const char *name,
const char* shorty, uint32_t len)
{
- ALOGV("enter native_bridge2_getTrampoline %s", name);
+ LOGV("enter native_bridge2_getTrampoline %s", name);
NativeBridgeCallbacks *cb = get_callbacks();
return cb ? cb->getTrampoline(handle, name, shorty, len) : nullptr;
}
static bool native_bridge2_isSupported(const char *libpath)
{
- ALOGV("enter native_bridge2_isSupported %s", libpath);
+ LOGV("enter native_bridge2_isSupported %s", libpath);
NativeBridgeCallbacks *cb = get_callbacks();
return cb ? cb->isSupported(libpath) : false;
}
static const struct NativeBridgeRuntimeValues *native_bridge2_getAppEnv(const char *abi)
{
- ALOGV("enter native_bridge2_getAppEnv %s", abi);
+ LOGV("enter native_bridge2_getAppEnv %s", abi);
NativeBridgeCallbacks *cb = get_callbacks();
return cb ? cb->getAppEnv(abi) : nullptr;
}
-static bool native_bridge2_is_compatible_compatible_with(uint32_t version)
+static bool native_bridge2_isCompatibleWith(uint32_t version)
{
- // For testing, allow 1 and 2, but disallow 3+.
- return version <= 2;
+ static uint32_t my_version = 0;
+ LOGV("enter native_bridge2_isCompatibleWith %u", version);
+ if (my_version == 0 && is_native_bridge_enabled()) {
+ if (NativeBridgeCallbacks *cb = get_callbacks()) {
+ my_version = cb->version;
+ }
+ }
+ // We have to claim a valid version before loading the real callbacks,
+ // otherwise native bridge will be disabled entirely
+ return version <= (my_version ? my_version : 3);
}
-static NativeBridgeSignalHandlerFn native_bridge2_get_signal_handler(int signal)
+static NativeBridgeSignalHandlerFn native_bridge2_getSignalHandler(int signal)
{
- ALOGV("enter native_bridge2_getAppEnv %d", signal);
+ LOGV("enter native_bridge2_getSignalHandler %d", signal);
NativeBridgeCallbacks *cb = get_callbacks();
return cb ? cb->getSignalHandler(signal) : nullptr;
}
+static int native_bridge3_unloadLibrary(void *handle)
+{
+ LOGV("enter native_bridge3_unloadLibrary %p", handle);
+ NativeBridgeCallbacks *cb = get_callbacks();
+ return cb ? cb->unloadLibrary(handle) : -1;
+}
+
+static const char *native_bridge3_getError()
+{
+ LOGV("enter native_bridge3_getError");
+ NativeBridgeCallbacks *cb = get_callbacks();
+ return cb ? cb->getError() : "unknown";
+}
+
+static bool native_bridge3_isPathSupported(const char *path)
+{
+ LOGV("enter native_bridge3_isPathSupported %s", path);
+ NativeBridgeCallbacks *cb = get_callbacks();
+ return cb && cb->isPathSupported(path);
+}
+
+static bool native_bridge3_initAnonymousNamespace(const char *public_ns_sonames,
+ const char *anon_ns_library_path)
+{
+ LOGV("enter native_bridge3_initAnonymousNamespace %s, %s", public_ns_sonames, anon_ns_library_path);
+ NativeBridgeCallbacks *cb = get_callbacks();
+ return cb && cb->initAnonymousNamespace(public_ns_sonames, anon_ns_library_path);
+}
+
+static native_bridge_namespace_t *
+native_bridge3_createNamespace(const char *name,
+ const char *ld_library_path,
+ const char *default_library_path,
+ uint64_t type,
+ const char *permitted_when_isolated_path,
+ native_bridge_namespace_t *parent_ns)
+{
+ LOGV("enter native_bridge3_createNamespace %s, %s, %s, %s", name, ld_library_path, default_library_path, permitted_when_isolated_path);
+ NativeBridgeCallbacks *cb = get_callbacks();
+ return cb ? cb->createNamespace(name, ld_library_path, default_library_path, type, permitted_when_isolated_path, parent_ns) : nullptr;
+}
+
+static bool native_bridge3_linkNamespaces(native_bridge_namespace_t *from,
+ native_bridge_namespace_t *to,
+ const char *shared_libs_soname)
+{
+ LOGV("enter native_bridge3_linkNamespaces %s", shared_libs_soname);
+ NativeBridgeCallbacks *cb = get_callbacks();
+ return cb && cb->linkNamespaces(from, to, shared_libs_soname);
+}
+
+static void *native_bridge3_loadLibraryExt(const char *libpath,
+ int flag,
+ native_bridge_namespace_t *ns)
+{
+ LOGV("enter native_bridge3_loadLibraryExt %s, %d, %p", libpath, flag, ns);
+ NativeBridgeCallbacks *cb = get_callbacks();
+ void *result = cb ? cb->loadLibraryExt(libpath, flag, ns) : nullptr;
+// void *result = cb ? cb->loadLibrary(libpath, flag) : nullptr;
+ LOGV("native_bridge3_loadLibraryExt: %p", result);
+ return result;
+}
+
+static native_bridge_namespace_t *native_bridge4_getVendorNamespace()
+{
+ LOGV("enter native_bridge4_getVendorNamespace");
+ NativeBridgeCallbacks *cb = get_callbacks();
+ return cb ? cb->getVendorNamespace() : nullptr;
+}
+
static void __attribute__ ((destructor)) on_dlclose()
{
if (native_handle) {
extern "C" {
NativeBridgeCallbacks NativeBridgeItf = {
- .version = 2,
- .initialize = &native_bridge2_initialize,
- .loadLibrary = &native_bridge2_loadLibrary,
- .getTrampoline = &native_bridge2_getTrampoline,
- .isSupported = &native_bridge2_isSupported,
- .getAppEnv = &native_bridge2_getAppEnv,
- .isCompatibleWith = &native_bridge2_is_compatible_compatible_with,
- .getSignalHandler = &native_bridge2_get_signal_handler,
+ // v1
+ .version = 4,
+ .initialize = native_bridge2_initialize,
+ .loadLibrary = native_bridge2_loadLibrary,
+ .getTrampoline = native_bridge2_getTrampoline,
+ .isSupported = native_bridge2_isSupported,
+ .getAppEnv = native_bridge2_getAppEnv,
+ // v2
+ .isCompatibleWith = native_bridge2_isCompatibleWith,
+ .getSignalHandler = native_bridge2_getSignalHandler,
+ // v3
+ .unloadLibrary = native_bridge3_unloadLibrary,
+ .getError = native_bridge3_getError,
+ .isPathSupported = native_bridge3_isPathSupported,
+ .initAnonymousNamespace = native_bridge3_initAnonymousNamespace,
+ .createNamespace = native_bridge3_createNamespace,
+ .linkNamespaces = native_bridge3_linkNamespaces,
+ .loadLibraryExt = native_bridge3_loadLibraryExt,
+ // v4
+ .getVendorNamespace = native_bridge4_getVendorNamespace,
};
} // extern "C"
PRODUCT_PACKAGES += \
libwpa_client \
hostapd \
+ wificond \
wpa_supplicant \
wpa_supplicant.conf \
--- /dev/null
+# Graphics HAL
+PRODUCT_PACKAGES += \
+ android.hardware.graphics.mapper@2.0-impl \
+ android.hardware.graphics.allocator@2.0-impl \
+
+# HWComposer HAL
+PRODUCT_PACKAGES += \
+ android.hardware.graphics.composer@2.1-impl
+
+# Audio HAL
+PRODUCT_PACKAGES += \
+ android.hardware.audio@2.0-impl \
+ android.hardware.audio@2.0-service \
+ android.hardware.audio.effect@2.0-impl \
+ android.hardware.broadcastradio@1.0-impl \
+ android.hardware.soundtrigger@2.0-impl
+
+# Bluetooth HAL
+PRODUCT_PACKAGES += \
+ android.hardware.bluetooth@1.0-service.btlinux
+
+# Camera HAL
+PRODUCT_PACKAGES += \
+ camera.device@3.2-impl \
+ android.hardware.camera.provider@2.4-impl \
+ android.hardware.camera.provider@2.4-service
+
+# DumpState HAL
+PRODUCT_PACKAGES += \
+ android.hardware.dumpstate@1.0-impl \
+ android.hardware.dumpstate@1.0-service
+
+# Gatekeeper HAL
+#PRODUCT_PACKAGES += \
+ android.hardware.gatekeeper@1.0-impl
+
+# Health HAL
+PRODUCT_PACKAGES += \
+ android.hardware.health@1.0-impl
+
+# Keymaster HAL
+PRODUCT_PACKAGES += \
+ android.hardware.keymaster@3.0-impl
+
+# Light HAL
+PRODUCT_PACKAGES += \
+ android.hardware.light@2.0-impl \
+ android.hardware.light@2.0-service
+
+# Memtrack HAL
+#PRODUCT_PACKAGES += \
+ android.hardware.memtrack@1.0-impl
+
+# Power HAL
+PRODUCT_PACKAGES += \
+ android.hardware.power@1.0-impl \
+ android.hardware.power@1.0-service
+
+# RenderScript HAL
+PRODUCT_PACKAGES += \
+ android.hardware.renderscript@1.0-impl
+
+# Sensors HAL
+PRODUCT_PACKAGES += \
+ android.hardware.sensors@1.0-impl
+
+# USB HAL
+PRODUCT_PACKAGES += \
+ android.hardware.usb@1.0-impl \
+ android.hardware.usb@1.0-service
+
+# Wifi HAL
+PRODUCT_PACKAGES += \
+ android.hardware.wifi@1.0-service
/dev/iio:device* 0660 system system
# for bluetooth nodes
-/dev/rfkill 0660 bluetooth bluetooth
+/dev/rfkill 0660 bluetooth wifi
/dev/uhid 0660 bluetooth bluetooth
/sys/devices/system/cpu/cpu* online 0664 system system
--- /dev/null
+ifneq ($(filter generic_%,$(TARGET_DEVICE)),)
+
+LOCAL_PATH := $(call my-dir)
+
+include $(LOCAL_PATH)/vndk-sp-libs.mk
+
+define define-vndk-sp-lib
+include $$(CLEAR_VARS)
+LOCAL_MODULE := $1.vndk-sp-gen
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,,)/$1.so
+LOCAL_STRIP_MODULE := false
+LOCAL_MULTILIB := first
+LOCAL_MODULE_TAGS := optional
+LOCAL_INSTALLED_MODULE_STEM := $1.so
+LOCAL_MODULE_SUFFIX := .so
+LOCAL_MODULE_RELATIVE_PATH := vndk-sp
+include $$(BUILD_PREBUILT)
+
+ifneq ($$(TARGET_2ND_ARCH),)
+ifneq ($$(TARGET_TRANSLATE_2ND_ARCH),true)
+include $$(CLEAR_VARS)
+LOCAL_MODULE := $1.vndk-sp-gen
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,$$(TARGET_2ND_ARCH_VAR_PREFIX),)/$1.so
+LOCAL_STRIP_MODULE := false
+LOCAL_MULTILIB := 32
+LOCAL_MODULE_TAGS := optional
+LOCAL_INSTALLED_MODULE_STEM := $1.so
+LOCAL_MODULE_SUFFIX := .so
+LOCAL_MODULE_RELATIVE_PATH := vndk-sp
+include $$(BUILD_PREBUILT)
+endif # TARGET_TRANSLATE_2ND_ARCH is not true
+endif # TARGET_2ND_ARCH is not empty
+endef
+
+$(foreach lib,$(VNDK_SP_LIBRARIES),\
+ $(eval $(call define-vndk-sp-lib,$(lib))))
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := vndk-sp
+LOCAL_MODULE_OWNER := google
+LOCAL_MODULE_TAGS := optional
+LOCAL_REQUIRED_MODULES := $(addsuffix .vndk-sp-gen,$(VNDK_SP_LIBRARIES))
+include $(BUILD_PHONY_PACKAGE)
+
+endif # TARGET_DEVICE is generic_*
--- /dev/null
+ifndef BOARD_VNDK_VERSION
+VNDK_SP_LIBRARIES += \
+ android.hardware.graphics.allocator@2.0 \
+ android.hardware.graphics.mapper@2.0 \
+ android.hardware.graphics.common@1.0 \
+ android.hardware.renderscript@1.0 \
+ android.hidl.memory@1.0 \
+ libbacktrace \
+ libbase \
+ libc++ \
+ libcutils \
+ libRSCpuRef \
+ libRSDriver \
+ libRS_internal \
+ libbcinfo \
+ libblas \
+ libcompiler_rt \
+ libft2 \
+ libpng \
+ libhardware \
+ libhwbinder \
+ libion \
+ liblzma \
+ libunwind \
+ libutils \
+ libhidlbase \
+ libhidlmemory \
+ libhidltransport \
+ libz \
+
+endif
--- /dev/null
+p2p_disabled=1