From 6dfb0a8d0e104b67fd28951d91b527334e168372 Mon Sep 17 00:00:00 2001 From: Francescodario Cuzzocrea Date: Thu, 29 Aug 2019 16:31:07 +0200 Subject: [PATCH] msm8226-common: initial commit of the rebased tree --- Android.mk | 1 - BoardConfigCommon.mk | 95 +- README | 3 + camera/Android.mk | 9 +- camera/CameraWrapper.cpp | 27 +- configs/media_codecs.xml | 3 +- configs/wifi/hostapd_default.conf | 1043 +++++++++++++++++ configs/wifi/p2p_supplicant_overlay.conf | 10 + configs/wifi/wpa_supplicant_overlay.conf | 4 + extract-files.sh | 2 +- gps/core/gps_extended_c.h | 3 + gps/core/loc_core_log.cpp | 50 +- gps/etc/flp.conf | 2 +- gps/etc/gps.conf | 41 +- gps/etc/izat.conf | 16 +- gps/etc/sap.conf | 4 +- .../libloc_api_50001/LocEngAdapter.cpp | 62 +- gps/loc_api/libloc_api_50001/loc_eng.cpp | 6 +- gps/utils/LocSharedLock.h | 7 +- gps/utils/MsgTask.cpp | 2 +- gps/utils/linked_list.c | 6 +- gps/utils/loc_cfg.cpp | 16 +- gps/utils/loc_cfg.h | 10 +- gps/utils/loc_log.cpp | 22 +- gps/utils/loc_log.h | 17 +- gps/utils/msg_q.c | 8 +- init/Android.mk | 32 + init/init_msm8226.cpp | 77 ++ init/init_msm8226.h | 39 + libhealthd/healthd_board_default.cpp | 103 -- libhealthd/images/battery_fail.png | Bin 1805 -> 0 bytes libhealthd/images/battery_scale.png | Bin 463 -> 0 bytes libshims/Android.mk | 17 + .../libshim_cutils_atomic}/Android.mk | 19 +- libshims/libshim_cutils_atomic/atomic.c | 26 + lineage.dependencies | 4 - manifest.xml | 31 - msm8226.mk | 125 +- .../base/core/res/res/values/config.xml | 24 +- .../packages/SystemUI/res/values/config.xml | 28 - .../apps/CarrierConfig/res/xml/vendor.xml | 25 - .../apps/Settings/res/values/arrays.xml | 29 - prima/WCNSS_cfg.dat | Bin 0 -> 10746 bytes prima/WCNSS_qcom_cfg.ini | 419 +++++++ prima/WCNSS_qcom_wlan_nv.bin | Bin 0 -> 29816 bytes .../internal/telephony/SamsungMSM8226RIL.java | 374 ------ rootdir/Android.mk | 57 +- rootdir/{ => etc}/init.qcom.power.rc | 69 +- rootdir/{ => etc}/init.qcom.rc | 32 +- rootdir/{ => etc}/init.qcom.usb.rc | 0 rootdir/etc/{ => scripts}/init.qcom.bt.sh | 0 rootdir/etc/{ => scripts}/init.ril.sh | 0 rootdir/{ => etc}/ueventd.qcom.rc | 4 +- sensors/SensorEventQueue.cpp | 6 +- sensors/multihal.cpp | 234 +--- sepolicy/common/macloader.te | 12 + setup-makefiles.sh | 2 +- system.prop | 2 - 58 files changed, 2088 insertions(+), 1171 deletions(-) create mode 100644 README create mode 100644 configs/wifi/hostapd_default.conf create mode 100644 configs/wifi/p2p_supplicant_overlay.conf create mode 100644 configs/wifi/wpa_supplicant_overlay.conf create mode 100644 init/Android.mk create mode 100644 init/init_msm8226.cpp create mode 100644 init/init_msm8226.h delete mode 100644 libhealthd/healthd_board_default.cpp delete mode 100644 libhealthd/images/battery_fail.png delete mode 100644 libhealthd/images/battery_scale.png create mode 100644 libshims/Android.mk rename {libhealthd => libshims/libshim_cutils_atomic}/Android.mk (63%) create mode 100644 libshims/libshim_cutils_atomic/atomic.c delete mode 100644 overlay/frameworks/base/packages/SystemUI/res/values/config.xml delete mode 100644 overlay/packages/apps/Settings/res/values/arrays.xml create mode 100644 prima/WCNSS_cfg.dat create mode 100644 prima/WCNSS_qcom_cfg.ini create mode 100644 prima/WCNSS_qcom_wlan_nv.bin delete mode 100644 ril/telephony/java/com/android/internal/telephony/SamsungMSM8226RIL.java rename rootdir/{ => etc}/init.qcom.power.rc (86%) rename rootdir/{ => etc}/init.qcom.rc (97%) rename rootdir/{ => etc}/init.qcom.usb.rc (100%) rename rootdir/etc/{ => scripts}/init.qcom.bt.sh (100%) rename rootdir/etc/{ => scripts}/init.ril.sh (100%) rename rootdir/{ => etc}/ueventd.qcom.rc (98%) create mode 100644 sepolicy/common/macloader.te delete mode 100644 system.prop diff --git a/Android.mk b/Android.mk index 10d7d9f..6c3b334 100644 --- a/Android.mk +++ b/Android.mk @@ -16,7 +16,6 @@ LOCAL_PATH := $(call my-dir) ifeq ($(BOARD_VENDOR),samsung) ifeq ($(TARGET_BOARD_PLATFORM),msm8226) - include $(call all-subdir-makefiles,$(LOCAL_PATH)) ADSP_IMAGES := \ diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index ddb8938..99cd5ee 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -1,5 +1,5 @@ -# Copyright (C) 2014 The CyanogenMod Project -# Copyright (C) 2017-2019 The LineageOS Project +# Copyright (C) 2012 The CyanogenMod Project +# Copyright (C) 2017-2018 The LineageOS Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,31 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Inherit from qcom-common +# inherit from qcom-common -include device/samsung/qcom-common/BoardConfigCommon.mk -VENDOR_PATH := device/samsung/msm8226-common - -TARGET_SPECIFIC_HEADER_PATH := $(VENDOR_PATH)/include - -# Use Snapdragon LLVM if available on build server -TARGET_USE_SDCLANG := true +# Platform +TARGET_BOARD_PLATFORM := msm8226 +TARGET_BOARD_PLATFORM_GPU := qcom-adreno305 # Architecture -BOARD_USES_QCOM_HARDWARE := true -TARGET_CPU_MEMCPY_BASE_OPT_DISABLE := true TARGET_CPU_VARIANT := krait -BOARD_GLOBAL_CFLAGS += -mfpu=neon -mfloat-abi=softfp -BOARD_GLOBAL_CPPFLAGS += -mfpu=neon -mfloat-abi=softfp # Audio -AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true -AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true -AUDIO_FEATURE_ENABLED_EXTN_POST_PROC := true -AUDIO_FEATURE_ENABLED_FLUENCE := true -AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true -AUDIO_FEATURE_ENABLED_HFP := true -AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true AUDIO_FEATURE_ENABLED_LOW_LATENCY_CAPTURE := true BOARD_USES_ALSA_AUDIO := true @@ -46,30 +32,22 @@ TARGET_USES_64_BIT_BINDER := true # Bluetooth BOARD_HAVE_BLUETOOTH := true -BOARD_HAVE_BLUETOOTH_QCOM := true -BLUETOOTH_HCI_USE_MCT := true - -# Bootloader -TARGET_BOOTLOADER_BOARD_NAME := MSM8226 # Camera -TARGET_PROVIDES_CAMERA_HAL := true -USE_DEVICE_SPECIFIC_CAMERA := true -TARGET_USE_COMPAT_GRALLOC_ALIGN := true TARGET_HAS_LEGACY_CAMERA_HAL1 := true TARGET_NEEDS_LEGACY_CAMERA_HAL1_DYN_NATIVE_HANDLE := true TARGET_USES_MEDIA_EXTENSIONS := true # Charger -BOARD_CHARGING_MODE_BOOTING_LPM := "/sys/class/power_supply/battery/batt_lp_charging" BOARD_BATTERY_DEVICE_NAME := "battery" BOARD_CHARGING_CMDLINE_NAME := "androidboot.mode" BOARD_CHARGING_CMDLINE_VALUE := "charger" -BOARD_CHARGER_DISABLE_INIT_BLANK := true +BOARD_CHARGER_SHOW_PERCENTAGE := true +BOARD_CHARGER_ENABLE_SUSPEND := true WITH_LINEAGE_CHARGER := false -# Custom RIL class -BOARD_RIL_CLASS := ../../../$(VENDOR_PATH)/ril +# LineageHW +BOARD_HARDWARE_CLASS += device/samsung/msm8226-common/lineagehw # Dexpreopt ifeq ($(HOST_OS),linux) @@ -79,11 +57,14 @@ ifeq ($(HOST_OS),linux) endif endif +WITH_DEXPREOPT_DEBUG_INFO := false +USE_DEX2OAT_DEBUG := false +DONT_DEXPREOPT_PREBUILTS := true + # Display NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 OVERRIDE_RS_DRIVER := libRSDriver_adreno.so TARGET_USES_C2D_COMPOSITION := true -TARGET_ADDITIONAL_GRALLOC_10_USAGE_BITS := 0x02000000U TARGET_USES_ION := true # Shader cache config options @@ -96,19 +77,9 @@ MAX_EGL_CACHE_KEY_SIZE := 12*1024 # of the device. MAX_EGL_CACHE_SIZE := 2048*1024 -# Extended Filesystem Support -TARGET_KERNEL_HAVE_EXFAT := true - # Filesystem TARGET_FS_CONFIG_GEN := device/samsung/msm8226-common/config.fs -# Fonts -EXTENDED_FONT_FOOTPRINT := true - -# Healthd -BOARD_HAL_STATIC_LIBRARIES := libhealthd.msm8226 -BOARD_HEALTHD_CUSTOM_CHARGER_RES := device/samsung/msm8226-common/libhealthd/images - # HIDL DEVICE_MANIFEST_FILE := device/samsung/msm8226-common/manifest.xml DEVICE_MATRIX_FILE := device/samsung/msm8226-common/compatibility_matrix.xml @@ -116,47 +87,31 @@ DEVICE_MATRIX_FILE := device/samsung/msm8226-common/compatibility_matrix.xml # SELinux include device/samsung/msm8226-common/sepolicy/sepolicy.mk +# Shims +TARGET_LD_SHIM_LIBS += \ + /system/lib/libcrypto.so|libboringssl-compat.so + # Init -TARGET_INIT_VENDOR_LIB := libinit_msm +TARGET_INIT_VENDOR_LIB := libinit_msm8226 +TARGET_RECOVERY_DEVICE_MODULES := libinit_msm8226 -# Legacy blobs support -TARGET_NEEDS_PLATFORM_TEXT_RELOCATIONS := true - -# LineageHW -BOARD_HARDWARE_CLASS += device/samsung/msm8226-common/lineagehw - -# Memory -MALLOC_SVELTE := true - -# Partitions and Vold -BOARD_VOLD_EMMC_SHARES_DEV_MAJOR := true +# Partitions TARGET_USERIMAGES_USE_EXT4 := true -TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/msm_hsusb/gadget/lun%d/file - -# Platform -TARGET_BOARD_PLATFORM := msm8226 -TARGET_BOARD_PLATFORM_GPU := qcom-adreno305 -USE_CLANG_PLATFORM_BUILD := true - -# Properties (reset them here, include more in device if needed) -TARGET_SYSTEM_PROP := $(VENDOR_PATH)/system.prop +TARGET_USERIMAGES_USE_F2FS := true +BOARD_VOLD_EMMC_SHARES_DEV_MAJOR := true # Power TARGET_HAS_LEGACY_POWER_STATS := true TARGET_HAS_NO_WIFI_STATS := true TARGET_USES_INTERACTION_BOOST := true -# Shims -TARGET_LD_SHIM_LIBS += \ - /system/lib/libcrypto.so|libboringssl-compat.so - # Time services -BOARD_USES_QC_TIME_SERVICES := true +BOARD_USES_QC_TIME_SERVICES := true # Wifi +BOARD_WLAN_DEVICE := qcwcn BOARD_HAS_QCOM_WLAN := true BOARD_HAS_QCOM_WLAN_SDK := true -BOARD_WLAN_DEVICE := qcwcn BOARD_HOSTAPD_DRIVER := NL80211 BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) BOARD_WPA_SUPPLICANT_DRIVER := NL80211 diff --git a/README b/README new file mode 100644 index 0000000..e536788 --- /dev/null +++ b/README @@ -0,0 +1,3 @@ +Copyright 2012 - The CyanogenMod Project + +Common Samsung 8226 repository diff --git a/camera/Android.mk b/camera/Android.mk index 29cf1b8..8581d26 100644 --- a/camera/Android.mk +++ b/camera/Android.mk @@ -1,5 +1,3 @@ -ifeq ($(TARGET_PROVIDES_CAMERA_HAL),true) - LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -9,14 +7,11 @@ LOCAL_C_INCLUDES := \ LOCAL_SRC_FILES := \ CameraWrapper.cpp +LOCAL_STATIC_LIBRARIES := libbase libarect LOCAL_SHARED_LIBRARIES := \ libhardware liblog libcamera_client libutils libcutils libdl libgui libhidltransport libsensor \ android.hidl.token@1.0-utils \ android.hardware.graphics.bufferqueue@1.0 - -LOCAL_STATIC_LIBRARIES := \ - libbase \ - libarect LOCAL_HEADER_LIBRARIES := libnativebase_headers @@ -26,5 +21,3 @@ LOCAL_MODULE_TAGS := optional LOCAL_PROPRIETARY_MODULE := true include $(BUILD_SHARED_LIBRARY) - -endif diff --git a/camera/CameraWrapper.cpp b/camera/CameraWrapper.cpp index d9b0c74..a1a8e1f 100644 --- a/camera/CameraWrapper.cpp +++ b/camera/CameraWrapper.cpp @@ -27,12 +27,12 @@ #define LOG_TAG "CameraWrapper" #include +#include +#include +#include +#include #include #include -#include -#include -#include -#include #define BACK_CAMERA_ID 0 #define FRONT_CAMERA_ID 1 @@ -76,7 +76,7 @@ camera_module_t HAL_MODULE_INFO_SYM = { .hal_api_version = HARDWARE_HAL_API_VERSION, .id = CAMERA_HARDWARE_MODULE_ID, .name = "Samsung msm8226 Camera Wrapper", - .author = "The LineageOS Project", + .author = "The CyanogenMod Project", .methods = &camera_module_methods, .dso = NULL, /* remove compilation warnings */ .reserved = {0}, /* remove compilation warnings */ @@ -264,8 +264,9 @@ static void camera_set_callbacks(struct camera_device* device, camera_notify_cal ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); - VENDOR_CALL(device, set_callbacks, camera_notify_cb, camera_data_cb,camera_data_cb_timestamp, camera_get_memory, user); - + VENDOR_CALL(device, set_callbacks, camera_notify_cb, camera_data_cb, + camera_data_cb_timestamp, camera_get_memory, user); + } static void camera_enable_msg_type(struct camera_device* device, int32_t msg_type) { @@ -474,13 +475,14 @@ static int camera_send_command(struct camera_device* device, int32_t cmd, int32_ static void camera_release(struct camera_device* device) { wrapper_camera_device_t* wrapper_dev = NULL; - + if (!device) return; - wrapper_dev = (wrapper_camera_device_t*) device; - + wrapper_dev = (wrapper_camera_device_t*) device; + + ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, - (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); + (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); VENDOR_CALL(device, release); @@ -590,7 +592,7 @@ static int camera_device_open(const hw_module_t* module, const char* name, hw_de memset(camera_device, 0, sizeof(*camera_device)); camera_device->camera_released = false; camera_device->id = cameraid; - + int retries = OPEN_RETRIES; bool retry; do { @@ -605,6 +607,7 @@ static int camera_device_open(const hw_module_t* module, const char* name, hw_de ALOGE("vendor camera open fail"); goto fail; } + ALOGV("%s: got vendor camera device 0x%08X", __FUNCTION__, (uintptr_t)(camera_device->vendor)); diff --git a/configs/media_codecs.xml b/configs/media_codecs.xml index 674c092..0280bf7 100644 --- a/configs/media_codecs.xml +++ b/configs/media_codecs.xml @@ -239,6 +239,5 @@ - - + diff --git a/configs/wifi/hostapd_default.conf b/configs/wifi/hostapd_default.conf new file mode 100644 index 0000000..915ceff --- /dev/null +++ b/configs/wifi/hostapd_default.conf @@ -0,0 +1,1043 @@ +##### hostapd configuration file ############################################## +# Empty lines and lines starting with # are ignored + +# AP netdevice name (without 'ap' postfix, i.e., wlan0 uses wlan0ap for +# management frames); ath0 for madwifi +interface=wlan0 + +# In case of madwifi and nl80211 driver interfaces, an additional configuration +# parameter, bridge, must be used to notify hostapd if the interface is +# included in a bridge. This parameter is not used with Host AP driver. +#bridge=br0 + +# Driver interface type (hostap/wired/madwifi/prism54/test/none/nl80211/bsd); +# default: hostap). nl80211 is used with all Linux mac80211 drivers. +# Use driver=none if building hostapd as a standalone RADIUS server that does +# not control any wireless/wired driver. +driver=nl80211 + +# hostapd event logger configuration +# +# Two output method: syslog and stdout (only usable if not forking to +# background). +# +# Module bitfield (ORed bitfield of modules that will be logged; -1 = all +# modules): +# bit 0 (1) = IEEE 802.11 +# bit 1 (2) = IEEE 802.1X +# bit 2 (4) = RADIUS +# bit 3 (8) = WPA +# bit 4 (16) = driver interface +# bit 5 (32) = IAPP +# bit 6 (64) = MLME +# +# Levels (minimum value for logged events): +# 0 = verbose debugging +# 1 = debugging +# 2 = informational messages +# 3 = notification +# 4 = warning +# +logger_syslog=-1 +logger_syslog_level=2 +logger_stdout=-1 +logger_stdout_level=2 + +# Dump file for state information (on SIGUSR1) +dump_file=/tmp/hostapd.dump + +# Interface for separate control program. If this is specified, hostapd +# will create this directory and a UNIX domain socket for listening to requests +# from external programs (CLI/GUI, etc.) for status information and +# configuration. The socket file will be named based on the interface name, so +# multiple hostapd processes/interfaces can be run at the same time if more +# than one interface is used. +# /var/run/hostapd is the recommended directory for sockets and by default, +# hostapd_cli will use it when trying to connect with hostapd. +ctrl_interface=/data/misc/wifi/hostapd + + +# Access control for the control interface can be configured by setting the +# directory to allow only members of a group to use sockets. This way, it is +# possible to run hostapd as root (since it needs to change network +# configuration and open raw sockets) and still allow GUI/CLI components to be +# run as non-root users. However, since the control interface can be used to +# change the network configuration, this access needs to be protected in many +# cases. By default, hostapd is configured to use gid 0 (root). If you +# want to allow non-root users to use the contron interface, add a new group +# and change this value to match with that group. Add users that should have +# control interface access to this group. +# +# This variable can be a group name or gid. +#ctrl_interface_group=wheel +#ctrl_interface_group=0 + + +##### IEEE 802.11 related configuration ####################################### + +# SSID to be used in IEEE 802.11 management frames +ssid=QualcommSoftAP + +# Country code (ISO/IEC 3166-1). Used to set regulatory domain. +# Set as needed to indicate country in which device is operating. +# This can limit available channels and transmit power. +#country_code=US + +# Enable IEEE 802.11d. This advertises the country_code and the set of allowed +# channels and transmit power levels based on the regulatory limits. The +# country_code setting must be configured with the correct country for +# IEEE 802.11d functions. +# (default: 0 = disabled) +#ieee80211d=1 + +# Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g, +# n = IEEE 802.11n, g_only = IEEE 802.11g_only, n_only = IEEE 802.11n_only, +# Default: IEEE 802.11n +hw_mode=g + +# Channel number (IEEE 802.11) +# (default: 0, i.e., not set) +# Please note that some drivers (e.g., madwifi) do not use this value from +# hostapd and the channel will need to be configuration separately with +# iwconfig. +channel=6 + +# Beacon interval in kus (1.024 ms) (default: 100; range 15..65535) +beacon_int=100 + +# DTIM (delivery trafic information message) period (range 1..255): +# number of beacons between DTIMs (1 = every beacon includes DTIM element) +# (default: 2) +dtim_period=2 + +# Maximum number of stations allowed in station table. New stations will be +# rejected after the station table is full. IEEE 802.11 has a limit of 2007 +# different association IDs, so this number should not be larger than that. +# (default: 2007) +max_num_sta=255 + +# RTS/CTS threshold; 2347 = disabled (default); range 0..2347 +# If this field is not included in hostapd.conf, hostapd will not control +# RTS threshold and 'iwconfig wlan# rts ' can be used to set it. +#rts_threshold=2347 + +# Fragmentation threshold; 2346 = disabled (default); range 256..2346 +# If this field is not included in hostapd.conf, hostapd will not control +# fragmentation threshold and 'iwconfig wlan# frag ' can be used to set +# it. +#fragm_threshold=2346 + +# Rate configuration +# Default is to enable all rates supported by the hardware. This configuration +# item allows this list be filtered so that only the listed rates will be left +# in the list. If the list is empty, all rates are used. This list can have +# entries that are not in the list of rates the hardware supports (such entries +# are ignored). The entries in this list are in 100 kbps, i.e., 11 Mbps = 110. +# If this item is present, at least one rate have to be matching with the rates +# hardware supports. +# default: use the most common supported rate setting for the selected +# hw_mode (i.e., this line can be removed from configuration file in most +# cases) +#supported_rates=10 20 55 110 60 90 120 180 240 360 480 540 + +# Basic rate set configuration +# List of rates (in 100 kbps) that are included in the basic rate set. +# If this item is not included, usually reasonable default set is used. +# This basic rates set is currently used for g-only profile +#basic_rates=60 + +# Short Preamble +# This parameter can be used to enable optional use of short preamble for +# frames sent at 2 Mbps, 5.5 Mbps, and 11 Mbps to improve network performance. +# This applies only to IEEE 802.11b-compatible networks and this should only be +# enabled if the local hardware supports use of short preamble. If any of the +# associated STAs do not support short preamble, use of short preamble will be +# disabled (and enabled when such STAs disassociate) dynamically. +# 0 = do not allow use of short preamble (default) +# 1 = allow use of short preamble +#preamble=1 + +# Station MAC address -based authentication +# Please note that this kind of access control requires a driver that uses +# hostapd to take care of management frame processing and as such, this can be +# used with driver=hostap or driver=nl80211, but not with driver=madwifi. +# 0 = accept unless in deny list +# 1 = deny unless in accept list +# 2 = use external RADIUS server (accept/deny lists are searched first) +macaddr_acl=0 + +# Accept/deny lists are read from separate files (containing list of +# MAC addresses, one per line). Use absolute path name to make sure that the +# files can be read on SIGHUP configuration reloads. +accept_mac_file=/data/misc/wifi/hostapd.accept +deny_mac_file=/data/misc/wifi/hostapd.deny + +# IEEE 802.11 specifies two authentication algorithms. hostapd can be +# configured to allow both of these or only one. Open system authentication +# should be used with IEEE 802.1X. +# Bit fields of allowed authentication algorithms: +# bit 0 = Open System Authentication +# bit 1 = Shared Key Authentication (requires WEP) +auth_algs=3 + +# Send empty SSID in beacons and ignore probe request frames that do not +# specify full SSID, i.e., require stations to know SSID. +# default: disabled (0) +# 1 = send empty (length=0) SSID in beacon and ignore probe request for +# broadcast SSID +# 2 = clear SSID (ASCII 0), but keep the original length (this may be required +# with some clients that do not support empty SSID) and ignore probe +# requests for broadcast SSID +ignore_broadcast_ssid=0 + +# TX queue parameters (EDCF / bursting) +# default for all these fields: not set, use hardware defaults +# tx_queue__ +# queues: data0, data1, data2, data3, after_beacon, beacon +# (data0 is the highest priority queue) +# parameters: +# aifs: AIFS (default 2) +# cwmin: cwMin (1, 3, 7, 15, 31, 63, 127, 255, 511, 1023) +# cwmax: cwMax (1, 3, 7, 15, 31, 63, 127, 255, 511, 1023); cwMax >= cwMin +# burst: maximum length (in milliseconds with precision of up to 0.1 ms) for +# bursting +# +# Default WMM parameters (IEEE 802.11 draft; 11-03-0504-03-000e): +# These parameters are used by the access point when transmitting frames +# to the clients. +# +# Low priority / AC_BK = background +#tx_queue_data3_aifs=7 +#tx_queue_data3_cwmin=15 +#tx_queue_data3_cwmax=1023 +#tx_queue_data3_burst=0 +# Note: for IEEE 802.11b mode: cWmin=31 cWmax=1023 burst=0 +# +# Normal priority / AC_BE = best effort +#tx_queue_data2_aifs=3 +#tx_queue_data2_cwmin=15 +#tx_queue_data2_cwmax=63 +#tx_queue_data2_burst=0 +# Note: for IEEE 802.11b mode: cWmin=31 cWmax=127 burst=0 +# +# High priority / AC_VI = video +#tx_queue_data1_aifs=1 +#tx_queue_data1_cwmin=7 +#tx_queue_data1_cwmax=15 +#tx_queue_data1_burst=3.0 +# Note: for IEEE 802.11b mode: cWmin=15 cWmax=31 burst=6.0 +# +# Highest priority / AC_VO = voice +#tx_queue_data0_aifs=1 +#tx_queue_data0_cwmin=3 +#tx_queue_data0_cwmax=7 +#tx_queue_data0_burst=1.5 +# Note: for IEEE 802.11b mode: cWmin=7 cWmax=15 burst=3.3 +# +# Special queues; normally not user configurable +# +#tx_queue_after_beacon_aifs=2 +#tx_queue_after_beacon_cwmin=15 +#tx_queue_after_beacon_cwmax=1023 +#tx_queue_after_beacon_burst=0 +# +#tx_queue_beacon_aifs=2 +#tx_queue_beacon_cwmin=3 +#tx_queue_beacon_cwmax=7 +#tx_queue_beacon_burst=1.5 + +# 802.1D Tag (= UP) to AC mappings +# WMM specifies following mapping of data frames to different ACs. This mapping +# can be configured using Linux QoS/tc and sch_pktpri.o module. +# 802.1D Tag 802.1D Designation Access Category WMM Designation +# 1 BK AC_BK Background +# 2 - AC_BK Background +# 0 BE AC_BE Best Effort +# 3 EE AC_BE Best Effort +# 4 CL AC_VI Video +# 5 VI AC_VI Video +# 6 VO AC_VO Voice +# 7 NC AC_VO Voice +# Data frames with no priority information: AC_BE +# Management frames: AC_VO +# PS-Poll frames: AC_BE + +# Default WMM parameters (IEEE 802.11 draft; 11-03-0504-03-000e): +# for 802.11a or 802.11g networks +# These parameters are sent to WMM clients when they associate. +# The parameters will be used by WMM clients for frames transmitted to the +# access point. +# +# note - txop_limit is in units of 32microseconds +# note - acm is admission control mandatory flag. 0 = admission control not +# required, 1 = mandatory +# note - here cwMin and cmMax are in exponent form. the actual cw value used +# will be (2^n)-1 where n is the value given here +# +wmm_enabled=1 +# +# Low priority / AC_BK = background +wmm_ac_bk_cwmin=4 +wmm_ac_bk_cwmax=10 +wmm_ac_bk_aifs=7 +wmm_ac_bk_txop_limit=0 +wmm_ac_bk_acm=0 +# Note: for IEEE 802.11b mode: cWmin=5 cWmax=10 +# +# Normal priority / AC_BE = best effort +wmm_ac_be_aifs=3 +wmm_ac_be_cwmin=4 +wmm_ac_be_cwmax=10 +wmm_ac_be_txop_limit=0 +wmm_ac_be_acm=0 +# Note: for IEEE 802.11b mode: cWmin=5 cWmax=7 +# +# High priority / AC_VI = video +wmm_ac_vi_aifs=2 +wmm_ac_vi_cwmin=3 +wmm_ac_vi_cwmax=4 +wmm_ac_vi_txop_limit=94 +wmm_ac_vi_acm=0 +# Note: for IEEE 802.11b mode: cWmin=4 cWmax=5 txop_limit=188 +# +# Highest priority / AC_VO = voice +wmm_ac_vo_aifs=2 +wmm_ac_vo_cwmin=2 +wmm_ac_vo_cwmax=3 +wmm_ac_vo_txop_limit=47 +wmm_ac_vo_acm=0 +# Note: for IEEE 802.11b mode: cWmin=3 cWmax=4 burst=102 + +# Static WEP key configuration +# +# The key number to use when transmitting. +# It must be between 0 and 3, and the corresponding key must be set. +# default: not set +#wep_default_key=0 +# The WEP keys to use. +# A key may be a quoted string or unquoted hexadecimal digits. +# The key length should be 5, 13, or 16 characters, or 10, 26, or 32 +# digits, depending on whether 40-bit (64-bit), 104-bit (128-bit), or +# 128-bit (152-bit) WEP is used. +# Only the default key must be supplied; the others are optional. +# default: not set +#wep_key0=1234567890 +#wep_key1=1234567890 +#wep_key2=1234567890 +#wep_key3=1234567890 + +# Station inactivity limit +# +# If a station does not send anything in ap_max_inactivity seconds, an +# empty data frame is sent to it in order to verify whether it is +# still in range. If this frame is not ACKed, the station will be +# disassociated and then deauthenticated. This feature is used to +# clear station table of old entries when the STAs move out of the +# range. +# +# The station can associate again with the AP if it is still in range; +# this inactivity poll is just used as a nicer way of verifying +# inactivity; i.e., client will not report broken connection because +# disassociation frame is not sent immediately without first polling +# the STA with a data frame. +# default: 300 (i.e., 5 minutes) +#ap_max_inactivity=300 + +# Enable/disable internal bridge for packets between associated stations. +# +# When IEEE 802.11 is used in managed mode, packets are usually send through +# the AP even if they are from a wireless station to another wireless station. +# This functionality requires that the AP has a bridge functionality that sends +# frames back to the same interface if their destination is another associated +# station. In addition, broadcast/multicast frames from wireless stations will +# be sent both to the host system net stack (e.g., to eventually wired network) +# and back to the wireless interface. +# +# The internal bridge is implemented within the wireless kernel module and it +# bypasses kernel filtering (netfilter/iptables/ebtables). If direct +# communication between the stations needs to be prevented, the internal +# bridge can be disabled by setting bridge_packets=0. +# +# Note: If this variable is not included in hostapd.conf, hostapd does not +# change the configuration and iwpriv can be used to set the value with +# 'iwpriv wlan# param 10 0' command. If the variable is in hostapd.conf, +# hostapd will override possible iwpriv configuration whenever configuration +# file is reloaded. +# +# default: do not control from hostapd (80211.o defaults to 1=enabled) +#bridge_packets=1 + +# Maximum allowed Listen Interval (how many Beacon periods STAs are allowed to +# remain asleep). Default: 65535 (no limit apart from field size) +#max_listen_interval=100 + +# Client isolation can be used to prevent low-level bridging of frames between +# associated stations in the BSS. By default, this bridging is allowed. +#ap_isolate=1 + +##### IEEE 802.11n related configuration ###################################### + +# ieee80211n: Whether IEEE 802.11n (HT) is enabled +# 0 = disabled (default) +# 1 = enabled +# Note: You will also need to enable WMM for full HT functionality. +ieee80211n=1 + +#require_ht=1 + +# ht_capab: HT capabilities (list of flags) +# LDPC coding capability: [LDPC] = supported +# Supported channel width set: [HT40-] = both 20 MHz and 40 MHz with secondary +# channel below the primary channel; [HT40+] = both 20 MHz and 40 MHz +# with secondary channel below the primary channel +# (20 MHz only if neither is set) +# Note: There are limits on which channels can be used with HT40- and +# HT40+. Following table shows the channels that may be available for +# HT40- and HT40+ use per IEEE 802.11n Annex J: +# freq HT40- HT40+ +# 2.4 GHz 5-13 1-7 (1-9 in Europe/Japan) +# 5 GHz 40,48,56,64 36,44,52,60 +# (depending on the location, not all of these channels may be available +# for use) +# Spatial Multiplexing (SM) Power Save: [SMPS-STATIC] or [SMPS-DYNAMIC] +# (SMPS disabled if neither is set) +# HT-greenfield: [GF] (disabled if not set) +# Short GI for 20 MHz: [SHORT-GI-20] (disabled if not set) +# Short GI for 40 MHz: [SHORT-GI-40] (disabled if not set) +# Tx STBC: [TX-STBC] (disabled if not set) +# Rx STBC: [RX-STBC1] (one spatial stream), [RX-STBC12] (one or two spatial +# streams), or [RX-STBC123] (one, two, or three spatial streams); Rx STBC +# disabled if none of these set +# HT-delayed Block Ack: [DELAYED-BA] (disabled if not set) +# Maximum A-MSDU length: [MAX-AMSDU-7935] for 7935 octets (3839 octets if not +# set) +# DSSS/CCK Mode in 40 MHz: [DSSS_CCK-40] = allowed (not allowed if not set) +# PSMP support: [PSMP] (disabled if not set) +# L-SIG TXOP protection support: [LSIG-TXOP-PROT] (disabled if not set) +# QcHostapd: +# LOWER byte for associated stations +# UPPER byte for overlapping stations +# each byte will have the following info +# bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 +# OBSS RIFS LSIG_TXOP NON_GF HT20 FROM_11G FROM_11B FROM_11A +# bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 +# OBSS RIFS LSIG_TXOP NON_GF HT_20 FROM_11G FROM_11B FROM_11A +#ht_capab=[HT40-] [SHORT-GI-20] [SHORT-GI-40] +ht_capab=[SHORT-GI-20] [GF] [DSSS_CCK-40] [LSIG-TXOP-PROT] +#ht_capab=[LDPC] [HT40-] [HT40+] [SMPS-STATIC] [SMPS-DYNAMIC] [GF] [SHORT-GI-20] [SHORT-GI-40] [TX-STBC] [RX-STBC1] [RX-STBC12] [RX-STBC123] [DELAYED-BA] [MAX-AMSDU-7935] [DSSS_CCK-40] [PSMP] [LSIG-TXOP-PROT] + +##### IEEE 802.1X-2004 related configuration ################################## + +# Require IEEE 802.1X authorization +#ieee8021x=1 + +# IEEE 802.1X/EAPOL version +# hostapd is implemented based on IEEE Std 802.1X-2004 which defines EAPOL +# version 2. However, there are many client implementations that do not handle +# the new version number correctly (they seem to drop the frames completely). +# In order to make hostapd interoperate with these clients, the version number +# can be set to the older version (1) with this configuration value. +#eapol_version=2 + +# Optional displayable message sent with EAP Request-Identity. The first \0 +# in this string will be converted to ASCII-0 (nul). This can be used to +# separate network info (comma separated list of attribute=value pairs); see, +# e.g., RFC 4284. +#eap_message=hello +#eap_message=hello\0networkid=netw,nasid=foo,portid=0,NAIRealms=example.com + +# WEP rekeying (disabled if key lengths are not set or are set to 0) +# Key lengths for default/broadcast and individual/unicast keys: +# 5 = 40-bit WEP (also known as 64-bit WEP with 40 secret bits) +# 13 = 104-bit WEP (also known as 128-bit WEP with 104 secret bits) +#wep_key_len_broadcast=5 +#wep_key_len_unicast=5 +# Rekeying period in seconds. 0 = do not rekey (i.e., set keys only once) +#wep_rekey_period=300 + +# EAPOL-Key index workaround (set bit7) for WinXP Supplicant (needed only if +# only broadcast keys are used) +eapol_key_index_workaround=0 + +# EAP reauthentication period in seconds (default: 3600 seconds; 0 = disable +# reauthentication). +#eap_reauth_period=3600 + +# Use PAE group address (01:80:c2:00:00:03) instead of individual target +# address when sending EAPOL frames with driver=wired. This is the most common +# mechanism used in wired authentication, but it also requires that the port +# is only used by one station. +#use_pae_group_addr=1 + +##### Integrated EAP server ################################################### + +# Optionally, hostapd can be configured to use an integrated EAP server +# to process EAP authentication locally without need for an external RADIUS +# server. This functionality can be used both as a local authentication server +# for IEEE 802.1X/EAPOL and as a RADIUS server for other devices. + +# Use integrated EAP server instead of external RADIUS authentication +# server. This is also needed if hostapd is configured to act as a RADIUS +# authentication server. +eap_server=1 + +# Path for EAP server user database +#eap_user_file=/etc/hostapd.eap_user + +# CA certificate (PEM or DER file) for EAP-TLS/PEAP/TTLS +#ca_cert=/etc/hostapd.ca.pem + +# Server certificate (PEM or DER file) for EAP-TLS/PEAP/TTLS +#server_cert=/etc/hostapd.server.pem + +# Private key matching with the server certificate for EAP-TLS/PEAP/TTLS +# This may point to the same file as server_cert if both certificate and key +# are included in a single file. PKCS#12 (PFX) file (.p12/.pfx) can also be +# used by commenting out server_cert and specifying the PFX file as the +# private_key. +#private_key=/etc/hostapd.server.prv + +# Passphrase for private key +#private_key_passwd=secret passphrase + +# Enable CRL verification. +# Note: hostapd does not yet support CRL downloading based on CDP. Thus, a +# valid CRL signed by the CA is required to be included in the ca_cert file. +# This can be done by using PEM format for CA certificate and CRL and +# concatenating these into one file. Whenever CRL changes, hostapd needs to be +# restarted to take the new CRL into use. +# 0 = do not verify CRLs (default) +# 1 = check the CRL of the user certificate +# 2 = check all CRLs in the certificate path +#check_crl=1 + +# dh_file: File path to DH/DSA parameters file (in PEM format) +# This is an optional configuration file for setting parameters for an +# ephemeral DH key exchange. In most cases, the default RSA authentication does +# not use this configuration. However, it is possible setup RSA to use +# ephemeral DH key exchange. In addition, ciphers with DSA keys always use +# ephemeral DH keys. This can be used to achieve forward secrecy. If the file +# is in DSA parameters format, it will be automatically converted into DH +# params. This parameter is required if anonymous EAP-FAST is used. +# You can generate DH parameters file with OpenSSL, e.g., +# "openssl dhparam -out /etc/hostapd.dh.pem 1024" +#dh_file=/etc/hostapd.dh.pem + +# Configuration data for EAP-SIM database/authentication gateway interface. +# This is a text string in implementation specific format. The example +# implementation in eap_sim_db.c uses this as the UNIX domain socket name for +# the HLR/AuC gateway (e.g., hlr_auc_gw). In this case, the path uses "unix:" +# prefix. +#eap_sim_db=unix:/tmp/hlr_auc_gw.sock + +# Encryption key for EAP-FAST PAC-Opaque values. This key must be a secret, +# random value. It is configured as a 16-octet value in hex format. It can be +# generated, e.g., with the following command: +# od -tx1 -v -N16 /dev/random | colrm 1 8 | tr -d ' ' +#pac_opaque_encr_key=000102030405060708090a0b0c0d0e0f + +# EAP-FAST authority identity (A-ID) +# A-ID indicates the identity of the authority that issues PACs. The A-ID +# should be unique across all issuing servers. In theory, this is a variable +# length field, but due to some existing implementations required A-ID to be +# 16 octets in length, it is strongly recommended to use that length for the +# field to provided interoperability with deployed peer implementation. This +# field is configured in hex format. +#eap_fast_a_id=101112131415161718191a1b1c1d1e1f + +# EAP-FAST authority identifier information (A-ID-Info) +# This is a user-friendly name for the A-ID. For example, the enterprise name +# and server name in a human-readable format. This field is encoded as UTF-8. +#eap_fast_a_id_info=test server + +# Enable/disable different EAP-FAST provisioning modes: +#0 = provisioning disabled +#1 = only anonymous provisioning allowed +#2 = only authenticated provisioning allowed +#3 = both provisioning modes allowed (default) +#eap_fast_prov=3 + +# EAP-FAST PAC-Key lifetime in seconds (hard limit) +#pac_key_lifetime=604800 + +# EAP-FAST PAC-Key refresh time in seconds (soft limit on remaining hard +# limit). The server will generate a new PAC-Key when this number of seconds +# (or fewer) of the lifetime remains. +#pac_key_refresh_time=86400 + +# EAP-SIM and EAP-AKA protected success/failure indication using AT_RESULT_IND +# (default: 0 = disabled). +#eap_sim_aka_result_ind=1 + +# Trusted Network Connect (TNC) +# If enabled, TNC validation will be required before the peer is allowed to +# connect. Note: This is only used with EAP-TTLS and EAP-FAST. If any other +# EAP method is enabled, the peer will be allowed to connect without TNC. +#tnc=1 + + +##### IEEE 802.11f - Inter-Access Point Protocol (IAPP) ####################### + +# Interface to be used for IAPP broadcast packets +#iapp_interface=eth0 + + +##### RADIUS client configuration ############################################# +# for IEEE 802.1X with external Authentication Server, IEEE 802.11 +# authentication with external ACL for MAC addresses, and accounting + +# The own IP address of the access point (used as NAS-IP-Address) +own_ip_addr=127.0.0.1 + +# Optional NAS-Identifier string for RADIUS messages. When used, this should be +# a unique to the NAS within the scope of the RADIUS server. For example, a +# fully qualified domain name can be used here. +# When using IEEE 802.11r, nas_identifier must be set and must be between 1 and +# 48 octets long. +#nas_identifier=ap.example.com + +# RADIUS authentication server +#auth_server_addr=127.0.0.1 +#auth_server_port=1812 +#auth_server_shared_secret=secret + +# RADIUS accounting server +#acct_server_addr=127.0.0.1 +#acct_server_port=1813 +#acct_server_shared_secret=secret + +# Secondary RADIUS servers; to be used if primary one does not reply to +# RADIUS packets. These are optional and there can be more than one secondary +# server listed. +#auth_server_addr=127.0.0.2 +#auth_server_port=1812 +#auth_server_shared_secret=secret2 +# +#acct_server_addr=127.0.0.2 +#acct_server_port=1813 +#acct_server_shared_secret=secret2 + +# Retry interval for trying to return to the primary RADIUS server (in +# seconds). RADIUS client code will automatically try to use the next server +# when the current server is not replying to requests. If this interval is set, +# primary server will be retried after configured amount of time even if the +# currently used secondary server is still working. +#radius_retry_primary_interval=600 + + +# Interim accounting update interval +# If this is set (larger than 0) and acct_server is configured, hostapd will +# send interim accounting updates every N seconds. Note: if set, this overrides +# possible Acct-Interim-Interval attribute in Access-Accept message. Thus, this +# value should not be configured in hostapd.conf, if RADIUS server is used to +# control the interim interval. +# This value should not be less 600 (10 minutes) and must not be less than +# 60 (1 minute). +#radius_acct_interim_interval=600 + +# Dynamic VLAN mode; allow RADIUS authentication server to decide which VLAN +# is used for the stations. This information is parsed from following RADIUS +# attributes based on RFC 3580 and RFC 2868: Tunnel-Type (value 13 = VLAN), +# Tunnel-Medium-Type (value 6 = IEEE 802), Tunnel-Private-Group-ID (value +# VLANID as a string). vlan_file option below must be configured if dynamic +# VLANs are used. Optionally, the local MAC ACL list (accept_mac_file) can be +# used to set static client MAC address to VLAN ID mapping. +# 0 = disabled (default) +# 1 = option; use default interface if RADIUS server does not include VLAN ID +# 2 = required; reject authentication if RADIUS server does not include VLAN ID +#dynamic_vlan=0 + +# VLAN interface list for dynamic VLAN mode is read from a separate text file. +# This list is used to map VLAN ID from the RADIUS server to a network +# interface. Each station is bound to one interface in the same way as with +# multiple BSSIDs or SSIDs. Each line in this text file is defining a new +# interface and the line must include VLAN ID and interface name separated by +# white space (space or tab). +#vlan_file=/etc/hostapd.vlan + +# Interface where 802.1q tagged packets should appear when a RADIUS server is +# used to determine which VLAN a station is on. hostapd creates a bridge for +# each VLAN. Then hostapd adds a VLAN interface (associated with the interface +# indicated by 'vlan_tagged_interface') and the appropriate wireless interface +# to the bridge. +#vlan_tagged_interface=eth0 + + +##### RADIUS authentication server configuration ############################## + +# hostapd can be used as a RADIUS authentication server for other hosts. This +# requires that the integrated EAP server is also enabled and both +# authentication services are sharing the same configuration. + +# File name of the RADIUS clients configuration for the RADIUS server. If this +# commented out, RADIUS server is disabled. +#radius_server_clients=/etc/hostapd.radius_clients + +# The UDP port number for the RADIUS authentication server +#radius_server_auth_port=1812 + +# Use IPv6 with RADIUS server (IPv4 will also be supported using IPv6 API) +#radius_server_ipv6=1 + + +##### WPA/IEEE 802.11i configuration ########################################## + +# Enable WPA. Setting this variable configures the AP to require WPA (either +# WPA-PSK or WPA-RADIUS/EAP based on other configuration). For WPA-PSK, either +# wpa_psk or wpa_passphrase must be set and wpa_key_mgmt must include WPA-PSK. +# For WPA-RADIUS/EAP, ieee8021x must be set (but without dynamic WEP keys), +# RADIUS authentication server must be configured, and WPA-EAP must be included +# in wpa_key_mgmt. +# This field is a bit field that can be used to enable WPA (IEEE 802.11i/D3.0) +# and/or WPA2 (full IEEE 802.11i/RSN): +# bit0 = WPA +# bit1 = IEEE 802.11i/RSN (WPA2) (dot11RSNAEnabled) +#wpa=1 + +# WPA pre-shared keys for WPA-PSK. This can be either entered as a 256-bit +# secret in hex format (64 hex digits), wpa_psk, or as an ASCII passphrase +# (8..63 characters) that will be converted to PSK. This conversion uses SSID +# so the PSK changes when ASCII passphrase is used and the SSID is changed. +# wpa_psk (dot11RSNAConfigPSKValue) +# wpa_passphrase (dot11RSNAConfigPSKPassPhrase) +#wpa_psk=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef +#wpa_passphrase=qualcomm + +# Optionally, WPA PSKs can be read from a separate text file (containing list +# of (PSK,MAC address) pairs. This allows more than one PSK to be configured. +# Use absolute path name to make sure that the files can be read on SIGHUP +# configuration reloads. +#wpa_psk_file=/etc/hostapd.wpa_psk + +# Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). The +# entries are separated with a space. WPA-PSK-SHA256 and WPA-EAP-SHA256 can be +# added to enable SHA256-based stronger algorithms. +# (dot11RSNAConfigAuthenticationSuitesTable) +#wpa_key_mgmt=WPA-PSK +#wpa_key_mgmt=WPA-EAP + +# Set of accepted cipher suites (encryption algorithms) for pairwise keys +# (unicast packets). This is a space separated list of algorithms: +# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] +# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] +# Group cipher suite (encryption algorithm for broadcast and multicast frames) +# is automatically selected based on this configuration. If only CCMP is +# allowed as the pairwise cipher, group cipher will also be CCMP. Otherwise, +# TKIP will be used as the group cipher. +# (dot11RSNAConfigPairwiseCiphersTable) +# Pairwise cipher for WPA (v1) (default: TKIP) +#wpa_pairwise=TKIP CCMP +# Pairwise cipher for RSN/WPA2 (default: use wpa_pairwise value) +#rsn_pairwise=CCMP + +# Time interval for rekeying GTK (broadcast/multicast encryption keys) in +# seconds. (dot11RSNAConfigGroupRekeyTime) +wpa_group_rekey=86400 + +# Rekey GTK when any STA that possesses the current GTK is leaving the BSS. +# (dot11RSNAConfigGroupRekeyStrict) +#wpa_strict_rekey=1 + +# Time interval for rekeying GMK (master key used internally to generate GTKs +# (in seconds). +#wpa_gmk_rekey=86400 + +# Maximum lifetime for PTK in seconds. This can be used to enforce rekeying of +# PTK to mitigate some attacks against TKIP deficiencies. +#wpa_ptk_rekey=600 + +# Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up +# roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN +# authentication and key handshake before actually associating with a new AP. +# (dot11RSNAPreauthenticationEnabled) +#rsn_preauth=1 +# +# Space separated list of interfaces from which pre-authentication frames are +# accepted (e.g., 'eth0' or 'eth0 wlan0wds0'. This list should include all +# interface that are used for connections to other APs. This could include +# wired interfaces and WDS links. The normal wireless data interface towards +# associated stations (e.g., wlan0) should not be added, since +# pre-authentication is only used with APs other than the currently associated +# one. +#rsn_preauth_interfaces=eth0 + +# peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e) is +# allowed. This is only used with RSN/WPA2. +# 0 = disabled (default) +# 1 = enabled +#peerkey=1 + +# ieee80211w: Whether management frame protection (MFP) is enabled +# 0 = disabled (default) +# 1 = optional +# 2 = required +#ieee80211w=0 + +# Association SA Query maximum timeout (in TU = 1.024 ms; for MFP) +# (maximum time to wait for a SA Query response) +# dot11AssociationSAQueryMaximumTimeout, 1...4294967295 +#assoc_sa_query_max_timeout=1000 + +# Association SA Query retry timeout (in TU = 1.024 ms; for MFP) +# (time between two subsequent SA Query requests) +# dot11AssociationSAQueryRetryTimeout, 1...4294967295 +#assoc_sa_query_retry_timeout=201 + + +# okc: Opportunistic Key Caching (aka Proactive Key Caching) +# Allow PMK cache to be shared opportunistically among configured interfaces +# and BSSes (i.e., all configurations within a single hostapd process). +# 0 = disabled (default) +# 1 = enabled +#okc=1 + + +##### IEEE 802.11r configuration ############################################## + +# Mobility Domain identifier (dot11FTMobilityDomainID, MDID) +# MDID is used to indicate a group of APs (within an ESS, i.e., sharing the +# same SSID) between which a STA can use Fast BSS Transition. +# 2-octet identifier as a hex string. +#mobility_domain=a1b2 + +# PMK-R0 Key Holder identifier (dot11FTR0KeyHolderID) +# 1 to 48 octet identifier. +# This is configured with nas_identifier (see RADIUS client section above). + +# Default lifetime of the PMK-RO in minutes; range 1..65535 +# (dot11FTR0KeyLifetime) +#r0_key_lifetime=10000 + +# PMK-R1 Key Holder identifier (dot11FTR1KeyHolderID) +# 6-octet identifier as a hex string. +#r1_key_holder=000102030405 + +# Reassociation deadline in time units (TUs / 1.024 ms; range 1000..65535) +# (dot11FTReassociationDeadline) +#reassociation_deadline=1000 + +# List of R0KHs in the same Mobility Domain +# format: <128-bit key as hex string> +# This list is used to map R0KH-ID (NAS Identifier) to a destination MAC +# address when requesting PMK-R1 key from the R0KH that the STA used during the +# Initial Mobility Domain Association. +#r0kh=02:01:02:03:04:05 r0kh-1.example.com 000102030405060708090a0b0c0d0e0f +#r0kh=02:01:02:03:04:06 r0kh-2.example.com 00112233445566778899aabbccddeeff +# And so on.. One line per R0KH. + +# List of R1KHs in the same Mobility Domain +# format: <128-bit key as hex string> +# This list is used to map R1KH-ID to a destination MAC address when sending +# PMK-R1 key from the R0KH. This is also the list of authorized R1KHs in the MD +# that can request PMK-R1 keys. +#r1kh=02:01:02:03:04:05 02:11:22:33:44:55 000102030405060708090a0b0c0d0e0f +#r1kh=02:01:02:03:04:06 02:11:22:33:44:66 00112233445566778899aabbccddeeff +# And so on.. One line per R1KH. + +# Whether PMK-R1 push is enabled at R0KH +# 0 = do not push PMK-R1 to all configured R1KHs (default) +# 1 = push PMK-R1 to all configured R1KHs whenever a new PMK-R0 is derived +#pmk_r1_push=1 + +##### Passive scanning ######################################################## +# Scan different channels every N seconds. 0 = disable passive scanning. +#passive_scan_interval=60 + +# Listen N usecs on each channel when doing passive scanning. +# This value plus the time needed for changing channels should be less than +# 32 milliseconds (i.e. 32000 usec) to avoid interruptions to normal +# operations. Time needed for channel changing varies based on the used wlan +# hardware. +# default: disabled (0) +#passive_scan_listen=10000 + +# Passive scanning mode: +# 0 = scan all supported modes (802.11a/b/g/Turbo) (default) +# 1 = scan only the mode that is currently used for normal operations +#passive_scan_mode=1 + +# Maximum number of entries kept in AP table (either for passive scanning or +# for detecting Overlapping Legacy BSS Condition). The oldest entry will be +# removed when adding a new entry that would make the list grow over this +# limit. Note! Wi-Fi certification for IEEE 802.11g requires that OLBC is +# enabled, so this field should not be set to 0 when using IEEE 802.11g. +# default: 255 +#ap_table_max_size=255 + +# Number of seconds of no frames received after which entries may be deleted +# from the AP table. Since passive scanning is not usually performed frequently +# this should not be set to very small value. In addition, there is no +# guarantee that every scan cycle will receive beacon frames from the +# neighboring APs. +# default: 60 +#ap_table_expiration_time=3600 + + +##### Wi-Fi Protected Setup (WPS) ############################################# + +# WPS state +# 0 = WPS disabled (default) +# 1 = WPS enabled, not configured +# 2 = WPS enabled, configured +#wps_state=2 + +# AP can be configured into a locked state where new WPS Registrar are not +# accepted, but previously authorized Registrars (including the internal one) +# can continue to add new Enrollees. +ap_setup_locked=1 + +# Universally Unique IDentifier (UUID; see RFC 4122) of the device +# This value is used as the UUID for the internal WPS Registrar. If the AP +# is also using UPnP, this value should be set to the device's UPnP UUID. +# If not configured, UUID will be generated based on the local MAC address. +#uuid=12345678-9abc-def0-1234-56789abcdef0 + +# Note: If wpa_psk_file is set, WPS is used to generate random, per-device PSKs +# that will be appended to the wpa_psk_file. If wpa_psk_file is not set, the +# default PSK (wpa_psk/wpa_passphrase) will be delivered to Enrollees. Use of +# per-device PSKs is recommended as the more secure option (i.e., make sure to +# set wpa_psk_file when using WPS with WPA-PSK). + +# When an Enrollee requests access to the network with PIN method, the Enrollee +# PIN will need to be entered for the Registrar. PIN request notifications are +# sent to hostapd ctrl_iface monitor. In addition, they can be written to a +# text file that could be used, e.g., to populate the AP administration UI with +# pending PIN requests. If the following variable is set, the PIN requests will +# be written to the configured file. +#wps_pin_requests=/var/run/hostapd_wps_pin_requests + +# Device Name +# User-friendly description of device; up to 32 octets encoded in UTF-8 +#device_name=Wireless AP + +# Manufacturer +# The manufacturer of the device (up to 64 ASCII characters) +#manufacturer=Qualcomm + +# Model Name +# Model of the device (up to 32 ASCII characters) +#model_name=QualcommSoftAP + +# Model Number +# Additional device description (up to 32 ASCII characters) +#model_number=123 + +# Serial Number +# Serial number of the device (up to 32 characters) +#serial_number=12345 + +# Primary Device Type +# Used format: -- +# categ = Category as an integer value +# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for +# default WPS OUI +# subcateg = OUI-specific Sub Category as an integer value +# Examples: +# 1-0050F204-1 (Computer / PC) +# 1-0050F204-2 (Computer / Server) +# 5-0050F204-1 (Storage / NAS) +# 6-0050F204-1 (Network Infrastructure / AP) +#device_type=6-0050F204-1 + +# OS Version +# 4-octet operating system version number (hex string) +#os_version=01020300 + +# Config Methods +# List of the supported configuration methods +config_methods=label display push_button keypad + +# Access point PIN for initial configuration and adding Registrars +# If not set, hostapd will not allow external WPS Registrars to control the +# access point. +#ap_pin=12345670 + +# Skip building of automatic WPS credential +# This can be used to allow the automatically generated Credential attribute to +# be replaced with pre-configured Credential(s). +#skip_cred_build=1 + +# Additional Credential attribute(s) +# This option can be used to add pre-configured Credential attributes into M8 +# message when acting as a Registrar. If skip_cred_build=1, this data will also +# be able to override the Credential attribute that would have otherwise been +# automatically generated based on network configuration. This configuration +# option points to an external file that much contain the WPS Credential +# attribute(s) as binary data. +#extra_cred=hostapd.cred + +# Credential processing +# 0 = process received credentials internally (default) +# 1 = do not process received credentials; just pass them over ctrl_iface to +# external program(s) +# 2 = process received credentials internally and pass them over ctrl_iface +# to external program(s) +# Note: With wps_cred_processing=1, skip_cred_build should be set to 1 and +# extra_cred be used to provide the Credential data for Enrollees. +# +# wps_cred_processing=1 will disabled automatic updates of hostapd.conf file +# both for Credential processing and for marking AP Setup Locked based on +# validation failures of AP PIN. An external program is responsible on updating +# the configuration appropriately in this case. +#wps_cred_processing=0 + +# AP Settings Attributes for M7 +# By default, hostapd generates the AP Settings Attributes for M7 based on the +# current configuration. It is possible to override this by providing a file +# with pre-configured attributes. This is similar to extra_cred file format, +# but the AP Settings attributes are not encapsulated in a Credential +# attribute. +#ap_settings=hostapd.ap_settings + +# WPS UPnP interface +# If set, support for external Registrars is enabled. +#upnp_iface=br0 + +# Friendly Name (required for UPnP) +# Short description for end use. Should be less than 64 characters. +#friendly_name=Qualcomm Access Point + +# Manufacturer URL (optional for UPnP) +#manufacturer_url=http://www.qualcomm.com/ + +# Model Description (recommended for UPnP) +# Long description for end user. Should be less than 128 characters. +#model_description=Wireless Access Point + +# Model URL (optional for UPnP) +#model_url=http://www.qualcomm.com/ + +# Universal Product Code (optional for UPnP) +# 12-digit, all-numeric code that identifies the consumer package. +#upc=123456789012 + +##### Multiple BSSID support ################################################## +# +# Above configuration is using the default interface (wlan#, or multi-SSID VLAN +# interfaces). Other BSSIDs can be added by using separator 'bss' with +# default interface name to be allocated for the data packets of the new BSS. +# +# hostapd will generate BSSID mask based on the BSSIDs that are +# configured. hostapd will verify that dev_addr & MASK == dev_addr. If this is +# not the case, the MAC address of the radio must be changed before starting +# hostapd (ifconfig wlan0 hw ether ). +# +# BSSIDs are assigned in order to each BSS, unless an explicit BSSID is +# specified using the 'bssid' parameter. +# If an explicit BSSID is specified, it must be chosen such that it: +# - results in a valid MASK that covers it and the dev_addr +# - is not the same as the MAC address of the radio +# - is not the same as any other explicitly specified BSSID +# +# Please note that hostapd uses some of the values configured for the first BSS +# as the defaults for the following BSSes. However, it is recommended that all +# BSSes include explicit configuration of all relevant configuration items. +# +#bss=wlan0_0 +#ssid=test2 +# most of the above items can be used here (apart from radio interface specific +# items, like channel) + +#bss=wlan0_1 +#bssid=00:13:10:95:fe:0b +# ... diff --git a/configs/wifi/p2p_supplicant_overlay.conf b/configs/wifi/p2p_supplicant_overlay.conf new file mode 100644 index 0000000..40c7bc7 --- /dev/null +++ b/configs/wifi/p2p_supplicant_overlay.conf @@ -0,0 +1,10 @@ +disable_scan_offload=1 +p2p_listen_reg_class=81 +p2p_listen_channel=1 +p2p_oper_reg_class=124 +p2p_oper_channel=149 +manufacturer=SAMSUNG_ELECTRONICS +model_name=SAMSUNG_MOBILE +model_number=2014 +serial_number=19691101 +update_config=1 diff --git a/configs/wifi/wpa_supplicant_overlay.conf b/configs/wifi/wpa_supplicant_overlay.conf new file mode 100644 index 0000000..4290f9d --- /dev/null +++ b/configs/wifi/wpa_supplicant_overlay.conf @@ -0,0 +1,4 @@ +disable_scan_offload=1 +p2p_disabled=1 +update_config=1 +p2p_no_group_iface=1 diff --git a/extract-files.sh b/extract-files.sh index 46982b7..cd64bc9 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -23,7 +23,7 @@ if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi # Override anything that may come from the calling environment CM_ROOT="$MY_DIR"/../../.. -BOARD=msm8974 +BOARD=msm8226 DEVICE_COMMON=${BOARD}-common VENDOR=samsung diff --git a/gps/core/gps_extended_c.h b/gps/core/gps_extended_c.h index 2047234..fb08364 100644 --- a/gps/core/gps_extended_c.h +++ b/gps/core/gps_extended_c.h @@ -378,6 +378,7 @@ enum loc_api_adapter_event_index { LOC_API_ADAPTER_GDT_UPLOAD_END_REQ, // GDT upload end request LOC_API_ADAPTER_GNSS_MEASUREMENT, // GNSS Measurement report LOC_API_ADAPTER_REQUEST_TIMEZONE, // Timezone injection request + LOC_API_ADAPTER_REPORT_GENFENCE_DWELL_REPORT, // Geofence dwell report LOC_API_ADAPTER_EVENT_MAX }; @@ -407,6 +408,7 @@ enum loc_api_adapter_event_index { #define LOC_API_ADAPTER_BIT_GDT_UPLOAD_END_REQ (1<getIzatDevId(), chipsetsn, brand); for (int i = 0; i < sizeof(userAgent) && userAgent[i]; i++) { @@ -201,6 +205,56 @@ void LocEngAdapter::setXtraUserAgent() { return; } + /** + * encode the given string value such that all separator characters ('/','+','|','%') + * in the string are repaced by their corresponding encodings (%2F","%2B","%7C", "%25") + */ + static void encodeInPlace(char value[], const int size) { + char buffer[size]; + + struct ENCODE { + const char ch; + const char *code; + }; + + const ENCODE encodings[] = { {'/', "%2F"}, {'+', "%2B"}, {'|', "%7C",}, {'%', "%25"} }; + const int nencodings = (int)sizeof(encodings) / sizeof(encodings[0]); + + int inpos = 0, outpos = 0; + while(value[inpos] != '\0' && outpos < size - 1) { + // check if escaped character + int escchar = 0; + while(escchar < nencodings && encodings[escchar].ch != value[inpos]) { + escchar++; + } + + if (escchar == nencodings) { + // non escaped character + buffer[outpos++] = value[inpos++]; + continue; + } + + // escaped character + int codepos = 0; + #define NUM_CHARS_IN_CODE 3 + + if (outpos + NUM_CHARS_IN_CODE >= size) { + // skip last character if there is insufficient space + break; + } + + while(outpos < size - 1 && codepos < NUM_CHARS_IN_CODE) { + buffer[outpos++] = encodings[escchar].code[codepos++]; + } + inpos++; + } + + // copy to ouput + value[outpos] = '\0'; + while(--outpos >= 0) { + value[outpos] = buffer[outpos]; + } + } }; sendMsg(new LocSetXtraUserAgent(mContext)); diff --git a/gps/loc_api/libloc_api_50001/loc_eng.cpp b/gps/loc_api/libloc_api_50001/loc_eng.cpp index 3664463..af97c51 100644 --- a/gps/loc_api/libloc_api_50001/loc_eng.cpp +++ b/gps/loc_api/libloc_api_50001/loc_eng.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2009-2015, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -94,7 +94,7 @@ loc_gps_cfg_s_type gps_conf; loc_sap_cfg_s_type sap_conf; /* Parameter spec table */ -static loc_param_s_type gps_conf_table[] = +static const loc_param_s_type gps_conf_table[] = { {"GPS_LOCK", &gps_conf.GPS_LOCK, NULL, 'n'}, {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'}, @@ -113,7 +113,7 @@ static loc_param_s_type gps_conf_table[] = {"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'}, }; -static loc_param_s_type sap_conf_table[] = +static const loc_param_s_type sap_conf_table[] = { {"GYRO_BIAS_RANDOM_WALK", &sap_conf.GYRO_BIAS_RANDOM_WALK, &sap_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'}, {"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'}, diff --git a/gps/utils/LocSharedLock.h b/gps/utils/LocSharedLock.h index 6b9e27f..7fe6237 100644 --- a/gps/utils/LocSharedLock.h +++ b/gps/utils/LocSharedLock.h @@ -30,6 +30,7 @@ #define __LOC_SHARED_LOCK__ #include +#include #include // This is a utility created for use cases such that there are more than @@ -39,16 +40,16 @@ // this share lock's share() method has to be called, so that the obj // can maintain an accurate client count. class LocSharedLock { - uint32_t mRef; + volatile int32_t mRef; pthread_mutex_t mMutex; inline ~LocSharedLock() { pthread_mutex_destroy(&mMutex); } public: // first client to create this LockSharedLock inline LocSharedLock() : mRef(1) { pthread_mutex_init(&mMutex, NULL); } // following client(s) are to *share()* this lock created by the first client - inline LocSharedLock* share() { mRef++; return this; } + inline LocSharedLock* share() { android_atomic_inc(&mRef); return this; } // whe a client no longer needs this shared lock, drop() shall be called. - inline void drop() { if (0 == --mRef) delete this; } + inline void drop() { if (1 == android_atomic_dec(&mRef)) delete this; } // locking the lock to enter critical section inline void lock() { pthread_mutex_lock(&mMutex); } // unlocking the lock to leave the critical section diff --git a/gps/utils/MsgTask.cpp b/gps/utils/MsgTask.cpp index fdb1102..6f9d0e9 100644 --- a/gps/utils/MsgTask.cpp +++ b/gps/utils/MsgTask.cpp @@ -83,7 +83,7 @@ void MsgTask::prerun() { } bool MsgTask::run() { - LOC_LOGD("MsgTask::loop() listening ...\n"); + LOC_LOGV("MsgTask::loop() listening ...\n"); LocMsg* msg; msq_q_err_type result = msg_q_rcv((void*)mQ, (void **)&msg); if (eMSG_Q_SUCCESS != result) { diff --git a/gps/utils/linked_list.c b/gps/utils/linked_list.c index 92617fe..2c91714 100644 --- a/gps/utils/linked_list.c +++ b/gps/utils/linked_list.c @@ -109,7 +109,7 @@ linked_list_err_type linked_list_destroy(void** list_data) ===========================================================================*/ linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dealloc)(void*)) { - LOC_LOGD("%s: Adding to list data_obj = 0x%08X\n", __FUNCTION__, data_obj); + LOC_LOGV("%s: Adding to list data_obj = 0x%08X\n", __FUNCTION__, data_obj); if( list_data == NULL ) { LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); @@ -161,7 +161,7 @@ linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dea ===========================================================================*/ linked_list_err_type linked_list_remove(void* list_data, void **data_obj) { - LOC_LOGD("%s: Removing from list\n", __FUNCTION__); + LOC_LOGV("%s: Removing from list\n", __FUNCTION__); if( list_data == NULL ) { LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__); @@ -268,7 +268,7 @@ linked_list_err_type linked_list_search(void* list_data, void **data_p, bool (*equal)(void* data_0, void* data), void* data_0, bool rm_if_found) { - LOC_LOGD("%s: Search the list\n", __FUNCTION__); + LOC_LOGV("%s: Search the list\n", __FUNCTION__); if( list_data == NULL || NULL == equal ) { LOC_LOGE("%s: Invalid list parameter! list_data %p equal %p\n", diff --git a/gps/utils/loc_cfg.cpp b/gps/utils/loc_cfg.cpp index 5c33320..967d2f3 100644 --- a/gps/utils/loc_cfg.cpp +++ b/gps/utils/loc_cfg.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -56,12 +56,12 @@ static uint32_t DEBUG_LEVEL = 0xff; static uint32_t TIMESTAMP = 0; /* Parameter spec table */ -static loc_param_s_type loc_param_table[] = +static const loc_param_s_type loc_param_table[] = { {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'}, {"TIMESTAMP", &TIMESTAMP, NULL, 'n'}, }; -int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); +static const int loc_param_num = sizeof(loc_param_table) / sizeof(loc_param_s_type); typedef struct loc_param_v_type { @@ -92,7 +92,7 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -int loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value) +int loc_set_config_entry(const loc_param_s_type* config_entry, loc_param_v_type* config_value) { int ret=-1; if(NULL == config_entry || NULL == config_value) @@ -181,7 +181,7 @@ SIDE EFFECTS N/A ===========================================================================*/ int loc_fill_conf_item(char* input_buf, - loc_param_s_type* config_table, uint32_t table_length) + const loc_param_s_type* config_table, uint32_t table_length) { int ret = 0; @@ -258,7 +258,7 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, uint32_t table_length) +int loc_read_conf_r(FILE *conf_fp, const loc_param_s_type* config_table, uint32_t table_length) { int ret=0; @@ -322,7 +322,7 @@ SIDE EFFECTS N/A ===========================================================================*/ int loc_update_conf(const char* conf_data, int32_t length, - loc_param_s_type* config_table, uint32_t table_length) + const loc_param_s_type* config_table, uint32_t table_length) { int ret = -1; @@ -377,7 +377,7 @@ RETURN VALUE SIDE EFFECTS N/A ===========================================================================*/ -void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table, +void loc_read_conf(const char* conf_file_name, const loc_param_s_type* config_table, uint32_t table_length) { FILE *conf_fp = NULL; diff --git a/gps/utils/loc_cfg.h b/gps/utils/loc_cfg.h index ea4865b..9045e1d 100644 --- a/gps/utils/loc_cfg.h +++ b/gps/utils/loc_cfg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -54,7 +54,7 @@ *============================================================================*/ typedef struct { - char param_name[LOC_MAX_PARAM_NAME]; + const char *param_name; void *param_ptr; uint8_t *param_set; /* was this value set by config file? */ char param_type; /* 'n' for number, @@ -78,12 +78,12 @@ extern "C" { * *============================================================================*/ void loc_read_conf(const char* conf_file_name, - loc_param_s_type* config_table, + const loc_param_s_type* config_table, uint32_t table_length); -int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, +int loc_read_conf_r(FILE *conf_fp, const loc_param_s_type* config_table, uint32_t table_length); int loc_update_conf(const char* conf_data, int32_t length, - loc_param_s_type* config_table, uint32_t table_length); + const loc_param_s_type* config_table, uint32_t table_length); #ifdef __cplusplus } #endif diff --git a/gps/utils/loc_log.cpp b/gps/utils/loc_log.cpp index 5500dea..76f0c53 100644 --- a/gps/utils/loc_log.cpp +++ b/gps/utils/loc_log.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2012, 2015, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -57,9 +57,9 @@ const char EXIT_ERROR_TAG[] = "Exiting with error"; loc_logger_s_type loc_logger; /* Get names from value */ -const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask) +const char* loc_get_name_from_mask(const loc_name_val_s_type table[], size_t table_size, long mask) { - int i; + size_t i; for (i = 0; i < table_size; i++) { if (table[i].val & (long) mask) @@ -71,9 +71,9 @@ const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, } /* Get names from value */ -const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value) +const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t table_size, long value) { - int i; + size_t i; for (i = 0; i < table_size; i++) { if (table[i].val == (long) value) @@ -84,7 +84,7 @@ const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, l return UNKNOWN_STR; } -static loc_name_val_s_type loc_msg_q_status[] = +static const loc_name_val_s_type loc_msg_q_status[] = { NAME_VAL( eMSG_Q_SUCCESS ), NAME_VAL( eMSG_Q_FAILURE_GENERAL ), @@ -93,7 +93,7 @@ static loc_name_val_s_type loc_msg_q_status[] = NAME_VAL( eMSG_Q_UNAVAILABLE_RESOURCE ), NAME_VAL( eMSG_Q_INSUFFICIENT_BUFFER ) }; -static int loc_msg_q_status_num = sizeof(loc_msg_q_status) / sizeof(loc_name_val_s_type); +static const size_t loc_msg_q_status_num = LOC_TABLE_SIZE(loc_msg_q_status); /* Find msg_q status name */ const char* loc_get_msg_q_status(int status) @@ -107,7 +107,7 @@ const char* log_succ_fail_string(int is_succ) } //Target names -loc_name_val_s_type target_name[] = +static const loc_name_val_s_type target_name[] = { NAME_VAL(GNSS_NONE), NAME_VAL(GNSS_MSM), @@ -118,7 +118,7 @@ loc_name_val_s_type target_name[] = NAME_VAL(GNSS_UNKNOWN) }; -static int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type); +static const size_t target_name_num = LOC_TABLE_SIZE(target_name); /*=========================================================================== @@ -139,7 +139,7 @@ const char *loc_get_target_name(unsigned int target) static char ret[BUFFER_SIZE]; index = getTargetGnssType(target); - if( index >= target_name_num || index < 0) + if( index < 0 || (unsigned)index >= target_name_num ) index = target_name_num - 1; if( (target & HAS_SSC) == HAS_SSC ) { @@ -168,7 +168,7 @@ RETURN VALUE The time string ===========================================================================*/ -char *loc_get_time(char *time_string, unsigned long buf_size) +char *loc_get_time(char *time_string, size_t buf_size) { struct timeval now; /* sec and usec */ struct tm now_tm; /* broken-down time */ diff --git a/gps/utils/loc_log.h b/gps/utils/loc_log.h index 82dc636..be492b1 100644 --- a/gps/utils/loc_log.h +++ b/gps/utils/loc_log.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2012, 2015 The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -36,12 +36,13 @@ extern "C" #endif #include +#include #include "loc_target.h" typedef struct { - char name[128]; - long val; + const char *name; + long val; } loc_name_val_s_type; #define NAME_VAL(x) {"" #x "", x } @@ -49,17 +50,19 @@ typedef struct #define UNKNOWN_STR "UNKNOWN" #define CHECK_MASK(type, value, mask_var, mask) \ - ((mask_var & mask) ? (type) value : (type) (-1)) + (((mask_var) & (mask)) ? (type) (value) : (type) (-1)) + +#define LOC_TABLE_SIZE(table) (sizeof(table)/sizeof((table)[0])) /* Get names from value */ -const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask); -const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value); +const char* loc_get_name_from_mask(const loc_name_val_s_type table[], size_t table_size, long mask); +const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t table_size, long value); const char* loc_get_msg_q_status(int status); const char* loc_get_target_name(unsigned int target); extern const char* log_succ_fail_string(int is_succ); -extern char *loc_get_time(char *time_string, unsigned long buf_size); +extern char *loc_get_time(char *time_string, size_t buf_size); #ifdef __cplusplus } diff --git a/gps/utils/msg_q.c b/gps/utils/msg_q.c index f82d4c0..5be8547 100644 --- a/gps/utils/msg_q.c +++ b/gps/utils/msg_q.c @@ -199,7 +199,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*) msg_q* p_msg_q = (msg_q*)msg_q_data; pthread_mutex_lock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); + LOC_LOGV("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); if( p_msg_q->unblocked ) { @@ -215,7 +215,7 @@ msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); + LOC_LOGV("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj); return rv; } @@ -242,7 +242,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) msg_q* p_msg_q = (msg_q*)msg_q_data; - LOC_LOGD("%s: Waiting on message\n", __FUNCTION__); + LOC_LOGV("%s: Waiting on message\n", __FUNCTION__); pthread_mutex_lock(&p_msg_q->list_mutex); @@ -263,7 +263,7 @@ msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj) pthread_mutex_unlock(&p_msg_q->list_mutex); - LOC_LOGD("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); + LOC_LOGV("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv); return rv; } diff --git a/init/Android.mk b/init/Android.mk new file mode 100644 index 0000000..6fde28f --- /dev/null +++ b/init/Android.mk @@ -0,0 +1,32 @@ +# +# Copyright (C) 2016 The CyanogenMod Project +# 2017 The LineageOS 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 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := optional +LOCAL_C_INCLUDES := system/core/init +LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\" +LOCAL_SRC_FILES := init_msm8226.cpp +ifneq ($(TARGET_LIBINIT_MSM8226_DEFINES_FILE),) + LOCAL_SRC_FILES += ../../../../$(TARGET_LIBINIT_MSM8226_DEFINES_FILE) +endif +LOCAL_MODULE := libinit_msm8226 + +LOCAL_STATIC_LIBRARIES := libbase + +include $(BUILD_STATIC_LIBRARY) diff --git a/init/init_msm8226.cpp b/init/init_msm8226.cpp new file mode 100644 index 0000000..2cc1544 --- /dev/null +++ b/init/init_msm8226.cpp @@ -0,0 +1,77 @@ +/* + Copyright (c) 2016, The CyanogenMod Project. All rights reserved. + Copyright (c) 2017-2018, The LineageOS Project. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include + +#include + +#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ +#include + +#include "vendor_init.h" +#include "property_service.h" + +#include "init_msm8226.h" + +using android::init::property_set; + +__attribute__ ((weak)) +void init_target_properties() +{ +} + +void property_override(char const prop[], char const value[]) +{ + prop_info *pi; + + pi = (prop_info*) __system_property_find(prop); + if (pi) + __system_property_update(pi, value, strlen(value)); + else + __system_property_add(prop, strlen(prop), value, strlen(value)); +} + +void property_override_dual(char const system_prop[], + char const vendor_prop[], char const value[]) +{ + property_override(system_prop, value); + property_override(vendor_prop, value); +} + + +void vendor_load_properties() +{ + init_target_properties(); +} diff --git a/init/init_msm8226.h b/init/init_msm8226.h new file mode 100644 index 0000000..40ceda8 --- /dev/null +++ b/init/init_msm8226.h @@ -0,0 +1,39 @@ +/* + Copyright (c) 2016, The CyanogenMod Project + Copyright (c) 2018, The LineageOS Project + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of The Linux Foundation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __INIT_MSM8226__H__ +#define __INIT_MSM8226__H__ + +void init_target_properties(); +void property_override(char const prop[], char const value[]); +void property_override_dual(char const system_prop[], + char const vendor_prop[], char const value[]); + +#endif /* __INIT_MSM8226__H__ */ diff --git a/libhealthd/healthd_board_default.cpp b/libhealthd/healthd_board_default.cpp deleted file mode 100644 index 974a462..0000000 --- a/libhealthd/healthd_board_default.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * Copyright (C) 2013 The CyanogenMod 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "minui/minui.h" - -#include -#include - -#include - -#ifndef BACKLIGHT_PATH -#define BACKLIGHT_PATH "/sys/class/leds/lcd-backlight/brightness" -#endif -#define BACKLIGHT_ON_LEVEL 100 - -#define LOGE(x...) do { KLOG_ERROR("charger", x); } while (0) -#define LOGW(x...) do { KLOG_WARNING("charger", x); } while (0) -#define LOGV(x...) do { KLOG_DEBUG("charger", x); } while (0) - -void healthd_board_init(struct healthd_config *config) -{ - config->batteryCapacityPath = "/sys/class/power_supply/battery/capacity"; - config->batteryStatusPath = "/sys/class/power_supply/battery/status"; - config->batteryVoltagePath = "/sys/class/power_supply/battery/voltage_now"; - config->batteryPresentPath = "/sys/class/power_supply/battery/present"; - config->batteryHealthPath = "/sys/class/power_supply/battery/health"; - config->batteryTemperaturePath = "/sys/class/power_supply/battery/temp"; - config->batteryTechnologyPath = "/sys/class/power_supply/battery/technology"; -} - -#define STR_LEN 8 -void healthd_board_mode_charger_draw_battery( - struct android::BatteryProperties *batt_prop) -{ - char cap_str[STR_LEN]; - int x, y; - int str_len_px; - static int char_height = -1, char_width = -1; - - if (char_height == -1 && char_width == -1) - gr_font_size(gr_sys_font(), &char_width, &char_height); - snprintf(cap_str, (STR_LEN - 1), "%d%%", batt_prop->batteryLevel); - str_len_px = gr_measure(gr_sys_font(), cap_str); - x = (gr_fb_width() - str_len_px) / 2; - y = (gr_fb_height() + char_height) / 2; - gr_color(0xa4, 0xc6, 0x39, 255); - gr_text(gr_sys_font(), x, y, cap_str, 0); -} - -int healthd_board_battery_update(__attribute__((unused)) struct android::BatteryProperties *props) -{ - // return 0 to log periodic polled battery status to kernel log - return 1; -} - -void healthd_board_mode_charger_battery_update(struct android::BatteryProperties*) -{ - -} - -void healthd_board_mode_charger_set_backlight(bool on) -{ - int fd; - char buffer[10]; - - if (access(BACKLIGHT_PATH, R_OK | W_OK) != 0) - { - LOGW("Backlight control not support\n"); - return; - } - - memset(buffer, '\0', sizeof(buffer)); - fd = open(BACKLIGHT_PATH, O_RDWR); - if (fd < 0) { - LOGE("Could not open backlight node : %s\n", strerror(errno)); - return; - } - LOGV("Enabling backlight\n"); - snprintf(buffer, sizeof(buffer), "%d\n", on ? BACKLIGHT_ON_LEVEL : 0); - if (write(fd, buffer,strlen(buffer)) < 0) { - LOGE("Could not write to backlight node : %s\n", strerror(errno)); - } - close(fd); -} - -void healthd_board_mode_charger_init() -{ - -} diff --git a/libhealthd/images/battery_fail.png b/libhealthd/images/battery_fail.png deleted file mode 100644 index 36fc254d054328c0c56372daa02589abceedf456..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1805 zcmbVNdrT8|9Ix`wsby?35fr@?hp)AFS6bRTs8HGh%`6~q6*rIepcUGy*Ta_jz!bBI zQHczPlaZk=Zqo#!TP%W;xj82?TnC~9#0ZL%!6ZYNh!FQH58WTeEMD%uzt`vc{C&Q; z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54d4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 463 zcmeAS@N?(olHy`uVBq!ia0vp^6$}h4F)YkL)?y2fOF)W0z$e5NNdE_cGeBT$Z2VW? zhXYWEqr^3$#H}bXH?^3-EdIluXABIC>7Fi*Ar*{ouWjUPFc5LQ$ibIjR>1Oo{yDpZ zkD(PUbHblHSzOJ3yzSqP;+p8r{wSS&VJwS%r6qE2CEePR$&A8`zGMI9c!Z8v_tB({ zJN8ED+GWr@W0<{uUMo>-b#d#tU^Fmzy85}Sb4q9e0C{iTuK)l5 diff --git a/libshims/Android.mk b/libshims/Android.mk new file mode 100644 index 0000000..37483e0 --- /dev/null +++ b/libshims/Android.mk @@ -0,0 +1,17 @@ +# +# Copyright (C) 2017 The LineageOS 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 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include $(call first-makefiles-under,$(call my-dir)) diff --git a/libhealthd/Android.mk b/libshims/libshim_cutils_atomic/Android.mk similarity index 63% rename from libhealthd/Android.mk rename to libshims/libshim_cutils_atomic/Android.mk index 714ffe7..1c31545 100644 --- a/libhealthd/Android.mk +++ b/libshims/libshim_cutils_atomic/Android.mk @@ -1,5 +1,5 @@ -# Copyright (C) 2013 The Android Open Source Project -# Copyright (C) 2013 The CyanogenMod Project +# +# Copyright (C) 2017 The LineageOS Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,13 +12,18 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := healthd_board_default.cpp -LOCAL_MODULE := libhealthd.msm8226 -LOCAL_C_INCLUDES := system/core/healthd/include bootable/recovery/minui/include -LOCAL_STATIC_LIBRARIES := libutils libbase libbinder -include $(BUILD_STATIC_LIBRARY) +LOCAL_MODULE := libshim_cutils_atomic +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +LOCAL_MODULE_TAGS := optional +LOCAL_PROPRIETARY_MODULE := true + +LOCAL_SRC_FILES := \ + atomic.c + +include $(BUILD_SHARED_LIBRARY) diff --git a/libshims/libshim_cutils_atomic/atomic.c b/libshims/libshim_cutils_atomic/atomic.c new file mode 100644 index 0000000..d34aa00 --- /dev/null +++ b/libshims/libshim_cutils_atomic/atomic.c @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2007 The Android 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Generate non-inlined versions of android_atomic functions. + * Nobody should be using these, but some binary blobs currently (late 2014) + * are. + * If you read this in 2015 or later, please try to delete this file. + */ + +#define ANDROID_ATOMIC_INLINE + +#include diff --git a/lineage.dependencies b/lineage.dependencies index 5635419..edf784b 100644 --- a/lineage.dependencies +++ b/lineage.dependencies @@ -2,9 +2,5 @@ { "repository": "android_device_samsung_qcom-common", "target_path": "device/samsung/qcom-common" - }, - { - "repository": "android_external_sony_boringssl-compat", - "target_path": "external/sony/boringssl-compat" } ] diff --git a/manifest.xml b/manifest.xml index d493133..3f609aa 100644 --- a/manifest.xml +++ b/manifest.xml @@ -26,15 +26,6 @@ default - - android.hardware.camera.provider - passthrough - 2.4 - - ICameraProvider - legacy/0 - - android.hardware.configstore hwbinder @@ -95,19 +86,6 @@ default - - android.hardware.media.omx - hwbinder - 1.0 - - IOmx - default - - - IOmxStore - default - - android.hardware.memtrack passthrough @@ -162,15 +140,6 @@ default - - android.hardware.wifi.hostapd - hwbinder - 1.0 - - IHostapd - default - - android.hardware.wifi.supplicant hwbinder diff --git a/msm8226.mk b/msm8226.mk index 052267f..b7c0d59 100644 --- a/msm8226.mk +++ b/msm8226.mk @@ -1,5 +1,5 @@ -# Copyright (C) 2014 The CyanogenMod Project -# Copyright (C) 2017-2019 The LineageOS Project +# Copyright (C) 2012 The CyanogenMod Project +# Copyright (C) 2017-2018 The LineageOS Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,11 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) - # Overlays -DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay -DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay-lineage +DEVICE_PACKAGE_OVERLAYS += device/samsung/msm8226-common/overlay # Permissions PRODUCT_COPY_FILES += \ @@ -41,36 +38,30 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \ frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml -# Ramdisk -PRODUCT_PACKAGES += \ - init.qcom.bt.sh \ - init.ril.sh - -PRODUCT_PACKAGES += \ - init.qcom.power.rc \ - init.qcom.rc \ - init.qcom.usb.rc \ - init.recovery.qcom.rc \ - ueventd.qcom.rc - # System properties PRODUCT_PROPERTY_OVERRIDES += \ audio.offload.buffer.size.kb=32 \ audio.offload.gapless.enabled=false \ - av.offload.enable=true \ - ro.af.client_heap_size_kbyte=7168 \ - persist.vendor.audio.hw.binder.size_kbyte=1024 + av.offload.enable=true\ + ro.af.client_heap_size_kbyte=7168 PRODUCT_PROPERTY_OVERRIDES += \ - ro.opengles.version=196608 \ - debug.hwui.use_buffer_age=false - + ro.opengles.version=196608 + PRODUCT_PROPERTY_OVERRIDES += \ persist.graphics.vulkan.disable=true - + PRODUCT_PROPERTY_OVERRIDES += \ - persist.timed.enable=true - + persist.rild.nitz_plmn="" \ + persist.rild.nitz_long_ons_0="" \ + persist.rild.nitz_long_ons_1="" \ + persist.rild.nitz_long_ons_2="" \ + persist.rild.nitz_long_ons_3="" \ + persist.rild.nitz_short_ons_0="" \ + persist.rild.nitz_short_ons_1="" \ + persist.rild.nitz_short_ons_2="" \ + persist.rild.nitz_short_ons_3="" + PRODUCT_PROPERTY_OVERRIDES += \ dalvik.vm.heapstartsize=8m \ dalvik.vm.heapgrowthlimit=192m \ @@ -90,45 +81,31 @@ PRODUCT_PROPERTY_OVERRIDES += \ persist.sys.purgeable_assets=1 PRODUCT_PROPERTY_OVERRIDES += \ - ro.vendor.extension_library=/vendor/lib/libqc-opt.so + persist.timed.enable=true # Audio PRODUCT_PACKAGES += \ android.hardware.audio@2.0-impl \ android.hardware.audio.effect@2.0-impl \ + audio_policy.msm8226 \ audio.a2dp.default \ audio.primary.msm8226 \ audio.r_submix.default \ - audio.usb.default - -PRODUCT_PACKAGES += \ + audio.usb.default \ libaudio-resampler \ - libqcompostprocbundle \ libqcomvisualizer \ + libqcompostprocbundle \ libqcomvoiceprocessing \ tinymix - + # Bluetooth PRODUCT_PACKAGES += \ android.hardware.bluetooth@1.0-impl \ - libbt-vendor + libbt-vendor # Boot animation TARGET_BOOTANIMATION_HALF_RES := true -# Camera -PRODUCT_PACKAGES += \ - android.hardware.camera.provider@2.4-impl-legacy \ - camera.device@1.0-impl-legacy \ - libboringssl-compat \ - camera.msm8226 \ - libxml2 \ - Snap - -# Charger -PRODUCT_PACKAGES += \ - charger_res_images - # Display PRODUCT_PACKAGES += \ android.hardware.graphics.allocator@2.0-impl \ @@ -164,18 +141,13 @@ PRODUCT_COPY_FILES += \ # Keymaster PRODUCT_PACKAGES += \ android.hardware.keymaster@3.0-impl - -# Keystore -PRODUCT_PACKAGES += \ - keystore.msm8226 # Media PRODUCT_COPY_FILES += \ 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_telephony.xml:system/etc/media_codecs_google_telephony.xml \ frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_video_le.xml:system/etc/media_codecs_google_video_le.xml \ - $(LOCAL_PATH)/configs/media_codecs.xml:system/etc/media_codecs.xml + device/samsung/msm8226-common/configs/media_codecs.xml:system/etc/media_codecs.xml # OMX PRODUCT_PACKAGES += \ @@ -188,25 +160,41 @@ PRODUCT_PACKAGES += \ libOmxVdec \ libOmxVenc \ libstagefrighthw - + +# Offmode charger +PRODUCT_PACKAGES += \ + lineage_charger_res_images + # Power HAL PRODUCT_PACKAGES += \ - android.hardware.power@1.0-service-qti - + android.hardware.power@1.0-service-qti + # Preopt PRODUCT_DEXPREOPT_SPEED_APPS += \ Settings \ - SystemUI + SystemUI + +# Ramdisk +PRODUCT_PACKAGES += \ + init.qcom.bt.sh \ + init.ril.sh + +PRODUCT_PACKAGES += \ + init.qcom.power.rc \ + init.qcom.rc \ + init.qcom.usb.rc \ + init.recovery.qcom.rc \ + ueventd.qcom.rc + +# RenderScript HAL +PRODUCT_PACKAGES += \ + android.hardware.renderscript@1.0-impl # Seccomp PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/seccomp/mediacodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \ $(LOCAL_PATH)/seccomp/mediaextractor.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediaextractor.policy -# RenderScript HAL -PRODUCT_PACKAGES += \ - android.hardware.renderscript@1.0-impl - # Sensors PRODUCT_PACKAGES += \ android.hardware.sensors@1.0-impl @@ -217,21 +205,28 @@ PRODUCT_PACKAGES += \ # Wifi PRODUCT_PACKAGES += \ + android.hardware.wifi@1.0-service \ dhcpcd.conf \ hostapd \ wificond \ wpa_supplicant \ wpa_supplicant.conf \ - libwpa_client \ - android.hardware.wifi@1.0-service + libwpa_client PRODUCT_PACKAGES += \ libcurl \ libwcnss_qmi \ wcnss_service +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/configs/wifi/wpa_supplicant_overlay.conf:system/etc/wifi/wpa_supplicant_overlay.conf \ + $(LOCAL_PATH)/configs/wifi/p2p_supplicant_overlay.conf:system/etc/wifi/p2p_supplicant_overlay.conf \ + $(LOCAL_PATH)/configs/wifi/hostapd_default.conf:system/etc/hostapd/hostapd_default.conf \ + $(LOCAL_PATH)/prima/WCNSS_cfg.dat:system/etc/firmware/wlan/prima/WCNSS_cfg.dat \ + $(LOCAL_PATH)/prima/WCNSS_qcom_cfg.ini:system/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini \ + $(LOCAL_PATH)/prima/WCNSS_qcom_wlan_nv.bin:system/etc/firmware/wlan/prima/WCNSS_qcom_wlan_nv.bin # Get non-open-source specific aspects $(call inherit-product-if-exists, vendor/samsung/msm8226-common/msm8226-common-vendor.mk) - -# Inherit from qcom-common + +# common msm8226 $(call inherit-product, device/samsung/qcom-common/qcom-common.mk) diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 4f55abe..b161af2 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -21,10 +21,6 @@ for different hardware and product builds. --> - - true - false - XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra3grc.bin @@ -37,26 +33,12 @@ LPP_PROFILE=0 - - 3300 - - - 40000 - - "/system/framework/arm/boot-framework.oat" - "/system/framework/boot-framework.vdex" - "/system/framework/oat/arm/services.odex" - "/system/framework/oat/arm/services.vdex" - "/system/framework/arm/boot.oat" - "/system/framework/boot.vdex" - "/system/framework/arm/boot-core-libart.oat" - "/system/framework/boot-core-libart.vdex" "/system/priv-app/SystemUI/SystemUI.apk" - "/data/dalvik-cache/arm64/system@priv-app@SystemUI@SystemUI.apk@classes.dex" - "/data/dalvik-cache/arm64/system@priv-app@SystemUI@SystemUI.apk@classes.vdex" + "/data/dalvik-cache/arm/system@priv-app@SystemUI@SystemUI.apk@classes.dex" + "/data/dalvik-cache/arm/system@priv-app@SystemUI@SystemUI.apk@classes.vdex" "/system/lib/libsurfaceflinger.so" - + diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml deleted file mode 100644 index eb65e67..0000000 --- a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - false - - - diff --git a/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml b/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml index d60cdf4..d7165d3 100644 --- a/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml +++ b/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml @@ -22,29 +22,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/overlay/packages/apps/Settings/res/values/arrays.xml b/overlay/packages/apps/Settings/res/values/arrays.xml deleted file mode 100644 index 74c22e8..0000000 --- a/overlay/packages/apps/Settings/res/values/arrays.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - 0 - -1 - -1 - - diff --git a/prima/WCNSS_cfg.dat b/prima/WCNSS_cfg.dat new file mode 100644 index 0000000000000000000000000000000000000000..e3434036962cdcb9ffafaae1d64d977e52c9cd46 GIT binary patch literal 10746 zcmeI034B!56^GBuJTifVxrr$5W(>=)$%I8fMDkS14#ushRRoEMHNdE#s8k;q6fNqw z6%j2^i;9Z-TDP=r)TN@ewptZy>xPPmXf4vF-+41PybKxbk5aA6g)is6bI(2Ry!+Pq zJ0+1~M+%$`oka>n#Dz}q=(Zv)usqY57W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TTn9Dd8feFx0}V7`&I;-?^xF$r8{%mVZqCllwOc_$Bpq{VS?}H`;lh;$M_cOnT`F zts_$5lTp4VycIn`ycPUtp;kLbJRz^Gv1lDFbw+b)n<#zbIjMHGC8ISDMPEbDHmRV0 zIxztm8kP|dI$)WB=vSa*29ON_qz6QxV-LuF$CfXL^>XkC*+g@m1e(ZU6iGx?lfW_p3jX|II${;B}(Yub+23i>tpk{mJL^-)%p- zmL8btp6TYlwbbfmtlk%{WA(B6WPJ+P9dhO4YkfVAe>d{Se3{0-UG`(X@ZVMYDO~;! DXA6}m literal 0 HcmV?d00001 diff --git a/ril/telephony/java/com/android/internal/telephony/SamsungMSM8226RIL.java b/ril/telephony/java/com/android/internal/telephony/SamsungMSM8226RIL.java deleted file mode 100644 index add90b9..0000000 --- a/ril/telephony/java/com/android/internal/telephony/SamsungMSM8226RIL.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (c) 2014, The CyanogenMod Project. All rights reserved. - * - * 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 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.internal.telephony; - -import static com.android.internal.telephony.RILConstants.*; - -import android.content.Context; -import android.telephony.Rlog; -import android.os.AsyncResult; -import android.os.Message; -import android.os.Parcel; -import android.os.SystemProperties; -import android.telephony.PhoneNumberUtils; -import android.telephony.SignalStrength; -import com.android.internal.telephony.uicc.IccCardApplicationStatus; -import com.android.internal.telephony.uicc.IccCardStatus; -import java.util.ArrayList; -import java.util.Collections; - -/** - * Qualcomm RIL for Samsung MSM8226 Single-sim devices - * {@hide} - */ -public class SamsungMSM8226RIL extends RIL { - - private static final int RIL_REQUEST_DIAL_EMERGENCY = 10001; - private static final int RIL_UNSOL_ON_SS_LL = 11055; - - public SamsungMSM8226RIL(Context context, int preferredNetworkType, int cdmaSubscription) { - super(context, preferredNetworkType, cdmaSubscription, null); - mQANElements = 6; - } - - public SamsungMSM8226RIL(Context context, int preferredNetworkType, - int cdmaSubscription, Integer instanceId) { - super(context, preferredNetworkType, cdmaSubscription, instanceId); - mQANElements = 6; - } - - @Override - public void - dial(String address, int clirMode, UUSInfo uusInfo, Message result) { - if (PhoneNumberUtils.isEmergencyNumber(address)) { - dialEmergencyCall(address, clirMode, result); - return; - } - - RILRequest rr = RILRequest.obtain(RIL_REQUEST_DIAL, result); - - rr.mParcel.writeString(address); - rr.mParcel.writeInt(clirMode); - rr.mParcel.writeInt(0); // CallDetails.call_type - rr.mParcel.writeInt(1); // CallDetails.call_domain - rr.mParcel.writeString(""); // CallDetails.getCsvFromExtras - - if (uusInfo == null) { - rr.mParcel.writeInt(0); // UUS information is absent - } else { - rr.mParcel.writeInt(1); // UUS information is present - rr.mParcel.writeInt(uusInfo.getType()); - rr.mParcel.writeInt(uusInfo.getDcs()); - rr.mParcel.writeByteArray(uusInfo.getUserData()); - } - - if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); - - send(rr); - } - - @Override - protected Object - responseIccCardStatus(Parcel p) { - IccCardApplicationStatus appStatus; - - IccCardStatus cardStatus = new IccCardStatus(); - cardStatus.setCardState(p.readInt()); - cardStatus.setUniversalPinState(p.readInt()); - cardStatus.mGsmUmtsSubscriptionAppIndex = p.readInt(); - cardStatus.mCdmaSubscriptionAppIndex = p.readInt(); - cardStatus.mImsSubscriptionAppIndex = p.readInt(); - - int numApplications = p.readInt(); - - // limit to maximum allowed applications - if (numApplications > IccCardStatus.CARD_MAX_APPS) { - numApplications = IccCardStatus.CARD_MAX_APPS; - } - cardStatus.mApplications = new IccCardApplicationStatus[numApplications]; - - for (int i = 0 ; i < numApplications ; i++) { - appStatus = new IccCardApplicationStatus(); - appStatus.app_type = appStatus.AppTypeFromRILInt(p.readInt()); - appStatus.app_state = appStatus.AppStateFromRILInt(p.readInt()); - appStatus.perso_substate = appStatus.PersoSubstateFromRILInt(p.readInt()); - appStatus.aid = p.readString(); - appStatus.app_label = p.readString(); - appStatus.pin1_replaced = p.readInt(); - appStatus.pin1 = appStatus.PinStateFromRILInt(p.readInt()); - appStatus.pin2 = appStatus.PinStateFromRILInt(p.readInt()); - p.readInt(); // pin1_num_retries - p.readInt(); // puk1_num_retries - p.readInt(); // pin2_num_retries - p.readInt(); // puk2_num_retries - p.readInt(); // perso_unblock_retries - - cardStatus.mApplications[i] = appStatus; - } - return cardStatus; - } - - @Override - protected Object - responseCallList(Parcel p) { - int num; - int voiceSettings; - ArrayList response; - DriverCall dc; - - num = p.readInt(); - response = new ArrayList(num); - - if (RILJ_LOGV) { - riljLog("responseCallList: num=" + num + - " mEmergencyCallbackModeRegistrant=" + mEmergencyCallbackModeRegistrant + - " mTestingEmergencyCall=" + mTestingEmergencyCall.get()); - } - for (int i = 0 ; i < num ; i++) { - dc = new DriverCall(); - - dc.state = DriverCall.stateFromCLCC(p.readInt()); - dc.index = p.readInt() & 0xff; - dc.TOA = p.readInt(); - dc.isMpty = (0 != p.readInt()); - dc.isMT = (0 != p.readInt()); - dc.als = p.readInt(); - voiceSettings = p.readInt(); - dc.isVoice = (0 == voiceSettings) ? false : true; - boolean isVideo; - int call_type = p.readInt(); // Samsung CallDetails - int call_domain = p.readInt(); // Samsung CallDetails - String csv = p.readString(); // Samsung CallDetails - dc.isVoicePrivacy = (0 != p.readInt()); - dc.number = p.readString(); - int np = p.readInt(); - dc.numberPresentation = DriverCall.presentationFromCLIP(np); - dc.name = p.readString(); - dc.namePresentation = DriverCall.presentationFromCLIP(p.readInt()); - int uusInfoPresent = p.readInt(); - if (uusInfoPresent == 1) { - dc.uusInfo = new UUSInfo(); - dc.uusInfo.setType(p.readInt()); - dc.uusInfo.setDcs(p.readInt()); - byte[] userData = p.createByteArray(); - dc.uusInfo.setUserData(userData); - riljLogv(String.format("Incoming UUS : type=%d, dcs=%d, length=%d", - dc.uusInfo.getType(), dc.uusInfo.getDcs(), - dc.uusInfo.getUserData().length)); - riljLogv("Incoming UUS : data (string)=" - + new String(dc.uusInfo.getUserData())); - riljLogv("Incoming UUS : data (hex): " - + IccUtils.bytesToHexString(dc.uusInfo.getUserData())); - } else { - riljLogv("Incoming UUS : NOT present!"); - } - - // Make sure there's a leading + on addresses with a TOA of 145 - dc.number = PhoneNumberUtils.stringFromStringAndTOA(dc.number, dc.TOA); - - response.add(dc); - - if (dc.isVoicePrivacy) { - mVoicePrivacyOnRegistrants.notifyRegistrants(); - riljLog("InCall VoicePrivacy is enabled"); - } else { - mVoicePrivacyOffRegistrants.notifyRegistrants(); - riljLog("InCall VoicePrivacy is disabled"); - } - } - - Collections.sort(response); - - if ((num == 0) && mTestingEmergencyCall.getAndSet(false)) { - if (mEmergencyCallbackModeRegistrant != null) { - riljLog("responseCallList: call ended, testing emergency call," + - " notify ECM Registrants"); - mEmergencyCallbackModeRegistrant.notifyRegistrant(); - } - } - - return response; - } - - @Override - protected Object - responseSignalStrength(Parcel p) { - int gsmSignalStrength = p.readInt() & 0xff; - int gsmBitErrorRate = p.readInt(); - int cdmaDbm = p.readInt(); - int cdmaEcio = p.readInt(); - int evdoDbm = p.readInt(); - int evdoEcio = p.readInt(); - int evdoSnr = p.readInt(); - int lteSignalStrength = p.readInt(); - int lteRsrp = p.readInt(); - int lteRsrq = p.readInt(); - int lteRssnr = p.readInt(); - int lteCqi = p.readInt(); - int tdScdmaRscp = p.readInt(); - // constructor sets default true, makeSignalStrengthFromRilParcel does not set it - boolean isGsm = true; - - if ((lteSignalStrength & 0xff) == 255 || lteSignalStrength == 99) { - lteSignalStrength = 99; - lteRsrp = SignalStrength.INVALID; - lteRsrq = SignalStrength.INVALID; - lteRssnr = SignalStrength.INVALID; - lteCqi = SignalStrength.INVALID; - } else { - lteSignalStrength &= 0xff; - } - - if (RILJ_LOGD) - riljLog("gsmSignalStrength:" + gsmSignalStrength + " gsmBitErrorRate:" + gsmBitErrorRate + - " cdmaDbm:" + cdmaDbm + " cdmaEcio:" + cdmaEcio + " evdoDbm:" + evdoDbm + - " evdoEcio: " + evdoEcio + " evdoSnr:" + evdoSnr + - " lteSignalStrength:" + lteSignalStrength + " lteRsrp:" + lteRsrp + - " lteRsrq:" + lteRsrq + " lteRssnr:" + lteRssnr + " lteCqi:" + lteCqi + - " tdScdmaRscp:" + tdScdmaRscp + " isGsm:" + (isGsm ? "true" : "false")); - - return new SignalStrength(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio, evdoDbm, - evdoEcio, evdoSnr, lteSignalStrength, lteRsrp, lteRsrq, lteRssnr, lteCqi, - tdScdmaRscp, isGsm); - } - - @Override - protected void - processUnsolicited (Parcel p) { - Object ret; - int dataPosition = p.dataPosition(); - int response = p.readInt(); - int newResponse = response; - - switch(response) { - case RIL_UNSOL_ON_SS_LL: - newResponse = RIL_UNSOL_ON_SS; - break; - } - if (newResponse != response) { - p.setDataPosition(dataPosition); - p.writeInt(newResponse); - } - p.setDataPosition(dataPosition); - super.processUnsolicited(p); - } - - @Override - public void - acceptCall (Message result) { - RILRequest rr - = RILRequest.obtain(RIL_REQUEST_ANSWER, result); - - rr.mParcel.writeInt(1); - rr.mParcel.writeInt(0); - - if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); - - send(rr); - } - - - private void - dialEmergencyCall(String address, int clirMode, Message result) { - RILRequest rr; - - rr = RILRequest.obtain(RIL_REQUEST_DIAL_EMERGENCY, result); - rr.mParcel.writeString(address); - rr.mParcel.writeInt(clirMode); - rr.mParcel.writeInt(0); // CallDetails.call_type - rr.mParcel.writeInt(3); // CallDetails.call_domain - rr.mParcel.writeString(""); // CallDetails.getCsvFromExtra - rr.mParcel.writeInt(0); // Unknown - - if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); - - send(rr); - } - - @Override - protected RILRequest - processSolicited (Parcel p) { - int serial, error; - boolean found = false; - int dataPosition = p.dataPosition(); // save off position within the Parcel - serial = p.readInt(); - error = p.readInt(); - RILRequest rr = null; - /* Pre-process the reply before popping it */ - synchronized (mRequestList) { - RILRequest tr = mRequestList.get(serial); - if (tr != null && tr.mSerial == serial) { - if (error == 0 || p.dataAvail() > 0) { - try {switch (tr.mRequest) { - /* Get those we're interested in */ - case RIL_REQUEST_DATA_REGISTRATION_STATE: - rr = tr; - break; - }} catch (Throwable thr) { - // Exceptions here usually mean invalid RIL responses - if (tr.mResult != null) { - AsyncResult.forMessage(tr.mResult, null, thr); - tr.mResult.sendToTarget(); - } - return tr; - } - } - } - } - if (rr == null) { - /* Nothing we care about, go up */ - p.setDataPosition(dataPosition); - // Forward responses that we are not overriding to the super class - return super.processSolicited(p); - } - rr = findAndRemoveRequestFromList(serial); - if (rr == null) { - return rr; - } - Object ret = null; - if (error == 0 || p.dataAvail() > 0) { - switch (rr.mRequest) { - case RIL_REQUEST_DATA_REGISTRATION_STATE: ret = responseDataRegistrationState(p); break; - default: - throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest); - } - //break; - } - if (RILJ_LOGD) riljLog(rr.serialString() + "< " + requestToString(rr.mRequest) - + " " + retToString(rr.mRequest, ret)); - if (rr.mResult != null) { - AsyncResult.forMessage(rr.mResult, ret, null); - rr.mResult.sendToTarget(); - } - return rr; - } - - private Object - responseDataRegistrationState(Parcel p) { - String response[] = (String[])responseStrings(p); - /* DANGER WILL ROBINSON - * In some cases from Vodaphone we are receiving a RAT of 102 - * while in tunnels of the metro. Lets Assume that if we - * receive 102 we actually want a RAT of 2 for EDGE service */ - if (response.length > 4 && - response[0].equals("1") && - response[3].equals("102")) { - response[3] = "2"; - } - return response; - } -} diff --git a/rootdir/Android.mk b/rootdir/Android.mk index bbc0d23..c5450e9 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -1,36 +1,12 @@ LOCAL_PATH:= $(call my-dir) - -# Configuration scripts - include $(CLEAR_VARS) -LOCAL_MODULE := init.qcom.bt.sh -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := etc/init.qcom.bt.sh -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := init.ril.sh -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := etc/init.ril.sh -include $(BUILD_PREBUILT) - -# Init scripts +# Init include $(CLEAR_VARS) LOCAL_MODULE := init.qcom.rc LOCAL_MODULE_TAGS := optional eng LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.qcom.rc -LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) -LOCAL_MODULE := init.qcom.power.rc -LOCAL_MODULE_TAGS := optional eng -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.qcom.power.rc +LOCAL_SRC_FILES := etc/init.qcom.rc LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) include $(BUILD_PREBUILT) @@ -38,7 +14,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := init.qcom.usb.rc LOCAL_MODULE_TAGS := optional eng LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.qcom.usb.rc +LOCAL_SRC_FILES := etc/init.qcom.usb.rc LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) include $(BUILD_PREBUILT) @@ -47,7 +23,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := init.recovery.qcom.rc LOCAL_MODULE_TAGS := optional eng LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := init.qcom.power.rc +LOCAL_SRC_FILES := etc/init.qcom.power.rc LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) include $(BUILD_PREBUILT) @@ -55,6 +31,29 @@ include $(CLEAR_VARS) LOCAL_MODULE := ueventd.qcom.rc LOCAL_MODULE_TAGS := optional eng LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := ueventd.qcom.rc +LOCAL_SRC_FILES := etc/ueventd.qcom.rc LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.qcom.power.rc +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/init.qcom.power.rc +LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) +include $(BUILD_PREBUILT) + +# Configuration scripts +include $(CLEAR_VARS) +LOCAL_MODULE := init.qcom.bt.sh +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/scripts/init.qcom.bt.sh +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) +LOCAL_MODULE := init.ril.sh +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := etc/scripts/init.ril.sh +include $(BUILD_PREBUILT) diff --git a/rootdir/init.qcom.power.rc b/rootdir/etc/init.qcom.power.rc similarity index 86% rename from rootdir/init.qcom.power.rc rename to rootdir/etc/init.qcom.power.rc index 1789fc6..1638564 100644 --- a/rootdir/init.qcom.power.rc +++ b/rootdir/etc/init.qcom.power.rc @@ -25,37 +25,6 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -on charger - write /sys/module/lpm_levels/enable_low_power/l2 4 - write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1 - write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1 - write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1 - write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1 - write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1 - write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled 1 - write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled 1 - write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled 1 - write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1 - write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled 1 - write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled 1 - write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled 1 - write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 1 - - write /sys/module/msm_thermal/core_control/enabled 0 - - write /sys/devices/system/cpu/cpu1/online 1 - write /sys/devices/system/cpu/cpu2/online 1 - write /sys/devices/system/cpu/cpu3/online 1 - - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 300000 - - write /sys/module/msm_thermal/core_control/enabled 1 - - write /sys/devices/system/cpu/cpu1/online 0 - write /sys/devices/system/cpu/cpu2/online 0 - write /sys/devices/system/cpu/cpu3/online 0 - on init # HMP scheduler settings @@ -117,8 +86,46 @@ on init write /dev/cpuset/top-app/cpus 0-3 write /dev/cpuset/camera-daemon/cpus 0-3 +on charger + mount_all fstab.qcom + class_start charger + write /sys/module/lpm_levels/parameters/sleep_disabled 0 + write /sys/module/lpm_levels/enable_low_power/l2 1 + write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled 1 + write /sys/module/msm_show_resume_irq/parameters/debug_mask 1 + write /sys/devices/system/cpu/cpu1/online 0 + write /sys/devices/system/cpu/cpu2/online 0 + write /sys/devices/system/cpu/cpu3/online 0 + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive" + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 300000 + chown system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + chown system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + chown root system /sys/devices/system/cpu/cpu1/online + chown root system /sys/devices/system/cpu/cpu2/online + chown root system /sys/devices/system/cpu/cpu3/online + chmod 664 /sys/devices/system/cpu/cpu1/online + chmod 664 /sys/devices/system/cpu/cpu2/online + chmod 664 /sys/devices/system/cpu/cpu3/online + write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1 + write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 1 + write /sys/module/lpm_levels/enable_low_power/l2 3 + write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 0 + write /sys/devices/system/cpu/cpu1/online 1 + write /sys/devices/system/cpu/cpu2/online 1 + write /sys/devices/system/cpu/cpu3/online 1 + on class_start:late_start trigger enable-low-power on property:init.svc.recovery=running trigger enable-low-power + +on property:dev.bootcomplete=1 + setprop sys.io.scheduler "bfq" diff --git a/rootdir/init.qcom.rc b/rootdir/etc/init.qcom.rc similarity index 97% rename from rootdir/init.qcom.rc rename to rootdir/etc/init.qcom.rc index 764e26d..d5f0054 100644 --- a/rootdir/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -42,9 +42,9 @@ on early-init mkdir /efs 0771 system radio symlink /data/tombstones /tombstones - + # Set permissions so radio can read - chmod 0444 /proc/cmdline + chmod 0444 /proc/cmdline on init @@ -85,19 +85,7 @@ on post-fs-data # Create the directories used by CnE subsystem mkdir /data/connectivity 0771 system system chown system system /data/connectivity - - mkdir /data/misc/bluetooth 0770 bluetooth bluetooth - # Create the directories used by the Wireless subsystem - mkdir /data/misc/wifi 0770 wifi wifi - chmod 0660 /data/misc/wifi/wpa_supplicant.conf - mkdir /data/misc/wifi/sockets 0770 wifi wifi - mkdir /data/vendor/wifi 0770 wifi wifi - mkdir /data/vendor/wifi/wpa 0770 wifi wifi - mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi - mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi - mkdir /data/misc/dhcp 0775 dhcp dhcp - # For WIFI TRP/TIS chown system root /data/.psm.info chmod 0664 /data/.psm.info @@ -238,12 +226,12 @@ on post-fs-data rmdir /data/user_de/0/com.android.providers.telephony/shared_prefs setprop vold.post_fs_data_done 1 - + # Create perfd deamon related dirs mkdir /data/misc/perfd 0755 root system chmod 2755 /data/misc/perfd mkdir /data/system/perfd 0770 root system - chmod 2770 /data/system/perfd + chmod 2770 /data/system/perfd on early-boot # Set RLIMIT_MEMLOCK to 64MB @@ -599,9 +587,8 @@ service adsprpcd /vendor/bin/adsprpcd user media group media -service charger /sbin/healthd -c +service charger /charger class charger - critical seclabel u:r:charger:s0 service ds_fmc_appd /vendor/bin/ds_fmc_appd -p "rmnet0" -D @@ -636,6 +623,7 @@ service mpdecision /vendor/bin/mpdecision --avg_comp class main user root group root readproc + disabled service qcamerasvr /vendor/bin/mm-qcamera-daemon class main @@ -695,11 +683,11 @@ service wcnss-service /system/bin/wcnss_service # WPA service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \ - -I/vendor/etc/wifi/p2p_supplicant_overlay.conf -N \ + -I/system/etc/wifi/p2p_supplicant_overlay.conf -N \ -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ - -I/vendor/etc/wifi/wpa_supplicant_overlay.conf \ - -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 \ - -g@android:wpa_wlan0 + -I/system/etc/wifi/wpa_supplicant_overlay.conf \ + -puse_p2p_group_interface=1 \ + -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 # we will start as root and wpa_supplicant will switch to user wifi # after setting up the capabilities required for WEXT # user wifi diff --git a/rootdir/init.qcom.usb.rc b/rootdir/etc/init.qcom.usb.rc similarity index 100% rename from rootdir/init.qcom.usb.rc rename to rootdir/etc/init.qcom.usb.rc diff --git a/rootdir/etc/init.qcom.bt.sh b/rootdir/etc/scripts/init.qcom.bt.sh similarity index 100% rename from rootdir/etc/init.qcom.bt.sh rename to rootdir/etc/scripts/init.qcom.bt.sh diff --git a/rootdir/etc/init.ril.sh b/rootdir/etc/scripts/init.ril.sh similarity index 100% rename from rootdir/etc/init.ril.sh rename to rootdir/etc/scripts/init.ril.sh diff --git a/rootdir/ueventd.qcom.rc b/rootdir/etc/ueventd.qcom.rc similarity index 98% rename from rootdir/ueventd.qcom.rc rename to rootdir/etc/ueventd.qcom.rc index 144a322..bc97f42 100644 --- a/rootdir/ueventd.qcom.rc +++ b/rootdir/etc/ueventd.qcom.rc @@ -25,8 +25,8 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# the DIAG device node is not world writable/readable. -/dev/diag 0660 system oem_2950 +# the DIAG device node HAS TO BE world writable/readable, otherwise libdiag cant open the socket :/ +/dev/diag 0777 system oem_2950 /dev/genlock 0666 system system /dev/kgsl 0666 system system diff --git a/sensors/SensorEventQueue.cpp b/sensors/SensorEventQueue.cpp index 0d4d64a..dff7ac9 100644 --- a/sensors/SensorEventQueue.cpp +++ b/sensors/SensorEventQueue.cpp @@ -14,13 +14,11 @@ * limitations under the License. */ -#include - +#include #include - +#include #include -#include #include "SensorEventQueue.h" SensorEventQueue::SensorEventQueue(int capacity) { diff --git a/sensors/multihal.cpp b/sensors/multihal.cpp index 7acf23a..40c9e03 100644 --- a/sensors/multihal.cpp +++ b/sensors/multihal.cpp @@ -18,7 +18,7 @@ #include "multihal.h" #define LOG_NDEBUG 1 -#include +#include #include #include @@ -49,11 +49,10 @@ static pthread_mutex_t queue_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t data_available_cond = PTHREAD_COND_INITIALIZER; bool waiting_for_data = false; -// Vector of sub modules, whose indexes are referred to in this file as module_index. -static std::vector *sub_hw_modules = nullptr; - -// Vector of sub modules shared object handles -static std::vector *so_handles = nullptr; +/* + * Vector of sub modules, whose indexes are referred to in this file as module_index. + */ +static std::vector *sub_hw_modules = NULL; /* * Comparable class that globally identifies a sensor, by module index and local handle. @@ -197,12 +196,7 @@ struct sensors_poll_context_t { int poll(sensors_event_t* data, int count); int batch(int handle, int flags, int64_t period_ns, int64_t timeout); int flush(int handle); - int inject_sensor_data(const sensors_event_t *data); - int register_direct_channel(const struct sensors_direct_mem_t* mem, - int channel_handle); - int config_direct_report(int sensor_handle, - int channel_handle, - const struct sensors_direct_cfg_t *config); + int inject_sensor_data(struct sensors_poll_device_1 *dev, const sensors_event_t *data); int close(); std::vector sub_hw_devices; @@ -212,7 +206,6 @@ struct sensors_poll_context_t { sensors_poll_device_t* get_v0_device_by_handle(int global_handle); sensors_poll_device_1_t* get_v1_device_by_handle(int global_handle); - sensors_poll_device_1_t* get_primary_v1_device(); int get_device_version_by_handle(int global_handle); void copy_event_remap_handle(sensors_event_t* src, sensors_event_t* dest, int sub_index); @@ -252,14 +245,6 @@ sensors_poll_device_1_t* sensors_poll_context_t::get_v1_device_by_handle(int glo return (sensors_poll_device_1_t*) this->sub_hw_devices[sub_index]; } -// Returns the device pointer, or NULL if primary hal does not exist -sensors_poll_device_1_t* sensors_poll_context_t::get_primary_v1_device() { - if (sub_hw_devices.size() < 1) { - return nullptr; - } - return (sensors_poll_device_1_t*) this->sub_hw_devices[0]; -} - // Returns the device version, or -1 if the handle is invalid. int sensors_poll_context_t::get_device_version_by_handle(int handle) { sensors_poll_device_t* v0 = this->get_v0_device_by_handle(handle); @@ -270,26 +255,6 @@ int sensors_poll_context_t::get_device_version_by_handle(int handle) { } } -// Android N and hire require sensor HALs to be at least 1_3 compliant -#define HAL_VERSION_IS_COMPLIANT(version) \ - (version >= SENSORS_DEVICE_API_VERSION_1_3) - -// Returns true if HAL is compliant, false if HAL is not compliant or if handle is invalid -static bool halIsCompliant(sensors_poll_context_t *ctx, int handle) { - int version = ctx->get_device_version_by_handle(handle); - return version != -1 && HAL_VERSION_IS_COMPLIANT(version); -} - -static bool halIsAPILevelCompliant(sensors_poll_context_t *ctx, int handle, int level) { - int version = ctx->get_device_version_by_handle(handle); - return version != -1 && (version >= level); -} - -static bool halSupportDirectSensorReport(sensors_poll_device_1_t* v1) { - return v1 != nullptr && HAL_VERSION_IS_COMPLIANT(v1->common.version) && - v1->register_direct_channel != nullptr && v1->config_direct_report != nullptr; -} - const char *apiNumToStr(int version) { switch(version) { case SENSORS_DEVICE_API_VERSION_1_0: @@ -312,12 +277,7 @@ int sensors_poll_context_t::activate(int handle, int enabled) { ALOGV("activate"); int local_handle = get_local_handle(handle); sensors_poll_device_t* v0 = this->get_v0_device_by_handle(handle); - if (halIsCompliant(this, handle) && local_handle >= 0 && v0) { - retval = v0->activate(v0, local_handle, enabled); - } else { - ALOGE("IGNORING activate(enable %d) call to non-API-compliant sensor handle=%d !", - enabled, handle); - } + retval = v0->activate(v0, local_handle, enabled); ALOGV("retval %d", retval); return retval; } @@ -327,11 +287,7 @@ int sensors_poll_context_t::setDelay(int handle, int64_t ns) { ALOGV("setDelay"); int local_handle = get_local_handle(handle); sensors_poll_device_t* v0 = this->get_v0_device_by_handle(handle); - if (halIsCompliant(this, handle) && local_handle >= 0 && v0) { - retval = v0->setDelay(v0, local_handle, ns); - } else { - ALOGE("IGNORING setDelay() call for non-API-compliant sensor handle=%d !", handle); - } + retval = v0->setDelay(v0, local_handle, ns); ALOGV("retval %d", retval); return retval; } @@ -375,7 +331,7 @@ int sensors_poll_context_t::poll(sensors_event_t *data, int maxReads) { } else { empties = 0; this->copy_event_remap_handle(&data[eventsRead], event, nextReadIndex); - if (data[eventsRead].sensor == SENSORS_HANDLE_BASE - 1) { + if (data[eventsRead].sensor == -1) { // Bad handle, do not pass corrupted event upstream ! ALOGW("Dropping bad local handle event packet on the floor"); } else { @@ -405,11 +361,7 @@ int sensors_poll_context_t::batch(int handle, int flags, int64_t period_ns, int6 int retval = -EINVAL; int local_handle = get_local_handle(handle); sensors_poll_device_1_t* v1 = this->get_v1_device_by_handle(handle); - if (halIsCompliant(this, handle) && local_handle >= 0 && v1) { - retval = v1->batch(v1, local_handle, flags, period_ns, timeout); - } else { - ALOGE("IGNORING batch() call to non-API-compliant sensor handle=%d !", handle); - } + retval = v1->batch(v1, local_handle, flags, period_ns, timeout); ALOGV("retval %d", retval); return retval; } @@ -419,84 +371,24 @@ int sensors_poll_context_t::flush(int handle) { int retval = -EINVAL; int local_handle = get_local_handle(handle); sensors_poll_device_1_t* v1 = this->get_v1_device_by_handle(handle); - if (halIsCompliant(this, handle) && local_handle >= 0 && v1) { - retval = v1->flush(v1, local_handle); - } else { - ALOGE("IGNORING flush() call to non-API-compliant sensor handle=%d !", handle); - } + retval = v1->flush(v1, local_handle); ALOGV("retval %d", retval); return retval; } -int sensors_poll_context_t::inject_sensor_data(const sensors_event_t *data) { +int sensors_poll_context_t::inject_sensor_data(struct sensors_poll_device_1 *dev, + const sensors_event_t *data) { int retval = -EINVAL; ALOGV("inject_sensor_data"); - if (data->sensor == -1) { - // operational parameter - sensors_poll_device_1_t* v1 = get_primary_v1_device(); - if (v1 && v1->common.version >= SENSORS_DEVICE_API_VERSION_1_4) { - retval = v1->inject_sensor_data(v1, data); - } else { - ALOGE("IGNORED inject_sensor_data(operational param) call to non-API-compliant sensor"); - return -ENOSYS; - } - } else { - // Get handle for the sensor owning the event being injected - int local_handle = get_local_handle(data->sensor); - sensors_poll_device_1_t* v1 = this->get_v1_device_by_handle(data->sensor); - if (halIsAPILevelCompliant(this, data->sensor, SENSORS_DEVICE_API_VERSION_1_4) && - local_handle >= 0 && v1) { - // if specific sensor is used, we have to replace global sensor handle - // with local one, before passing to concrete HAL - sensors_event_t data_copy = *data; - data_copy.sensor = local_handle; - retval = v1->inject_sensor_data(v1, &data_copy); - } else { - ALOGE("IGNORED inject_sensor_data(type=%d, handle=%d) call to non-API-compliant sensor", - data->type, data->sensor); - retval = -ENOSYS; - } - } + // Get handle for the sensor owning the event being injected + int local_handle = get_local_handle(data->sensor); + sensors_poll_device_1_t* v1 = this->get_v1_device_by_handle(data->sensor); + retval = v1->inject_sensor_data(dev, data); ALOGV("retval %d", retval); return retval; + } -int sensors_poll_context_t::register_direct_channel(const struct sensors_direct_mem_t* mem, - int channel_handle) { - int retval = -EINVAL; - ALOGV("register_direct_channel"); - sensors_poll_device_1_t* v1 = get_primary_v1_device(); - if (v1 && halSupportDirectSensorReport(v1)) { - retval = v1->register_direct_channel(v1, mem, channel_handle); - } else { - ALOGE("IGNORED register_direct_channel(mem=%p, handle=%d) call to non-API-compliant sensor", - mem, channel_handle); - retval = -ENOSYS; - } - ALOGV("retval %d", retval); - return retval; -} - -int sensors_poll_context_t::config_direct_report(int sensor_handle, - int channel_handle, - const struct sensors_direct_cfg_t *config) { - int retval = -EINVAL; - ALOGV("config_direct_report"); - - if (config != nullptr) { - int local_handle = get_local_handle(sensor_handle); - sensors_poll_device_1_t* v1 = get_primary_v1_device(); - if (v1 && halSupportDirectSensorReport(v1)) { - retval = v1->config_direct_report(v1, local_handle, channel_handle, config); - } else { - ALOGE("IGNORED config_direct_report(sensor=%d, channel=%d, rate_level=%d) call to " - "non-API-compliant sensor", sensor_handle, channel_handle, config->rate_level); - retval = -ENOSYS; - } - } - ALOGV("retval %d", retval); - return retval; -} int sensors_poll_context_t::close() { ALOGV("close"); for (std::vector::iterator it = this->sub_hw_devices.begin(); @@ -510,26 +402,11 @@ int sensors_poll_context_t::close() { static int device__close(struct hw_device_t *dev) { - pthread_mutex_lock(&init_modules_mutex); sensors_poll_context_t* ctx = (sensors_poll_context_t*) dev; if (ctx != NULL) { int retval = ctx->close(); delete ctx; } - - if (sub_hw_modules != nullptr) { - delete sub_hw_modules; - sub_hw_modules = nullptr; - } - - if (so_handles != nullptr) { - for (auto handle : *so_handles) { - dlclose(handle); - } - delete so_handles; - so_handles = nullptr; - } - pthread_mutex_unlock(&init_modules_mutex); return 0; } @@ -554,7 +431,9 @@ static int device__poll(struct sensors_poll_device_t *dev, sensors_event_t* data static int device__batch(struct sensors_poll_device_1 *dev, int handle, int flags, int64_t period_ns, int64_t timeout) { sensors_poll_context_t* ctx = (sensors_poll_context_t*) dev; + ctx->setDelay(handle, period_ns); + return 0; } @@ -565,22 +444,7 @@ static int device__flush(struct sensors_poll_device_1 *dev, int handle) { static int device__inject_sensor_data(struct sensors_poll_device_1 *dev, const sensors_event_t *data) { sensors_poll_context_t* ctx = (sensors_poll_context_t*) dev; - return ctx->inject_sensor_data(data); -} - -static int device__register_direct_channel(struct sensors_poll_device_1 *dev, - const struct sensors_direct_mem_t* mem, - int channel_handle) { - sensors_poll_context_t* ctx = (sensors_poll_context_t*) dev; - return ctx->register_direct_channel(mem, channel_handle); -} - -static int device__config_direct_report(struct sensors_poll_device_1 *dev, - int sensor_handle, - int channel_handle, - const struct sensors_direct_cfg_t *config) { - sensors_poll_context_t* ctx = (sensors_poll_context_t*) dev; - return ctx->config_direct_report(sensor_handle, channel_handle, config); + return ctx->inject_sensor_data(dev, data); } static int open_sensors(const struct hw_module_t* module, const char* name, @@ -599,9 +463,7 @@ static bool starts_with(const char* s, const char* prefix) { * Adds valid paths from the config file to the vector passed in. * The vector must not be null. */ -static std::vector get_so_paths() { - std::vector so_paths; - +static void get_so_paths(std::vector *so_paths) { const std::vector config_path_list( { MULTI_HAL_CONFIG_FILE_PATH, DEPRECATED_MULTI_HAL_CONFIG_FILE_PATH }); @@ -617,7 +479,7 @@ static std::vector get_so_paths() { } if(!stream) { ALOGW("No multihal config file found"); - return so_paths; + return; } ALOGE_IF(strcmp(path, DEPRECATED_MULTI_HAL_CONFIG_FILE_PATH) == 0, @@ -629,9 +491,8 @@ static std::vector get_so_paths() { std::string line; while (std::getline(stream, line)) { ALOGV("config file line: '%s'", line.c_str()); - so_paths.push_back(line); + so_paths->push_back(line); } - return so_paths; } /* @@ -644,15 +505,15 @@ static void lazy_init_modules() { pthread_mutex_unlock(&init_modules_mutex); return; } - std::vector so_paths(get_so_paths()); + std::vector *so_paths = new std::vector(); + get_so_paths(so_paths); // dlopen the module files and cache their module symbols in sub_hw_modules sub_hw_modules = new std::vector(); - so_handles = new std::vector(); dlerror(); // clear any old errors const char* sym = HAL_MODULE_INFO_SYM_AS_STR; - for (const auto &s : so_paths) { - const char* path = s.c_str(); + for (std::vector::iterator it = so_paths->begin(); it != so_paths->end(); it++) { + const char* path = it->c_str(); void* lib_handle = dlopen(path, RTLD_LAZY); if (lib_handle == NULL) { ALOGW("dlerror(): %s", dlerror()); @@ -670,13 +531,8 @@ static void lazy_init_modules() { } else { ALOGV("Loaded symbols from \"%s\"", sym); sub_hw_modules->push_back(module); - so_handles->push_back(lib_handle); - lib_handle = nullptr; } } - if (lib_handle != nullptr) { - dlclose(lib_handle); - } } pthread_mutex_unlock(&init_modules_mutex); } @@ -687,11 +543,27 @@ static void lazy_init_modules() { */ static void fix_sensor_fields(sensor_t& sensor) { /* - * Because batching and flushing don't work modify the + * Becasue batching and flushing don't work modify the * sensor fields to not report any fifo counts. */ sensor.fifoReservedEventCount = 0; sensor.fifoMaxEventCount = 0; + + switch (sensor.type) { + /* + * Use the flags suggested by the sensors documentation. + */ + case SENSOR_TYPE_TILT_DETECTOR: + sensor.flags = SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ON_CHANGE_MODE; + break; + /* + * Report a proper range to fix doze proximity check. + */ + case SENSOR_TYPE_PROXIMITY: + sensor.flags = SENSOR_FLAG_WAKE_UP | SENSOR_FLAG_ON_CHANGE_MODE; + sensor.maxRange = 5.0; + break; + } } /* @@ -746,12 +618,6 @@ static void lazy_init_sensors_list() { memcpy(&mutable_sensor_list[mutable_sensor_index], local_sensor, sizeof(struct sensor_t)); - // sensor direct report is only for primary module - if (module_index != 0) { - mutable_sensor_list[mutable_sensor_index].flags &= - ~(SENSOR_FLAG_MASK_DIRECT_REPORT | SENSOR_FLAG_MASK_DIRECT_CHANNEL); - } - // Overwrite the global version's handle with a global handle. int global_handle = assign_global_handle(module_index, local_handle); @@ -816,7 +682,7 @@ static int open_sensors(const struct hw_module_t* hw_module, const char* name, sensors_poll_context_t *dev = new sensors_poll_context_t(); memset(dev, 0, sizeof(sensors_poll_device_1_t)); dev->proxy_device.common.tag = HARDWARE_DEVICE_TAG; - dev->proxy_device.common.version = SENSORS_DEVICE_API_VERSION_1_4; + dev->proxy_device.common.version = SENSORS_DEVICE_API_VERSION_1_3; dev->proxy_device.common.module = const_cast(hw_module); dev->proxy_device.common.close = device__close; dev->proxy_device.activate = device__activate; @@ -825,8 +691,6 @@ static int open_sensors(const struct hw_module_t* hw_module, const char* name, dev->proxy_device.batch = device__batch; dev->proxy_device.flush = device__flush; dev->proxy_device.inject_sensor_data = device__inject_sensor_data; - dev->proxy_device.register_direct_channel = device__register_direct_channel; - dev->proxy_device.config_direct_report = device__config_direct_report; dev->nextReadIndex = 0; @@ -837,12 +701,6 @@ static int open_sensors(const struct hw_module_t* hw_module, const char* name, struct hw_device_t* sub_hw_device; int sub_open_result = sensors_module->common.methods->open(*it, name, &sub_hw_device); if (!sub_open_result) { - if (!HAL_VERSION_IS_COMPLIANT(sub_hw_device->version)) { - ALOGE("SENSORS_DEVICE_API_VERSION_1_3 or newer is required for all sensor HALs"); - ALOGE("This HAL reports non-compliant API level : %s", - apiNumToStr(sub_hw_device->version)); - ALOGE("Sensors belonging to this HAL will get ignored !"); - } dev->addSubHwDevice(sub_hw_device); } } diff --git a/sepolicy/common/macloader.te b/sepolicy/common/macloader.te new file mode 100644 index 0000000..52d47e1 --- /dev/null +++ b/sepolicy/common/macloader.te @@ -0,0 +1,12 @@ +type macloader, domain; +type macloader_exec, exec_type, file_type; +init_daemon_domain(macloader) + +type_transition macloader system_data_file:file wifi_data_file ".cid.info"; + +r_dir_file(macloader, wifi_efs_file) + +allow macloader efs_file:dir search; +allow macloader sysfs_wifi_writeable:file w_file_perms; +allow macloader system_data_file:dir w_dir_perms; +allow macloader wifi_data_file:file create_file_perms; diff --git a/setup-makefiles.sh b/setup-makefiles.sh index 97f63bb..db03c11 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -40,7 +40,7 @@ fi setup_vendor "$DEVICE_COMMON" "$VENDOR" "$CM_ROOT" true # Copyright headers -write_headers $BOARD TARGET_BOARD_BOARD +write_headers $BOARD TARGET_BOARD_PLATFORM write_makefiles "$MY_DIR"/common-proprietary-files.txt diff --git a/system.prop b/system.prop deleted file mode 100644 index aea0ade..0000000 --- a/system.prop +++ /dev/null @@ -1,2 +0,0 @@ -# Storage -ro.sys.sdcardfs=true