From: Chih-Wei Huang Date: Mon, 5 Mar 2018 04:03:06 +0000 (+0800) Subject: Merge remote-tracking branch 'x86/nougat-x86' into oreo-x86 X-Git-Tag: android-x86-8.1-r1~38 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fdevice-generic-common.git;a=commitdiff_plain;h=2cae43df47994631a340f415523f66f40be10733;hp=248c649041b1ad5624e778e357930a0a1f70decb Merge remote-tracking branch 'x86/nougat-x86' into oreo-x86 --- diff --git a/BoardConfig.mk b/BoardConfig.mk index fef9278..faf780c 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -10,7 +10,10 @@ BOARD_HAVE_BLUETOOTH_LINUX := true 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 @@ -60,6 +63,7 @@ USE_INTEL_OMX_COMPONENTS := 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 @@ -68,9 +72,7 @@ SUPERUSER_PACKAGE_PREFIX := com.android.settings.cyanogenmod.superuser # 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)),) @@ -83,3 +85,5 @@ TARGET_KERNEL_DIFFCONFIG := device/generic/common/selinux_diffconfig COMPATIBILITY_ENHANCEMENT_PACKAGE := true PRC_COMPATIBILITY_PACKAGE := true ZIP_OPTIMIZATION_NO_INTEGRITY := true + +DEVICE_MANIFEST_FILE := device/generic/common/manifest.xml diff --git a/CleanSpec.mk b/CleanSpec.mk new file mode 100644 index 0000000..8f9ce00 --- /dev/null +++ b/CleanSpec.mk @@ -0,0 +1,4 @@ +$(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) diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk new file mode 100644 index 0000000..abdd312 --- /dev/null +++ b/build/tasks/kernel.mk @@ -0,0 +1,106 @@ +# +# 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) +$(INSTALLED_KERNEL_TARGET): $(KERNEL_DOTCONFIG_FILE) | $(ACP) $(BISON) + $(mk_kernel) $(KERNEL_TARGET) $(if $(MOD_ENABLED),modules) + $(hide) $(ACP) -fp $(BUILT_KERNEL_TARGET) $@ + $(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/%: $(INSTALLED_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): $(INSTALLED_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 := $(INSTALLED_KERNEL_TARGET) + +.PHONY: kernel $(if $(KERNEL_ARCH_CHANGED),$(KERNEL_HEADERS_COMMON)/linux/binder.h) +kernel: $(TARGET_PREBUILT_KERNEL) + +else + +$(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 # TARGET_PREBUILT_KERNEL +endif # KBUILD_OUTPUT diff --git a/build/tasks/system.mk b/build/tasks/system.mk new file mode 100644 index 0000000..6b03ed2 --- /dev/null +++ b/build/tasks/system.mk @@ -0,0 +1,9 @@ +$(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 diff --git a/device.mk b/device.mk index 3764464..3d3468b 100644 --- a/device.mk +++ b/device.mk @@ -35,6 +35,7 @@ PRODUCT_COPY_FILES := \ $(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 \ @@ -49,7 +50,7 @@ PRODUCT_COPY_FILES += \ 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 \ @@ -85,6 +86,9 @@ PRODUCT_AAPT_PREF_CONFIG := mdpi 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) diff --git a/init.x86.rc b/init.x86.rc index d71d272..e0fe113 100644 --- a/init.x86.rc +++ b/init.x86.rc @@ -45,8 +45,9 @@ on boot # 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 @@ -56,6 +57,7 @@ service wpa_supplicant /system/bin/wpa_supplicant -c/data/misc/wifi/wpa_supplica class main socket wpa_wlan0 dgram 660 wifi wifi disabled + oneshot service nativebridge /system/bin/enable_nativebridge class main diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 0000000..596ef18 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,150 @@ + + + android.hardware.audio + hwbinder + 2.0 + + IDevicesFactory + default + + + + android.hardware.audio.effect + hwbinder + 2.0 + + IEffectsFactory + default + + + + android.hardware.bluetooth + hwbinder + 1.0 + + IBluetoothHci + default + + + + android.hardware.camera.provider + hwbinder + 2.4 + + ICameraProvider + legacy/0 + + + + android.hardware.cas + hwbinder + 1.0 + + IMediaCasService + default + + + + android.hardware.configstore + hwbinder + 1.0 + + ISurfaceFlingerConfigs + default + + + + android.hardware.dumpstate + hwbinder + 1.0 + + IDumpstateDevice + default + + + + android.hardware.graphics.allocator + passthrough + 2.0 + + IAllocator + default + + + + android.hardware.graphics.mapper + passthrough + 2.0 + + IMapper + default + + + + android.hardware.light + hwbinder + 2.0 + + ILight + default + + + + android.hardware.media.omx + hwbinder + 1.0 + + IOmx + default + + + IOmxStore + default + + + + android.hardware.power + hwbinder + 1.0 + + IPower + default + + + + android.hardware.renderscript + passthrough + 1.0 + + IDevice + default + + + + android.hardware.sensors + passthrough + 1.0 + + ISensors + default + + + + android.hardware.usb + hwbinder + 1.0 + + IUsb + default + + + + android.hardware.wifi.supplicant + hwbinder + 1.0 + + ISupplicant + default + + + diff --git a/media_codecs.xml b/media_codecs.xml index 5b31bac..ba1fbdb 100644 --- a/media_codecs.xml +++ b/media_codecs.xml @@ -78,7 +78,6 @@ Only the three quirks included above are recognized at this point: --> - diff --git a/nativebridge/Android.mk b/nativebridge/Android.mk index 75cd99e..378ce69 100644 --- a/nativebridge/Android.mk +++ b/nativebridge/Android.mk @@ -17,6 +17,7 @@ LOCAL_SRC_FILES := src/libnb.cpp 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*}; \ diff --git a/nativebridge/bin/enable_nativebridge b/nativebridge/bin/enable_nativebridge index 0f8cd13..2e3a926 100644 --- a/nativebridge/bin/enable_nativebridge +++ b/nativebridge/bin/enable_nativebridge @@ -8,15 +8,15 @@ binfmt_misc_dir=/proc/sys/fs/binfmt_misc 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 @@ -45,6 +45,7 @@ fi # 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 diff --git a/nativebridge/src/libnb.cpp b/nativebridge/src/libnb.cpp index 386a514..4576a30 100644 --- a/nativebridge/src/libnb.cpp +++ b/nativebridge/src/libnb.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Android-x86 Open Source Project + * Copyright (C) 2015-2017 The Android-x86 Open Source Project * * by Chih-Wei Huang * @@ -18,10 +18,22 @@ #include #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; @@ -40,6 +52,7 @@ static NativeBridgeCallbacks *get_callbacks() } } callbacks = reinterpret_cast(dlsym(native_handle, "NativeBridgeItf")); + ALOGI("Found %s version %u", libnb, callbacks ? callbacks->version : 0); } return callbacks; } @@ -49,11 +62,12 @@ static bool native_bridge2_initialize(const NativeBridgeRuntimeCallbacks *art_cb 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"); } @@ -62,7 +76,7 @@ static bool native_bridge2_initialize(const NativeBridgeRuntimeCallbacks *art_cb 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; } @@ -70,38 +84,116 @@ static void *native_bridge2_loadLibrary(const char *libpath, int flag) 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) { @@ -113,14 +205,26 @@ static void __attribute__ ((destructor)) on_dlclose() 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" diff --git a/packages.mk b/packages.mk index 6bae5ef..a1e102b 100644 --- a/packages.mk +++ b/packages.mk @@ -64,6 +64,7 @@ PRODUCT_PACKAGES := \ PRODUCT_PACKAGES += \ libwpa_client \ hostapd \ + wificond \ wpa_supplicant \ wpa_supplicant.conf \ diff --git a/treble.mk b/treble.mk new file mode 100644 index 0000000..95cb842 --- /dev/null +++ b/treble.mk @@ -0,0 +1,74 @@ +# 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 diff --git a/ueventd.x86.rc b/ueventd.x86.rc index c88a243..e2189fe 100644 --- a/ueventd.x86.rc +++ b/ueventd.x86.rc @@ -5,7 +5,7 @@ /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 diff --git a/vndk/Android.mk b/vndk/Android.mk new file mode 100644 index 0000000..4ef78ba --- /dev/null +++ b/vndk/Android.mk @@ -0,0 +1,47 @@ +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_* diff --git a/vndk/vndk-sp-libs.mk b/vndk/vndk-sp-libs.mk new file mode 100644 index 0000000..6957a1d --- /dev/null +++ b/vndk/vndk-sp-libs.mk @@ -0,0 +1,31 @@ +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 diff --git a/wpa_supplicant_overlay.conf b/wpa_supplicant_overlay.conf new file mode 100644 index 0000000..06fc042 --- /dev/null +++ b/wpa_supplicant_overlay.conf @@ -0,0 +1 @@ +p2p_disabled=1