From 4e18dc435b633b7b6adceda10f84f29d081f0d6a Mon Sep 17 00:00:00 2001 From: Thierry Strudel Date: Thu, 2 Mar 2017 16:50:16 -0800 Subject: [PATCH] Import common file from device specific directory Test: boot, basic functionality Change-Id: I9c07718b481730c3388f99c5e1eff17c9fd75a7b Signed-off-by: Thierry Strudel --- Android.mk | 22 + BoardConfig.mk | 110 + WCNSS_qcom_cfg.ini | 594 +++++ android_filesystem_config.h | 40 + audio_platform_info.xml | 74 + audio_platform_info_tavil.xml | 65 + audio_policy_configuration.xml | 181 ++ bluetooth/bdroid_buildcfg.h | 34 + device.mk | 359 +++ dumpstate/Android.mk | 28 + dumpstate/dumpstate.cpp | 85 + fstab.hardware | 9 + init.hardware.diag.rc.user | 18 + init.hardware.diag.rc.userdebug | 324 +++ init.hardware.rc | 405 ++++ init.hardware.usb.rc | 111 + init.power.sh | 76 + init.radio.sh | 33 + init.recovery.hardware.rc | 3 + liblight/Android.mk | 29 + liblight/NOTICE | 190 ++ liblight/lights.c | 403 ++++ lowi.conf | 51 + manifest.xml | 30 + media_codecs.xml | 294 +++ media_profiles.xml | 554 +++++ mixer_paths.xml | 2058 +++++++++++++++++ mixer_paths_tasha.xml | 1762 ++++++++++++++ mixer_paths_tavil.xml | 1780 ++++++++++++++ .../base/core/res/res/values/config.xml | 54 + p2p_supplicant_overlay.conf | 1 + power/performance.h | 259 +++ sec_config | 323 +++ seccomp_policy/mediacodec.policy | 9 + sensors/hals.conf | 1 + sepolicy/adsprpcd.te | 8 + sepolicy/audioserver.te | 6 + sepolicy/bluetooth.te | 6 + sepolicy/bootanim.te | 1 + sepolicy/cameraserver.te | 6 + sepolicy/device.te | 17 + sepolicy/domain.te | 3 + sepolicy/file.te | 28 + sepolicy/file_contexts | 117 + sepolicy/gatekeeperd.te | 1 + sepolicy/hal_fingerprint.te | 4 + sepolicy/hal_gatekeeper.te | 1 + sepolicy/init.te | 10 + sepolicy/init_power.te | 18 + sepolicy/init_radio.te | 13 + sepolicy/ioctl_defines | 7 + sepolicy/ioctl_macros | 8 + sepolicy/irsc_util.te | 11 + sepolicy/kernel.te | 4 + sepolicy/location.te | 28 + sepolicy/netmgrd.te | 37 + sepolicy/pd_services.te | 8 + sepolicy/per_mgr.te | 27 + sepolicy/per_proxy.te | 11 + sepolicy/perfd.te | 8 + sepolicy/port-bridge.te | 10 + sepolicy/property.te | 5 + sepolicy/property_contexts | 5 + sepolicy/qti.te | 12 + sepolicy/ramdump.te | 7 + sepolicy/rfs_access.te | 16 + sepolicy/rild.te | 11 + sepolicy/rmt_storage.te | 24 + sepolicy/sensors.te | 13 + sepolicy/service.te | 1 + sepolicy/service_contexts | 1 + sepolicy/ssr_diag.te | 8 + sepolicy/ssr_setup.te | 8 + sepolicy/subsystem_ramdump.te | 8 + sepolicy/surfaceflinger.te | 1 + sepolicy/system_app.te | 6 + sepolicy/system_server.te | 5 + sepolicy/tee.te | 10 + sepolicy/thermal-engine.te | 19 + sepolicy/time_daemon.te | 17 + sepolicy/ueventd.te | 8 + sepolicy/wcnss_filter.te | 10 + sepolicy/wcnss_service.te | 13 + system.prop | 96 + ueventd.hardware.rc | 100 + utils.mk | 201 ++ wifi_concurrency_cfg.txt | 3 + wpa_supplicant_overlay.conf | 3 + wpa_supplicant_wcn.conf | 830 +++++++ 89 files changed, 12208 insertions(+) create mode 100644 Android.mk create mode 100644 BoardConfig.mk create mode 100644 WCNSS_qcom_cfg.ini create mode 100644 android_filesystem_config.h create mode 100644 audio_platform_info.xml create mode 100644 audio_platform_info_tavil.xml create mode 100644 audio_policy_configuration.xml create mode 100644 bluetooth/bdroid_buildcfg.h create mode 100644 device.mk create mode 100644 dumpstate/Android.mk create mode 100644 dumpstate/dumpstate.cpp create mode 100644 fstab.hardware create mode 100644 init.hardware.diag.rc.user create mode 100644 init.hardware.diag.rc.userdebug create mode 100644 init.hardware.rc create mode 100644 init.hardware.usb.rc create mode 100644 init.power.sh create mode 100644 init.radio.sh create mode 100644 init.recovery.hardware.rc create mode 100644 liblight/Android.mk create mode 100644 liblight/NOTICE create mode 100644 liblight/lights.c create mode 100644 lowi.conf create mode 100644 manifest.xml create mode 100644 media_codecs.xml create mode 100644 media_profiles.xml create mode 100644 mixer_paths.xml create mode 100644 mixer_paths_tasha.xml create mode 100644 mixer_paths_tavil.xml create mode 100755 overlay/frameworks/base/core/res/res/values/config.xml create mode 100644 p2p_supplicant_overlay.conf create mode 100755 power/performance.h create mode 100644 sec_config create mode 100644 seccomp_policy/mediacodec.policy create mode 100644 sensors/hals.conf create mode 100644 sepolicy/adsprpcd.te create mode 100644 sepolicy/audioserver.te create mode 100644 sepolicy/bluetooth.te create mode 100644 sepolicy/bootanim.te create mode 100644 sepolicy/cameraserver.te create mode 100644 sepolicy/device.te create mode 100644 sepolicy/domain.te create mode 100644 sepolicy/file.te create mode 100644 sepolicy/file_contexts create mode 100644 sepolicy/gatekeeperd.te create mode 100644 sepolicy/hal_fingerprint.te create mode 100644 sepolicy/hal_gatekeeper.te create mode 100644 sepolicy/init.te create mode 100644 sepolicy/init_power.te create mode 100644 sepolicy/init_radio.te create mode 100644 sepolicy/ioctl_defines create mode 100644 sepolicy/ioctl_macros create mode 100644 sepolicy/irsc_util.te create mode 100644 sepolicy/kernel.te create mode 100644 sepolicy/location.te create mode 100644 sepolicy/netmgrd.te create mode 100644 sepolicy/pd_services.te create mode 100644 sepolicy/per_mgr.te create mode 100644 sepolicy/per_proxy.te create mode 100644 sepolicy/perfd.te create mode 100644 sepolicy/port-bridge.te create mode 100644 sepolicy/property.te create mode 100644 sepolicy/property_contexts create mode 100644 sepolicy/qti.te create mode 100644 sepolicy/ramdump.te create mode 100644 sepolicy/rfs_access.te create mode 100644 sepolicy/rild.te create mode 100644 sepolicy/rmt_storage.te create mode 100644 sepolicy/sensors.te create mode 100644 sepolicy/service.te create mode 100644 sepolicy/service_contexts create mode 100644 sepolicy/ssr_diag.te create mode 100644 sepolicy/ssr_setup.te create mode 100644 sepolicy/subsystem_ramdump.te create mode 100644 sepolicy/surfaceflinger.te create mode 100644 sepolicy/system_app.te create mode 100644 sepolicy/system_server.te create mode 100644 sepolicy/tee.te create mode 100644 sepolicy/thermal-engine.te create mode 100644 sepolicy/time_daemon.te create mode 100644 sepolicy/ueventd.te create mode 100644 sepolicy/wcnss_filter.te create mode 100644 sepolicy/wcnss_service.te create mode 100644 system.prop create mode 100644 ueventd.hardware.rc create mode 100644 utils.mk create mode 100644 wifi_concurrency_cfg.txt create mode 100644 wpa_supplicant_overlay.conf create mode 100644 wpa_supplicant_wcn.conf diff --git a/Android.mk b/Android.mk new file mode 100644 index 00000000..9d0ff710 --- /dev/null +++ b/Android.mk @@ -0,0 +1,22 @@ +# +# Copyright 2017 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. +# + +LOCAL_PATH := $(call my-dir) + +ifeq ($(USES_DEVICE_GOOGLE_WAHOO),true) + subdir_makefiles=$(call first-makefiles-under,$(LOCAL_PATH)) + $(foreach mk,$(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk))) +endif diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 00000000..ac0db98a --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,110 @@ +# +# Copyright (C) 2016 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. +# + +TARGET_BOARD_PLATFORM := msm8998 + +TARGET_ARCH := arm64 +TARGET_ARCH_VARIANT := armv8-a +TARGET_CPU_ABI := arm64-v8a +TARGET_CPU_ABI2 := +TARGET_CPU_VARIANT := generic + +TARGET_2ND_ARCH := arm +TARGET_2ND_ARCH_VARIANT := armv7-a-neon +TARGET_2ND_CPU_ABI := armeabi-v7a +TARGET_2ND_CPU_ABI2 := armeabi +TARGET_2ND_CPU_VARIANT := cortex-a9 + +BOARD_KERNEL_CMDLINE += console=ttyMSM0,115200,n8 earlycon=msm_serial_dm,0xc1b0000 +BOARD_KERNEL_CMDLINE += androidboot.hardware=$(TARGET_BOOTLOADER_BOARD_NAME) androidboot.console=ttyMSM0 +BOARD_KERNEL_CMDLINE += user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 +BOARD_KERNEL_CMDLINE += lpm_levels.sleep_disabled=1 sched_enable_hmp=1 sched_enable_power_aware=1 +BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive service_locator.enable=1 +BOARD_KERNEL_CMDLINE += swiotlb=2048 +BOARD_KERNEL_CMDLINE += firmware_class.path=/vendor/etc/firmware +BOARD_KERNEL_CMDLINE += no_console_suspend=1 + +BOARD_KERNEL_BASE := 0x00000000 +BOARD_KERNEL_PAGESIZE := 4096 +BOARD_KERNEL_TAGS_OFFSET := 0x01E00000 +BOARD_RAMDISK_OFFSET := 0x02000000 + +TARGET_NO_BOOTLOADER := true +TARGET_NO_KERNEL := false +TARGET_NO_RECOVERY := true +TARGET_RECOVERY_FSTAB := device/google/wahoo/fstab.hardware +BOARD_USES_RECOVERY_AS_BOOT := true +BOARD_BUILD_SYSTEM_ROOT_IMAGE := true + +ENABLE_CPUSETS := true + +TARGET_COPY_OUT_VENDOR := vendor + +BOARD_HAL_STATIC_LIBRARIES := libdumpstate.$(TARGET_BOOTLOADER_BOARD_NAME) + +# Install odex files into the other system image +BOARD_USES_SYSTEM_OTHER_ODEX := true + +BOARD_ROOT_EXTRA_FOLDERS := persist firmware + +BOARD_SEPOLICY_DIRS += device/google/wahoo/sepolicy + +TARGET_ANDROID_FILESYSTEM_CONFIG_H := device/google/wahoo/android_filesystem_config.h + +QCOM_BOARD_PLATFORMS += msm8998 +BOARD_HAVE_BLUETOOTH_QCOM := true +BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/google/wahoo/bluetooth + +# Camera +TARGET_USES_AOSP := true +BOARD_QTI_CAMERA_32BIT_ONLY := true +CAMERA_DAEMON_NOT_PRESENT := true +TARGET_USES_ION := true +TARGET_USES_PAINTBOX := true + +# GPS +TARGET_NO_RPC := true +BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default +BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET := true + +# Sensors +USE_SENSOR_MULTI_HAL := true + +# wlan +BOARD_WLAN_DEVICE := qcwcn +BOARD_WPA_SUPPLICANT_DRIVER := NL80211 +BOARD_HOSTAPD_DRIVER := NL80211 +WIFI_DRIVER_DEFAULT := qca_cld3 +WPA_SUPPLICANT_VERSION := VER_0_8_X +WIFI_DRIVER_FW_PATH_STA := "sta" +WIFI_DRIVER_FW_PATH_AP := "ap" +WIFI_DRIVER_FW_PATH_P2P := "p2p" +BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) +BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE) + +# Audio +BOARD_USES_ALSA_AUDIO := true +USE_XML_AUDIO_POLICY_CONF := 1 +AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true +AUDIO_FEATURE_ENABLED_SND_MONITOR := true +AUDIO_FEATURE_ENABLED_USB_TUNNEL := true +BOARD_ROOT_EXTRA_SYMLINKS := /vendor/lib/dsp:/dsp + +# Include whaoo modules +USES_DEVICE_GOOGLE_WAHOO := true + +# Graphics +TARGET_USES_GRALLOC1 := true diff --git a/WCNSS_qcom_cfg.ini b/WCNSS_qcom_cfg.ini new file mode 100644 index 00000000..fa5a03ff --- /dev/null +++ b/WCNSS_qcom_cfg.ini @@ -0,0 +1,594 @@ +# This file allows user to override the factory +# defaults for the WLAN Driver + +############################################# +# STA related general configurations +############################################# +# Assigned MAC Addresses - This will be used until NV items are in place +# Each byte of MAC address is represented in Hex format as XX +Intf0MacAddress=000AF58989FF +Intf1MacAddress=000AF58989FE +Intf2MacAddress=000AF58989FD +Intf3MacAddress=000AF58989FC + +#Channel Bonding +gChannelBondingMode5GHz=1 +gChannelBondingMode24GHz=0 + +#Enable Keep alive with non-zero period value +gStaKeepAlivePeriod = 30 + +# Maximum MPDU length (VHT only. Valid values: 0->3895 octets, 1->7991 octets, 2->11454 octets) +gVhtMpduLen=2 + +# 0 for OLPC 1 for CLPC and SCPC +gEnableCloseLoop=1 + +ImplicitQosIsEnabled=0 + +# Enable Tx beamforming in VHT20MHz +# Valid values are 0,1. If commented out, the default value is 0. +# 0=disable, 1=enable +gEnableTxBFin20MHz=1 + +#Enable/Disable SU Tx beamformer support. +gEnableTxSUBeamformer=1 + +# 1=enable tx STBC; 0=disable +gEnableTXSTBC=1 + +# 1=enable STBC; 0=disable STBC +gEnableRXSTBC=1 + +# 1=enable rx LDPC; 0=disable +gEnableRXLDPC=1 + +# Flag to allow STA send AddTspec even when ACM is Off +gAddTSWhenACMIsOff=1 + +# RTS threshold +RTSThreshold=1048576 + +# 802.11d support +g11dSupportEnabled=0 + + +# Phy Mode (auto, b, g, n, etc) +# Valid values are 0-9, with 0 = Auto, 4 = 11n, 9 = 11ac +# 1 = 11abg, 2 = 11b, 3 = 11g, 5 = 11g only, 6 = 11n only +# 7 = 11b only 8 = 11ac only. +gDot11Mode=0 + +# Enable Rx handling options +# Rx_thread=1 RPS=2(default for ROME) NAPI=4(default for ihelium) +rx_mode=4 + +#Enable VHT on 2.4Ghz +gEnableVhtFor24GHzBand=1 + +# Regulatory Setting; 0=STRICT; 1=CUSTOM +gRegulatoryChangeCountry=1 + +# userspace country code setting shld take priority +gCountryCodePriority=1 + +# Enable/Disable LPASS support +# 0 to disable, 1 to enable +gEnableLpassSupport=1 + +# Enable(1)/Disable(0) SIFS burst +gEnableSifsBurst=1 + +# Tx Chain Mask for CCK +gCckChainMaskEnable=1 + +# Tx Chain Mask for 1SS +gTxChainMask1ss=0 + +# TPC power +gSelfGenFrmPwr=3 + +################ NAN feature set start ################### +# Enable or Disable NAN +# 1=Enable (default), 0=Disable +gEnableNanSupport=1 +################ NAN feature set end ##################### + +gIgnorePeerHTopMode=1 +gIgnorePeerErpInfo=1 + +# 802.11n Protection flag +gEnableApProt=1 + +# Fixed Rate +gFixedRate=0 + +# Intra-BSS forward +gDisableIntraBssFwd=0 + +# WMM Enable/Disable +WmmIsEnabled=0 + +# 802.11h support +g11hSupportEnabled=1 + +#Short Guard Interval Enable/disable +gShortGI20Mhz=1 +gShortGI40Mhz=1 + +#Auto Shutdown wlan : Value in Seconds. 0 means disabled. Max 1 day = 86400 sec +gWlanAutoShutdown=0 + +#Preferred band (both or 2.4 only or 5 only) +BandCapability=0 + +gVhtChannelWidth=2 + +# Enable Tx beamforming +gTxBFEnable=1 + +# Set txchainmask and rxchainmask +# These parameters are used only if gEnable2x2 is 0 +# Valid values are 1,2 +# Set gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0. +# Set gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1. +gSetTxChainmask1x1=1 +gSetRxChainmask1x1=1 + +#If set to 0, MCC is not allowed. +gEnableMCCMode=1 + +# MCC to SCC Switch mode: 0-Disable 1-Enable 2-Force SCC if same band +gWlanMccToSccSwitchMode = 0 + +# Maximum Receive AMPDU size (VHT only. Valid values: 0->8k 1->16k 2->32k 3->64k 4->128k) +gVhtAmpduLenExponent=7 + +# Maximum number of concurrent connections +gMaxConcurrentActiveSessions=3 + +# Radar PRI multiplier +gDFSradarMappingPriMultiplier=4 + +# Enable or Disable Multi-user MIMO +# 1=Enable (default), 0=Disable +gEnableMuBformee=1 + +# Enable to check FW hash if secure FW feature is enabled. It's for defconfig +# builds only since it will be ignored in performance/release builds. +gEnableFWHashCheck=1 + +# Enable or Disable MCC Adaptive Scheduler at the FW +# 1=Enable (default), 0=Disable +gEnableMCCAdaptiveScheduler=1 + +# Disable/Enable GreenAP +# 0 to disable, 1 to enable, default: 1 +gEnableGreenAp=0 + +################ Datapath feature set Begin ################ +# Bus bandwidth threshold values in terms of number of packets +gBusBandwidthHighThreshold=2000 +gBusBandwidthMediumThreshold=500 +gBusBandwidthLowThreshold=150 + +# Bus bandwidth compute timeout value in ms +gBusBandwidthComputeInterval=100 + +# VHT Tx/Rx MCS values +# Valid values are 0,1,2. If commented out, the default value is 0. +# 0=MCS0-7, 1=MCS0-8, 2=MCS0-9 +gVhtRxMCS=2 +gVhtTxMCS=2 + +# VHT Tx/Rx MCS values for 2x2 +# Valid values are 0,1,2. If commented out, the default value is 0. +# 0=MCS0-7, 1=MCS0-8, 2=MCS0-9 +gEnable2x2=1 +gVhtRxMCS2x2=2 +gVhtTxMCS2x2=2 + +#IPA config is a bit mask and following are the configurations. +#bit0 IPA Enable +#bit1 IPA PRE Filter enable +#bit2 IPv6 enable +#bit3 IPA Resource Manager (RM) enable +#bit4 IPA Clock scaling enable +#bit5 IPA uC ENABLE +#bit6 IPA uC STA ENABLE +#bit8 IPA Real Time Debugging +gIPAConfig=0x7d +gIPADescSize=800 + +# Enable/Disable RX full reorder offload +gReorderOffloadSupported=1 + +# Enable CE classification +# 1 - enable(default) 0 - disable +gCEClassifyEnable=1 + +# Enable(Tx) fastpath for data traffic. +# 1 - enable(default) 0 - disable +gEnableFastPath=1 + +# This flag enables IP, TCP and UDP checksum offload +# 1 - enable(default) 0 - disable +gEnableIpTcpUdpChecksumOffload=1 + +# Enable TCP Segmentation Offload +# 1 - enable 0 - disable +TSOEnable=1 + +# Enable Large Recieve Offload +# 1 - enable(default) 0 - disable +LROEnable=1 + +# Enable HT MPDU Density +# 4 for 2 micro sec +ght_mpdu_density=4 + +# Enable flow steering to enable multiple CEs for Rx flows. +# Multiple Rx CEs<==>Multiple Rx IRQs<==>probably different CPUs. +# Parallel Rx paths. +# 1 - enable 0 - disable(default) +gEnableFlowSteering=1 + +################ Datapath feature set End ################ + +############################################# +# SCAN related configurations +############################################# +# Enable/Disable Idle Scan +gEnableIdleScan=0 + +#Enable Scan Results Aging based on timer +#Timer value is in seconds +#If Set to 0 it will not enable the feature +gScanAgingTime=0 + +#Enable Scan Results Aging based on number of scans +gScanResultAgeCount=1 + +#Enable thermal mitigation +gThermalMitigationEnable=0 + +#List of Country codes for which 11ac needs to be disabled +#Each country code must be delimited by comma(,) +gListOfNon11acCountryCode=RU,UA,ZA + +#Maximum Channel time in msec +gMaxMediumTime=6000 + +# Scan Timing Parameters +# gPassiveMaxChannelTime=110 +# gPassiveMinChannelTime=60 +gActiveMaxChannelTime=40 +gActiveMinChannelTime=20 + +gPNOScanSupport=1 + +# Perform PNO fast scan this many number of times +gPNOScanTimerRepeatValue=6 + +# PNO slow scan period = gPNOSlowScanMultiplier times PNO fast scan period +# Example: fast scan period is passed from framework (default = 10 sec), then +# PNO slow scan period = 60 sec. +gPNOSlowScanMultiplier=6 + +# Enable or Disable Extended Scan (GScan) +# 1=Enable (default), 0=Disable +gExtScanEnable=1 + +#If set will start with active scan after driver load, otherwise will start with +#passive scan to find out the domain +gEnableBypass11d=1 + +#If set to 0, will not scan DFS channels +gEnableDFSChnlScan=1 + +#Maxium Channel time in msec +gMaxMediumTime = 6000 + +adaptive_dwell_mode_enabled=1 + +hostscan_adaptive_dwell_mode=1 + +adapt_dwell_lpf_weight=80 + +adapt_dwell_wifi_act_threshold=10 + + +############################################# +# Power related configurations +############################################# +# Enable IMPS or not +gEnableImps=1 + +# Enable BMPS or not +gEnableBmps=1 + +# Increase sleep duration (seconds) during IMPS +# 0 implies no periodic wake up from IMPS. Periodic wakeup is +# unnecessary if Idle Scan is disabled. +gImpsModSleepTime=0 + +# UAPSD service interval for VO,VI, BE, BK traffic +InfraUapsdVoSrvIntv=0 +InfraUapsdViSrvIntv=0 +InfraUapsdBeSrvIntv=0 +InfraUapsdBkSrvIntv=0 + +# Enable suspend or not +# 1: Enable standby, 2: Enable Deep sleep, 3: Enable Mcast/Bcast Filter +gEnableSuspend=3 + +#Enable Power Save offload +gEnablePowerSaveOffload=5 + +# Enable Runtime PM Feature. +# Enabling this feature will put target wow and shutdown pcie link +# when inactivity is detected in WLAN Driver. +# This feature is inactive when beaconing interfaces are active with +# clients associated. +# 0 - disable +# 1 - enable +gRuntimePM=1 + +# When gRuntimePM is disabled gRuntimeAutoTime won't take effect. +# The Time is in msec. +# 100 is min, 10000 is max, 500 is default. +gRuntimePMDelay=500 + +#Enable Power saving mechanism Based on Android Framework +#If set to 0 Driver internally control the Power saving mechanism +#If set to 1 Android Framwrok control the Power saving mechanism +isAndroidPsEn=0 + +beaconEarlyTerminationWakeInterval=3 + +#Data Inactivity Timeout when in powersave (in ms) +gDataInactivityTimeout=200 + +# Inactivity time (in ms) to end TX Service Period while in IBSS power save mode +gIbssTxSpEndInactivityTime=10 + +gEnableModulatedDTIM=2 +gMaxLIModulatedDTIM=6 + +############################################# +# Roaming related configurations +############################################# +# CSR Roaming Enable(1) Disable(0) +gRoamingTime=0 + +# ESE Support and fast transition +EseEnabled=1 + +gNeighborLookupThreshold=76 +gNeighborReassocThreshold=81 +gNeighborScanTimerPeriod=200 +gNeighborScanChannelMinTime=20 +gNeighborScanChannelMaxTime=30 +gMaxNeighborReqTries=3 + +# To enable, set gRoamIntraBand=1 (Roaming within band) +# To disable, set gRoamIntraBand=0 (Roaming across band) +gRoamIntraBand=0 + +# Legacy (non-ESE, non-802.11r) Fast Roaming Support +# To enable, set FastRoamEnabled=1 +# To disable, set FastRoamEnabled=0 +FastRoamEnabled=1 + +#Check if the AP to which we are roaming is better than current AP in terms of RSSI. +#Checking is disabled if set to Zero.Otherwise it will use this value as to how better +#the RSSI of the new/roamable AP should be for roaming +RoamRssiDiff=3 + +# If the RSSI of any available candidate is better than currently associated +# AP by at least gImmediateRoamRssiDiff, then being to roam immediately (without +# registering for reassoc threshold). +# NOTE: Value of 0 means that we would register for reassoc threshold. +gImmediateRoamRssiDiff=10 + +# 802.11K support +gRrmEnable=1 +gRrmOperChanMax=8 +gRrmNonOperChanMax=8 + +gEnableFastRoamInConcurrency=1 + +# Enable/Disable Roaming Offload Support (a.k.a Key Management Offload) +# 0 to disable, 1 to enable +gRoamOffloadEnabled=0 + +gAllowDFSChannelRoam=1 + +############################################# +# Offload related configurations +############################################# +# Beacon filtering frequency (unit in beacon intervals) +gNthBeaconFilter=50 + +# Enable WAPI or not +# WAPIIsEnabled=0 +# Flags to filter Mcast abd Bcast RX packets. +# Value 0: No filtering, 1: Filter all Multicast. +# 2: Filter all Broadcast. 3: Filter all Mcast abd Bcast +McastBcastFilter=3 + +#Flag to enable HostARPOffload feature or not +hostArpOffload=1 + +#Flag to enable TCPChkSumOffld feature or not +gEnableTCPChkSumOffld=1 + +#Flag to enable HostNSOffload feature or not +hostNSOffload=1 + +#Flag to enable IPChkSumOffld feature or not +gEnableIPChecksumOffload=1 + +# controlling the following offload patterns +# through ini parameter. Default value is 1 +# to disable set it to zero. ssdp = 0 +# Setup multicast pattern for mDNS 224.0.0.251, +# SSDP 239.255.255.250 and LLMNR 224.0.0.252 +ssdp = 0 + +#Enable MC address filtering offload +gMCAddrListEnable=1 + +# Enable Active mode offload +gActiveModeOffload=1 + +# Enable Active mode offload +gEnableActiveModeOffload=1 + +# WOW Enable/Disable. +# 0 - Disable both magic pattern match and pattern byte match. +# 1 - Enable magic pattern match on all interfaces. +# 2 - Enable pattern byte match on all interfaces. +# 3 - Enable both magic patter and pattern byte match on all interfaces. +# Default value of gEnableWoW is 3. +# gEnableWoW=0 + + +############################################# +# Logging related configurations +############################################# +gEnableLogp=1 + +gEnableSelfRecovery=1 + +#Enable firmware log +gEnablefwlog=1 +# Additional firmware log levels +gFwDebugLogLevel=4 +gFwDebugModuleLoglevel=1,0,2,0,4,0,5,0,6,0,7,4,8,0,9,0,11,0,13,0,17,0,18,0,19,0,27,0,29,0,31,0,35,0,36,0,38,0 + +#Enable firmware uart print +gEnablefwprint=0 + +############################################# +# TDLS related configurations +############################################# +# Enable support for TDLS +# 0 - disable +# 1 - enable +gEnableTDLSSupport=1 + +# Enable support for Implicit Trigger of TDLS. That is, wlan driver shall +# initiate TDLS Discovery towards a peer whenever setup criteria (throughput +# and RSSI) is met and then will initiate teardown when teardown criteria +# (idle packet count and RSSI) is met. +# 0 - disable +# 1 - enable +gEnableTDLSImplicitTrigger=1 + +# Enable TDLS External Control. That is, user space application has to +# first configure a peer MAC in wlan driver towards which TDLS is desired. +# Device will establish TDLS only towards those configured peers whenever +# TDLS criteria (throughput and RSSI threshold) is met and teardown TDLS +# when teardown criteria (idle packet count and RSSI) is met. However, +# device will accept TDLS connection if it is initiated from any other peer, +# even if that peer is not configured. +# 0 - disable +# 1 - enable +# For TDLS External Control, Implicit Trigger must also be enabled. +gTDLSExternalControl=1 + +# Enable support for TDLS off-channel operation +# 0 - disable +# 1 - enable +# TDLS off-channel operation will be invoked when there is only one +# TDLS connection. +gEnableTDLSOffChannel=1 + +gEnableTDLSScan=1 +gTDLSTxStatsPeriod=500 +gTDLSTxPacketThreshold=10 +gTDLSIdlePacketThreshold=1 + +############################################# +# P2P related configurations +############################################# +#P2P Listen offload +gEnableP2pListenOffload=1 + +#Enable or Disable p2p device address administered +isP2pDeviceAddrAdministrated=0 + +#Say gGoKeepAlivePeriod(5 seconds) and gGoLinkMonitorPeriod(10 seconds). +#For every 10 seconds DUT send Qos Null frame(i.e., Keep Alive frame if link is idle for last 10 seconds.) +#For both active and power save clients. + +#Power save clients: DUT set TIM bit from 10th second onwards and till client honors TIM bit. +#If doesn't honor for 5 seconds then DUT remove client. + +#Active clients: DUT send Qos Null frame for 10th seconds onwards if it is not success still we try on +#11th second if not tries on 12th and so on till 15th second. Hence before disconnection DUT will send 5 NULL frames. +#Hence in any case DUT will detect client got removed in (10+5) seconds. i.e., (gGoKeepAlivePeriod + gGoLinkMonitorPeriod).. + +#gGoLinkMonitorPeriod/ gApLinkMonitorPeriod is period where link is idle and it is period +#where we send NULL frame. + +#gApLinkMonitorPeriod = 10 +#gGoLinkMonitorPeriod = 10 + +#gGoKeepAlivePeriod/gApKeepAlivePeriod is time to spend to check whether frame are succeed to send or not. +#Hence total effective detection time is gGoLinkMonitorPeriod+ gGoKeepAlivePeriod/gApLinkMonitorPeriod+ gApKeepAlivePeriod. +gGoKeepAlivePeriod = 20 +gApKeepAlivePeriod = 20 + +############################################# +# SAP related configurations +############################################# +#Enable OBSS protection +gEnableApOBSSProt=1 + +#Enable/Disable UAPSD for SoftAP +gEnableApUapsd=1 + +# SAP auto channel selection configuration +# 0 = disable auto channel selection +# 1 = enable auto channel selection, channel provided by supplicant will be ignored +gApAutoChannelSelection=0 + +#SOFTAP Channel Range selection +gAPChannelSelectStartChannel=1 +gAPChannelSelectEndChannel=11 + +# SAP Country code +# Default Country Code is 2 bytes, 3rd byte is optional indoor or out door. +# Example +# US Indoor, USI +# Korea Outdoor, KRO +# Japan without optional byte, JP +# France without optional byte, FR +#gAPCntryCode=USI + +# DFS Master Capability +gEnableDFSMasterCap=1 + +# Disable 11AC for hotspot +gSapForce11NFor11AC=1 + +#Auto Shutdown Value in seconds. A value of 0 means Auto shutoff is disabled +gAPAutoShutOff=0 + +# Remove Overlap channel restriction +gEnableOverLapCh=0 + +# Enable/Disable channel avoidance for SAP in SCC scenario +# 0 - disable +# 1 - enable +gSapSccChanAvoidance=0 + +#Enable/Disable Tx beamformee in SAP mode +gEnableTxBFeeSAP=1 + + +END + +# Note: Configuration parser would not read anything past the END marker diff --git a/android_filesystem_config.h b/android_filesystem_config.h new file mode 100644 index 00000000..a28ce04f --- /dev/null +++ b/android_filesystem_config.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2016 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. + */ + +/* This file is used to define the properties of the filesystem +** images generated by build tools (mkbootfs and mkyaffs2image) and +** by the device side of adb. +*/ + +#include + +static const struct fs_path_config android_device_dirs[] = { + { 00771, AID_SYSTEM, AID_SYSTEM, 0, "bt_firmware"}, +}; + +/* Rules for files. +** These rules are applied based on "first match", so they +** should start with the most specific path and work their +** way up to the root. Prefixes ending in * denotes wildcard +** and will allow partial matches. +*/ +static const struct fs_path_config android_device_files[] = { + { 00755, AID_SYSTEM, AID_SYSTEM, (1ULL << CAP_NET_BIND_SERVICE), "vendor/bin/pm-service" }, + { 00755, AID_SYSTEM, AID_SYSTEM, (1ULL << CAP_NET_BIND_SERVICE), "vendor/bin/cnss-daemon"}, +#ifdef NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS + { 00000, AID_ROOT, AID_ROOT, 0, "system/etc/fs_config_dirs" }, +#endif +}; diff --git a/audio_platform_info.xml b/audio_platform_info.xml new file mode 100644 index 00000000..dcc16490 --- /dev/null +++ b/audio_platform_info.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audio_platform_info_tavil.xml b/audio_platform_info_tavil.xml new file mode 100644 index 00000000..7a87904a --- /dev/null +++ b/audio_platform_info_tavil.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/audio_policy_configuration.xml b/audio_policy_configuration.xml new file mode 100644 index 00000000..0cb59e77 --- /dev/null +++ b/audio_policy_configuration.xml @@ -0,0 +1,181 @@ + + + + + + + + + + Speaker + Earpiece + Telephony Tx + Built-In Mic + Built-In Back Mic + Telephony Rx + + Speaker + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h new file mode 100644 index 00000000..82283a5a --- /dev/null +++ b/bluetooth/bdroid_buildcfg.h @@ -0,0 +1,34 @@ +/* + * + * Copyright (c) 2013, The Linux Foundation. All rights reserved. + * Not a Contribution, Apache license notifications and license are retained + * for attribution purposes only. + * + * Copyright (C) 2012 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. + */ + +#ifndef _BDROID_BUILDCFG_H +#define _BDROID_BUILDCFG_H +#define BTM_DEF_LOCAL_NAME "QCOM-BTD" +// Disables read remote device feature +#define BTA_SKIP_BLE_READ_REMOTE_FEAT FALSE +#define MAX_ACL_CONNECTIONS 7 +#define MAX_L2CAP_CHANNELS 16 +#define BLE_VND_INCLUDED TRUE +// skips conn update at conn completion +#define BTA_BLE_SKIP_CONN_UPD FALSE +#define BLE_PERIPHERAL_ADV_NAME FALSE +#define BT_CLEAN_TURN_ON_DISABLED 1 +#endif diff --git a/device.mk b/device.mk new file mode 100644 index 00000000..1585fb40 --- /dev/null +++ b/device.mk @@ -0,0 +1,359 @@ +# +# Copyright (C) 2016 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. +# + +LOCAL_PATH := device/google/wahoo + +SRC_MEDIA_HAL_DIR := hardware/qcom/media/msm8998 +SRC_DISPLAY_HAL_DIR := hardware/qcom/display/msm8998 +SRC_CAMERA_HAL_DIR := hardware/qcom/camera/msm8998 + +TARGET_SYSTEM_PROP := $(LOCAL_PATH)/system.prop + +# Get kernel-headers +$(call inherit-product, hardware/qcom/msm8998/msm8998.mk) + +$(call inherit-product, device/google/wahoo/utils.mk) + +ifeq ($(TARGET_PREBUILT_KERNEL),) + LOCAL_KERNEL := device/google/wahoo-kernel/Image.lz4-dtb +else + LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL) +endif + +PRODUCT_CHARACTERISTICS := nosdcard +PRODUCT_SHIPPING_API_LEVEL := 24 + +DEVICE_PACKAGE_OVERLAYS := $(LOCAL_PATH)/overlay + +PRODUCT_COPY_FILES += \ + $(LOCAL_KERNEL):kernel \ + $(LOCAL_PATH)/init.recovery.hardware.rc:root/init.recovery.$(PRODUCT_HARDWARE).rc \ + $(LOCAL_PATH)/init.hardware.rc:root/init.$(PRODUCT_HARDWARE).rc \ + $(LOCAL_PATH)/init.hardware.usb.rc:root/init.$(PRODUCT_HARDWARE).usb.rc \ + $(LOCAL_PATH)/ueventd.hardware.rc:root/ueventd.$(PRODUCT_HARDWARE).rc \ + $(LOCAL_PATH)/init.radio.sh:system/bin/init.radio.sh \ + +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) + PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/init.hardware.diag.rc.userdebug:root/init.$(PRODUCT_HARDWARE).diag.rc +else + PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/init.hardware.diag.rc.user:root/init.$(PRODUCT_HARDWARE).diag.rc +endif + +BOARD_KERNEL_PAGESIZE := 4096 +BOARD_FLASH_BLOCK_SIZE := 131072 +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 +TARGET_USERIMAGES_USE_EXT4 := true +BOARD_PERSISTIMAGE_PARTITION_SIZE := 33554432 +BOARD_PERSISTIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_VENDORIMAGE_PARTITION_SIZE := 419430400 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 + +MSM_VIDC_TARGET_LIST := msm8998 # Get the color format from kernel headers +MASTER_SIDE_CP_TARGET_LIST := msm8998 # ION specific settings + +# Vendor Interface Manifest +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/manifest.xml:vendor/manifest.xml + +# Use Sdcardfs +PRODUCT_PROPERTY_OVERRIDES += \ + ro.sys.sdcardfs=1 + +# A/B support +PRODUCT_PACKAGES += \ + otapreopt_script \ + cppreopts.sh \ + update_engine \ + update_verifier + +PRODUCT_PACKAGES += SSRestartDetector + +PRODUCT_PACKAGES += \ + bootctrl.msm8998 + +PRODUCT_PROPERTY_OVERRIDES += \ + ro.cp_system_other_odex=1 + +AB_OTA_UPDATER := true + +AB_OTA_PARTITIONS += \ + boot \ + system + +AB_OTA_POSTINSTALL_CONFIG += \ + RUN_POSTINSTALL_system=true \ + POSTINSTALL_PATH_system=system/bin/otapreopt_script \ + FILESYSTEM_TYPE_system=ext4 \ + POSTINSTALL_OPTIONAL_system=true + + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \ + frameworks/native/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \ + frameworks/native/data/etc/android.hardware.camera.full.xml:system/etc/permissions/android.hardware.camera.full.xml\ + frameworks/native/data/etc/android.hardware.camera.raw.xml:system/etc/permissions/android.hardware.camera.raw.xml\ + frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \ + frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \ + frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \ + frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \ + frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \ + frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \ + frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \ + frameworks/native/data/etc/android.hardware.sensor.barometer.xml:system/etc/permissions/android.hardware.sensor.barometer.xml \ + frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:system/etc/permissions/android.hardware.sensor.stepcounter.xml \ + frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:system/etc/permissions/android.hardware.sensor.stepdetector.xml \ + frameworks/native/data/etc/android.hardware.sensor.hifi_sensors.xml:system/etc/permissions/android.hardware.sensor.hifi_sensors.xml \ + frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \ + frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \ + frameworks/native/data/etc/android.hardware.telephony.cdma.xml:system/etc/permissions/android.hardware.telephony.cdma.xml \ + frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ + frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \ + frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml \ + frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \ + frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \ + frameworks/native/data/etc/android.hardware.opengles.aep.xml:system/etc/permissions/android.hardware.opengles.aep.xml \ + +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/init.power.sh:system/bin/init.power.sh \ + +# graphics +PRODUCT_PROPERTY_OVERRIDES += \ + ro.opengles.version=196610 + +# Enable low power video mode for 4K encode +PRODUCT_PROPERTY_OVERRIDES += \ + vidc.debug.perf.mode=2 + +# OEM Unlock reporting +PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ + ro.oem_unlock_supported=1 + +PRODUCT_PROPERTY_OVERRIDES += \ + persist.cne.feature=1 \ + persist.data.iwlan.enable=true \ + persist.radio.RATE_ADAPT_ENABLE=1 \ + persist.radio.ROTATION_ENABLE=1 \ + persist.radio.VT_ENABLE=1 \ + persist.radio.VT_HYBRID_ENABLE=1 \ + persist.radio.apm_sim_not_pwdn=1 \ + persist.radio.data_ltd_sys_ind=1 \ + persist.radio.is_wps_enabled=true \ + persist.radio.videopause.mode=1 \ + persist.rcs.supported=1 \ + rild.libpath=/vendor/lib64/libril-qc-qmi-1.so + +# Set snapshot timer to 3 second +PRODUCT_PROPERTY_OVERRIDES += \ + persist.radio.snapshot_enabled=1 \ + persist.radio.snapshot_timer=3 + +PRODUCT_PROPERTY_OVERRIDES += \ + ro.vendor.extension_library=libqti-perfd-client.so + +# camera gyro and laser sensor +PRODUCT_PROPERTY_OVERRIDES += \ + persist.camera.gyro.android=4 \ + persist.camera.tof.direct=1 \ + persist.camera.max.previewfps=60 \ + persist.camera.sensor.hdr=2 + +# WLAN driver configuration files +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/wpa_supplicant_overlay.conf:system/etc/wifi/wpa_supplicant_overlay.conf \ + $(LOCAL_PATH)/p2p_supplicant_overlay.conf:system/etc/wifi/p2p_supplicant_overlay.conf \ + $(LOCAL_PATH)/wifi_concurrency_cfg.txt:system/etc/wifi/wifi_concurrency_cfg.txt \ + $(LOCAL_PATH)/WCNSS_qcom_cfg.ini:system/etc/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini + +PRODUCT_PACKAGES += \ + hwcomposer.msm8998 \ + gralloc.msm8998 \ + android.hardware.graphics.allocator@2.0-impl \ + android.hardware.graphics.allocator@2.0-service \ + android.hardware.graphics.mapper@2.0-impl \ + android.hardware.graphics.composer@2.1-impl \ + libbt-vendor + +# Light HAL +PRODUCT_PACKAGES += \ + lights.$(PRODUCT_HARDWARE) \ + android.hardware.light@2.0-impl \ + android.hardware.light@2.0-service + +# gatekeeper HAL +PRODUCT_PACKAGES += \ + android.hardware.gatekeeper@1.0-impl \ + android.hardware.gatekeeper@1.0-service + +# Keymaster HAL +PRODUCT_PACKAGES += \ + android.hardware.keymaster@3.0-impl + +# Bluetooth HAL +PRODUCT_PACKAGES += \ + android.hardware.bluetooth@1.0-impl \ + android.hardware.bluetooth@1.0-service + +ifeq ($(ENABLE_TREBLE), true) +PRODUCT_PACKAGES += \ + android.hardware.keymaster@3.0-service +endif + +PRODUCT_PACKAGES += \ + libmm-omxcore \ + libOmxCore \ + libstagefrighthw \ + libOmxVdec \ + libOmxVdecHevc \ + libOmxVenc \ + libc2dcolorconvert + +PRODUCT_PACKAGES += \ + android.hardware.camera.provider@2.4-impl \ + camera.device@3.2-impl \ + camera.msm8998 \ + libqomx_core \ + libmmjpeg_interface \ + libmmcamera_interface + +PRODUCT_PACKAGES += \ + sensors.$(PRODUCT_HARDWARE) \ + android.hardware.sensors@1.0-impl + +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/sensors/hals.conf:system/etc/sensors/hals.conf + +PRODUCT_PACKAGES += \ + fs_config_dirs \ + fs_config_files + +# Boot control HAL +PRODUCT_PACKAGES += \ + android.hardware.boot@1.0-impl \ + android.hardware.boot@1.0-service \ + +# Vibrator HAL +PRODUCT_PACKAGES += \ + android.hardware.vibrator@1.0-impl + +# Thermal packages +PRODUCT_PACKAGES += \ + android.hardware.thermal@1.0-impl \ + android.hardware.thermal@1.0-service + +#GNSS HAL +PRODUCT_PACKAGES += \ + android.hardware.gnss@1.0-impl + +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/sec_config:system/etc/sec_config + +PRODUCT_PACKAGES += \ + gps.conf \ + gps.default \ + libgps.utils \ + libloc_eng \ + libloc_api_v02 \ + libloc_ds_api \ + libgnsspps + +HOSTAPD := hostapd +HOSTAPD += hostapd_cli +PRODUCT_PACKAGES += $(HOSTAPD) + +WPA := wpa_supplicant.conf +WPA += wpa_supplicant_wcn.conf +WPA += wpa_supplicant +PRODUCT_PACKAGES += $(WPA) + +PRODUCT_PACKAGES += \ + android.hardware.wifi@1.0-service \ + wificond \ + wifilogd + +LIB_NL := libnl_2 +PRODUCT_PACKAGES += $(LIB_NL) + +PRODUCT_PACKAGES += \ + audio.primary.msm8998 \ + audio.a2dp.default \ + audio.usb.default \ + audio.r_submix.default \ + libaudio-resampler + +PRODUCT_PACKAGES += \ + android.hardware.audio@2.0-impl \ + android.hardware.audio.effect@2.0-impl \ + android.hardware.broadcastradio@1.0-impl \ + android.hardware.soundtrigger@2.0-impl + +# Thermal packages +PRODUCT_PACKAGES += \ + thermal.default + +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) +PRODUCT_PACKAGES += \ + tinyplay \ + tinycap \ + tinymix \ + tinypcminfo \ + cplay +endif + +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/audio_policy_configuration.xml:system/etc/audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:system/etc/a2dp_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ + frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ + +# audio hal tables +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/mixer_paths.xml:system/etc/mixer_paths.xml \ + $(LOCAL_PATH)/mixer_paths_tasha.xml:system/etc/mixer_paths_tasha.xml \ + $(LOCAL_PATH)/mixer_paths_tavil.xml:system/etc/mixer_paths_tavil.xml \ + $(LOCAL_PATH)/audio_platform_info.xml:system/etc/audio_platform_info.xml \ + $(LOCAL_PATH)/audio_platform_info_tavil.xml:system/etc/audio_platform_info_tavil.xml \ + +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/media_codecs.xml:system/etc/media_codecs.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_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 \ + $(LOCAL_PATH)/media_profiles.xml:system/etc/media_profiles.xml \ + +PRODUCT_PROPERTY_OVERRIDES += \ + audio.snd_card.open.retries=50 + +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/lowi.conf:system/etc/lowi.conf + +# Fingerprint HIDL implementation +PRODUCT_PACKAGES += \ + fingerprint.fpc \ + android.hardware.biometrics.fingerprint@2.1-service + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.fingerprint.xml:system/etc/permissions/android.hardware.fingerprint.xml + +# Vendor seccomp policy files for media components: +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/seccomp_policy/mediacodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy + +# setup dalvik vm configs +$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk) diff --git a/dumpstate/Android.mk b/dumpstate/Android.mk new file mode 100644 index 00000000..00bc4eaf --- /dev/null +++ b/dumpstate/Android.mk @@ -0,0 +1,28 @@ +# +# Copyright 2017 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. +# + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_STATIC_LIBRARIES := libdumpstateheaders + +LOCAL_SRC_FILES := dumpstate.cpp + +LOCAL_MODULE := libdumpstate.$(TARGET_DEVICE) + +LOCAL_MODULE_TAGS := optional + +include $(BUILD_STATIC_LIBRARY) diff --git a/dumpstate/dumpstate.cpp b/dumpstate/dumpstate.cpp new file mode 100644 index 00000000..a058764b --- /dev/null +++ b/dumpstate/dumpstate.cpp @@ -0,0 +1,85 @@ +/* + * Copyright 2017 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. + */ + +#define LOG_TAG "dumpstate" + +#include +#include +#include +#include +#include +#include + +#include + +#define MODEM_LOG_PREFIX_PROPERTY "ro.radio.log_prefix" +#define MODEM_LOGGING_SWITCH "persist.radio.smlog_switch" + +static void getModemLogs(Dumpstate &ds) +{ + bool modemLogsEnabled = 0; + + /* Check if smlog_dump tool exist */ + if (!ds.IsUserBuild() && !access("/system/bin/smlog_dump", F_OK)) { + modemLogsEnabled = android::base::GetBoolProperty(MODEM_LOGGING_SWITCH, false); + + /* Execute SMLOG DUMP if SMLOG is enabled */ + if (modemLogsEnabled && !ds.GetPath("").empty()) { + std::string bugreportDir = dirname(ds.GetPath("").c_str()); + CommandOptions options = CommandOptions::WithTimeout(120).AsRoot().Build(); + ds.RunCommand("SMLOG DUMP", { "smlog_dump", "-d", "-o", bugreportDir.c_str() }, options); + + // Remove smlog folders older than 10 days. + std::string filePrefix = android::base::GetProperty(MODEM_LOG_PREFIX_PROPERTY, ""); + if (!filePrefix.empty()) { + + std::string removeCommand = "/system/bin/find " + + bugreportDir + "/" + filePrefix + "* -mtime +10 -delete"; + + ds.RunCommand("RM OLD SMLOG", + { "/system/bin/sh", "-c", removeCommand.c_str()}, + CommandOptions::AS_ROOT_5); + } + } + } +} + + +void dumpstate_board() +{ + Dumpstate& ds = Dumpstate::GetInstance(); + + getModemLogs(ds); + ds.DumpFile("CPU present", "/sys/devices/system/cpu/present"); + ds.DumpFile("CPU online", "/sys/devices/system/cpu/online"); + ds.DumpFile("RPM Stats", "/d/rpm_stats"); + ds.DumpFile("Power Management Stats", "/d/rpm_master_stats"); + ds.DumpFile("SMD Log", "/d/ipc_logging/smd/log"); + ds.RunCommand("ION HEAPS", {"/system/bin/sh", "-c", "for d in $(ls -d /d/ion/*); do for f in $(ls $d); do echo --- $d/$f; cat $d/$f; done; done"}, CommandOptions::AS_ROOT_5); + ds.DumpFile("dmabuf info", "/d/dma_buf/bufinfo"); + ds.RunCommand("Temperatures", {"/system/bin/sh", "-c", "for f in `ls /sys/class/thermal` ; do type=`cat /sys/class/thermal/$f/type` ; temp=`cat /sys/class/thermal/$f/temp` ; echo \"$type: $temp\" ; done"}, CommandOptions::AS_ROOT_5); + ds.DumpFile("cpu0-3 time-in-state", "/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state"); + ds.RunCommand("cpu0-3 cpuidle", {"/system/bin/sh", "-c", "for d in $(ls -d /sys/devices/system/cpu/cpu0/cpuidle/state*); do echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done"}, CommandOptions::AS_ROOT_5); + ds.DumpFile("cpu4-7 time-in-state", "/sys/devices/system/cpu/cpu4/cpufreq/stats/time_in_state"); + ds.RunCommand("cpu4-7 cpuidle", {"/system/bin/sh", "-c", "for d in $(ls -d /sys/devices/system/cpu/cpu4/cpuidle/state*); do echo \"$d: `cat $d/name` `cat $d/desc` `cat $d/time` `cat $d/usage`\"; done"}, CommandOptions::AS_ROOT_5); + ds.DumpFile("MDP xlogs", "/d/mdp/xlog/dump"); + ds.RunCommand("RAMDUMP LIST", {"/system/bin/sh", "-c", "cat /data/data/com.android.ramdump/files/RAMDUMP_LIST"}, CommandOptions::AS_ROOT_5); + + /* Check if qsee_logger tool exists */ + if (!access("/vendor/bin/qsee_logger", F_OK)) { + ds.RunCommand("FP LOGS", {"qsee_logger", "-d"}); + } +}; diff --git a/fstab.hardware b/fstab.hardware new file mode 100644 index 00000000..854506cb --- /dev/null +++ b/fstab.hardware @@ -0,0 +1,9 @@ +# Android fstab file. + +# +/dev/block/bootdevice/by-name/system / ext4 ro,barrier=1 wait,slotselect +/dev/block/bootdevice/by-name/vendor /vendor ext4 ro,barrier=1 wait,slotselect +/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,check,fileencryption=ice:aes-256-heh +/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults +/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect +/devices/soc/a800000.ssusb/a800000.dwc3* auto vfat defaults voldmanaged=usb:auto diff --git a/init.hardware.diag.rc.user b/init.hardware.diag.rc.user new file mode 100644 index 00000000..1fc0b0c9 --- /dev/null +++ b/init.hardware.diag.rc.user @@ -0,0 +1,18 @@ +# +# Copyright (C) 2016 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. +# + +on property:ro.boot.mode=normal + rm /dev/diag diff --git a/init.hardware.diag.rc.userdebug b/init.hardware.diag.rc.userdebug new file mode 100644 index 00000000..e2adedcb --- /dev/null +++ b/init.hardware.diag.rc.userdebug @@ -0,0 +1,324 @@ +# +# Copyright (C) 2016 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. +# + +on post-fs-data + # Modem logging collection + mkdir /data/diag_logs 0777 system system + # WLAN logging collection + mkdir /data/cnss_diag 0777 system system + +on boot + chmod 666 /dev/diag + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x900E + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x901D + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,serial_cdev,rmnet_gsi,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmnet_gsi,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Default composition" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x9091 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/gsi.rmnet /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.ffs.ready=1 && sys.usb.config=diag,serial_cdev,rmnet_gsi && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Default comp without ADB" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x9092 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/gsi.rmnet /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x902C + symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state rndis + +on property:sys.usb.config=rndis,diag,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x902D + symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state rndis,adb + +on property:sys.usb.config=rndis,serial_cdev,diag && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun_diag" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90B5 + symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state rndis + +on property:sys.usb.config=rndis,serial_cdev,diag,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,serial_cdev,diag,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun_diag" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90B6 + symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state rndis,adb + +on property:sys.usb.config=mtp,diag && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_diag" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x901B + symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=mtp,diag,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,diag,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_diag_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x903A + symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,qdss && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x904A + write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,qdss,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,qdss,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x9060 + write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,qdss,rmnet_gsi && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_rmnet" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x9083 + write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/gsi.rmnet /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,qdss,rmnet_gsi,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,qdss,rmnet_gsi,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_rmnet_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x9084 + write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/gsi.rmnet /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag,qdss && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_qdss" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x9081 + write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 + symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=rndis,diag,qdss,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,qdss,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_qdss_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x9082 + write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 + symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,serial_cdev && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x9004 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,adb,serial_cdev && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb,serial_cdev && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_adb_dun" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x901f + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} diff --git a/init.hardware.rc b/init.hardware.rc new file mode 100644 index 00000000..770f9ed4 --- /dev/null +++ b/init.hardware.rc @@ -0,0 +1,405 @@ +# +# Copyright (C) 2016 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. +# + +import init.${ro.hardware}.usb.rc +import init.${ro.hardware}.diag.rc + +on early-init + mount debugfs debugfs /sys/kernel/debug + chmod 0755 /sys/kernel/debug + +on init + # Support legacy paths + symlink /sdcard /mnt/sdcard + symlink /sdcard /storage/sdcard0 + +on fs + wait /dev/block/platform/soc/${ro.boot.bootdevice} + symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice + + mount_all fstab.${ro.hardware} + swapon_all fstab.${ro.hardware} + + # Keeping following partitions outside fstab file. As user may not have + # these partition flashed on the device. Failure to mount any partition in fstab file + # results in failure to launch late-start class. + + wait /dev/block/bootdevice/by-name/cache + mount ext4 /dev/block/bootdevice/by-name/cache /cache nosuid nodev noatime barrier=1 + + wait /dev/block/bootdevice/by-name/persist + mount ext4 /dev/block/bootdevice/by-name/persist /persist nosuid nodev noatime barrier=1 + restorecon_recursive /persist + mkdir /persist/data 0700 system system + +on post-fs + # set RLIMIT_MEMLOCK to 64MB + setrlimit 8 67108864 67108864 + + # Since bootloader does not have a UI turn screen ON + write /sys/class/leds/lcd-backlight/brightness 255 + + # Enable audio and video device for bootanim + write /sys/kernel/boot_adsp/boot 1 + write /sys/kernel/boot_slpi/boot 1 + + start qseecomd + + chmod 0664 /sys/devices/virtual/graphics/fb0/idle_time + chown system graphics /sys/devices/virtual/graphics/fb0/idle_time + +on property:sys.listeners.registered=true + # load IPA FWs + write /dev/ipa 1 + +on post-fs-data + mkdir /data/tombstones 0771 system system + mkdir /tombstones/modem 0771 system system + mkdir /tombstones/lpass 0771 system system + mkdir /tombstones/wcnss 0771 system system + mkdir /tombstones/dsps 0771 system system + mkdir /data/misc/qvop 0660 system system + mkdir /data/misc/hbtp 0750 system system + mkdir /data/misc/seemp 0700 system system + + # Create directory for TZ Apps + mkdir /data/misc/qsee 0770 system system + + #Create folder for mm-qcamera-daemon + mkdir /data/misc/camera 0770 camera camera + + mkdir /data/media 0770 media_rw media_rw + chown media_rw media_rw /data/media + + mkdir /data/misc/ipa 0700 net_admin net_admin + + # Create the directories used by the Wireless subsystem + mkdir /data/misc/wifi 0770 wifi wifi + mkdir /data/misc/wifi/sockets 0770 wifi wifi + mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi + mkdir /data/misc/dhcp 0770 dhcp dhcp + chown dhcp dhcp /data/misc/dhcp + + # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections + # We chown/chmod /persist again so because mount is run as root + defaults + chown root system /persist + chmod 0771 /persist + chown system system /persist/WCNSS_qcom_wlan_nv.bin + + # Create directory for hostapd + mkdir /data/hostapd 0770 system wifi + + # Trigger WLAN driver load + write /sys/kernel/boot_wlan/boot_wlan 1 + + #create port-bridge log dir + mkdir /data/misc/port_bridge 0770 radio radio + chmod 0770 /data/misc/port_bridge + + #create netmgr log dir + mkdir /data/misc/netmgr 0770 radio radio + chmod 0770 /data/misc/netmgr + + # Create the directories used by CnE subsystem + mkdir /data/connectivity 0771 system system + chown system system /data/connectivity + + # Create the directories used by DPM subsystem + mkdir /data/dpm 0771 system system + chown system system /data/dpm + + mkdir /data/dpm/nsrm 0771 system system + chown system system /data/dpm/nsrm + + # Create directory used by audio subsystem + mkdir /data/misc/audio 0770 audio audio + + # Create directory for audio delta files + mkdir /data/misc/audio/acdbdata 0770 media audio + mkdir /data/misc/audio/acdbdata/delta 0770 media audio + + # Create directory used by the DASH client + mkdir /data/misc/dash 0770 media audio + + # Create directory used by display clients + mkdir /data/misc/display 0770 system graphics + + # Create perfd related dirs + mkdir /data/system/perfd 0770 root system + chmod 2770 /data/system/perfd + + chmod 775 /persist/sensors + chmod 664 /persist/sensors/sensors_settings + chown system root /persist/sensors/sensors_settings + + mkdir /data/misc/sensors + chmod 775 /data/misc/sensors + + # Mark the copy complete flag to not completed + write /data/misc/radio/copy_complete 0 + chown radio radio /data/misc/radio/copy_complete + chmod 0660 /data/misc/radio/copy_complete + + # File flags for prebuilt ril db file + write /data/misc/radio/prebuilt_db_support 1 + chown radio radio /data/misc/radio/prebuilt_db_support + chmod 0400 /data/misc/radio/prebuilt_db_support + write /data/misc/radio/db_check_done 0 + chown radio radio /data/misc/radio/db_check_done + chmod 0660 /data/misc/radio/db_check_done + + # Create directories for Location services + mkdir /data/misc/location 0770 gps gps + mkdir /data/misc/location/mq 0770 gps gps + mkdir /data/misc/location/xtwifi 0770 gps gps + mkdir /data/misc/location/gpsone_d 0770 system gps + mkdir /data/misc/location/quipc 0770 gps system + mkdir /data/misc/location/gsiff 0770 gps gps + + + # Set indication (checked by vold) that we have finished this action + setprop vold.post_fs_data_done 1 + +on early-boot + exec - root root system -- /system/bin/init.power.sh + + # update cpusets now that processors are up + # initialize for Silver Only first and then Silver + Gold + # Silver Only configuration cannot work with 0-7 + write /dev/cpuset/top-app/cpus 0-3 + write /dev/cpuset/foreground/cpus 0-3 + write /dev/cpuset/foreground/boost/cpus 0-3 + write /dev/cpuset/background/cpus 0-3 + write /dev/cpuset/system-background/cpus 0-3 + write /dev/cpuset/top-app/cpus 0-7 + write /dev/cpuset/foreground/cpus 0-7 + write /dev/cpuset/foreground/boost/cpus 0-7 + write /dev/cpuset/background/cpus 0-7 + write /dev/cpuset/system-background/cpus 0-7 + +on boot + # Install touch modules + insmod /vendor/lib/modules/synaptics_dsx_core_htc.ko + insmod /vendor/lib/modules/synaptics_dsx_fw_update_htc.ko + insmod /vendor/lib/modules/synaptics_dsx_rmi_dev_htc.ko + + mkdir /dev/socket/qmux_radio 0770 radio radio + chmod 2770 /dev/socket/qmux_radio + mkdir /dev/socket/qmux_audio 0770 media audio + chmod 2770 /dev/socket/qmux_audio + mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth + chmod 2770 /dev/socket/qmux_bluetooth + mkdir /dev/socket/qmux_gps 0770 gps gps + chmod 2770 /dev/socket/qmux_gps + + # Create NETMGR daemon socket area + mkdir /dev/socket/netmgr 0750 radio radio + + setprop wifi.interface wlan0 + + # Define TCP buffer sizes for various networks + # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax, + setprop net.tcp.buffersize.wifi 524288,2097152,4194304,262144,524288,1048576 + + # Assign TCP buffer thresholds to be ceiling value of technology maximums + # Increased technology maximums should be reflected here. + write /proc/sys/net/core/rmem_max 8388608 + + # Bluetooth + chown bluetooth net_bt /sys/class/rfkill/rfkill0/type + chown bluetooth net_bt /sys/class/rfkill/rfkill0/state + chmod 0660 /sys/class/rfkill/rfkill0/state + chown bluetooth net_bt /sys/class/rfkill/rfkill0/device/extldo + chmod 0660 /sys/class/rfkill/rfkill0/device/extldo + + # Wifi firmware reload path + chown wifi wifi /sys/module/wlan/parameters/fwpath + + # Required for time_daemon + mkdir /persist/time 0770 system system + mkdir /data/time/ 0700 system system + + # Permission for laser sensor driver + chown camera camera /sys/class/htc_laser/laser/enable_ps_sensor + +service init-radio-sh /system/bin/init.radio.sh + class late_start + user radio + group root radio + oneshot + +service perfd /vendor/bin/perfd + class main + user root + group root readproc + socket perfd seqpacket 0666 root system + +service thermal-engine /vendor/bin/thermal-engine + class main + user root + group root system + socket thermal-send-client stream 0666 system system + socket thermal-recv-client stream 0660 system system + socket thermal-recv-passive-client stream 0666 system system + +on property:persist.sys.ssr.restart_level=* + start ssr_setup + +service ssr_setup /vendor/bin/ssr_setup + oneshot + disabled + +service ssr_diag /vendor/bin/ssr_diag + class late_start + user system + group system + disabled + +service per_mgr /vendor/bin/pm-service + class core + user system + group system + ioprio rt 4 + +service per_proxy /vendor/bin/pm-proxy + class core + user system + group system + disabled + +on property:init.svc.per_mgr=running + start per_proxy + +on property:sys.shutdown.requested=* + stop per_proxy + +service qseecomd /vendor/bin/qseecomd + class core + user root + group root + +service time_daemon /vendor/bin/time_daemon + class late_start + user root + group root + +service ss_ramdump /vendor/bin/subsystem_ramdump + class main + user root + group root system + disabled + +on property:persist.sys.ssr.enable_ramdumps=1 + write /sys/module/subsystem_restart/parameters/enable_ramdumps 1 + mkdir /data/ramdump 761 root system + start ss_ramdump + +on property:persist.sys.ssr.enable_ramdumps=0 + write /sys/module/subsystem_restart/parameters/enable_ramdumps 0 + +service sensors /vendor/bin/sensors.qcom + class core + user root + group root + +service adsprpcd /vendor/bin/adsprpcd + class main + user media + group media + +service irsc_util /vendor/bin/irsc_util "/etc/sec_config" + class core + user root + oneshot + +service rmt_storage /vendor/bin/rmt_storage + class core + user root + +service tftp_server /vendor/bin/tftp_server + class core + user root + +service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ + -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \ + -I/system/etc/wifi/p2p_supplicant_overlay.conf -N \ + -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ + -I/system/etc/wifi/wpa_supplicant_overlay.conf \ + -O/data/misc/wifi/sockets -puse_p2p_group_interface=1 -dd \ + -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 + # group wifi inet keystore + class main + socket wpa_wlan0 dgram 660 wifi wifi + disabled + oneshot + +service cnss_diag /vendor/bin/cnss_diag -q -f + class main + user root + group root + oneshot + +service cnss-daemon /vendor/bin/cnss-daemon -n -l + class late_start + user system + group system inet net_admin wifi + +service netmgrd /vendor/bin/netmgrd + class main + user root + group root wifi wakelock radio inet + +service port-bridge /vendor/bin/port-bridge + class main + user radio + group radio system inet + oneshot + +service qti /vendor/bin/qti + class main + user radio + group radio net_raw diag usb net_admin + +on property:wc_transport.start_hci=true + start hci_filter + +on property:wc_transport.start_hci=false + stop hci_filter + +service hci_filter /vendor/bin/wcnss_filter + class late_start + user bluetooth + group bluetooth diag + disabled + +service loc_launcher /vendor/bin/loc_launcher + class late_start + group gps inet diag wifi + +service pd_mapper /vendor/bin/pd-mapper + class core + +# bugreport is triggered by holding down volume down, volume up and power +service bugreport /system/bin/dumpstate -d -p -B -z \ + -o /data/user_de/0/com.android.shell/files/bugreports/bugreport + class main + disabled + oneshot + keycodes 114 115 116 + diff --git a/init.hardware.usb.rc b/init.hardware.usb.rc new file mode 100644 index 00000000..55bf258b --- /dev/null +++ b/init.hardware.usb.rc @@ -0,0 +1,111 @@ +# +# Copyright (C) 2016 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. +# + +on boot + mkdir /dev/usb-ffs 0770 shell shell + mkdir /dev/usb-ffs/adb 0770 shell shell + mount configfs none /config + mkdir /config/usb_gadget/g1 0770 shell shell + mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell + write /config/usb_gadget/g1/bcdUSB 0x0200 + write /config/usb_gadget/g1/idVendor 0x18d1 + write /config/usb_gadget/g1/bcdDevice 0x4ee1 + write /config/usb_gadget/g1/os_desc/use 1 + write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} + write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} + write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} + mkdir /config/usb_gadget/g1/functions/mass_storage.0 + mkdir /config/usb_gadget/g1/functions/mtp.gs0 + mkdir /config/usb_gadget/g1/functions/ptp.gs1 + mkdir /config/usb_gadget/g1/functions/accessory.gs2 + mkdir /config/usb_gadget/g1/functions/audio_source.gs3 + mkdir /config/usb_gadget/g1/functions/midi.gs5 + mkdir /config/usb_gadget/g1/functions/ffs.adb + mkdir /config/usb_gadget/g1/functions/diag.diag + mkdir /config/usb_gadget/g1/functions/cser.dun.0 + mkdir /config/usb_gadget/g1/functions/cser.nmea.1 + mkdir /config/usb_gadget/g1/functions/gsi.rmnet + mkdir /config/usb_gadget/g1/functions/gsi.rndis + mkdir /config/usb_gadget/g1/functions/qdss.qdss + mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell + mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell + write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 + write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" + symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 + mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 + write /sys/class/android_usb/android0/f_ffs/aliases adb + setprop sys.usb.configfs 1 + setprop sys.usb.controller "a800000.dwc3" + +on property:sys.usb.config=none && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/os_desc/use 0 + setprop sys.usb.ffs.ready 0 + +on property:init.svc.adbd=stopped + setprop sys.usb.ffs.ready 0 + +on property:sys.usb.config=mtp && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/functions/mtp.gs0/os_desc/interface.MTP/compatible_id "MTP" + write /config/usb_gadget/g1/os_desc/use 1 + write /config/usb_gadget/g1/idProduct 0x4ee1 + +on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/functions/mtp.gs0/os_desc/interface.MTP/compatible_id "MTP" + write /config/usb_gadget/g1/os_desc/use 1 + write /config/usb_gadget/g1/idProduct 0x4ee2 + +on property:sys.usb.config=rndis && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee3 + +on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee4 + +on property:sys.usb.config=ptp && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/functions/ptp.gs1/os_desc/interface.MTP/compatible_id "PTP" + write /config/usb_gadget/g1/os_desc/use 1 + write /config/usb_gadget/g1/idProduct 0x4ee5 + +on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/functions/ptp.gs1/os_desc/interface.MTP/compatible_id "PTP" + write /config/usb_gadget/g1/os_desc/use 1 + write /config/usb_gadget/g1/idProduct 0x4ee6 + +on property:sys.usb.config=adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee7 + +on property:sys.usb.config=midi && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee8 + +on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x4ee9 + +on property:sys.usb.config=accessory && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d00 + +on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d01 + +on property:sys.usb.config=audio_source && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d02 + +on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d03 + +on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d04 + +on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/idProduct 0x2d05 diff --git a/init.power.sh b/init.power.sh new file mode 100644 index 00000000..e2c7704b --- /dev/null +++ b/init.power.sh @@ -0,0 +1,76 @@ +#!/system/bin/sh + +################################################################################ +# helper functions to allow Android init like script + +function write() { + echo -n $2 > $1 +} + +function copy() { + cat $1 > $2 +} + +################################################################################ + +soc_revision=`cat /sys/devices/soc0/revision` +if [ "$soc_revision" == "1.0" ]; then + # Disable retention low power modes + write /sys/module/lpm_levels/system/pwr/cpu0/ret/idle_enabled N + write /sys/module/lpm_levels/system/pwr/cpu1/ret/idle_enabled N + write /sys/module/lpm_levels/system/pwr/cpu2/ret/idle_enabled N + write /sys/module/lpm_levels/system/pwr/cpu3/ret/idle_enabled N + write /sys/module/lpm_levels/system/perf/cpu4/ret/idle_enabled N + write /sys/module/lpm_levels/system/perf/cpu5/ret/idle_enabled N + write /sys/module/lpm_levels/system/perf/cpu6/ret/idle_enabled N + write /sys/module/lpm_levels/system/perf/cpu7/ret/idle_enabled N + # Enable all LPMs by default + write /sys/module/lpm_levels/parameters/sleep_disabled N +fi + +# disable thermal hotplug to switch governor +write /sys/module/msm_thermal/core_control/enabled 0 + +# bring back main cores CPU 0,4 +write /sys/devices/system/cpu/cpu0/online 1 +write /sys/devices/system/cpu/cpu4/online 1 + +# Setting b.L scheduler parameters +write /proc/sys/kernel/sched_migration_fixup 1 +write /proc/sys/kernel/sched_upmigrate 99 +write /proc/sys/kernel/sched_downmigrate 85 +write /proc/sys/kernel/sched_freq_inc_notify 400000 +write /proc/sys/kernel/sched_freq_dec_notify 400000 +write /proc/sys/kernel/sched_spill_nr_run 5 +write /proc/sys/kernel/sched_restrict_cluster_spill 1 + +# configure governor settings for little cluster +write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "sched" + +# configure governor settings for big cluster +write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor "sched" + +# re-enable thermal hotplug +write /sys/module/msm_thermal/core_control/enabled 1 + +# Enable bus-dcvs +for cpubw in /sys/class/devfreq/*qcom,cpubw* +do + write $cpubw/governor "bw_hwmon" + write $cpubw/polling_interval 50 + write $cpubw/min_freq 1525 + write $cpubw/bw_hwmon/mbps_zones "3143 5859 11863 13763" + write $cpubw/bw_hwmon/sample_ms 4 + write $cpubw/bw_hwmon/io_percent 34 + write $cpubw/bw_hwmon/hist_memory 20 + write $cpubw/bw_hwmon/hyst_length 10 + write $cpubw/bw_hwmon/low_power_ceil_mbps 0 + write $cpubw/bw_hwmon/low_power_io_percent 34 + write $cpubw/bw_hwmon/low_power_delay 20 + write $cpubw/bw_hwmon/guard_band_mbps 0 + write $cpubw/bw_hwmon/up_scale 250 + write $cpubw/bw_hwmon/idle_mbps 1600 +done + +write /sys/class/devfreq/soc:qcom,mincpubw/governor "cpufreq" + diff --git a/init.radio.sh b/init.radio.sh new file mode 100644 index 00000000..cbfa6a1a --- /dev/null +++ b/init.radio.sh @@ -0,0 +1,33 @@ +#!/system/bin/sh + +# +# Copy qcril.db if needed for RIL +# +if [ -f /vendor/qcril.db -a ! -f /data/misc/radio/qcril.db ]; then + cp /vendor/qcril.db /data/misc/radio/qcril.db + chown -h radio.radio /data/misc/radio/qcril.db +fi +echo 1 > /data/misc/radio/db_check_done + +# +# Make modem config folder and copy firmware config to that folder for RIL +# +if [ -f /data/misc/radio/ver_info.txt ]; then + prev_version_info=`cat /data/misc/radio/ver_info.txt` +else + prev_version_info="" +fi + +cur_version_info=`cat /firmware/verinfo/ver_info.txt` +if [ ! -f /firmware/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then + rm -rf /data/misc/radio/modem_config + mkdir /data/misc/radio/modem_config + chmod 770 /data/misc/radio/modem_config + cp -r /firmware/image/modem_pr/mcfg/configs/* /data/misc/radio/modem_config + chown -hR radio.radio /data/misc/radio/modem_config + cp /firmware/verinfo/ver_info.txt /data/misc/radio/ver_info.txt + chown radio.radio /data/misc/radio/ver_info.txt +fi +cp /firmware/image/modem_pr/mbn_ota.txt /data/misc/radio/modem_config +chown radio.radio /data/misc/radio/modem_config/mbn_ota.txt +echo 1 > /data/misc/radio/copy_complete diff --git a/init.recovery.hardware.rc b/init.recovery.hardware.rc new file mode 100644 index 00000000..40946271 --- /dev/null +++ b/init.recovery.hardware.rc @@ -0,0 +1,3 @@ +on fs + wait /dev/block/platform/soc/${ro.boot.bootdevice} + symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice diff --git a/liblight/Android.mk b/liblight/Android.mk new file mode 100644 index 00000000..da87af29 --- /dev/null +++ b/liblight/Android.mk @@ -0,0 +1,29 @@ +# Copyright (C) 2016 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. + +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := lights.c +LOCAL_MODULE_RELATIVE_PATH := hw +LOCAL_SHARED_LIBRARIES := libc libcutils liblog +LOCAL_CFLAGS := $(common_flags) \ + -DLOG_TAG=\"qdlights\" \ + -DDEFAULT_LOW_PERSISTENCE_MODE_BRIGHTNESS=$(DEFAULT_LOW_PERSISTENCE_MODE_BRIGHTNESS) +LOCAL_CLANG := true +LOCAL_MODULE := lights.$(TARGET_DEVICE) +LOCAL_MODULE_TAGS := optional + +include $(BUILD_SHARED_LIBRARY) diff --git a/liblight/NOTICE b/liblight/NOTICE new file mode 100644 index 00000000..7340b9e3 --- /dev/null +++ b/liblight/NOTICE @@ -0,0 +1,190 @@ + + Copyright (c) 2008, 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. + + 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. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/liblight/lights.c b/liblight/lights.c new file mode 100644 index 00000000..7ceec6e5 --- /dev/null +++ b/liblight/lights.c @@ -0,0 +1,403 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * Copyright (C) 2014 The Linux Foundation. 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. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +/* + * Change this to 1 to support battery notifications via BatteryService + */ +#define LIGHTS_SUPPORT_BATTERY 0 +#define CG_COLOR_ID_PROPERTY "ro.boot.hardware.color" + +static pthread_once_t g_init = PTHREAD_ONCE_INIT; +static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER; +static struct light_state_t g_notification; +static struct light_state_t g_battery; +static int g_last_backlight_mode = BRIGHTNESS_MODE_USER; +static int g_attention = 0; +static int rgb_brightness_ratio = 255; + +char const*const RED_LED_FILE + = "/sys/class/leds/red/brightness"; + +char const*const GREEN_LED_FILE + = "/sys/class/leds/green/brightness"; + +char const*const BLUE_LED_FILE + = "/sys/class/leds/blue/brightness"; + +char const*const LCD_FILE + = "/sys/class/leds/lcd-backlight/brightness"; + +char const*const PERSISTENCE_FILE + = "/sys/class/leds/lcd-backlight/low_persistence"; + +char const*const BUTTON_FILE + = "/sys/class/leds/button-backlight/brightness"; + +char const*const RED_BLINK_FILE + = "/sys/class/leds/red/blink"; + +char const*const GREEN_BLINK_FILE + = "/sys/class/leds/green/blink"; + +char const*const BLUE_BLINK_FILE + = "/sys/class/leds/blue/blink"; + +char const*const RED_ON_OFF_MS_FILE + = "/sys/class/leds/red/on_off_ms"; + +char const*const GREEN_ON_OFF_MS_FILE + = "/sys/class/leds/green/on_off_ms"; + +char const*const BLUE_ON_OFF_MS_FILE + = "/sys/class/leds/blue/on_off_ms"; + +char const*const RED_RGB_START_FILE + = "/sys/class/leds/red/rgb_start"; + +char const*const GREEN_RGB_START_FILE + = "/sys/class/leds/green/rgb_start"; + +char const*const BLUE_RGB_START_FILE + = "/sys/class/leds/blue/rgb_start"; + +/** + * device methods + */ + +void init_globals(void) +{ + char color_id_prop[PROPERTY_VALUE_MAX] = {""}; + + // init the mutex + pthread_mutex_init(&g_lock, NULL); + + // check CG color + property_get(CG_COLOR_ID_PROPERTY, color_id_prop, "DEF00"); + if (strcmp(color_id_prop, "GRA00") == 0) { + rgb_brightness_ratio = 25; + } else if (strcmp(color_id_prop, "SLV00") == 0) { + rgb_brightness_ratio = 15; + } else if (strcmp(color_id_prop, "BLU00") == 0) { + rgb_brightness_ratio = 15; + } else { + rgb_brightness_ratio = 20; + } +} + +static int +write_int(char const* path, int value) +{ + int fd; + static int already_warned = 0; + + fd = open(path, O_WRONLY); + if (fd >= 0) { + char buffer[20]; + size_t bytes = snprintf(buffer, sizeof(buffer), "%d\n", value); + if(bytes >= sizeof(buffer)) return -EINVAL; + ssize_t amt = write(fd, buffer, bytes); + close(fd); + return amt == -1 ? -errno : 0; + } else { + if (already_warned == 0) { + ALOGE("write_int failed to open %s\n", path); + already_warned = 1; + } + return -errno; + } +} + +static int +write_double_int(char const* path, int value1, int value2) +{ + int fd; + static int already_warned = 0; + + fd = open(path, O_WRONLY); + if (fd >= 0) { + char buffer[20]; + size_t bytes = snprintf(buffer, sizeof(buffer), "%d %d\n", value1, value2); + if(bytes >= sizeof(buffer)) return -EINVAL; + ssize_t amt = write(fd, buffer, bytes); + close(fd); + return amt == -1 ? -errno : 0; + } else { + if (already_warned == 0) { + ALOGE("write_int failed to open %s\n", path); + already_warned = 1; + } + return -errno; + } +} + +static int +is_lit(struct light_state_t const* state) +{ + return state->color & 0x00ffffff; +} + +static int +rgb_to_brightness(struct light_state_t const* state) +{ + int color = state->color & 0x00ffffff; + return ((77*((color>>16)&0x00ff)) + + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8; +} + +static int +set_light_backlight(struct light_device_t* dev, + struct light_state_t const* state) +{ + int err = 0; + int brightness = rgb_to_brightness(state); + unsigned int lpEnabled = state->brightnessMode == BRIGHTNESS_MODE_LOW_PERSISTENCE; + if(!dev) { + return -1; + } + + pthread_mutex_lock(&g_lock); + + // If we're not in lp mode and it has been enabled or if we are in lp mode + // and it has been disabled send an ioctl to the display with the update + if ((g_last_backlight_mode != state->brightnessMode && lpEnabled) || + (!lpEnabled && g_last_backlight_mode == BRIGHTNESS_MODE_LOW_PERSISTENCE)) { + if ((err = write_int(PERSISTENCE_FILE, lpEnabled)) != 0) { + ALOGE("%s: Failed to write to %s: %s\n", __FUNCTION__, PERSISTENCE_FILE, + strerror(errno)); + } + if (lpEnabled != 0) { + // This is defined in BoardConfig.mk. + brightness = DEFAULT_LOW_PERSISTENCE_MODE_BRIGHTNESS; + } + } + + g_last_backlight_mode = state->brightnessMode; + + if (!err) { + err = write_int(LCD_FILE, brightness); + } + + pthread_mutex_unlock(&g_lock); + return err; +} + +static int +set_speaker_light_locked(struct light_device_t* dev, + struct light_state_t const* state) +{ + int red, green, blue; + int blink; + int onMS, offMS; + unsigned int colorRGB; + + if(!dev) { + return -1; + } + + switch (state->flashMode) { + case LIGHT_FLASH_TIMED: + onMS = state->flashOnMS; + offMS = state->flashOffMS; + break; + case LIGHT_FLASH_NONE: + default: + onMS = 0; + offMS = 0; + break; + } + + colorRGB = state->color; + +#if 0 + ALOGD("set_speaker_light_locked mode %d, colorRGB=%08X, onMS=%d, offMS=%d\n", + state->flashMode, colorRGB, onMS, offMS); +#endif + + red = ((colorRGB >> 16) & 0xFF) * rgb_brightness_ratio / 255; + green = ((colorRGB >> 8) & 0xFF) * rgb_brightness_ratio / 255; + blue = (colorRGB & 0xFF) * rgb_brightness_ratio / 255; + + write_double_int(RED_ON_OFF_MS_FILE, onMS, offMS); + write_int(RED_LED_FILE, red); + write_double_int(GREEN_ON_OFF_MS_FILE, onMS, offMS); + write_int(GREEN_LED_FILE, green); + write_double_int(BLUE_ON_OFF_MS_FILE, onMS, offMS); + write_int(BLUE_LED_FILE, blue); + + if(!write_int(RED_RGB_START_FILE, 1)) + if(!write_int(GREEN_RGB_START_FILE, 1)) + if(!write_int(BLUE_RGB_START_FILE, 1)) + return -1; + + return 0; +} + +static void +handle_speaker_battery_locked(struct light_device_t* dev) +{ + if (is_lit(&g_battery)) { + set_speaker_light_locked(dev, &g_battery); + } else { + set_speaker_light_locked(dev, &g_notification); + } +} + +#if LIGHTS_SUPPORT_BATTERY +static int +set_light_battery(struct light_device_t* dev, + struct light_state_t const* state) +{ + pthread_mutex_lock(&g_lock); + g_battery = *state; + handle_speaker_battery_locked(dev); + pthread_mutex_unlock(&g_lock); + return 0; +} +#endif + +static int +set_light_notifications(struct light_device_t* dev, + struct light_state_t const* state) +{ + pthread_mutex_lock(&g_lock); + g_notification = *state; + handle_speaker_battery_locked(dev); + pthread_mutex_unlock(&g_lock); + return 0; +} + +static int +set_light_attention(struct light_device_t* dev, + struct light_state_t const* state) +{ + pthread_mutex_lock(&g_lock); + if (state->flashMode == LIGHT_FLASH_HARDWARE) { + g_attention = state->flashOnMS; + } else if (state->flashMode == LIGHT_FLASH_NONE) { + g_attention = 0; + } + handle_speaker_battery_locked(dev); + pthread_mutex_unlock(&g_lock); + return 0; +} + +static int +set_light_buttons(struct light_device_t* dev, + struct light_state_t const* state) +{ + int err = 0; + if(!dev) { + return -1; + } + pthread_mutex_lock(&g_lock); + err = write_int(BUTTON_FILE, state->color & 0xFF); + pthread_mutex_unlock(&g_lock); + return err; +} + +/** Close the lights device */ +static int +close_lights(struct light_device_t *dev) +{ + if (dev) { + free(dev); + } + return 0; +} + + +/******************************************************************************/ + +/** + * module methods + */ + +/** Open a new instance of a lights device using name */ +static int open_lights(const struct hw_module_t* module, char const* name, + struct hw_device_t** device) +{ + int (*set_light)(struct light_device_t* dev, + struct light_state_t const* state); + + if (0 == strcmp(LIGHT_ID_BACKLIGHT, name)) + set_light = set_light_backlight; +#if LIGHTS_SUPPORT_BATTERY + else if (0 == strcmp(LIGHT_ID_BATTERY, name)) + set_light = set_light_battery; +#endif + else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name)) + set_light = set_light_notifications; + else if (0 == strcmp(LIGHT_ID_BUTTONS, name)) + set_light = set_light_buttons; + else if (0 == strcmp(LIGHT_ID_ATTENTION, name)) + set_light = set_light_attention; + else + return -EINVAL; + + pthread_once(&g_init, init_globals); + + struct light_device_t *dev = malloc(sizeof(struct light_device_t)); + + if(!dev) + return -ENOMEM; + + memset(dev, 0, sizeof(*dev)); + + dev->common.tag = HARDWARE_DEVICE_TAG; + dev->common.version = LIGHTS_DEVICE_API_VERSION_2_0; + dev->common.module = (struct hw_module_t*)module; + dev->common.close = (int (*)(struct hw_device_t*))close_lights; + dev->set_light = set_light; + + *device = (struct hw_device_t*)dev; + return 0; +} + +static struct hw_module_methods_t lights_module_methods = { + .open = open_lights, +}; + +/* + * The lights Module + */ +struct hw_module_t HAL_MODULE_INFO_SYM = { + .tag = HARDWARE_MODULE_TAG, + .version_major = 1, + .version_minor = 0, + .id = LIGHTS_HARDWARE_MODULE_ID, + .name = "lights Module", + .author = "Google, Inc.", + .methods = &lights_module_methods, +}; diff --git a/lowi.conf b/lowi.conf new file mode 100644 index 00000000..cfadcb21 --- /dev/null +++ b/lowi.conf @@ -0,0 +1,51 @@ +#*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* +# +# LOWI Config file +# +# GENERAL DESCRIPTION +# This file contains the config params for LOWI +# +# Copyright (c) 2012-2013 Qualcomm Atheros, Inc. +# All Rights Reserved. +# Qualcomm Atheros Confidential and Proprietary. +# +# Export of this technology or software is regulated by the U.S. Government. +# Diversion contrary to U.S. law prohibited. +#=============================================================================*/ + +# X86 ONLY - UBUNTU: +# Copy this file in the same directory where the executable is + +# The RSSI threshold used in the RTT outlier detection in half decibels. Default value recommended by the +# system team currently is -140 (corresponding to -70 dB). +LOWI_RSSI_THRESHOLD_FOR_RTT = -140 + +# Number of measurment per AP for RTS/CTS +LOWI_RTS_CTS_NUM_MEAS = 5 + +# Maximum Number of Outstanding Requests supported +LOWI_MAX_OUTSTANDING_REQUEST = 255 + +# Maximum number of records in Cache +LOWI_MAX_NUM_CACHE_RECORDS = 200 + +# Default threshold before issuing another fresh scan (ms) +LOWI_FRESH_SCAN_THRESHOLD = 500 + +# Timeout in case no result is reported by the driver (seconds) +LOWI_NO_RESULT_WAIT_TOLERANCE = 10 + +# Use Fake Wifi driver. Only valid for engineering builds +LOWI_USE_FAKE_WIFI_DRIVER = 0 + +# Use ROME Wifi driver. Only valid for engineering builds +# Will be removed later only for development support +LOWI_USE_ROME_WIFI_DRIVER = 0 + +# Use LOWI LP. +# When enabled the Discovery Request will be routed to LOWI-LP +LOWI_USE_LOWI_LP = 1 + +# Log level +# EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100 +LOWI_LOG_LEVEL = 2 diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 00000000..e9bca612 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,30 @@ + + + android.hardware.light + hwbinder + + 2.0 + + + android.hardware.biometrics.fingerprint + hwbinder + + 2.1 + + IBiometricsFingerprint + fingerprint_hal + + + + android.hardware.graphics.allocator + hwbinder + + 2.0 + + + android.hardware.graphics.mapper + passthrough + + 2.0 + + diff --git a/media_codecs.xml b/media_codecs.xml new file mode 100644 index 00000000..3d06362d --- /dev/null +++ b/media_codecs.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/media_profiles.xml b/media_profiles.xml new file mode 100644 index 00000000..d4b8ae0b --- /dev/null +++ b/media_profiles.xml @@ -0,0 +1,554 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mixer_paths.xml b/mixer_paths.xml new file mode 100644 index 00000000..8fb14cc6 --- /dev/null +++ b/mixer_paths.xml @@ -0,0 +1,2058 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mixer_paths_tasha.xml b/mixer_paths_tasha.xml new file mode 100644 index 00000000..b765d662 --- /dev/null +++ b/mixer_paths_tasha.xml @@ -0,0 +1,1762 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mixer_paths_tavil.xml b/mixer_paths_tavil.xml new file mode 100644 index 00000000..07237af7 --- /dev/null +++ b/mixer_paths_tavil.xml @@ -0,0 +1,1780 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100755 index 00000000..f458dfd6 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,54 @@ + + + + + + + true + + + true + + + true + + + + "wlan0" + "softap.*" + + + + com.android.systemui/com.android.systemui.doze.DozeService + + + true + + + com.google.sensor.double_touch + + diff --git a/p2p_supplicant_overlay.conf b/p2p_supplicant_overlay.conf new file mode 100644 index 00000000..acbace22 --- /dev/null +++ b/p2p_supplicant_overlay.conf @@ -0,0 +1 @@ +disable_scan_offload=1 diff --git a/power/performance.h b/power/performance.h new file mode 100755 index 00000000..b8734466 --- /dev/null +++ b/power/performance.h @@ -0,0 +1,259 @@ +/* Copyright (c) 2012, 2014, 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 + * 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. + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define FAILED -1 +#define SUCCESS 0 +#define INDEFINITE_DURATION 0 + +enum SCREEN_DISPLAY_TYPE { + DISPLAY_OFF = 0x00FF, +}; + +enum PWR_CLSP_TYPE { + ALL_CPUS_PWR_CLPS_DIS = 0x101, +}; + +/* For CPUx min freq, the leftmost byte + * represents the CPU and the + * rightmost byte represents the frequency + * All intermediate frequencies on the + * device are supported. The hex value + * passed into PerfLock will be multiplied + * by 10^5. This frequency or the next + * highest frequency available will be set + * + * For example, if 1.4 Ghz is required on + * CPU0, use 0x20E + * + * If the highest available frequency + * on the device is required, use + * CPUx_MIN_FREQ_TURBO_MAX + * where x represents the CPU + */ +enum CPU0_MIN_FREQ_LVL { + CPU0_MIN_FREQ_NONTURBO_MAX = 0x20A, + CPU0_MIN_FREQ_TURBO_MAX = 0x2FE, +}; + +enum CPU1_MIN_FREQ_LVL { + CPU1_MIN_FREQ_NONTURBO_MAX = 0x30A, + CPU1_MIN_FREQ_TURBO_MAX = 0x3FE, +}; + +enum CPU2_MIN_FREQ_LVL { + CPU2_MIN_FREQ_NONTURBO_MAX = 0x40A, + CPU2_MIN_FREQ_TURBO_MAX = 0x4FE, +}; + +enum CPU3_MIN_FREQ_LVL { + CPU3_MIN_FREQ_NONTURBO_MAX = 0x50A, + CPU3_MIN_FREQ_TURBO_MAX = 0x5FE, +}; + +enum CPU0_MAX_FREQ_LVL { + CPU0_MAX_FREQ_NONTURBO_MAX = 0x150A, +}; + +enum CPU1_MAX_FREQ_LVL { + CPU1_MAX_FREQ_NONTURBO_MAX = 0x160A, +}; + +enum CPU2_MAX_FREQ_LVL { + CPU2_MAX_FREQ_NONTURBO_MAX = 0x170A, +}; + +enum CPU3_MAX_FREQ_LVL { + CPU3_MAX_FREQ_NONTURBO_MAX = 0x180A, +}; + +enum MIN_CPUS_ONLINE_LVL { + CPUS_ONLINE_MIN_2 = 0x702, + CPUS_ONLINE_MIN_3 = 0x703, + CPUS_ONLINE_MIN_4 = 0x704, + CPUS_ONLINE_MPD_OVERRIDE = 0x777, + CPUS_ONLINE_MAX = 0x7FF, +}; + +enum MAX_CPUS_ONLINE_LVL { + CPUS_ONLINE_MAX_LIMIT_1 = 0x8FE, + CPUS_ONLINE_MAX_LIMIT_2 = 0x8FD, + CPUS_ONLINE_MAX_LIMIT_3 = 0x8FC, + CPUS_ONLINE_MAX_LIMIT_4 = 0x8FB, + CPUS_ONLINE_MAX_LIMIT_MAX = 0x8FB, +}; + +enum SAMPLING_RATE_LVL { + MS_500 = 0xBCD, + MS_50 = 0xBFA, + MS_20 = 0xBFD, +}; + +enum ONDEMAND_IO_BUSY_LVL { + IO_BUSY_OFF = 0xC00, + IO_BUSY_ON = 0xC01, +}; + +enum ONDEMAND_SAMPLING_DOWN_FACTOR_LVL { + SAMPLING_DOWN_FACTOR_1 = 0xD01, + SAMPLING_DOWN_FACTOR_4 = 0xD04, +}; + +enum INTERACTIVE_TIMER_RATE_LVL { + TR_MS_500 = 0xECD, + TR_MS_100 = 0xEF5, + TR_MS_50 = 0xEFA, + TR_MS_30 = 0xEFC, + TR_MS_20 = 0xEFD, +}; + +/* This timer rate applicable to cpu0 + across 8939 series chipset */ +enum INTERACTIVE_TIMER_RATE_LVL_CPU0_8939 { + TR_MS_CPU0_500 = 0x30CD, + TR_MS_CPU0_100 = 0x30F5, + TR_MS_CPU0_50 = 0x30FA, + TR_MS_CPU0_30 = 0x30FC, + TR_MS_CPU0_20 = 0x30FD, +}; + +/* This timer rate applicable to cpu4 + across 8939 series chipset */ +enum INTERACTIVE_TIMER_RATE_LVL_CPU4_8939 { + TR_MS_CPU4_500 = 0x3BCD, + TR_MS_CPU4_100 = 0x3BF5, + TR_MS_CPU4_50 = 0x3BFA, + TR_MS_CPU4_30 = 0x3BFC, + TR_MS_CPU4_20 = 0x3BFD, +}; + +/* This timer rate applicable to big.little arch */ +enum INTERACTIVE_TIMER_RATE_LVL_BIG_LITTLE { + BIG_LITTLE_TR_MS_100 = 0x64, + BIG_LITTLE_TR_MS_50 = 0x32, + BIG_LITTLE_TR_MS_40 = 0x28, + BIG_LITTLE_TR_MS_30 = 0x1E, + BIG_LITTLE_TR_MS_20 = 0x14, +}; + +/* INTERACTIVE opcodes */ +enum INTERACTIVE_OPCODES { + INT_OP_CLUSTER0_TIMER_RATE = 0x41424000, + INT_OP_CLUSTER1_TIMER_RATE = 0x41424100, + INT_OP_CLUSTER0_USE_SCHED_LOAD = 0x41430000, + INT_OP_CLUSTER1_USE_SCHED_LOAD = 0x41430100, + INT_OP_CLUSTER0_USE_MIGRATION_NOTIF = 0x41434000, + INT_OP_CLUSTER1_USE_MIGRATION_NOTIF = 0x41434100, + INT_OP_NOTIFY_ON_MIGRATE = 0x4241C000 +}; + +enum INTERACTIVE_HISPEED_FREQ_LVL { + HS_FREQ_1026 = 0xF0A, +}; + +enum INTERACTIVE_HISPEED_LOAD_LVL { + HISPEED_LOAD_90 = 0x105A, +}; + +enum SYNC_FREQ_LVL { + SYNC_FREQ_300 = 0x1103, + SYNC_FREQ_600 = 0X1106, + SYNC_FREQ_384 = 0x1103, + SYNC_FREQ_NONTURBO_MAX = 0x110A, + SYNC_FREQ_TURBO = 0x110F, +}; + +enum OPTIMAL_FREQ_LVL { + OPTIMAL_FREQ_300 = 0x1203, + OPTIMAL_FREQ_600 = 0x1206, + OPTIMAL_FREQ_384 = 0x1203, + OPTIMAL_FREQ_NONTURBO_MAX = 0x120A, + OPTIMAL_FREQ_TURBO = 0x120F, +}; + +enum SCREEN_PWR_CLPS_LVL { + PWR_CLPS_DIS = 0x1300, + PWR_CLPS_ENA = 0x1301, +}; + +enum THREAD_MIGRATION_LVL { + THREAD_MIGRATION_SYNC_OFF = 0x1400, +}; + +enum INTERACTIVE_IO_BUSY_LVL { + INTERACTIVE_IO_BUSY_OFF = 0x1B00, + INTERACTIVE_IO_BUSY_ON = 0x1B01, +}; + +enum SCHED_BOOST_LVL { + SCHED_BOOST_ON = 0x1E01, +}; + +enum CPU4_MIN_FREQ_LVL { + CPU4_MIN_FREQ_NONTURBO_MAX = 0x1F0A, + CPU4_MIN_FREQ_TURBO_MAX = 0x1FFE, +}; + +enum CPU5_MIN_FREQ_LVL { + CPU5_MIN_FREQ_NONTURBO_MAX = 0x200A, + CPU5_MIN_FREQ_TURBO_MAX = 0x20FE, +}; + +enum CPU6_MIN_FREQ_LVL { + CPU6_MIN_FREQ_NONTURBO_MAX = 0x210A, + CPU6_MIN_FREQ_TURBO_MAX = 0x21FE, +}; + +enum CPU7_MIN_FREQ_LVL { + CPU7_MIN_FREQ_NONTURBO_MAX = 0x220A, + CPU7_MIN_FREQ_TURBO_MAX = 0x22FE, +}; + +enum CPU4_MAX_FREQ_LVL { + CPU4_MAX_FREQ_NONTURBO_MAX = 0x230A, +}; + +enum CPU5_MAX_FREQ_LVL { + CPU5_MAX_FREQ_NONTURBO_MAX = 0x240A, +}; + +enum CPU6_MAX_FREQ_LVL { + CPU6_MAX_FREQ_NONTURBO_MAX = 0x250A, +}; + +enum CPU7_MAX_FREQ_LVL { + CPU7_MAX_FREQ_NONTURBO_MAX = 0x260A, +}; + +#ifdef __cplusplus +} +#endif diff --git a/sec_config b/sec_config new file mode 100644 index 00000000..23716aac --- /dev/null +++ b/sec_config @@ -0,0 +1,323 @@ +/* IPC Security Config */ +/* :: */ +16:4294967295:1000:1021 +/* :: */ +56:4294967295:1021 +/* Allow SS CTL service to be used by system and net_raw processes */ +43:4294967295:1000:3004 +/* :: */ +71:4294967295:1001 +/* :: */ +50:4294967295:1001 +/* QMI-SLIM service permitted to gps and net_raw */ +55:4294967295:1021 +/* Allow Sensor services to be used by sensor process */ +256:4294967295:1000:1006:1013:1021:1047:3011 +257:4294967295:1000:1006:1013:1021:1047:3011 +258:4294967295:1000:1006:1013:1021:1047:3011 +259:4294967295:1000:1006:1013:1021:1047:3011 +260:4294967295:1000:1006:1013:1021:1047:3011 +261:4294967295:1000:1006:1013:1021:1047:3011 +262:4294967295:1000:1006:1013:1021:1047:3011 +263:4294967295:1000:1006:1013:1021:1047:3011 +264:4294967295:1000:1006:1013:1021:1047:3011 +265:4294967295:1000:1006:1013:1021:1047:3011 +266:4294967295:1000:1006:1013:1021:1047:3011 +267:4294967295:1000:1006:1013:1021:1047:3011 +268:4294967295:1000:1006:1013:1021:1047:3011 +269:4294967295:1000:1006:1013:1021:1047:3011 +270:4294967295:1000:1006:1013:1021:1047:3011 +271:4294967295:1000:1006:1013:1021:1047:3011 +272:4294967295:1000:1006:1013:1021:1047:3011 +273:4294967295:1000:1006:1013:1021:1047:3011 +274:4294967295:1000:1006:1013:1021:1047:3011 +275:4294967295:1000:1006:1013:1021:1047:3011 +276:4294967295:1000:1006:1013:1021:1047:3011 +277:4294967295:1000:1006:1013:1021:1047:3011 +278:4294967295:1000:1006:1013:1021:1047:3011 +279:4294967295:1000:1006:1013:1021:1047:3011 +280:4294967295:1000:1006:1013:1021:1047:3011 +281:4294967295:1000:1006:1013:1021:1047:3011 +282:4294967295:1000:1006:1013:1021:1047:3011 +283:4294967295:1000:1006:1013:1021:1047:3011 +284:4294967295:1000:1006:1013:1021:1047:3011 +285:4294967295:1000:1006:1013:1021:1047:3011 +286:4294967295:1000:1006:1013:1021:1047:3011 +287:4294967295:1000:1006:1013:1021:1047:3011 +288:4294967295:1000:1006:1013:1021:1047:3011 +289:4294967295:1000:1006:1013:1021:1047:3011 +290:4294967295:1000:1006:1013:1021:1047:3011 +291:4294967295:1000:1006:1013:1021:1047:3011 +292:4294967295:1000:1006:1013:1021:1047:3011 +293:4294967295:1000:1006:1013:1021:1047:3011 +294:4294967295:1000:1006:1013:1021:1047:3011 +295:4294967295:1000:1006:1013:1021:1047:3011 +296:4294967295:1000:1006:1013:1021:1047:3011 +297:4294967295:1000:1006:1013:1021:1047:3011 +298:4294967295:1000:1006:1013:1021:1047:3011 +299:4294967295:1000:1006:1013:1021:1047:3011 +300:4294967295:1000:1006:1013:1021:1047:3011 +301:4294967295:1000:1006:1013:1021:1047:3011 +302:4294967295:1000:1006:1013:1021:1047:3011 +303:4294967295:1000:1006:1013:1021:1047:3011 +304:4294967295:1000:1006:1013:1021:1047:3011 +305:4294967295:1000:1006:1013:1021:1047:3011 +306:4294967295:1000:1006:1013:1021:1047:3011 +307:4294967295:1000:1006:1013:1021:1047:3011 +308:4294967295:1000:1006:1013:1021:1047:3011 +309:4294967295:1000:1006:1013:1021:1047:3011 +310:4294967295:1000:1006:1013:1021:1047:3011 +311:4294967295:1000:1006:1013:1021:1047:3011 +312:4294967295:1000:1006:1013:1021:1047:3011 +313:4294967295:1000:1006:1013:1021:1047:3011 +314:4294967295:1000:1006:1013:1021:1047:3011 +315:4294967295:1000:1006:1013:1021:1047:3011 +316:4294967295:1000:1006:1013:1021:1047:3011 +317:4294967295:1000:1006:1013:1021:1047:3011 +318:4294967295:1000:1006:1013:1021:1047:3011 +319:4294967295:1000:1006:1013:1021:1047:3011 +320:4294967295:1000:1006:1013:1021:1047:3011 +321:4294967295:1000:1006:1013:1021:1047:3011 +322:4294967295:1000:1006:1013:1021:1047:3011 +323:4294967295:1000:1006:1013:1021:1047:3011 +324:4294967295:1000:1006:1013:1021:1047:3011 +325:4294967295:1000:1006:1013:1021:1047:3011 +326:4294967295:1000:1006:1013:1021:1047:3011 +327:4294967295:1000:1006:1013:1021:1047:3011 +328:4294967295:1000:1006:1013:1021:1047:3011 +329:4294967295:1000:1006:1013:1021:1047:3011 +330:4294967295:1000:1006:1013:1021:1047:3011 +331:4294967295:1000:1006:1013:1021:1047:3011 +332:4294967295:1000:1006:1013:1021:1047:3011 +333:4294967295:1000:1006:1013:1021:1047:3011 +334:4294967295:1000:1006:1013:1021:1047:3011 +335:4294967295:1000:1006:1013:1021:1047:3011 +336:4294967295:1000:1006:1013:1021:1047:3011 +337:4294967295:1000:1006:1013:1021:1047:3011 +338:4294967295:1000:1006:1013:1021:1047:3011 +339:4294967295:1000:1006:1013:1021:1047:3011 +340:4294967295:1000:1006:1013:1021:1047:3011 +341:4294967295:1000:1006:1013:1021:1047:3011 +342:4294967295:1000:1006:1013:1021:1047:3011 +343:4294967295:1000:1006:1013:1021:1047:3011 +344:4294967295:1000:1006:1013:1021:1047:3011 +345:4294967295:1000:1006:1013:1021:1047:3011 +346:4294967295:1000:1006:1013:1021:1047:3011 +347:4294967295:1000:1006:1013:1021:1047:3011 +348:4294967295:1000:1006:1013:1021:1047:3011 +349:4294967295:1000:1006:1013:1021:1047:3011 +350:4294967295:1000:1006:1013:1021:1047:3011 +351:4294967295:1000:1006:1013:1021:1047:3011 +352:4294967295:1000:1006:1013:1021:1047:3011 +353:4294967295:1000:1006:1013:1021:1047:3011 +354:4294967295:1000:1006:1013:1021:1047:3011 +355:4294967295:1000:1006:1013:1021:1047:3011 +356:4294967295:1000:1006:1013:1021:1047:3011 +357:4294967295:1000:1006:1013:1021:1047:3011 +358:4294967295:1000:1006:1013:1021:1047:3011 +359:4294967295:1000:1006:1013:1021:1047:3011 +360:4294967295:1000:1006:1013:1021:1047:3011 +361:4294967295:1000:1006:1013:1021:1047:3011 +362:4294967295:1000:1006:1013:1021:1047:3011 +363:4294967295:1000:1006:1013:1021:1047:3011 +364:4294967295:1000:1006:1013:1021:1047:3011 +365:4294967295:1000:1006:1013:1021:1047:3011 +366:4294967295:1000:1006:1013:1021:1047:3011 +367:4294967295:1000:1006:1013:1021:1047:3011 +368:4294967295:1000:1006:1013:1021:1047:3011 +369:4294967295:1000:1006:1013:1021:1047:3011 +370:4294967295:1000:1006:1013:1021:1047:3011 +371:4294967295:1000:1006:1013:1021:1047:3011 +372:4294967295:1000:1006:1013:1021:1047:3011 +373:4294967295:1000:1006:1013:1021:1047:3011 +374:4294967295:1000:1006:1013:1021:1047:3011 +375:4294967295:1000:1006:1013:1021:1047:3011 +376:4294967295:1000:1006:1013:1021:1047:3011 +377:4294967295:1000:1006:1013:1021:1047:3011 +378:4294967295:1000:1006:1013:1021:1047:3011 +379:4294967295:1000:1006:1013:1021:1047:3011 +380:4294967295:1000:1006:1013:1021:1047:3011 +381:4294967295:1000:1006:1013:1021:1047:3011 +382:4294967295:1000:1006:1013:1021:1047:3011 +383:4294967295:1000:1006:1013:1021:1047:3011 +384:4294967295:1000:1006:1013:1021:1047:3011 +385:4294967295:1000:1006:1013:1021:1047:3011 +386:4294967295:1000:1006:1013:1021:1047:3011 +387:4294967295:1000:1006:1013:1021:1047:3011 +388:4294967295:1000:1006:1013:1021:1047:3011 +389:4294967295:1000:1006:1013:1021:1047:3011 +390:4294967295:1000:1006:1013:1021:1047:3011 +391:4294967295:1000:1006:1013:1021:1047:3011 +392:4294967295:1000:1006:1013:1021:1047:3011 +393:4294967295:1000:1006:1013:1021:1047:3011 +394:4294967295:1000:1006:1013:1021:1047:3011 +395:4294967295:1000:1006:1013:1021:1047:3011 +396:4294967295:1000:1006:1013:1021:1047:3011 +397:4294967295:1000:1006:1013:1021:1047:3011 +398:4294967295:1000:1006:1013:1021:1047:3011 +399:4294967295:1000:1006:1013:1021:1047:3011 +400:4294967295:1000:1006:1013:1021:1047:3011 +401:4294967295:1000:1006:1013:1021:1047:3011 +402:4294967295:1000:1006:1013:1021:1047:3011 +403:4294967295:1000:1006:1013:1021:1047:3011 +404:4294967295:1000:1006:1013:1021:1047:3011 +405:4294967295:1000:1006:1013:1021:1047:3011 +406:4294967295:1000:1006:1013:1021:1047:3011 +407:4294967295:1000:1006:1013:1021:1047:3011 +408:4294967295:1000:1006:1013:1021:1047:3011 +409:4294967295:1000:1006:1013:1021:1047:3011 +410:4294967295:1000:1006:1013:1021:1047:3011 +411:4294967295:1000:1006:1013:1021:1047:3011 +412:4294967295:1000:1006:1013:1021:1047:3011 +413:4294967295:1000:1006:1013:1021:1047:3011 +414:4294967295:1000:1006:1013:1021:1047:3011 +415:4294967295:1000:1006:1013:1021:1047:3011 +416:4294967295:1000:1006:1013:1021:1047:3011 +417:4294967295:1000:1006:1013:1021:1047:3011 +418:4294967295:1000:1006:1013:1021:1047:3011 +419:4294967295:1000:1006:1013:1021:1047:3011 +420:4294967295:1000:1006:1013:1021:1047:3011 +421:4294967295:1000:1006:1013:1021:1047:3011 +422:4294967295:1000:1006:1013:1021:1047:3011 +423:4294967295:1000:1006:1013:1021:1047:3011 +424:4294967295:1000:1006:1013:1021:1047:3011 +425:4294967295:1000:1006:1013:1021:1047:3011 +426:4294967295:1000:1006:1013:1021:1047:3011 +427:4294967295:1000:1006:1013:1021:1047:3011 +428:4294967295:1000:1006:1013:1021:1047:3011 +429:4294967295:1000:1006:1013:1021:1047:3011 +430:4294967295:1000:1006:1013:1021:1047:3011 +431:4294967295:1000:1006:1013:1021:1047:3011 +432:4294967295:1000:1006:1013:1021:1047:3011 +433:4294967295:1000:1006:1013:1021:1047:3011 +434:4294967295:1000:1006:1013:1021:1047:3011 +435:4294967295:1000:1006:1013:1021:1047:3011 +436:4294967295:1000:1006:1013:1021:1047:3011 +437:4294967295:1000:1006:1013:1021:1047:3011 +438:4294967295:1000:1006:1013:1021:1047:3011 +439:4294967295:1000:1006:1013:1021:1047:3011 +440:4294967295:1000:1006:1013:1021:1047:3011 +441:4294967295:1000:1006:1013:1021:1047:3011 +442:4294967295:1000:1006:1013:1021:1047:3011 +443:4294967295:1000:1006:1013:1021:1047:3011 +444:4294967295:1000:1006:1013:1021:1047:3011 +445:4294967295:1000:1006:1013:1021:1047:3011 +446:4294967295:1000:1006:1013:1021:1047:3011 +447:4294967295:1000:1006:1013:1021:1047:3011 +448:4294967295:1000:1006:1013:1021:1047:3011 +449:4294967295:1000:1006:1013:1021:1047:3011 +450:4294967295:1000:1006:1013:1021:1047:3011 +451:4294967295:1000:1006:1013:1021:1047:3011 +452:4294967295:1000:1006:1013:1021:1047:3011 +453:4294967295:1000:1006:1013:1021:1047:3011 +454:4294967295:1000:1006:1013:1021:1047:3011 +455:4294967295:1000:1006:1013:1021:1047:3011 +456:4294967295:1000:1006:1013:1021:1047:3011 +457:4294967295:1000:1006:1013:1021:1047:3011 +458:4294967295:1000:1006:1013:1021:1047:3011 +459:4294967295:1000:1006:1013:1021:1047:3011 +460:4294967295:1000:1006:1013:1021:1047:3011 +461:4294967295:1000:1006:1013:1021:1047:3011 +462:4294967295:1000:1006:1013:1021:1047:3011 +463:4294967295:1000:1006:1013:1021:1047:3011 +464:4294967295:1000:1006:1013:1021:1047:3011 +465:4294967295:1000:1006:1013:1021:1047:3011 +466:4294967295:1000:1006:1013:1021:1047:3011 +467:4294967295:1000:1006:1013:1021:1047:3011 +468:4294967295:1000:1006:1013:1021:1047:3011 +469:4294967295:1000:1006:1013:1021:1047:3011 +470:4294967295:1000:1006:1013:1021:1047:3011 +471:4294967295:1000:1006:1013:1021:1047:3011 +472:4294967295:1000:1006:1013:1021:1047:3011 +473:4294967295:1000:1006:1013:1021:1047:3011 +474:4294967295:1000:1006:1013:1021:1047:3011 +475:4294967295:1000:1006:1013:1021:1047:3011 +476:4294967295:1000:1006:1013:1021:1047:3011 +477:4294967295:1000:1006:1013:1021:1047:3011 +478:4294967295:1000:1006:1013:1021:1047:3011 +479:4294967295:1000:1006:1013:1021:1047:3011 +480:4294967295:1000:1006:1013:1021:1047:3011 +481:4294967295:1000:1006:1013:1021:1047:3011 +482:4294967295:1000:1006:1013:1021:1047:3011 +483:4294967295:1000:1006:1013:1021:1047:3011 +484:4294967295:1000:1006:1013:1021:1047:3011 +485:4294967295:1000:1006:1013:1021:1047:3011 +486:4294967295:1000:1006:1013:1021:1047:3011 +487:4294967295:1000:1006:1013:1021:1047:3011 +488:4294967295:1000:1006:1013:1021:1047:3011 +489:4294967295:1000:1006:1013:1021:1047:3011 +490:4294967295:1000:1006:1013:1021:1047:3011 +491:4294967295:1000:1006:1013:1021:1047:3011 +492:4294967295:1000:1006:1013:1021:1047:3011 +493:4294967295:1000:1006:1013:1021:1047:3011 +494:4294967295:1000:1006:1013:1021:1047:3011 +495:4294967295:1000:1006:1013:1021:1047:3011 +496:4294967295:1000:1006:1013:1021:1047:3011 +497:4294967295:1000:1006:1013:1021:1047:3011 +498:4294967295:1000:1006:1013:1021:1047:3011 +499:4294967295:1000:1006:1013:1021:1047:3011 +500:4294967295:1000:1006:1013:1021:1047:3011 +501:4294967295:1000:1006:1013:1021:1047:3011 +502:4294967295:1000:1006:1013:1021:1047:3011 +503:4294967295:1000:1006:1013:1021:1047:3011 +504:4294967295:1000:1006:1013:1021:1047:3011 +505:4294967295:1000:1006:1013:1021:1047:3011 +506:4294967295:1000:1006:1013:1021:1047:3011 +507:4294967295:1000:1006:1013:1021:1047:3011 +508:4294967295:1000:1006:1013:1021:1047:3011 +509:4294967295:1000:1006:1013:1021:1047:3011 +510:4294967295:1000:1006:1013:1021:1047:3011 +511:4294967295:1000:1006:1013:1021:1047:3011 +/* Allow RCS service to aquire net_raw permission */ +18:4294967295:1001:3004 +/* Allow QMID service to aquire net_raw permission */ +3:4294967295:1001:3004 +2:4294967295:1001:3004 +42:4294967295:1001:3004 +18:4294967295:1001:3004 +9:4294967295:1001:3004 +1:4294967295:1001:3004:1000 +4:4294967295:1001:3004 +7:4294967295:1001:3004 +8:4294967295:1001:3004:1000 +68:4294967295:1001:3004 +/* DPM */ +47:4294967295:1001:3004 +/* Allow communication to some QMI services with radio privilages */ +/* Format is :: */ +/* PBM */ +12:4294967295:1001 +/* WMS */ +5:4294967295:1001 +/* IMS VT */ +32:4294967295:1001 +/* IMSP */ +31:4294967295:1001 +/* PDC */ +36:4294967295:1001 +/* SAR */ +17:4294967295:1001 +/* RFRPE */ +41:4294967295:1001 +/*UIM*/ +11:4294967295:1001 +/*CAT*/ +10:4294967295:1001 +/*IMSA*/ +33:4294967295:1001 +/* CSVT */ +29:4294967295:1001 +/*LTE*/ +70:4294967295:1001 +/* Allow Data dpmd to access QMI DFS */ +48:4294967295:1000:3004 +/* hTC Extended QMI service from modem team. more protocol related */ +229:4294967295:1001 +/* hTC Extended QMI service from modem BSP team */ +230:4294967295:1001 +/* DIAG */ +4097:4294967295:2002:2950:3009 +/* :: */ +69:4294967295:1000 +/* :: */ +57:4294967295:1000 \ No newline at end of file diff --git a/seccomp_policy/mediacodec.policy b/seccomp_policy/mediacodec.policy new file mode 100644 index 00000000..07b7bf70 --- /dev/null +++ b/seccomp_policy/mediacodec.policy @@ -0,0 +1,9 @@ +# device specific syscalls +pselect6: 1 +eventfd2: 1 +sendto: 1 +recvfrom: 1 +_llseek: 1 +sysinfo: 1 +getcwd: 1 +getdents64: 1 diff --git a/sensors/hals.conf b/sensors/hals.conf new file mode 100644 index 00000000..5f3a14be --- /dev/null +++ b/sensors/hals.conf @@ -0,0 +1 @@ +sensors.ssc.so diff --git a/sepolicy/adsprpcd.te b/sepolicy/adsprpcd.te new file mode 100644 index 00000000..350a1e28 --- /dev/null +++ b/sepolicy/adsprpcd.te @@ -0,0 +1,8 @@ +type adsprpcd, domain; +type adsprpcd_exec, exec_type, file_type; + +init_daemon_domain(adsprpcd) + +userdebug_or_eng(` +permissive adsprpcd; +') diff --git a/sepolicy/audioserver.te b/sepolicy/audioserver.te new file mode 100644 index 00000000..02c801ca --- /dev/null +++ b/sepolicy/audioserver.te @@ -0,0 +1,6 @@ +binder_call(audioserver, bootanim) + +allow audioserver perfd_socket:sock_file write; + +allow audioserver sysfs_soc:file r_file_perms; +allow audioserver sysfs_soc:dir search; diff --git a/sepolicy/bluetooth.te b/sepolicy/bluetooth.te new file mode 100644 index 00000000..851b7152 --- /dev/null +++ b/sepolicy/bluetooth.te @@ -0,0 +1,6 @@ +allow bluetooth wcnss_filter:unix_stream_socket connectto; + +set_prop(bluetooth, wc_prop) + +# Allow access to net_admin ioctls +allowxperm bluetooth self:udp_socket ioctl priv_sock_ioctls; diff --git a/sepolicy/bootanim.te b/sepolicy/bootanim.te new file mode 100644 index 00000000..be41f077 --- /dev/null +++ b/sepolicy/bootanim.te @@ -0,0 +1 @@ +allow bootanim hwservicemanager:binder call; diff --git a/sepolicy/cameraserver.te b/sepolicy/cameraserver.te new file mode 100644 index 00000000..e392a310 --- /dev/null +++ b/sepolicy/cameraserver.te @@ -0,0 +1,6 @@ +allow cameraserver gpu_device:chr_file rw_file_perms; + +set_prop(cameraserver, camera_prop) + +allow cameraserver sysfs_camera:file r_file_perms; +allow cameraserver sysfs_camera:dir search; diff --git a/sepolicy/device.te b/sepolicy/device.te new file mode 100644 index 00000000..f407dafc --- /dev/null +++ b/sepolicy/device.te @@ -0,0 +1,17 @@ +type diag_device, dev_type, mlstrustedobject; +type smd_device, dev_type; +type ipa_dev, dev_type; +type rmnet_device, dev_type; +type at_device, dev_type; +type qsee_ipc_irq_spss_device, dev_type; +type seemplog_device, dev_type; +type spcom_device, dev_type; +type qdsp_device, dev_type, mlstrustedobject; +type dsp_device, dev_type; +type avtimer_device, dev_type; +type ssr_device, dev_type; +type ramdump_device, dev_type; +type hbtp_device, dev_type; +type sg_device, dev_type; +type sdd_block_device, dev_type; +type sdf_block_device, dev_type; diff --git a/sepolicy/domain.te b/sepolicy/domain.te new file mode 100644 index 00000000..07223d16 --- /dev/null +++ b/sepolicy/domain.te @@ -0,0 +1,3 @@ +userdebug_or_eng(` + allow domain diag_device:chr_file rw_file_perms; +') diff --git a/sepolicy/file.te b/sepolicy/file.te new file mode 100644 index 00000000..2af7b478 --- /dev/null +++ b/sepolicy/file.te @@ -0,0 +1,28 @@ +type sysfs_graphics, sysfs_type, fs_type; +type sysfs_camera, sysfs_type, fs_type; +type sysfs_soc, sysfs_type, fs_type; +type sysfs_rmtfs, sysfs_type, fs_type; +type sysfs_net, sysfs_type, fs_type; +type sysfs_fingerprint, sysfs_type, fs_type; +type sysfs_msm_subsys, sysfs_type, fs_type; +type sysfs_msm_subsys_restart, sysfs_type, fs_type; + +type debugfs_rmt_storage, debugfs_type, fs_type; + +type qmuxd_socket, file_type; +type netmgrd_socket, file_type; +type thermal_socket, file_type; +type perfd_socket, file_type; + +type firmware_file, fs_type, contextmount_type; + +type location_data_file, file_type, data_file_type; + +type persist_file, file_type; +type persist_data_file, file_type; +type persist_display_file, file_type; +type persist_sensors_file, file_type; + +type netmgr_data_file, file_type, data_file_type; + +type ramdump_data_file, file_type, data_file_type, mlstrustedobject; diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts new file mode 100644 index 00000000..5048b2ca --- /dev/null +++ b/sepolicy/file_contexts @@ -0,0 +1,117 @@ +# dev nodes +/dev/diag u:object_r:diag_device:s0 +/dev/kgsl-3d0 u:object_r:gpu_device:s0 +/dev/rtc0 u:object_r:rtc_device:s0 +/dev/smd.* u:object_r:smd_device:s0 +# TODO: does ttyMSM0 need to be more specific +/dev/ttyMSM0 u:object_r:tty_device:s0 +/dev/ipa u:object_r:ipa_dev:s0 +/dev/wwan_ioctl u:object_r:ipa_dev:s0 +/dev/ipaNatTable u:object_r:ipa_dev:s0 +/dev/rmnet_ctrl.* u:object_r:rmnet_device:s0 +/dev/at_.* u:object_r:at_device:s0 +/dev/video([0-9])+ u:object_r:video_device:s0 +/dev/media([0-9])+ u:object_r:video_device:s0 +/dev/v4l-subdev.* u:object_r:video_device:s0 +/dev/qseecom u:object_r:tee_device:s0 +/dev/qsee_ipc_irq_spss u:object_r:qsee_ipc_irq_spss_device:s0 +/dev/seemplog u:object_r:seemplog_device:s0 +/dev/spcom u:object_r:spcom_device:s0 +/dev/jpeg[0-9]* u:object_r:video_device:s0 +/dev/adsprpc-smd u:object_r:qdsp_device:s0 +/dev/sdsprpc-smd u:object_r:dsp_device:s0 +/dev/wcd-dsp-glink u:object_r:audio_device:s0 +/dev/msm_.* u:object_r:audio_device:s0 +/dev/avtimer u:object_r:avtimer_device:s0 +/dev/subsys_.* u:object_r:ssr_device:s0 +/dev/ramdump_.* u:object_r:ramdump_device:s0 +/dev/hbtp_input u:object_r:hbtp_device:s0 +/dev/hbtp_vm u:object_r:hbtp_device:s0 +/dev/sg[0-9]+ u:object_r:sg_device:s0 +/dev/sensors u:object_r:sensors_device:s0 + +# dev socket nodes +/dev/socket/qmux_audio(/.*)? u:object_r:qmuxd_socket:s0 +/dev/socket/qmux_bluetooth(/.*)? u:object_r:qmuxd_socket:s0 +/dev/socket/qmux_gps(/.*)? u:object_r:qmuxd_socket:s0 +/dev/socket/qmux_radio(/.*)? u:object_r:qmuxd_socket:s0 +/dev/socket/thermal-send-client u:object_r:thermal_socket:s0 +/dev/socket/thermal-recv-client u:object_r:thermal_socket:s0 +/dev/socket/thermal-recv-passive-client u:object_r:thermal_socket:s0 +/dev/socket/perfd u:object_r:perfd_socket:s0 +/dev/socket/netmgr(/.*)? u:object_r:netmgrd_socket:s0 + +# dev block nodes +/dev/block/sdd[0-9]+ u:object_r:sdd_block_device:s0 +/dev/block/sdf[0-9]+ u:object_r:sdf_block_device:s0 + +# files in sysfs +/sys/class/uio(/.*)? u:object_r:sysfs_uio:s0 +/sys/devices/soc/c900000.qcom,mdss_mdp/c900000.qcom,mdss_mdp:qcom,mdss_fb_primary/leds(/.*)? u:object_r:sysfs_leds:s0 +/sys/devices/soc/800f000.qcom,spmi/spmi-0/spmi0-03/800f000.qcom,spmi:qcom,pmi8998@3:qcom,leds@d000/leds(/.*)? u:object_r:sysfs_leds:s0 +/sys/devices/soc/soc:qcom,ipa_fws@1e08000(/.*)? u:object_r:sysfs_msm_subsys:s0 +/sys/devices/soc/cce0000\.qcom,venus(/.*)? u:object_r:sysfs_msm_subsys:s0 +/sys/devices/soc/0\.qcom,rmtfs_sharedmem(/.*)? u:object_r:sysfs_rmtfs:s0 +/sys/devices/soc/soc:fp_fpc1020(/.*)? u:object_r:sysfs_fingerprint:s0 +/sys/devices/virtual/thermal(/.*)? u:object_r:sysfs_thermal:s0 +/sys/kernel/debug/rmt_storage(/.*)? u:object_r:debugfs_rmt_storage:s0 +/sys/module/msm_thermal(/.*)? u:object_r:sysfs_thermal:s0 +/sys/module/tcp_cubic/parameters(/.*)? u:object_r:sysfs_net:s0 +/sys/devices/virtual/graphics/fb([0-2])+/idle_time u:object_r:sysfs_graphics:s0 +/sys/devices/virtual/net(/.*)? u:object_r:sysfs_net:s0 +/sys/devices/soc/8c0000\.qcom,msm-cam(/.*)? u:object_r:sysfs_camera:s0 +/sys/devices/soc0(/.*)? u:object_r:sysfs_soc:s0 +/sys/devices/soc/caa0000\.qcom,jpeg(/.*)? u:object_r:sysfs_camera:s0 +/sys/devices/soc/caa4000\.qcom,fd(/.*)? u:object_r:sysfs_camera:s0 +/sys/bus/msm_subsys(/.*)? u:object_r:sysfs_msm_subsys:s0 + +# files in /system +/system/bin/init\.power\.sh u:object_r:init_power_exec:s0 +/system/bin/init\.radio\.sh u:object_r:init_radio_exec:s0 +/system/bin/location-mq-s u:object_r:location_exec:s0 +/system/bin/lowi-server u:object_r:location_exec:s0 +/system/bin/ramdump u:object_r:ramdump_exec:s0 + +# files in /vendor +/vendor/bin/perfd u:object_r:perfd_exec:s0 +/vendor/bin/thermal-engine u:object_r:thermal-engine_exec:s0 +/vendor/bin/sensors.qcom u:object_r:sensors_exec:s0 +/vendor/bin/ssr_setup u:object_r:ssr_setup_exec:s0 +/vendor/bin/ssr_diag u:object_r:ssr_diag_exec:s0 +/vendor/bin/pm-service u:object_r:per_mgr_exec:s0 +/vendor/bin/pm-proxy u:object_r:per_proxy_exec:s0 +/vendor/bin/qseecomd u:object_r:tee_exec:s0 +/vendor/bin/time_daemon u:object_r:time_daemon_exec:s0 +/vendor/bin/subsystem_ramdump u:object_r:subsystem_ramdump_exec:s0 +/vendor/bin/adsprpcd u:object_r:adsprpcd_exec:s0 +/vendor/bin/irsc_util u:object_r:irsc_util_exec:s0 +/vendor/bin/rmt_storage u:object_r:rmt_storage_exec:s0 +/vendor/bin/tftp_server u:object_r:rfs_access_exec:s0 +/vendor/bin/cnss-daemon u:object_r:wcnss_service_exec:s0 +/vendor/bin/cnss_diag u:object_r:wcnss_service_exec:s0 +/vendor/bin/netmgrd u:object_r:netmgrd_exec:s0 +/vendor/bin/port-bridge u:object_r:port-bridge_exec:s0 +/vendor/bin/qti u:object_r:qti_exec:s0 +/vendor/bin/wcnss_filter u:object_r:wcnss_filter_exec:s0 +/vendor/bin/loc_launcher u:object_r:location_exec:s0 +/vendor/bin/lowi-server u:object_r:location_exec:s0 +/vendor/bin/pd-mapper u:object_r:pd_mapper_exec:s0 + +# data files +/data/time(/.*)? u:object_r:time_data_file:s0 +/data/misc/radio(/.*)? u:object_r:radio_data_file:s0 +/data/misc/netmgr(/.*)? u:object_r:netmgr_data_file:s0 +/data/misc/location(/.*)? u:object_r:location_data_file:s0 + +# / +/tombstones u:object_r:rootfs:s0 +/dsp u:object_r:rootfs:s0 + +# files in firmware +/firmware(/.*)? u:object_r:firmware_file:s0 + +# /persist +/persist(/.*)? u:object_r:persist_file:s0 +/persist/data(/.*)? u:object_r:persist_data_file:s0 +/persist/display(/.*)? u:object_r:persist_display_file:s0 +/persist/sensors(/.*)? u:object_r:persist_sensors_file:s0 diff --git a/sepolicy/gatekeeperd.te b/sepolicy/gatekeeperd.te new file mode 100644 index 00000000..647ede2a --- /dev/null +++ b/sepolicy/gatekeeperd.te @@ -0,0 +1 @@ +set_prop(gatekeeperd, keymaster_prop) diff --git a/sepolicy/hal_fingerprint.te b/sepolicy/hal_fingerprint.te new file mode 100644 index 00000000..ba42783d --- /dev/null +++ b/sepolicy/hal_fingerprint.te @@ -0,0 +1,4 @@ +allow hal_fingerprint sysfs_fingerprint:file rw_file_perms; +allow hal_fingerprint tee_device:file rw_file_perms; +allow hal_fingerprint tee_device:chr_file rw_file_perms; +allow hal_fingerprint sysfs_fingerprint:dir r_dir_perms; diff --git a/sepolicy/hal_gatekeeper.te b/sepolicy/hal_gatekeeper.te new file mode 100644 index 00000000..fcadc1e9 --- /dev/null +++ b/sepolicy/hal_gatekeeper.te @@ -0,0 +1 @@ +set_prop(hal_gatekeeper, keymaster_prop) diff --git a/sepolicy/init.te b/sepolicy/init.te new file mode 100644 index 00000000..a6155f79 --- /dev/null +++ b/sepolicy/init.te @@ -0,0 +1,10 @@ +# symlink /sdcard to backing block +allow init tmpfs:lnk_file create; + +allow init self:capability sys_module; +allow init system_file:system module_load; +allow init firmware_file:dir mounton; +allow init configfs:file w_file_perms; +allow init tty_device:chr_file rw_file_perms; + +allow init persist_file:dir mounton; diff --git a/sepolicy/init_power.te b/sepolicy/init_power.te new file mode 100644 index 00000000..904015d5 --- /dev/null +++ b/sepolicy/init_power.te @@ -0,0 +1,18 @@ +type init_power, domain; +type init_power_exec, exec_type, file_type; + +init_daemon_domain(init_power) + +allow init_power shell_exec:file rx_file_perms; +allow init_power toolbox_exec:file rx_file_perms; + +allow init_power sysfs_thermal:dir search; +allow init_power sysfs_thermal:file w_file_perms; +allow init_power sysfs_devices_system_cpu:file w_file_perms; +allow init_power sysfs_soc:file r_file_perms; +allow init_power sysfs_soc:dir search; + + +userdebug_or_eng(` +permissive init_power; +') diff --git a/sepolicy/init_radio.te b/sepolicy/init_radio.te new file mode 100644 index 00000000..178828d0 --- /dev/null +++ b/sepolicy/init_radio.te @@ -0,0 +1,13 @@ +# /system/bin/init.radio.sh +type init_radio, domain; +type init_radio_exec, exec_type, file_type; + +init_daemon_domain(init_radio) + +allow init_radio toolbox_exec:file rx_file_perms; +allow init_radio radio_data_file:dir create_dir_perms; +allow init_radio radio_data_file:file create_file_perms; + +userdebug_or_eng(` +permissive init_radio; +') diff --git a/sepolicy/ioctl_defines b/sepolicy/ioctl_defines new file mode 100644 index 00000000..93a833d8 --- /dev/null +++ b/sepolicy/ioctl_defines @@ -0,0 +1,7 @@ +# socket ioctls defined in the kernel in include/uapi/linux/msm_ipc.h +define(`IPC_ROUTER_IOCTL_GET_VERSION', `0x0000c300') +define(`IPC_ROUTER_IOCTL_GET_MTU', `0x0000c301') +define(`IPC_ROUTER_IOCTL_LOOKUP_SERVER', `0x0000c302') +define(`IPC_ROUTER_IOCTL_GET_CURR_PKT_SIZE', `0x0000c303') +define(`IPC_ROUTER_IOCTL_BIND_CONTROL_PORT', `0x0000c304') +define(`IPC_ROUTER_IOCTL_CONFIG_SEC_RULES', `0x0000c305') diff --git a/sepolicy/ioctl_macros b/sepolicy/ioctl_macros new file mode 100644 index 00000000..dd9a2e86 --- /dev/null +++ b/sepolicy/ioctl_macros @@ -0,0 +1,8 @@ +define(`msm_sock_ipc_ioctls', `{ +IPC_ROUTER_IOCTL_GET_VERSION +IPC_ROUTER_IOCTL_GET_MTU +IPC_ROUTER_IOCTL_LOOKUP_SERVER +IPC_ROUTER_IOCTL_GET_CURR_PKT_SIZE +IPC_ROUTER_IOCTL_BIND_CONTROL_PORT +IPC_ROUTER_IOCTL_CONFIG_SEC_RULES +}') diff --git a/sepolicy/irsc_util.te b/sepolicy/irsc_util.te new file mode 100644 index 00000000..746860e9 --- /dev/null +++ b/sepolicy/irsc_util.te @@ -0,0 +1,11 @@ +type irsc_util, domain; +type irsc_util_exec, exec_type, file_type; + +init_daemon_domain(irsc_util) + +allow irsc_util self:socket create_socket_perms; +allowxperm irsc_util self:socket ioctl msm_sock_ipc_ioctls; + +userdebug_or_eng(` +permissive irsc_util; +') diff --git a/sepolicy/kernel.te b/sepolicy/kernel.te new file mode 100644 index 00000000..9491cd38 --- /dev/null +++ b/sepolicy/kernel.te @@ -0,0 +1,4 @@ +# for diag over socket +userdebug_or_eng(` + allow kernel self:socket create; +') diff --git a/sepolicy/location.te b/sepolicy/location.te new file mode 100644 index 00000000..1493992c --- /dev/null +++ b/sepolicy/location.te @@ -0,0 +1,28 @@ +type location, domain; +type location_exec, exec_type, file_type; + +init_daemon_domain(location) + +# STOPSHIP b/28340421 +# Temporarily grant this permission and log its use. +allow location self:capability { net_admin }; +auditallow location self:capability { net_admin }; + +allow location location_exec:file execute_no_trans; + +allow location self:capability { setgid setuid }; + +allow location proc_net:file r_file_perms; +allow location location_data_file:file w_file_perms; +allow location location_data_file:dir w_dir_perms; +allow location location_data_file:sock_file create_file_perms; + +allow location self:netlink_route_socket create_socket_perms_no_ioctl; +allow location self:udp_socket create_socket_perms; + +# files in /sys +r_dir_file(location, sysfs_type) + +userdebug_or_eng(` +permissive location; +') diff --git a/sepolicy/netmgrd.te b/sepolicy/netmgrd.te new file mode 100644 index 00000000..97a5948a --- /dev/null +++ b/sepolicy/netmgrd.te @@ -0,0 +1,37 @@ +type netmgrd, domain; +type netmgrd_exec, exec_type, file_type; + +net_domain(netmgrd) +init_daemon_domain(netmgrd) + +set_prop(netmgrd, net_radio_prop) + +# communicate with netd +unix_socket_connect(netmgrd, netd, netd) + +allow netmgrd netmgrd_socket:dir w_dir_perms; +allow netmgrd netmgrd_socket:sock_file { create setattr }; +allow netmgrd self:netlink_generic_socket create_socket_perms_no_ioctl; +allow netmgrd self:netlink_socket create_socket_perms_no_ioctl; +allow netmgrd self:socket create_socket_perms; +allowxperm netmgrd self:socket ioctl msm_sock_ipc_ioctls; +allowxperm netmgrd self:udp_socket ioctl priv_sock_ioctls; + +allow netmgrd sysfs_net:file rw_file_perms; +allow netmgrd sysfs_net:dir r_dir_perms; +allow netmgrd sysfs_soc:file r_file_perms; +allow netmgrd sysfs_msm_subsys:dir r_dir_perms; +allow netmgrd sysfs_msm_subsys:file r_file_perms; + +allow netmgrd proc_net:file rw_file_perms; +allow netmgrd net_data_file:dir r_dir_perms; +allow netmgrd netmgr_data_file:file rw_file_perms; +allow netmgrd system_file:file execute_no_trans; + +allow netmgrd self:capability { net_admin net_raw setuid }; + +allow netmgrd toolbox_exec:file rx_file_perms; + +userdebug_or_eng(` +permissive netmgrd; +') diff --git a/sepolicy/pd_services.te b/sepolicy/pd_services.te new file mode 100644 index 00000000..096dd011 --- /dev/null +++ b/sepolicy/pd_services.te @@ -0,0 +1,8 @@ +type pd_mapper, domain; + +type pd_mapper_exec, exec_type, file_type; +init_daemon_domain(pd_mapper); + +userdebug_or_eng(` +permissive pd_mapper; +') diff --git a/sepolicy/per_mgr.te b/sepolicy/per_mgr.te new file mode 100644 index 00000000..6cba2eb1 --- /dev/null +++ b/sepolicy/per_mgr.te @@ -0,0 +1,27 @@ +# Policy for pm-service and pm-proxy +type per_mgr, domain; +type per_mgr_exec, exec_type, file_type; + +init_daemon_domain(per_mgr); + +add_service(per_mgr, per_mgr_service) + +binder_use(per_mgr) +binder_call(per_mgr, per_proxy) + +allow per_mgr self:capability net_bind_service; + +allow per_mgr firmware_file:file r_file_perms; +allow per_mgr firmware_file:dir search; +allow per_mgr sysfs_msm_subsys:lnk_file r_file_perms; +allow per_mgr sysfs_msm_subsys:dir r_dir_perms; + +allow per_mgr self:socket create_socket_perms; +allowxperm per_mgr self:socket ioctl msm_sock_ipc_ioctls; +allow per_mgr ssr_device:chr_file { open read }; + +r_dir_file(per_mgr, sysfs) + +userdebug_or_eng(` +permissive per_mgr; +') diff --git a/sepolicy/per_proxy.te b/sepolicy/per_proxy.te new file mode 100644 index 00000000..8b6e6bdd --- /dev/null +++ b/sepolicy/per_proxy.te @@ -0,0 +1,11 @@ +# Policy for /system/bin/pm-proxy +type per_proxy, domain; +type per_proxy_exec, exec_type, file_type; + +init_daemon_domain(per_proxy) + +allow per_proxy per_mgr_service:service_manager find; +r_dir_file(per_proxy, sysfs_type) + +binder_use(per_proxy) +binder_call(per_proxy, per_mgr) diff --git a/sepolicy/perfd.te b/sepolicy/perfd.te new file mode 100644 index 00000000..40bd0184 --- /dev/null +++ b/sepolicy/perfd.te @@ -0,0 +1,8 @@ +type perfd, domain; +type perfd_exec, exec_type, file_type; + +init_daemon_domain(perfd) + +userdebug_or_eng(` +permissive perfd; +') diff --git a/sepolicy/port-bridge.te b/sepolicy/port-bridge.te new file mode 100644 index 00000000..fd302e40 --- /dev/null +++ b/sepolicy/port-bridge.te @@ -0,0 +1,10 @@ +type port-bridge, domain; +type port-bridge_exec, exec_type, file_type; + +init_daemon_domain(port-bridge) + +allowxperm port-bridge at_device:chr_file ioctl IPC_ROUTER_IOCTL_GET_VERSION; + +userdebug_or_eng(` +permissive port-bridge; +') diff --git a/sepolicy/property.te b/sepolicy/property.te new file mode 100644 index 00000000..6a207b09 --- /dev/null +++ b/sepolicy/property.te @@ -0,0 +1,5 @@ +type wc_prop, property_type; +type camera_prop, property_type; +type ssr_prop, property_type; +type tee_listener_prop, property_type; +type keymaster_prop, property_type; diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts new file mode 100644 index 00000000..f321d54f --- /dev/null +++ b/sepolicy/property_contexts @@ -0,0 +1,5 @@ +wc_transport. u:object_r:wc_prop:s0 +persist.camera. u:object_r:camera_prop:s0 +persist.net.doxlat u:object_r:net_radio_prop:s0 +sys.listeners.registered u:object_r:tee_listener_prop:s0 +sys.keymaster.loaded u:object_r:keymaster_prop:s0 diff --git a/sepolicy/qti.te b/sepolicy/qti.te new file mode 100644 index 00000000..d8f2e98e --- /dev/null +++ b/sepolicy/qti.te @@ -0,0 +1,12 @@ +type qti, domain; +type qti_exec, exec_type, file_type; + +init_daemon_domain(qti) +net_domain(qti) + +allow qti self:socket create_socket_perms; +allowxperm qti self:socket ioctl msm_sock_ipc_ioctls; + +userdebug_or_eng(` +permissive qti; +') diff --git a/sepolicy/ramdump.te b/sepolicy/ramdump.te new file mode 100644 index 00000000..12b565c4 --- /dev/null +++ b/sepolicy/ramdump.te @@ -0,0 +1,7 @@ +type ramdump_exec, exec_type, file_type; + +userdebug_or_eng(` +type ramdump, domain; +init_daemon_domain(ramdump) +permissive ramdump; +') diff --git a/sepolicy/rfs_access.te b/sepolicy/rfs_access.te new file mode 100644 index 00000000..77b54827 --- /dev/null +++ b/sepolicy/rfs_access.te @@ -0,0 +1,16 @@ +type rfs_access, domain; +type rfs_access_exec, exec_type, file_type; + +init_daemon_domain(rfs_access) + +allow rfs_access persist_file:file rw_file_perms; +allow rfs_access persist_file:dir { getattr setattr remove_name add_name search }; + +allow rfs_access self:capability { chown setpcap }; +allow rfs_access self:capability2 { block_suspend }; + +allow rfs_access self:socket create_socket_perms_no_ioctl; + +userdebug_or_eng(` +permissive rfs_access; +') diff --git a/sepolicy/rild.te b/sepolicy/rild.te new file mode 100644 index 00000000..93e1c5dd --- /dev/null +++ b/sepolicy/rild.te @@ -0,0 +1,11 @@ +binder_use(rild) +binder_call(rild, per_mgr) + +allow rild qmuxd_socket:dir w_dir_perms; +allow rild qmuxd_socket:sock_file create; + +allow rild socket_device:sock_file write; +unix_socket_connect(rild, netmgrd, netmgrd) + +allow rild self:socket ioctl; +allowxperm rild self:socket ioctl msm_sock_ipc_ioctls; diff --git a/sepolicy/rmt_storage.te b/sepolicy/rmt_storage.te new file mode 100644 index 00000000..6008bb5a --- /dev/null +++ b/sepolicy/rmt_storage.te @@ -0,0 +1,24 @@ +type rmt_storage, domain; +type rmt_storage_exec, exec_type, file_type; + +init_daemon_domain(rmt_storage) + +wakelock_use(rmt_storage) + +allow rmt_storage self:capability { net_bind_service setgid setpcap setuid }; + +allow rmt_storage sdd_block_device:blk_file rw_file_perms; +allow rmt_storage sdf_block_device:blk_file rw_file_perms; +allow rmt_storage uio_device:chr_file rw_file_perms; + +allow rmt_storage sysfs_uio:dir r_dir_perms; +allow rmt_storage sysfs_uio:lnk_file r_file_perms; +allow rmt_storage sysfs_rmtfs:file r_file_perms; + +allow rmt_storage debugfs_rmt_storage:file w_file_perms; + +allow rmt_storage self:socket create_socket_perms_no_ioctl; + +userdebug_or_eng(` +permissive rmt_storage; +') diff --git a/sepolicy/sensors.te b/sepolicy/sensors.te new file mode 100644 index 00000000..b280949a --- /dev/null +++ b/sepolicy/sensors.te @@ -0,0 +1,13 @@ +# Policy for sensor daemon +type sensors, domain; +type sensors_exec, exec_type, file_type; + +init_daemon_domain(sensors) + +allow sensors self:socket rw_socket_perms_no_ioctl; + +r_dir_file(sensors, sysfs_msm_subsys) + +userdebug_or_eng(` +permissive sensors; +') diff --git a/sepolicy/service.te b/sepolicy/service.te new file mode 100644 index 00000000..56f1e27e --- /dev/null +++ b/sepolicy/service.te @@ -0,0 +1 @@ +type per_mgr_service, service_manager_type; diff --git a/sepolicy/service_contexts b/sepolicy/service_contexts new file mode 100644 index 00000000..39223561 --- /dev/null +++ b/sepolicy/service_contexts @@ -0,0 +1 @@ +vendor.qcom.PeripheralManager u:object_r:per_mgr_service:s0 diff --git a/sepolicy/ssr_diag.te b/sepolicy/ssr_diag.te new file mode 100644 index 00000000..b1f73c58 --- /dev/null +++ b/sepolicy/ssr_diag.te @@ -0,0 +1,8 @@ +type ssr_diag, domain; +type ssr_diag_exec, exec_type, file_type; + +init_daemon_domain(ssr_diag); + +userdebug_or_eng(` +permissive ssr_diag; +') diff --git a/sepolicy/ssr_setup.te b/sepolicy/ssr_setup.te new file mode 100644 index 00000000..40a1c943 --- /dev/null +++ b/sepolicy/ssr_setup.te @@ -0,0 +1,8 @@ +type ssr_setup, domain; +type ssr_setup_exec, exec_type, file_type; + +init_daemon_domain(ssr_setup); + +userdebug_or_eng(` +permissive ssr_setup; +') diff --git a/sepolicy/subsystem_ramdump.te b/sepolicy/subsystem_ramdump.te new file mode 100644 index 00000000..c6917566 --- /dev/null +++ b/sepolicy/subsystem_ramdump.te @@ -0,0 +1,8 @@ +type subsystem_ramdump, domain; +type subsystem_ramdump_exec, exec_type, file_type; + +init_daemon_domain(subsystem_ramdump); + +userdebug_or_eng(` +permissive subsystem_ramdump; +') diff --git a/sepolicy/surfaceflinger.te b/sepolicy/surfaceflinger.te new file mode 100644 index 00000000..6ec8e82b --- /dev/null +++ b/sepolicy/surfaceflinger.te @@ -0,0 +1 @@ +dontaudit surfaceflinger firmware_file:dir search; diff --git a/sepolicy/system_app.te b/sepolicy/system_app.te new file mode 100644 index 00000000..44b8dfdd --- /dev/null +++ b/sepolicy/system_app.te @@ -0,0 +1,6 @@ +r_dir_file(system_app, sysfs_msm_subsys) +userdebug_or_eng(` + allow system_app ramdump_data_file:dir r_dir_perms; + allow system_app ramdump_data_file:file r_file_perms; + get_prop(system_app, ssr_prop) +') diff --git a/sepolicy/system_server.te b/sepolicy/system_server.te new file mode 100644 index 00000000..2ce9c93d --- /dev/null +++ b/sepolicy/system_server.te @@ -0,0 +1,5 @@ +allow system_server self:socket ioctl; +allowxperm system_server self:socket ioctl msm_sock_ipc_ioctls; + +allow system_server persist_sensors_file:file r_file_perms; +allow system_server persist_sensors_file:dir search; diff --git a/sepolicy/tee.te b/sepolicy/tee.te new file mode 100644 index 00000000..78365bcc --- /dev/null +++ b/sepolicy/tee.te @@ -0,0 +1,10 @@ +allow tee self:capability { chown setgid setuid sys_admin sys_rawio }; + +allow tee device:dir r_dir_perms; + +set_prop(tee, tee_listener_prop) +set_prop(tee, keymaster_prop) + +allow tee block_device:dir { getattr search }; +allow tee sdd_block_device:blk_file rw_file_perms; +allow tee sg_device:chr_file { rw_file_perms setattr }; diff --git a/sepolicy/thermal-engine.te b/sepolicy/thermal-engine.te new file mode 100644 index 00000000..5ec9ed78 --- /dev/null +++ b/sepolicy/thermal-engine.te @@ -0,0 +1,19 @@ +type thermal-engine, domain; +type thermal-engine_exec, exec_type, file_type; + +init_daemon_domain(thermal-engine) + +allow thermal-engine self:capability2 block_suspend; + +allow thermal-engine sysfs_thermal:dir r_dir_perms; +allow thermal-engine sysfs_thermal:file rw_file_perms; +allow thermal-engine sysfs_rmtfs:file r_file_perms; +allow thermal-engine sysfs_uio:lnk_file r_file_perms; +allow thermal-engine sysfs_uio:dir r_dir_perms; + +allow thermal-engine self:socket create_socket_perms; +allowxperm thermal-engine self:socket ioctl msm_sock_ipc_ioctls; + +userdebug_or_eng(` +permissive thermal-engine; +') diff --git a/sepolicy/time_daemon.te b/sepolicy/time_daemon.te new file mode 100644 index 00000000..79e38491 --- /dev/null +++ b/sepolicy/time_daemon.te @@ -0,0 +1,17 @@ +type time_daemon, domain; +type time_daemon_exec, exec_type, file_type; + +init_daemon_domain(time_daemon) + +type time_data_file, file_type, data_file_type; + +allow time_daemon self:socket create_socket_perms; +allowxperm time_daemon self:socket ioctl IPC_ROUTER_IOCTL_LOOKUP_SERVER; + +allow time_daemon rtc_device:chr_file r_file_perms; + +allow time_daemon self:capability { setuid setgid }; + +userdebug_or_eng(` +permissive time_daemon; +') diff --git a/sepolicy/ueventd.te b/sepolicy/ueventd.te new file mode 100644 index 00000000..52241fc5 --- /dev/null +++ b/sepolicy/ueventd.te @@ -0,0 +1,8 @@ +allow ueventd sysfs_thermal:file w_file_perms; +allow ueventd sysfs_leds:file w_file_perms; +allow ueventd sysfs_camera:file w_file_perms; +allow ueventd sysfs_fingerprint:file w_file_perms; +allow ueventd sysfs_rmtfs:file w_file_perms; +allow ueventd sysfs_soc:file w_file_perms; +allow ueventd sysfs_net:file w_file_perms; +allow ueventd sysfs_msm_subsys:file w_file_perms; diff --git a/sepolicy/wcnss_filter.te b/sepolicy/wcnss_filter.te new file mode 100644 index 00000000..1f253d2c --- /dev/null +++ b/sepolicy/wcnss_filter.te @@ -0,0 +1,10 @@ +type wcnss_filter, domain; +type wcnss_filter_exec, exec_type, file_type; + +init_daemon_domain(wcnss_filter) + +set_prop(wcnss_filter, wc_prop) + +userdebug_or_eng(` +permissive wcnss_filter; +') diff --git a/sepolicy/wcnss_service.te b/sepolicy/wcnss_service.te new file mode 100644 index 00000000..4870fe56 --- /dev/null +++ b/sepolicy/wcnss_service.te @@ -0,0 +1,13 @@ +type wcnss_service, domain; +type wcnss_service_exec, exec_type, file_type; + +init_daemon_domain(wcnss_service) +net_domain(wcnss_service) + +allow wcnss_service self:socket create_socket_perms; +allowxperm wcnss_service self:socket ioctl IPC_ROUTER_IOCTL_LOOKUP_SERVER; +allow wcnss_service self:netlink_socket read; + +userdebug_or_eng(` +permissive wcnss_service; +') diff --git a/system.prop b/system.prop new file mode 100644 index 00000000..b491b175 --- /dev/null +++ b/system.prop @@ -0,0 +1,96 @@ + +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= +ril.subscription.types=NV,RUIM +DEVICE_PROVISIONED=1 +# Set network mode to (T/L/G/W/1X/EVDO, T/G/W/L) for 7+5 mode device on DSDS mode +ro.telephony.default_network=22,20 + +debug.sf.hw=1 +debug.gralloc.enable_fb_ubwc=1 + +# system props for the cne module +persist.cne.feature=1 + +# system props for the MM modules +media.stagefright.enable-player=true +media.stagefright.enable-http=true +media.stagefright.enable-aac=true +media.stagefright.enable-qcp=true +media.stagefright.enable-scan=true +mmp.enable.3g2=true +media.aac_51_output_enabled=true +mm.enable.smoothstreaming=true +#13631487 is decimal sum of supported codecs in AAL +#codecs:(PARSER_)AAC AC3 AMR_NB AMR_WB ASF AVI DTS FLV 3GP 3G2 MKV MP2PS MP2TS MP3 OGG QCP WAV FLAC AIFF APE DSD +mm.enable.qcom_parser=13631487 +persist.mm.enable.prefetch=true + +# Additional buffers shared between Camera and Video +vidc.enc.dcvs.extra-buff-count=2 + +# system props for the data netmgrd +persist.data.netmgrd.qos.enable=true +persist.data.mode=concurrent + +# system props for time-services +persist.timed.enable=true + +# System prop to turn on CdmaLTEPhone always +telephony.lteOnCdmaDevice=1 + +# Simulate sdcard on /data/media +persist.fuse_sdcard=true + +# system prop for Bluetooth SOC type +qcom.bluetooth.soc=cherokee + +# system prop for A4WP profile support +ro.bluetooth.a4wp=false + +# system prop for wipower support +ro.bluetooth.wipower=true + +# settings to enable PMD and Device Orientation Sensors +ro.qti.sensors.dev_ori=true +ro.qti.sensors.pmd=true +ro.qti.sensors.sta_detect=true +ro.qti.sensors.mot_detect=true + +#system prop for RmNet Data +persist.rmnet.data.enable=true +persist.data.wda.enable=true +persist.data.df.dl_mode=5 +persist.data.df.ul_mode=5 +persist.data.df.agg.dl_pkt=10 +persist.data.df.agg.dl_size=4096 +persist.data.df.mux_count=8 +persist.data.df.iwlan_mux=9 +persist.data.df.dev_name=rmnet_usb0 + +# +## system props for the data modules +# +#ro.use_data_netmgrd=true +persist.data.netmgrd.qos.enable=true +persist.data.mode=concurrent + +#system prop for Bluetooth SOC type +qcom.bluetooth.soc=cherokee + +#system prop for A4WP profile support +ro.bluetooth.a4wp=false + +#system prop for wipower support +ro.bluetooth.emb_wp_mode=true +ro.bluetooth.wipower=true + +# Property for loading BDA from bdaddress module in kernel +ro.bt.bdaddr_path=/sys/module/bdaddress/parameters/bdaddress diff --git a/ueventd.hardware.rc b/ueventd.hardware.rc new file mode 100644 index 00000000..21acd3cf --- /dev/null +++ b/ueventd.hardware.rc @@ -0,0 +1,100 @@ +# +# Copyright (C) 2016 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. +# + +# the DIAG device node is not world writable/readable. +/dev/diag 0660 system diag + +/dev/kgsl-3d0 0666 system system +/dev/ion 0664 system system +/dev/rtc0 0660 system system +/dev/smd7 0660 bluetooth bluetooth +/dev/ipa 0660 system net_admin +/dev/wwan_ioctl 0660 system net_admin +/dev/ipaNatTable 0660 net_admin net_admin +/dev/rmnet_ctrl 0660 usb usb + +#permissions for CSVT +/dev/smd11 0660 radio radio + +/dev/smdcntl8 0640 radio radio +/dev/at_usb0 0640 radio radio +/dev/at_mdm0 0640 radio radio + +/dev/video* 0660 system camera +/dev/media* 0660 system camera +/dev/v4l-subdev* 0660 system camera + +/dev/qseecom 0660 system drmrpc +/dev/qsee_ipc_irq_spss 0660 system drmrpc +/dev/seemplog 0660 system system +/dev/spcom 0660 system system + +/dev/jpeg0 0660 system camera +/dev/adsprpc-smd 0664 system system + +/dev/hw_random 0600 root root +/dev/sdsprpc-smd 0660 system system + +/dev/wcd-dsp-glink 0660 system audio + +/dev/msm_qcelp 0660 system audio +/dev/msm_evrc 0660 system audio +/dev/msm_wma 0660 system audio +/dev/msm_wmapro 0660 system audio +/dev/msm_alac 0660 system audio +/dev/msm_ape 0660 system audio +/dev/msm_amrnb 0660 system audio +/dev/msm_amrwb 0660 system audio +/dev/msm_amrwbplus 0660 system audio +/dev/msm_aac 0660 system audio +/dev/msm_multi_aac 0660 system audio +/dev/msm_aac_in 0660 system audio +/dev/msm_qcelp_in 0660 system audio +/dev/msm_evrc_in 0660 system audio +/dev/msm_amrnb_in 0640 system audio +/dev/msm_a2dp_in 0660 system audio +/dev/msm_ac3 0660 system audio +/dev/msm_audio_cal 0660 system audio +/dev/msm_hweffects 0660 system audio +/dev/msm_rtac 0660 system audio + +/dev/i2c-5 0660 media media +/dev/avtimer 0660 system audio + +/dev/uio0 0660 system system +/dev/uio1 0660 system system + +# SSR devices +/dev/subsys_* 0640 system system + +# Ramdump devices +/dev/ramdump_* 0640 system system + +#ImproveTouch device +/dev/hbtp_input 0660 system system +/dev/hbtp_vm 0660 system system + +# BT +/dev/ttyHS0 0660 bluetooth net_bt +/dev/btpower 0660 bluetooth net_bt + +# fpc fingerprint +/sys/devices/soc/soc:fp_fpc* irq 0600 system system +/sys/devices/soc/soc:fp_fpc* wakeup_enable 0200 system system + +# Paintbox/Easel +/dev/easelcomm-client 0660 cameraserver camera +/dev/mnh_sm 0660 cameraserver camera diff --git a/utils.mk b/utils.mk new file mode 100644 index 00000000..c823d211 --- /dev/null +++ b/utils.mk @@ -0,0 +1,201 @@ +# vars for use by utils +empty := +space := $(empty) $(empty) +colon := $(empty):$(empty) +underscore := $(empty)_$(empty) + +# $(call match-word,w1,w2) +# checks if w1 == w2 +# How it works +# if (w1-w2 not empty or w2-w1 not empty) then not_match else match +# +# returns true or empty +#$(warning :$(1): :$(2): :$(subst $(1),,$(2)):) \ +#$(warning :$(2): :$(1): :$(subst $(2),,$(1)):) \ +# +define match-word +$(strip \ + $(if $(or $(subst $(1),$(empty),$(2)),$(subst $(2),$(empty),$(1))),,true) \ +) +endef + +# $(call find-word-in-list,w,wlist) +# finds an exact match of word w in word list wlist +# +# How it works +# fill wlist spaces with colon +# wrap w with colon +# search word w in list wl, if found match m, return stripped word w +# +# returns stripped word or empty +define find-word-in-list +$(strip \ + $(eval wl:= $(colon)$(subst $(space),$(colon),$(strip $(2)))$(colon)) \ + $(eval w:= $(colon)$(strip $(1))$(colon)) \ + $(eval m:= $(findstring $(w),$(wl))) \ + $(if $(m),$(1),) \ +) +endef + +# $(call match-word-in-list,w,wlist) +# does an exact match of word w in word list wlist +# How it works +# if the input word is not empty +# return output of an exact match of word w in wordlist wlist +# else +# return empty +# returns true or empty +define match-word-in-list +$(strip \ + $(if $(strip $(1)), \ + $(call match-word,$(call find-word-in-list,$(1),$(2)),$(strip $(1))), \ + ) \ +) +endef + +# $(call match-prefix,p,delim,w/wlist) +# matches prefix p in wlist using delimiter delim +# +# How it works +# trim the words in wlist w +# if find-word-in-list returns not empty +# return true +# else +# return empty +# +define match-prefix +$(strip \ + $(eval w := $(strip $(1)$(strip $(2)))) \ + $(eval text := $(patsubst $(w)%,$(1),$(3))) \ + $(if $(call match-word-in-list,$(1),$(text)),true,) \ +) +endef + +# ---- +# The following utilities are meant for board platform specific +# featurisation + +# $(call get-vendor-board-platforms,v) +# returns list of board platforms for vendor v +define get-vendor-board-platforms +$($(1)_BOARD_PLATFORMS) +endef + +# $(call is-board-platform,bp) +# returns true or empty +define is-board-platform +$(call match-word,$(1),$(TARGET_BOARD_PLATFORM)) +endef + +# $(call is-not-board-platform,bp) +# returns true or empty +define is-not-board-platform +$(if $(call match-word,$(1),$(TARGET_BOARD_PLATFORM)),,true) +endef + +# $(call is-board-platform-in-list,bpl) +# returns true or empty +define is-board-platform-in-list +$(call match-word-in-list,$(TARGET_BOARD_PLATFORM),$(1)) +endef + +# $(call is-vendor-board-platform,vendor) +# returns true or empty +define is-vendor-board-platform +$(strip \ + $(call match-word-in-list,$(TARGET_BOARD_PLATFORM),\ + $(call get-vendor-board-platforms,$(1)) \ + ) \ +) +endef + +# $(call is-chipset-in-board-platform,chipset) +# does a prefix match of chipset in TARGET_BOARD_PLATFORM +# uses underscore as a delimiter +# +# returns true or empty +define is-chipset-in-board-platform +$(call match-prefix,$(1),$(underscore),$(TARGET_BOARD_PLATFORM)) +endef + +# $(call is-chipset-prefix-in-board-platform,prefix) +# does a chipset prefix match in TARGET_BOARD_PLATFORM +# assumes '_' and 'a' as the delimiter to the chipset prefix +# +# How it works +# if ($(prefix)_ or $(prefix)a match in board platform) +# return true +# else +# return empty +# +define is-chipset-prefix-in-board-platform +$(strip \ + $(eval delim_a := $(empty)a$(empty)) \ + $(if \ + $(or \ + $(call match-prefix,$(1),$(delim_a),$(TARGET_BOARD_PLATFORM)), \ + $(call match-prefix,$(1),$(underscore),$(TARGET_BOARD_PLATFORM)), \ + ), \ + true, \ + ) \ +) +endef + +#---- +# The following utilities are meant for Android Code Name +# specific featurisation +# +# refer http://source.android.com/source/build-numbers.html +# for code names and associated sdk versions +CUPCAKE_SDK_VERSIONS := 3 +DONUT_SDK_VERSIONS := 4 +ECLAIR_SDK_VERSIONS := 5 6 7 +FROYO_SDK_VERSIONS := 8 +GINGERBREAD_SDK_VERSIONS := 9 10 +HONEYCOMB_SDK_VERSIONS := 11 12 13 +ICECREAM_SANDWICH_SDK_VERSIONS := 14 15 +JELLY_BEAN_SDK_VERSIONS := 16 17 18 + +# $(call is-platform-sdk-version-at-least,version) +# version is a numeric SDK_VERSION defined above +define is-platform-sdk-version-at-least +$(strip \ + $(if $(filter 1,$(shell echo "$$(( $(PLATFORM_SDK_VERSION) >= $(1) ))" )), \ + true, \ + ) \ +) +endef + +# $(call is-android-codename,codename) +# codename is one of cupcake,donut,eclair,froyo,gingerbread,icecream +# please refer the $(codename)_SDK_VERSIONS declared above +define is-android-codename +$(strip \ + $(if \ + $(call match-word-in-list,$(PLATFORM_SDK_VERSION),$($(1)_SDK_VERSIONS)), \ + true, \ + ) \ +) +endef + +# $(call is-android-codename-in-list,cnlist) +# cnlist is combination/list of android codenames +define is-android-codename-in-list +$(strip \ + $(eval acn := $(empty)) \ + $(foreach \ + i,$(1),\ + $(eval acn += \ + $(if \ + $(call \ + match-word-in-list,\ + $(PLATFORM_SDK_VERSION),\ + $($(i)_SDK_VERSIONS)\ + ),\ + true,\ + )\ + )\ + ) \ + $(if $(strip $(acn)),true,) \ +) +endef diff --git a/wifi_concurrency_cfg.txt b/wifi_concurrency_cfg.txt new file mode 100644 index 00000000..fa2764c6 --- /dev/null +++ b/wifi_concurrency_cfg.txt @@ -0,0 +1,3 @@ +ENABLE_STA_SAP_CONCURRENCY:1 +SAP_INTERFACE_NAME:softap0 +SAP_CHANNEL:6 diff --git a/wpa_supplicant_overlay.conf b/wpa_supplicant_overlay.conf new file mode 100644 index 00000000..e1f530db --- /dev/null +++ b/wpa_supplicant_overlay.conf @@ -0,0 +1,3 @@ +disable_scan_offload=1 +p2p_disabled=1 +tdls_external_control=1 diff --git a/wpa_supplicant_wcn.conf b/wpa_supplicant_wcn.conf new file mode 100644 index 00000000..287954e1 --- /dev/null +++ b/wpa_supplicant_wcn.conf @@ -0,0 +1,830 @@ +##### Example wpa_supplicant configuration file ############################### +# +# This file describes configuration file format and lists all available option. +# Please also take a look at simpler configuration examples in 'examples' +# subdirectory. +# +# Empty lines and lines starting with # are ignored + +# NOTE! This file may contain password information and should probably be made +# readable only by root user on multiuser systems. + +# Note: All file paths in this configuration file should use full (absolute, +# not relative to working directory) path in order to allow working directory +# to be changed. This can happen if wpa_supplicant is run in the background. + +# Whether to allow wpa_supplicant to update (overwrite) configuration +# +# This option can be used to allow wpa_supplicant to overwrite configuration +# file whenever configuration is changed (e.g., new network block is added with +# wpa_cli or wpa_gui, or a password is changed). This is required for +# wpa_cli/wpa_gui to be able to store the configuration changes permanently. +# Please note that overwriting configuration file will remove the comments from +# it. +update_config=1 + +# global configuration (shared by all network blocks) +# +# Parameters for the control interface. If this is specified, wpa_supplicant +# will open a control interface that is available for external programs to +# manage wpa_supplicant. The meaning of this string depends on which control +# interface mechanism is used. For all cases, the existance of this parameter +# in configuration is used to determine whether the control interface is +# enabled. +# +# For UNIX domain sockets (default on Linux and BSD): This is a directory that +# will be created for UNIX domain sockets 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 +# wpa_supplicant processes can be run at the same time if more than one +# interface is used. +# /var/run/wpa_supplicant is the recommended directory for sockets and by +# default, wpa_cli will use it when trying to connect with wpa_supplicant. +# +# 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 wpa_supplicant 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, wpa_supplicant is configured to use gid 0 (root). If you +# want to allow non-root users to use the control 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. If this variable is commented out or +# not included in the configuration file, group will not be changed from the +# value it got by default when the directory or socket was created. +# +# When configuring both the directory and group, use following format: +# DIR=/var/run/wpa_supplicant GROUP=wheel +# DIR=/var/run/wpa_supplicant GROUP=0 +# (group can be either group name or gid) +ctrl_interface=wlan0 + +# IEEE 802.1X/EAPOL version +# wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which defines +# EAPOL version 2. However, there are many APs that do not handle the new +# version number correctly (they seem to drop the frames completely). In order +# to make wpa_supplicant interoperate with these APs, the version number is set +# to 1 by default. This configuration value can be used to set it to the new +# version (2). +eapol_version=1 + +# AP scanning/selection +# By default, wpa_supplicant requests driver to perform AP scanning and then +# uses the scan results to select a suitable AP. Another alternative is to +# allow the driver to take care of AP scanning and selection and use +# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association +# information from the driver. +# 1: wpa_supplicant initiates scanning and AP selection +# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association +# parameters (e.g., WPA IE generation); this mode can also be used with +# non-WPA drivers when using IEEE 802.1X mode; do not try to associate with +# APs (i.e., external program needs to control association). This mode must +# also be used when using wired Ethernet drivers. +# 2: like 0, but associate with APs using security policy and SSID (but not +# BSSID); this can be used, e.g., with ndiswrapper and NDIS drivers to +# enable operation with hidden SSIDs and optimized roaming; in this mode, +# the network blocks in the configuration file are tried one by one until +# the driver reports successful association; each network block should have +# explicit security policy (i.e., only one option in the lists) for +# key_mgmt, pairwise, group, proto variables +ap_scan=1 + +# EAP fast re-authentication +# By default, fast re-authentication is enabled for all EAP methods that +# support it. This variable can be used to disable fast re-authentication. +# Normally, there is no need to disable this. +fast_reauth=1 + +#Disable the default behavior of adding a separate interface for the P2P +#group when driver support for concurrent interfaces is available. +p2p_no_group_iface=1 + +# OpenSSL Engine support +# These options can be used to load OpenSSL engines. +# The two engines that are supported currently are shown below: +# They are both from the opensc project (http://www.opensc.org/) +# By default no engines are loaded. +# make the opensc engine available +#opensc_engine_path=/usr/lib/opensc/engine_opensc.so +# make the pkcs11 engine available +#pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so +# configure the path to the pkcs11 module required by the pkcs11 engine +#pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so + +# Dynamic EAP methods +# If EAP methods were built dynamically as shared object files, they need to be +# loaded here before being used in the network blocks. By default, EAP methods +# are included statically in the build, so these lines are not needed +#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_tls.so +#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_md5.so + +# Driver interface parameters +# This field can be used to configure arbitrary driver interace parameters. The +# format is specific to the selected driver interface. This field is not used +# in most cases. +#driver_param="field=value" + +# Country code +# The ISO/IEC alpha2 country code for the country in which this device is +# currently operating. +#country=US + +# Maximum lifetime for PMKSA in seconds; default 43200 +#dot11RSNAConfigPMKLifetime=43200 +# Threshold for reauthentication (percentage of PMK lifetime); default 70 +#dot11RSNAConfigPMKReauthThreshold=70 +# Timeout for security association negotiation in seconds; default 60 +#dot11RSNAConfigSATimeout=60 + +# Wi-Fi Protected Setup (WPS) parameters + +# Universally Unique IDentifier (UUID; see RFC 4122) of the device +# If not configured, UUID will be generated based on the local MAC address. +#uuid=12345678-9abc-def0-1234-56789abcdef0 + +# Device Name +# User-friendly description of device; up to 32 octets encoded in UTF-8 +#device_name=Wireless Client + +# Manufacturer +# The manufacturer of the device (up to 64 ASCII characters) +#manufacturer=Company + +# Model Name +# Model of the device (up to 32 ASCII characters) +#model_name=cmodel + +# 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=1-0050F204-1 + +# OS Version +# 4-octet operating system version number (hex string) +#os_version=01020300 + +# 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) +#wps_cred_processing=0 + +# network block +# +# Each network (usually AP's sharing the same SSID) is configured as a separate +# block in this configuration file. The network blocks are in preference order +# (the first match is used). +# +# network block fields: +# +# disabled: +# 0 = this network can be used (default) +# 1 = this network block is disabled (can be enabled through ctrl_iface, +# e.g., with wpa_cli or wpa_gui) +# +# id_str: Network identifier string for external scripts. This value is passed +# to external action script through wpa_cli as WPA_ID_STR environment +# variable to make it easier to do network specific configuration. +# +# ssid: SSID (mandatory); either as an ASCII string with double quotation or +# as hex string; network name +# +# scan_ssid: +# 0 = do not scan this SSID with specific Probe Request frames (default) +# 1 = scan with SSID-specific Probe Request frames (this can be used to +# find APs that do not accept broadcast SSID or use multiple SSIDs; +# this will add latency to scanning, so enable this only when needed) +# +# bssid: BSSID (optional); if set, this network block is used only when +# associating with the AP using the configured BSSID +# +# priority: priority group (integer) +# By default, all networks will get same priority group (0). If some of the +# networks are more desirable, this field can be used to change the order in +# which wpa_supplicant goes through the networks when selecting a BSS. The +# priority groups will be iterated in decreasing priority (i.e., the larger the +# priority value, the sooner the network is matched against the scan results). +# Within each priority group, networks will be selected based on security +# policy, signal strength, etc. +# Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not +# using this priority to select the order for scanning. Instead, they try the +# networks in the order that used in the configuration file. +# +# mode: IEEE 802.11 operation mode +# 0 = infrastructure (Managed) mode, i.e., associate with an AP (default) +# 1 = IBSS (ad-hoc, peer-to-peer) +# Note: IBSS can only be used with key_mgmt NONE (plaintext and static WEP) +# and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition, ap_scan has +# to be set to 2 for IBSS. WPA-None requires following network block options: +# proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not +# both), and psk must also be set. +# +# frequency: Channel frequency in megahertz (MHz) for IBSS, e.g., +# 2412 = IEEE 802.11b/g channel 1. This value is used to configure the initial +# channel for IBSS (adhoc) networks. It is ignored in the infrastructure mode. +# In addition, this value is only used by the station that creates the IBSS. If +# an IBSS network with the configured SSID is already present, the frequency of +# the network will be used instead of this configured value. +# +# proto: list of accepted protocols +# WPA = WPA/IEEE 802.11i/D3.0 +# RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN) +# If not set, this defaults to: WPA RSN +# +# key_mgmt: list of accepted authenticated key management protocols +# WPA-PSK = WPA pre-shared key (this requires 'psk' field) +# WPA-EAP = WPA using EAP authentication +# IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically +# generated WEP keys +# NONE = WPA is not used; plaintext or static WEP could be used +# WPA-PSK-SHA256 = Like WPA-PSK but using stronger SHA256-based algorithms +# WPA-EAP-SHA256 = Like WPA-EAP but using stronger SHA256-based algorithms +# If not set, this defaults to: WPA-PSK WPA-EAP +# +# auth_alg: list of allowed IEEE 802.11 authentication algorithms +# OPEN = Open System authentication (required for WPA/WPA2) +# SHARED = Shared Key authentication (requires static WEP keys) +# LEAP = LEAP/Network EAP (only used with LEAP) +# If not set, automatic selection is used (Open System with LEAP enabled if +# LEAP is allowed as one of the EAP methods). +# +# pairwise: list of accepted pairwise (unicast) ciphers for WPA +# 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] +# NONE = Use only Group Keys (deprecated, should not be included if APs support +# pairwise keys) +# If not set, this defaults to: CCMP TKIP +# +# group: list of accepted group (broadcast/multicast) ciphers for WPA +# 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] +# WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key +# WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key [IEEE 802.11] +# If not set, this defaults to: CCMP TKIP WEP104 WEP40 +# +# psk: WPA preshared key; 256-bit pre-shared key +# The key used in WPA-PSK mode can be entered either as 64 hex-digits, i.e., +# 32 bytes or as an ASCII passphrase (in which case, the real PSK will be +# generated using the passphrase and SSID). ASCII passphrase must be between +# 8 and 63 characters (inclusive). +# This field is not needed, if WPA-EAP is used. +# Note: Separate tool, wpa_passphrase, can be used to generate 256-bit keys +# from ASCII passphrase. This process uses lot of CPU and wpa_supplicant +# startup and reconfiguration time can be optimized by generating the PSK only +# only when the passphrase or SSID has actually changed. +# +# eapol_flags: IEEE 802.1X/EAPOL options (bit field) +# Dynamic WEP key required for non-WPA mode +# bit0 (1): require dynamically generated unicast WEP key +# bit1 (2): require dynamically generated broadcast WEP key +# (3 = require both keys; default) +# Note: When using wired authentication, eapol_flags must be set to 0 for the +# authentication to be completed successfully. +# +# mixed_cell: This option can be used to configure whether so called mixed +# cells, i.e., networks that use both plaintext and encryption in the same +# SSID, are allowed when selecting a BSS form scan results. +# 0 = disabled (default) +# 1 = enabled +# +# proactive_key_caching: +# Enable/disable opportunistic PMKSA caching for WPA2. +# 0 = disabled (default) +# 1 = enabled +# +# wep_key0..3: Static WEP key (ASCII in double quotation, e.g. "abcde" or +# hex without quotation, e.g., 0102030405) +# wep_tx_keyidx: Default WEP key index (TX) (0..3) +# +# peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e DLS) is +# allowed. This is only used with RSN/WPA2. +# 0 = disabled (default) +# 1 = enabled +#peerkey=1 +# +# wpa_ptk_rekey: Maximum lifetime for PTK in seconds. This can be used to +# enforce rekeying of PTK to mitigate some attacks against TKIP deficiencies. +# +# Following fields are only used with internal EAP implementation. +# eap: space-separated list of accepted EAP methods +# MD5 = EAP-MD5 (unsecure and does not generate keying material -> +# cannot be used with WPA; to be used as a Phase 2 method +# with EAP-PEAP or EAP-TTLS) +# MSCHAPV2 = EAP-MSCHAPv2 (cannot be used separately with WPA; to be used +# as a Phase 2 method with EAP-PEAP or EAP-TTLS) +# OTP = EAP-OTP (cannot be used separately with WPA; to be used +# as a Phase 2 method with EAP-PEAP or EAP-TTLS) +# GTC = EAP-GTC (cannot be used separately with WPA; to be used +# as a Phase 2 method with EAP-PEAP or EAP-TTLS) +# TLS = EAP-TLS (client and server certificate) +# PEAP = EAP-PEAP (with tunnelled EAP authentication) +# TTLS = EAP-TTLS (with tunnelled EAP or PAP/CHAP/MSCHAP/MSCHAPV2 +# authentication) +# If not set, all compiled in methods are allowed. +# +# identity: Identity string for EAP +# This field is also used to configure user NAI for +# EAP-PSK/PAX/SAKE/GPSK. +# anonymous_identity: Anonymous identity string for EAP (to be used as the +# unencrypted identity with EAP types that support different tunnelled +# identity, e.g., EAP-TTLS) +# password: Password string for EAP. This field can include either the +# plaintext password (using ASCII or hex string) or a NtPasswordHash +# (16-byte MD4 hash of password) in hash:<32 hex digits> format. +# NtPasswordHash can only be used when the password is for MSCHAPv2 or +# MSCHAP (EAP-MSCHAPv2, EAP-TTLS/MSCHAPv2, EAP-TTLS/MSCHAP, LEAP). +# EAP-PSK (128-bit PSK), EAP-PAX (128-bit PSK), and EAP-SAKE (256-bit +# PSK) is also configured using this field. For EAP-GPSK, this is a +# variable length PSK. +# ca_cert: File path to CA certificate file (PEM/DER). This file can have one +# or more trusted CA certificates. If ca_cert and ca_path are not +# included, server certificate will not be verified. This is insecure and +# a trusted CA certificate should always be configured when using +# EAP-TLS/TTLS/PEAP. Full path should be used since working directory may +# change when wpa_supplicant is run in the background. +# On Windows, trusted CA certificates can be loaded from the system +# certificate store by setting this to cert_store://, e.g., +# ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT". +# Note that when running wpa_supplicant as an application, the user +# certificate store (My user account) is used, whereas computer store +# (Computer account) is used when running wpasvc as a service. +# ca_path: Directory path for CA certificate files (PEM). This path may +# contain multiple CA certificates in OpenSSL format. Common use for this +# is to point to system trusted CA list which is often installed into +# directory like /etc/ssl/certs. If configured, these certificates are +# added to the list of trusted CAs. ca_cert may also be included in that +# case, but it is not required. +# client_cert: File path to client certificate file (PEM/DER) +# Full path should be used since working directory may change when +# wpa_supplicant is run in the background. +# Alternatively, a named configuration blob can be used by setting this +# to blob://. +# private_key: File path to client private key file (PEM/DER/PFX) +# When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be +# commented out. Both the private key and certificate will be read from +# the PKCS#12 file in this case. Full path should be used since working +# directory may change when wpa_supplicant is run in the background. +# Windows certificate store can be used by leaving client_cert out and +# configuring private_key in one of the following formats: +# cert://substring_to_match +# hash://certificate_thumbprint_in_hex +# for example: private_key="hash://63093aa9c47f56ae88334c7b65a4" +# Note that when running wpa_supplicant as an application, the user +# certificate store (My user account) is used, whereas computer store +# (Computer account) is used when running wpasvc as a service. +# Alternatively, a named configuration blob can be used by setting this +# to blob://. +# private_key_passwd: Password for private key file (if left out, this will be +# asked through control interface) +# 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. +# subject_match: Substring to be matched against the subject of the +# authentication server certificate. If this string is set, the server +# sertificate is only accepted if it contains this string in the subject. +# The subject string is in following format: +# /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@example.com +# altsubject_match: Semicolon separated string of entries to be matched against +# the alternative subject name of the authentication server certificate. +# If this string is set, the server sertificate is only accepted if it +# contains one of the entries in an alternative subject name extension. +# altSubjectName string is in following format: TYPE:VALUE +# Example: EMAIL:server@example.com +# Example: DNS:server.example.com;DNS:server2.example.com +# Following types are supported: EMAIL, DNS, URI +# phase1: Phase1 (outer authentication, i.e., TLS tunnel) parameters +# (string with field-value pairs, e.g., "peapver=0" or +# "peapver=1 peaplabel=1") +# 'peapver' can be used to force which PEAP version (0 or 1) is used. +# 'peaplabel=1' can be used to force new label, "client PEAP encryption", +# to be used during key derivation when PEAPv1 or newer. Most existing +# PEAPv1 implementation seem to be using the old label, "client EAP +# encryption", and wpa_supplicant is now using that as the default value. +# Some servers, e.g., Radiator, may require peaplabel=1 configuration to +# interoperate with PEAPv1; see eap_testing.txt for more details. +# 'peap_outer_success=0' can be used to terminate PEAP authentication on +# tunneled EAP-Success. This is required with some RADIUS servers that +# implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g., +# Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode) +# include_tls_length=1 can be used to force wpa_supplicant to include +# TLS Message Length field in all TLS messages even if they are not +# fragmented. +# sim_min_num_chal=3 can be used to configure EAP-SIM to require three +# challenges (by default, it accepts 2 or 3) +# result_ind=1 can be used to enable EAP-SIM and EAP-AKA to use +# protected result indication. +# 'crypto_binding' option can be used to control PEAPv0 cryptobinding +# behavior: +# * 0 = do not use cryptobinding (default) +# * 1 = use cryptobinding if server supports it +# * 2 = require cryptobinding +# EAP-WSC (WPS) uses following options: pin= or +# pbc=1. +# phase2: Phase2 (inner authentication with TLS tunnel) parameters +# (string with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or +# "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS) +# Following certificate/private key fields are used in inner Phase2 +# authentication when using EAP-TTLS or EAP-PEAP. +# ca_cert2: File path to CA certificate file. This file can have one or more +# trusted CA certificates. If ca_cert2 and ca_path2 are not included, +# server certificate will not be verified. This is insecure and a trusted +# CA certificate should always be configured. +# ca_path2: Directory path for CA certificate files (PEM) +# client_cert2: File path to client certificate file +# private_key2: File path to client private key file +# private_key2_passwd: Password for private key file +# dh_file2: File path to DH/DSA parameters file (in PEM format) +# subject_match2: Substring to be matched against the subject of the +# authentication server certificate. +# altsubject_match2: Substring to be matched against the alternative subject +# name of the authentication server certificate. +# +# fragment_size: Maximum EAP fragment size in bytes (default 1398). +# This value limits the fragment size for EAP methods that support +# fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set +# small enough to make the EAP messages fit in MTU of the network +# interface used for EAPOL. The default value is suitable for most +# cases. +# +# EAP-FAST variables: +# pac_file: File path for the PAC entries. wpa_supplicant will need to be able +# to create this file and write updates to it when PAC is being +# provisioned or refreshed. Full path to the file should be used since +# working directory may change when wpa_supplicant is run in the +# background. Alternatively, a named configuration blob can be used by +# setting this to blob:// +# phase1: fast_provisioning option can be used to enable in-line provisioning +# of EAP-FAST credentials (PAC): +# 0 = disabled, +# 1 = allow unauthenticated provisioning, +# 2 = allow authenticated provisioning, +# 3 = allow both unauthenticated and authenticated provisioning +# fast_max_pac_list_len= option can be used to set the maximum +# number of PAC entries to store in a PAC list (default: 10) +# fast_pac_format=binary option can be used to select binary format for +# storing PAC entries in order to save some space (the default +# text format uses about 2.5 times the size of minimal binary +# format) +# +# wpa_supplicant supports number of "EAP workarounds" to work around +# interoperability issues with incorrectly behaving authentication servers. +# These are enabled by default because some of the issues are present in large +# number of authentication servers. Strict EAP conformance mode can be +# configured by disabling workarounds with eap_workaround=0. + +# Example blocks: + +# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers +#network={ +# ssid="simple" +# psk="very secret passphrase" +# priority=5 +#} +# +## Same as previous, but request SSID-specific scanning (for APs that reject +## broadcast SSID) +#network={ +# ssid="second ssid" +# scan_ssid=1 +# psk="very secret passphrase" +# priority=2 +#} +# +## Only WPA-PSK is used. Any valid cipher combination is accepted. +#network={ +# ssid="example" +# proto=WPA +# key_mgmt=WPA-PSK +# pairwise=CCMP TKIP +# group=CCMP TKIP WEP104 WEP40 +# psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb +# priority=2 +#} +# +## WPA-Personal(PSK) with TKIP and enforcement for frequent PTK rekeying +#network={ +# ssid="example" +# proto=WPA +# key_mgmt=WPA-PSK +# pairwise=TKIP +# group=TKIP +# psk="not so secure passphrase" +# wpa_ptk_rekey=600 +#} +# +## Only WPA-EAP is used. Both CCMP and TKIP is accepted. An AP that used WEP104 +## or WEP40 as the group cipher will not be accepted. +#network={ +# ssid="example" +# proto=RSN +# key_mgmt=WPA-EAP +# pairwise=CCMP TKIP +# group=CCMP TKIP +# eap=TLS +# identity="user@example.com" +# ca_cert="/etc/cert/ca.pem" +# client_cert="/etc/cert/user.pem" +# private_key="/etc/cert/user.prv" +# private_key_passwd="password" +# priority=1 +#} +# +## EAP-PEAP/MSCHAPv2 configuration for RADIUS servers that use the new peaplabel +## (e.g., Radiator) +#network={ +# ssid="example" +# key_mgmt=WPA-EAP +# eap=PEAP +# identity="user@example.com" +# password="foobar" +# ca_cert="/etc/cert/ca.pem" +# phase1="peaplabel=1" +# phase2="auth=MSCHAPV2" +# priority=10 +#} +# +## EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the +## unencrypted use. Real identity is sent only within an encrypted TLS tunnel. +#network={ +# ssid="example" +# key_mgmt=WPA-EAP +# eap=TTLS +# identity="user@example.com" +# anonymous_identity="anonymous@example.com" +# password="foobar" +# ca_cert="/etc/cert/ca.pem" +# priority=2 +#} +# +## EAP-TTLS/MSCHAPv2 configuration with anonymous identity for the unencrypted +## use. Real identity is sent only within an encrypted TLS tunnel. +#network={ +# ssid="example" +# key_mgmt=WPA-EAP +# eap=TTLS +# identity="user@example.com" +# anonymous_identity="anonymous@example.com" +# password="foobar" +# ca_cert="/etc/cert/ca.pem" +# phase2="auth=MSCHAPV2" +#} +# +## WPA-EAP, EAP-TTLS with different CA certificate used for outer and inner +## authentication. +#network={ +# ssid="example" +# key_mgmt=WPA-EAP +# eap=TTLS +# # Phase1 / outer authentication +# anonymous_identity="anonymous@example.com" +# ca_cert="/etc/cert/ca.pem" +# # Phase 2 / inner authentication +# phase2="autheap=TLS" +# ca_cert2="/etc/cert/ca2.pem" +# client_cert2="/etc/cer/user.pem" +# private_key2="/etc/cer/user.prv" +# private_key2_passwd="password" +# priority=2 +#} +# +## Both WPA-PSK and WPA-EAP is accepted. Only CCMP is accepted as pairwise and +## group cipher. +#network={ +# ssid="example" +# bssid=00:11:22:33:44:55 +# proto=WPA RSN +# key_mgmt=WPA-PSK WPA-EAP +# pairwise=CCMP +# group=CCMP +# psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb +#} +# +## Special characters in SSID, so use hex string. Default to WPA-PSK, WPA-EAP +## and all valid ciphers. +#network={ +# ssid=00010203 +# psk=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f +#} +# +# +## EAP-SIM with a GSM SIM or USIM +#network={ +# ssid="eap-sim-test" +# key_mgmt=WPA-EAP +# eap=SIM +# pin="1234" +# pcsc="" +#} +# +# +## EAP-PSK +#network={ +# ssid="eap-psk-test" +# key_mgmt=WPA-EAP +# eap=PSK +# anonymous_identity="eap_psk_user" +# password=06b4be19da289f475aa46a33cb793029 +# identity="eap_psk_user@example.com" +#} +# +# +## IEEE 802.1X/EAPOL with dynamically generated WEP keys (i.e., no WPA) using +## EAP-TLS for authentication and key generation; require both unicast and +## broadcast WEP keys. +#network={ +# ssid="1x-test" +# key_mgmt=IEEE8021X +# eap=TLS +# identity="user@example.com" +# ca_cert="/etc/cert/ca.pem" +# client_cert="/etc/cert/user.pem" +# private_key="/etc/cert/user.prv" +# private_key_passwd="password" +# eapol_flags=3 +#} +# +# +## LEAP with dynamic WEP keys +#network={ +# ssid="leap-example" +# key_mgmt=IEEE8021X +# eap=LEAP +# identity="user" +# password="foobar" +#} +# +## EAP-IKEv2 using shared secrets for both server and peer authentication +#network={ +# ssid="ikev2-example" +# key_mgmt=WPA-EAP +# eap=IKEV2 +# identity="user" +# password="foobar" +#} +# +## EAP-FAST with WPA (WPA or WPA2) +#network={ +# ssid="eap-fast-test" +# key_mgmt=WPA-EAP +# eap=FAST +# anonymous_identity="FAST-000102030405" +# identity="username" +# password="password" +# phase1="fast_provisioning=1" +# pac_file="/etc/wpa_supplicant.eap-fast-pac" +#} +# +#network={ +# ssid="eap-fast-test" +# key_mgmt=WPA-EAP +# eap=FAST +# anonymous_identity="FAST-000102030405" +# identity="username" +# password="password" +# phase1="fast_provisioning=1" +# pac_file="blob://eap-fast-pac" +#} +# +## Plaintext connection (no WPA, no IEEE 802.1X) +#network={ +# ssid="plaintext-test" +# key_mgmt=NONE +#} +# +# +## Shared WEP key connection (no WPA, no IEEE 802.1X) +#network={ +# ssid="static-wep-test" +# key_mgmt=NONE +# wep_key0="abcde" +# wep_key1=0102030405 +# wep_key2="1234567890123" +# wep_tx_keyidx=0 +# priority=5 +#} +# +# +## Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key +## IEEE 802.11 authentication +#network={ +# ssid="static-wep-test2" +# key_mgmt=NONE +# wep_key0="abcde" +# wep_key1=0102030405 +# wep_key2="1234567890123" +# wep_tx_keyidx=0 +# priority=5 +# auth_alg=SHARED +#} +# +# +## IBSS/ad-hoc network with WPA-None/TKIP. +#network={ +# ssid="test adhoc" +# mode=1 +# frequency=2412 +# proto=WPA +# key_mgmt=WPA-NONE +# pairwise=NONE +# group=TKIP +# psk="secret passphrase" +#} +# +# +## Catch all example that allows more or less all configuration modes +#network={ +# ssid="example" +# scan_ssid=1 +# key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE +# pairwise=CCMP TKIP +# group=CCMP TKIP WEP104 WEP40 +# psk="very secret passphrase" +# eap=TTLS PEAP TLS +# identity="user@example.com" +# password="foobar" +# ca_cert="/etc/cert/ca.pem" +# client_cert="/etc/cert/user.pem" +# private_key="/etc/cert/user.prv" +# private_key_passwd="password" +# phase1="peaplabel=0" +#} +# +## Example of EAP-TLS with smartcard (openssl engine) +#network={ +# ssid="example" +# key_mgmt=WPA-EAP +# eap=TLS +# proto=RSN +# pairwise=CCMP TKIP +# group=CCMP TKIP +# identity="user@example.com" +# ca_cert="/etc/cert/ca.pem" +# client_cert="/etc/cert/user.pem" +# +# engine=1 +# +# # The engine configured here must be available. Look at +# # OpenSSL engine support in the global section. +# # The key available through the engine must be the private key +# # matching the client certificate configured above. +# +# # use the opensc engine +# #engine_id="opensc" +# #key_id="45" +# +# # use the pkcs11 engine +# engine_id="pkcs11" +# key_id="id_45" +# +# # Optional PIN configuration; this can be left out and PIN will be +# # asked through the control interface +# pin="1234" +#} +# +## Example configuration showing how to use an inlined blob as a CA certificate +## data instead of using external file +#network={ +# ssid="example" +# key_mgmt=WPA-EAP +# eap=TTLS +# identity="user@example.com" +# anonymous_identity="anonymous@example.com" +# password="foobar" +# ca_cert="blob://exampleblob" +# priority=20 +#} +# +#blob-base64-exampleblob={ +#SGVsbG8gV29ybGQhCg== +#} + + +# Wildcard match for SSID (plaintext APs only). This example select any +# open AP regardless of its SSID. +#network={ +# key_mgmt=NONE +#}