init for lineage-15.1
This commit is contained in:
parent
75b862a461
commit
190d8b9442
301 changed files with 50624 additions and 2362 deletions
369
Android.mk
Executable file → Normal file
369
Android.mk
Executable file → Normal file
|
@ -5,7 +5,7 @@
|
|||
# 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
|
||||
# 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,
|
||||
|
@ -22,5 +22,370 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
ifeq ($(TARGET_DEVICE),gts3llte)
|
||||
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
endif
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
MODEM_IMAGES := \
|
||||
modem.b00 modem.b01 modem.b02 modem.b03 modem.b04 modem.b05 \
|
||||
modem.b06 modem.b07 modem.b08 modem.b09 modem.b10 modem.b11 \
|
||||
modem.b12 modem.b13 modem.b15 modem.b16 modem.b17 modem.b18 \
|
||||
modem.b19 modem.b20 modem.mdt
|
||||
|
||||
MODEM_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(MODEM_IMAGES)))
|
||||
$(MODEM_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "MODEM firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware-modem/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(MODEM_SYMLINKS)
|
||||
|
||||
IMS_LIBS := libimscamera_jni.so libimsmedia_jni.so
|
||||
IMS_SYMLINKS := $(addprefix $(TARGET_OUT_APPS)/ims/lib/arm64/,$(notdir $(IMS_LIBS)))
|
||||
$(IMS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "IMS lib link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /system/lib64/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(IMS_SYMLINKS)
|
||||
|
||||
WCNSS_INI_SYMLINK := $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini
|
||||
$(WCNSS_INI_SYMLINK): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "WCNSS config ini link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /vendor/etc/wifi/$(notdir $@) $@
|
||||
|
||||
WCNSS_MAC_SYMLINK := $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/wlan_mac.bin
|
||||
$(WCNSS_MAC_SYMLINK): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "WCNSS MAC bin link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /persist/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(WCNSS_INI_SYMLINK) $(WCNSS_MAC_SYMLINK)
|
||||
|
||||
# Create links for audcal data files
|
||||
$(shell mkdir -p $(TARGET_OUT)/etc/firmware/wcd9320; \
|
||||
ln -sf /data/misc/audio/wcd9320_anc.bin \
|
||||
$(TARGET_OUT)/etc/firmware/wcd9320/wcd9320_anc.bin;\
|
||||
ln -sf /data/misc/audio/mbhc.bin \
|
||||
$(TARGET_OUT)/etc/firmware/wcd9320/wcd9320_mbhc.bin; \
|
||||
ln -sf /data/misc/audio/wcd9320_mad_audio.bin \
|
||||
$(TARGET_OUT)/etc/firmware/wcd9320/wcd9320_mad_audio.bin)
|
||||
|
||||
RFS_MSM_ADSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/adsp/
|
||||
$(RFS_MSM_ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM ADSP folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/lpass $@/ramdumps
|
||||
$(hide) ln -sf /persist/rfs/msm/adsp $@/readwrite
|
||||
$(hide) ln -sf /persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /firmware $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
RFS_MSM_MPSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/mpss/
|
||||
$(RFS_MSM_MPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM MPSS folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/modem $@/ramdumps
|
||||
$(hide) ln -sf /persist/rfs/msm/mpss $@/readwrite
|
||||
$(hide) ln -sf /persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /firmware $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
RFS_MSM_SLPI_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/slpi/
|
||||
$(RFS_MSM_SLPI_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MSM SLPI folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/rfs/modem $@/ramdumps
|
||||
$(hide) ln -sf /persist/rfs/msm/slpi $@/readwrite
|
||||
$(hide) ln -sf /persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /firmware $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
RFS_MDM_SPARROW_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/mdm/sparrow/
|
||||
$(RFS_MDM_SPARROW_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS MDM SPARROW folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/sparrow $@/ramdumps
|
||||
$(hide) ln -sf /persist/rfs/mdm/sparrow $@/readwrite
|
||||
$(hide) ln -sf /persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /firmware $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
RFS_APQ_GNSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/apq/gnss/
|
||||
$(RFS_APQ_GNSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Creating RFS APQ GNSS folder structure: $@"
|
||||
@rm -rf $@/*
|
||||
@mkdir -p $(dir $@)/readonly/vendor
|
||||
$(hide) ln -sf /data/vendor/tombstones/modem $@/ramdumps
|
||||
$(hide) ln -sf /persist/rfs/apq/gnss $@/readwrite
|
||||
$(hide) ln -sf /persist/rfs/shared $@/shared
|
||||
$(hide) ln -sf /persist/hlos_rfs/shared $@/hlos
|
||||
$(hide) ln -sf /firmware $@/readonly/firmware
|
||||
$(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += \
|
||||
$(RFS_MSM_ADSP_SYMLINKS) \
|
||||
$(RFS_MSM_MPSS_SYMLINKS) \
|
||||
$(RFS_MSM_SLPI_SYMLINKS) \
|
||||
$(RFS_MDM_SPARROW_SYMLINKS) \
|
||||
$(RFS_APQ_GNSS_SYMLINKS)
|
||||
|
||||
ADSP_IMAGES := \
|
||||
adsp.b00 adsp.b01 adsp.b02 adsp.b03 adsp.b04 \
|
||||
adsp.b05 adsp.b06 adsp.b08 adsp.b09 adsp.mdt
|
||||
|
||||
ADSP_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(ADSP_IMAGES)))
|
||||
$(ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "ADSP firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware-modem/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(ADSP_SYMLINKS)
|
||||
|
||||
MBA_IMAGES := mba.mbn
|
||||
|
||||
MBA_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(MBA_IMAGES)))
|
||||
$(MBA_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "MBA firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware-modem/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(MBA_SYMLINKS)
|
||||
|
||||
|
||||
AUTHHAT_IMAGES := authhat.b00 authhat.b01 authhat.b02 authhat.b03 authhat.b04 authhat.b05 authhat.b06 authhat.mdt
|
||||
|
||||
AUTHHAT_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(AUTHHAT_IMAGES)))
|
||||
$(AUTHHAT_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "AUTHHAT firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(AUTHHAT_SYMLINKS)
|
||||
|
||||
BDWLAN_IMAGES := \
|
||||
bdwlan30.b01 bdwlan30.b02 bdwlan30.b03 bdwlan30.b04 bdwlan30.b05 bdwlan30.b06 bdwlan30.b07 \
|
||||
bdwlan30.b08 bdwlan30.b09 bdwlan30.b0a bdwlan30.b0b bdwlan30.b0c bdwlan30.b0d bdwlan30.b0e \
|
||||
bdwlan30.b11 bdwlan30.b15 bdwlan30.b18 bdwlan30.b1c bdwlan30.bin
|
||||
|
||||
BDWLAN_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(BDWLAN_IMAGES)))
|
||||
$(BDWLAN_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "BDWLAN firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(BDWLAN_SYMLINKS)
|
||||
|
||||
CPE_IMAGES := \
|
||||
cpe_9335.b08 cpe_9335.b09 cpe_9335.b11 cpe_9335.b14 cpe_9335.b16 \
|
||||
cpe_9335.b18 cpe_9335.b19 cpe_9335.b20 cpe_9335.b22 cpe_9335.b24 \
|
||||
cpe_9335.b26 cpe_9335.b28 cpe_9335.b29 cpe_9335.mdt
|
||||
|
||||
CPE_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(CPE_IMAGES)))
|
||||
$(CPE_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "CPE firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(CPE_SYMLINKS)
|
||||
|
||||
CPPF_IMAGES := cppf.b00 cppf.b01 cppf.b02 cppf.b03 cppf.b04 cppf.b05 cppf.b06 cppf.mdt
|
||||
|
||||
CPPF_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(CPPF_IMAGES)))
|
||||
$(CPPF_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "CPPF firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(CPPF_SYMLINKS)
|
||||
|
||||
DATA_IMAGES := data.msc
|
||||
|
||||
DATA_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(DATA_IMAGES)))
|
||||
$(DATA_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "DATA firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(DATA_SYMLINKS)
|
||||
|
||||
ADD_IMAGES := \
|
||||
dhsecapp.b00 dhsecapp.b01 dhsecapp.b02 dhsecapp.b03 dhsecapp.b04 dhsecapp.b05 dhsecapp.b06 dhsecapp.mdt \
|
||||
dmverity.b00 dmverity.b01 dmverity.b02 dmverity.b03 dmverity.b04 dmverity.b05 dmverity.b06 dmverity.mdt \
|
||||
dualfp.b00 dualfp.b01 dualfp.b02 dualfp.b03 dualfp.b04 dualfp.b05 dualfp.b06 dualfp.mdt \
|
||||
dxprdy.b00 dxprdy.b01 dxprdy.b02 dxprdy.b03 dxprdy.b04 dxprdy.b05 dxprdy.b06 dxprdy.mdt \
|
||||
esecomm.b00 esecomm.b01 esecomm.b02 esecomm.b03 esecomm.b04 esecomm.b05 esecomm.b06 esecomm.mdt \
|
||||
isdbtmm.b00 isdbtmm.b01 isdbtmm.b02 isdbtmm.b03 isdbtmm.b04 isdbtmm.b05 isdbtmm.b06 isdbtmm.mdt \
|
||||
lksecapp.b00 lksecapp.b01 lksecapp.b02 lksecapp.b03 lksecapp.b04 lksecapp.b05 lksecapp.b06 lksecapp.mdt \
|
||||
mldap.b00 mldap.b01 mldap.b02 mldap.b03 mldap.b04 mldap.b05 mldap.b06 mldap.mdt \
|
||||
mst.b00 mst.b01 mst.b02 mst.b03 mst.b04 mst.b05 mst.b06 mst.mdt \
|
||||
otp30.bin \
|
||||
prov.b00 prov.b01 prov.b02 prov.b03 prov.b04 prov.b05 prov.b06 prov.mdt \
|
||||
qmpsecap.b00 qmpsecap.b01 qmpsecap.b02 qmpsecap.b03 qmpsecap.b04 qmpsecap.b05 qmpsecap.b06 qmpsecap.mdt \
|
||||
qwlan30.bin \
|
||||
sdtvrmp.b00 sdtvrmp.b01 sdtvrmp.b02 sdtvrmp.b03 sdtvrmp.b04 sdtvrmp.b05 sdtvrmp.b06 sdtvrmp.mdt \
|
||||
securemm.b00 securemm.b01 securemm.b02 securemm.b03 securemm.b04 securemm.b05 securemm.b06 securemm.mdt \
|
||||
sem.b00 sem.b01 sem.b02 sem.b03 sem.b04 sem.b05 sem.b06 sem.mdt \
|
||||
skeymast.b00 skeymast.b01 skeymast.b02 skeymast.b03 skeymast.b04 skeymast.b05 skeymast.b06 skeymast.mdt \
|
||||
slpi.b00 slpi.b01 slpi.b02 slpi.b03 slpi.b04 slpi.b05 slpi.b06 slpi.b07 \
|
||||
slpi.b08 slpi.b09 slpi.b10 slpi.b11 slpi.b12 slpi.b13 slpi.b14 slpi.mdt \
|
||||
smplap32.b00 smplap32.b01 smplap32.b02 smplap32.b03 smplap32.b04 smplap32.b05 smplap32.b06 smplap32.mdt \
|
||||
smplap64.b00 smplap64.b01 smplap64.b02 smplap64.b03 smplap64.b04 smplap64.b05 smplap64.b06 smplap64.mdt \
|
||||
softsim.b00 softsim.b01 softsim.b02 softsim.b03 softsim.b04 softsim.b05 softsim.b06 softsim.mdt \
|
||||
tbase.b00 tbase.b01 tbase.b02 tbase.b03 tbase.b04 tbase.b05 tbase.b06 tbase.mdt \
|
||||
utf30.bin
|
||||
|
||||
ADD_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(ADD_IMAGES)))
|
||||
$(ADD_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Additional firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(ADD_SYMLINKS)
|
||||
|
||||
FINGERPR_IMAGES := fingerpr.b00 fingerpr.b01 fingerpr.b02 fingerpr.b03 fingerpr.b04 fingerpr.b05 fingerpr.b06 fingerpr.mdt
|
||||
|
||||
FINGERPR_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(FINGERPR_IMAGES)))
|
||||
$(FINGERPR_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "FINGERPR firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(FINGERPR_SYMLINKS)
|
||||
|
||||
GPSTEST_IMAGES := gptest.b00 gptest.b01 gptest.b02 gptest.b03 gptest.b04 gptest.b05 gptest.b06 gptest.mdt
|
||||
|
||||
GPSTEST_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(GPSTEST_IMAGES)))
|
||||
$(GPSTEST_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "GPSTEST firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(GPSTEST_SYMLINKS)
|
||||
|
||||
SKM_IMAGES := \
|
||||
skm.b00 skm.b01 skm.b02 skm.b03 skm.b04 skm.b05 skm.b06 skm.mdt \
|
||||
|
||||
SKM_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(SKM_IMAGES)))
|
||||
$(SKM_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "SKM firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(SKM_SYMLINKS)
|
||||
|
||||
SKMM_TA_IMAGES := \
|
||||
skmm_ta.b00 skmm_ta.b01 skmm_ta.b02 skmm_ta.b03 skmm_ta.b04 skmm_ta.b05 skmm_ta.b06 skmm_ta.mdt \
|
||||
|
||||
SKMM_TA_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(SKMM_TA_IMAGES)))
|
||||
$(SKMM_TA_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "SKMM firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(SKMM_TA_SYMLINKS)
|
||||
|
||||
SSHDCPAP_IMAGES := \
|
||||
sshdcpap.b00 sshdcpap.b01 sshdcpap.b02 sshdcpap.b03 sshdcpap.b04 sshdcpap.b05 sshdcpap.b06 sshdcpap.mdt \
|
||||
|
||||
SSHDCPAP_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(SSHDCPAP_IMAGES)))
|
||||
$(SSHDCPAP_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "SSHDCPAP firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(SSHDCPAP_SYMLINKS)
|
||||
|
||||
TIMA_IMAGES := \
|
||||
tima_atn.b00 tima_atn.b01 tima_atn.b02 tima_atn.b03 tima_atn.b04 tima_atn.b05 tima_atn.b06 tima_atn.mdt \
|
||||
tima_key.b00 tima_key.b01 tima_key.b02 tima_key.b03 tima_key.b04 tima_key.b05 tima_key.b06 tima_key.mdt \
|
||||
tima_lkm.b00 tima_lkm.b01 tima_lkm.b02 tima_lkm.b03 tima_lkm.b04 tima_lkm.b05 tima_lkm.b06 tima_lkm.mdt \
|
||||
tima_pkm.b00 tima_pkm.b01 tima_pkm.b02 tima_pkm.b03 tima_pkm.b04 tima_pkm.b05 tima_pkm.b06 tima_pkm.mdt
|
||||
|
||||
TIMA_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(TIMA_IMAGES)))
|
||||
$(TIMA_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "TIMA firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(TIMA_SYMLINKS)
|
||||
|
||||
TZ_IMAGES := \
|
||||
tz_ccm.b00 tz_ccm.b01 tz_ccm.b02 tz_ccm.b03 tz_ccm.b04 tz_ccm.b05 tz_ccm.b06 tz_ccm.mdt \
|
||||
tz_iccc.b00 tz_iccc.b01 tz_iccc.b02 tz_iccc.b03 tz_iccc.b04 tz_iccc.b05 tz_iccc.b06 tz_iccc.mdt \
|
||||
tz_otp.b00 tz_otp.b01 tz_otp.b02 tz_otp.b03 tz_otp.b04 tz_otp.b05 tz_otp.b06 tz_otp.mdt
|
||||
|
||||
TZ_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(TZ_IMAGES)))
|
||||
$(TZ_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "TZ firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(TZ_SYMLINKS)
|
||||
|
||||
VENUS_IMAGES := venus.b00 venus.b01 venus.b02 venus.b03 venus.b04 venus.mdt
|
||||
|
||||
VENUS_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(VENUS_IMAGES)))
|
||||
$(VENUS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Venus firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(VENUS_SYMLINKS)
|
||||
|
||||
WV_IMAGES := \
|
||||
cmnlib.b00 cmnlib.b01 cmnlib.b02 cmnlib.b03 cmnlib.b04 cmnlib.b05 cmnlib.mdt \
|
||||
cmnlib64.b00 cmnlib64.b01 cmnlib64.b02 cmnlib64.b03 cmnlib64.b04 cmnlib64.b05 cmnlib64.mdt \
|
||||
widevine.b00 widevine.b01 widevine.b02 widevine.b03 widevine.b04 widevine.b05 widevine.b06 widevine.mdt
|
||||
|
||||
WV_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(WV_IMAGES)))
|
||||
$(WV_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "Widevine firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(WV_SYMLINKS)
|
||||
|
||||
WSM_IMAGES := wsm.b00 wsm.b01 wsm.b02 wsm.b03 wsm.b04 wsm.b05 wsm.b06 wsm.mdt
|
||||
|
||||
WSM_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/,$(notdir $(WSM_IMAGES)))
|
||||
$(WSM_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
|
||||
@echo "WSM firmware link: $@"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf /firmware/image/$(notdir $@) $@
|
||||
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(WSM_SYMLINKS)
|
||||
|
||||
endif
|
0
AndroidProducts.mk
Executable file → Normal file
0
AndroidProducts.mk
Executable file → Normal file
200
BoardConfig.mk
Executable file → Normal file
200
BoardConfig.mk
Executable file → Normal file
|
@ -13,19 +13,209 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# inherit from common msm8996-common
|
||||
-include device/samsung/msm8996-common/BoardConfigCommon.mk
|
||||
BOARD_VENDOR := samsung
|
||||
|
||||
DEVICE_PATH := device/samsung/gts3llte
|
||||
|
||||
TARGET_SPECIFIC_HEADER_PATH := $(DEVICE_PATH)/include
|
||||
|
||||
# Assert
|
||||
TARGET_OTA_ASSERT_DEVICE := gts3llte
|
||||
|
||||
# Architecture
|
||||
TARGET_ARCH := arm64
|
||||
TARGET_ARCH_VARIANT := armv8-a
|
||||
TARGET_CPU_ABI := arm64-v8a
|
||||
TARGET_CPU_ABI2 :=
|
||||
TARGET_CPU_VARIANT := kryo
|
||||
|
||||
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 := kryo
|
||||
|
||||
TARGET_USES_64_BIT_BINDER := true
|
||||
|
||||
# Bootloader
|
||||
TARGET_BOOTLOADER_BOARD_NAME := MSM8996
|
||||
TARGET_NO_BOOTLOADER := true
|
||||
|
||||
# Kernel
|
||||
BOARD_KERNEL_BASE := 0x80000000
|
||||
BOARD_KERNEL_CMDLINE := console=null androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7464900.sdhci lpm_levels.sleep_disabled=1 rcupdate.rcu_expedited=1 cma=32M@0-0xffffffff androidboot.selinux=permissive
|
||||
BOARD_KERNEL_IMAGE_NAME := Image.gz
|
||||
BOARD_KERNEL_PAGESIZE := 4096
|
||||
BOARD_KERNEL_SEPARATED_DT := true
|
||||
BOARD_MKBOOTIMG_ARGS := --kernel_offset 0x00008000 --ramdisk_offset 0x02200000 --tags_offset 0x02000000 --board SRPPK08B000KU
|
||||
TARGET_KERNEL_SOURCE := kernel/samsung/gts3l
|
||||
BOARD_CUSTOM_BOOTIMG := true
|
||||
BOARD_CUSTOM_BOOTIMG_MK := hardware/samsung/mkbootimg.mk
|
||||
TARGET_KERNEL_CROSS_COMPILE_PREFIX := aarch64-linux-android-
|
||||
TARGET_KERNEL_CONFIG := lineage_gts3llte_defconfig
|
||||
|
||||
# Properties
|
||||
TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop
|
||||
# Platform
|
||||
TARGET_BOARD_PLATFORM := msm8996
|
||||
TARGET_BOARD_PLATFORM_GPU := qcom-adreno530
|
||||
|
||||
# ANT+
|
||||
BOARD_ANT_WIRELESS_DEVICE := "qualcomm-uart"
|
||||
|
||||
# Audio
|
||||
#AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
|
||||
AUDIO_FEATURE_ENABLED_ACDB_LICENSE := true
|
||||
#AUDIO_FEATURE_ENABLED_APE_OFFLOAD := true
|
||||
#AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD := true
|
||||
#AUDIO_FEATURE_ENABLED_ANC_HEADSET := true
|
||||
AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
|
||||
AUDIO_FEATURE_ENABLED_COMPRESS_VOIP := true
|
||||
#AUDIO_FEATURE_ENABLED_DEV_ARBI := true
|
||||
AUDIO_FEATURE_ENABLED_EXTN_FORMATS := true
|
||||
AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD := true
|
||||
AUDIO_FEATURE_ENABLED_FLUENCE := true
|
||||
AUDIO_FEATURE_ENABLED_HFP := true
|
||||
#AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
|
||||
AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
|
||||
AUDIO_FEATURE_ENABLED_NT_PAUSE_TIMEOUT := true
|
||||
AUDIO_FEATURE_ENABLED_PCM_OFFLOAD := true
|
||||
AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true
|
||||
#AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
|
||||
#AUDIO_FEATURE_ENABLED_VORBIS_OFFLOAD := true
|
||||
#AUDIO_FEATURE_ENABLED_WMA_OFFLOAD := true
|
||||
AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
|
||||
#BOARD_SUPPORTS_SOUND_TRIGGER := true
|
||||
BOARD_USES_ALSA_AUDIO := true
|
||||
#USE_CUSTOM_AUDIO_POLICY := 1
|
||||
|
||||
#AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
|
||||
|
||||
# Bluetooth
|
||||
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth
|
||||
BOARD_HAS_QCA_BT_ROME := true
|
||||
BOARD_HAVE_BLUETOOTH := true
|
||||
BOARD_HAVE_BLUETOOTH_QCOM := true
|
||||
QCOM_BT_USE_BTNV := true
|
||||
BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED := false
|
||||
|
||||
# Camera
|
||||
USE_CAMERA_STUB := true
|
||||
USE_DEVICE_SPECIFIC_CAMERA := true
|
||||
TARGET_USES_MEDIA_EXTENSIONS := true
|
||||
|
||||
# Charger
|
||||
#BOARD_CHARGER_ENABLE_SUSPEND := true
|
||||
|
||||
# Dex
|
||||
ifeq ($(HOST_OS),linux)
|
||||
ifneq ($(TARGET_BUILD_VARIANT),eng)
|
||||
WITH_DEXPREOPT ?= true
|
||||
endif
|
||||
endif
|
||||
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true
|
||||
|
||||
# Display
|
||||
MAX_VIRTUAL_DISPLAY_DIMENSION := 4096
|
||||
TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true
|
||||
TARGET_USES_C2D_COMPOSITION := true
|
||||
TARGET_USES_GRALLOC1 := true
|
||||
TARGET_USES_HWC2 := true
|
||||
TARGET_USES_ION := true
|
||||
TARGET_USES_OVERLAY := true
|
||||
USE_OPENGL_RENDERER := true
|
||||
|
||||
MAX_EGL_CACHE_KEY_SIZE := 12*1024
|
||||
MAX_EGL_CACHE_SIZE := 2048*1024
|
||||
|
||||
OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
|
||||
|
||||
VSYNC_EVENT_PHASE_OFFSET_NS := 2000000
|
||||
SF_VSYNC_EVENT_PHASE_OFFSET_NS := 6000000
|
||||
|
||||
# Encryption
|
||||
TARGET_HW_DISK_ENCRYPTION := true
|
||||
|
||||
# Filesystem
|
||||
BOARD_BOOTIMAGE_PARTITION_SIZE := 79691776
|
||||
BOARD_CACHEIMAGE_PARTITION_SIZE := 209715200
|
||||
BOARD_PERSISTIMAGE_PARTITION_SIZE := 33554432
|
||||
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 79691776
|
||||
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3072000000
|
||||
#BOARD_SYSTEMIMAGE_PARTITION_SIZE := 4194304000
|
||||
BOARD_USERDATAIMAGE_PARTITION_SIZE := 26226982912
|
||||
BOARD_FLASH_BLOCK_SIZE := 131072
|
||||
|
||||
# Filesystem
|
||||
TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/config.fs
|
||||
TARGET_EXFAT_DRIVER := exfat
|
||||
|
||||
# Fingerprint
|
||||
TARGET_SEC_FP_HAL_VARIANT := bauth
|
||||
|
||||
# HIDL
|
||||
DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/configs/manifest.xml
|
||||
DEVICE_MATRIX_FILE := $(DEVICE_PATH)/configs/compatibility_matrix.xml
|
||||
|
||||
TARGET_LD_SHIM_LIBS := \
|
||||
/system/vendor/lib/libbauthserver.so|/vendor/lib/libbauthtzcommon_shim.so \
|
||||
/system/vendor/lib64/libbauthserver.so|/vendor/lib64/libbauthtzcommon_shim.so
|
||||
|
||||
TARGET_LD_SHIM_LIBS += \
|
||||
/system/vendor/lib/hw/camera.msm8996.so|/system/vendor/lib/libshims_cameraclient.so \
|
||||
|
||||
# Init
|
||||
TARGET_PLATFORM_DEVICE_BASE := /devices/soc/
|
||||
|
||||
# Keymaster
|
||||
TARGET_PROVIDES_KEYMASTER := true
|
||||
|
||||
# Lineage Hardware
|
||||
BOARD_HARDWARE_CLASS += \
|
||||
$(DEVICE_PATH)/lineagehw
|
||||
|
||||
# Power
|
||||
TARGET_HAS_NO_WIFI_STATS := true
|
||||
TARGET_POWERHAL_VARIANT := qcom
|
||||
|
||||
# QCOM
|
||||
BOARD_USES_QCOM_HARDWARE := true
|
||||
TARGET_USE_SDCLANG := true
|
||||
|
||||
# Ramdisk
|
||||
BOARD_ROOT_EXTRA_FOLDERS := dsp efs firmware firmware-modem persist
|
||||
BOARD_ROOT_EXTRA_SYMLINKS := /system/etc/firmware/btfw32.tlv:/bt_firmware/image/btfw32.tlv
|
||||
BOARD_ROOT_EXTRA_SYMLINKS += /system/etc/firmware/btnv32.bin:/bt_firmware/image/btnv32.bin
|
||||
BOARD_ROOT_EXTRA_SYMLINKS += /data/tombstones:/tombstones
|
||||
|
||||
# Recovery
|
||||
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.qcom
|
||||
TARGET_USERIMAGES_USE_EXT4 := true
|
||||
TARGET_USERIMAGES_USE_F2FS := true
|
||||
|
||||
# Treble
|
||||
#PRODUCT_FULL_TREBLE_OVERRIDE := true
|
||||
PRODUCT_VENDOR_MOVE_ENABLED := true
|
||||
|
||||
# RIL
|
||||
PROTOBUF_SUPPORTED := true
|
||||
TARGET_RIL_VARIANT := caf
|
||||
|
||||
# SELinux
|
||||
include device/qcom/sepolicy/sepolicy.mk
|
||||
BOARD_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy
|
||||
|
||||
# Wifi
|
||||
BOARD_HAS_QCOM_WLAN := true
|
||||
BOARD_HAS_QCOM_WLAN_SDK := true
|
||||
BOARD_WLAN_DEVICE := qcwcn
|
||||
BOARD_HOSTAPD_DRIVER := NL80211
|
||||
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
|
||||
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
|
||||
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
|
||||
WPA_SUPPLICANT_VERSION := VER_0_8_X
|
||||
WIFI_DRIVER_FW_PATH_AP := "ap"
|
||||
WIFI_DRIVER_FW_PATH_STA := "sta"
|
||||
WIFI_DRIVER_FW_PATH_P2P := "p2p"
|
||||
WPA_SUPPLICANT_USE_HIDL := true
|
||||
|
||||
# inherit from the proprietary version
|
||||
-include vendor/samsung/gts3llte/BoardConfigVendor.mk
|
||||
-include vendor/samsung/gts3llte/BoardConfigVendor.mk
|
60
README.md
Executable file
60
README.md
Executable file
|
@ -0,0 +1,60 @@
|
|||
Device configuration for the Samsung Galaxy Tab S3 LTE
|
||||
|
||||
Copyright (C) 2017 The LineageOS Project
|
||||
Copyright (C) 2018 Valera Chigir <valera1978@tut.by>
|
||||
|
||||
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
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
* Description
|
||||
|
||||
This repository is for LineageOS on Samsung Galaxy Tab S3 LTE (gts3llte)
|
||||
|
||||
* How To Build LineageOS for Samsung Galaxy Tab S3 LTE
|
||||
|
||||
- Make a workspace
|
||||
|
||||
mkdir cm15
|
||||
cd cm15
|
||||
|
||||
- Do repo init & sync
|
||||
|
||||
repo init -u git://github.com/LineageOS/android.git -b lineage-15.1
|
||||
|
||||
- Create .repo/local_manifests/roomservice.xml with the following content:
|
||||
|
||||
```
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<manifest>
|
||||
|
||||
<project name="Valera1978/android_device_samsung_gts3llte" path="device/samsung/gts3llte" remote="github" revision="lineage-15.1" />
|
||||
<project name="Valera1978/android_kernel_samsung_msm8996" path="kernel/samsung/msm8996" remote="github" revision="lineage-15.1" />
|
||||
<project name="Valera1978/android_vendor_samsung_gts3llte" path="vendor/samsung/gts3llte" remote="github" revision="lineage-15.1" />
|
||||
|
||||
</manifest>
|
||||
```
|
||||
|
||||
repo sync
|
||||
|
||||
- Copy proprietary vendor files
|
||||
|
||||
There are two options to to that. Connect your device with adb enabled and run:
|
||||
|
||||
./extract-files.sh
|
||||
|
||||
Or if you have the system image unpacked on your disk, then simply run:
|
||||
|
||||
STOCK_ROM_DIR=/path/to/system ./extract-files.sh
|
||||
|
||||
- Setup environment
|
||||
|
||||
. build/envsetup.sh
|
||||
|
||||
- Build lineage 15.1
|
||||
|
||||
brunch gts3llte
|
File diff suppressed because it is too large
Load diff
29
bluetooth/bdroid_buildcfg.h
Normal file
29
bluetooth/bdroid_buildcfg.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
*
|
||||
* 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 "Samsung Galaxy Tab S3"
|
||||
#define BLUETOOTH_QTI_SW TRUE
|
||||
#define BLE_VND_INCLUDED TRUE
|
||||
|
||||
#endif
|
167
config.fs
Normal file
167
config.fs
Normal file
|
@ -0,0 +1,167 @@
|
|||
[AID_QCOM_DIAG]
|
||||
value:2950
|
||||
|
||||
[AID_QTI_DIAG]
|
||||
value:2901
|
||||
|
||||
[AID_RFS]
|
||||
value:2951
|
||||
|
||||
[AID_RFS_SHARED]
|
||||
value:2952
|
||||
|
||||
[vendor/bin/wcnss_filter]
|
||||
mode: 0755
|
||||
user: AID_BLUETOOTH
|
||||
group: AID_BLUETOOTH
|
||||
caps: BLOCK_SUSPEND
|
||||
|
||||
[system/vendor/bin/wcnss_filter]
|
||||
mode: 0755
|
||||
user: AID_BLUETOOTH
|
||||
group: AID_BLUETOOTH
|
||||
caps: BLOCK_SUSPEND
|
||||
|
||||
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
|
||||
mode: 0755
|
||||
user: AID_BLUETOOTH
|
||||
group: AID_BLUETOOTH
|
||||
caps: BLOCK_SUSPEND NET_ADMIN
|
||||
|
||||
[system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: BLOCK_SUSPEND NET_ADMIN
|
||||
|
||||
[system/bin/cnss-daemon]
|
||||
mode: 0755
|
||||
user: AID_BLUETOOTH
|
||||
group: AID_BLUETOOTH
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/pm-service]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/vendor/bin/pm-service]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/bin/pm-service]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/pd-mapper]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/vendor/bin/pd-mapper]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/bin/pd-mapper]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/imsdatadaemon]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/vendor/bin/imsdatadaemon]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/ims_rtp_daemon]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_RADIO
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/vendor/bin/ims_rtp_daemon]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_RADIO
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/imsrcsd]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_RADIO
|
||||
caps: WAKE_ALARM
|
||||
|
||||
[system/vendor/bin/imsrcsd]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_RADIO
|
||||
caps: WAKE_ALARM
|
||||
|
||||
[vendor/bin/cnd]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
|
||||
|
||||
[system/vendor/bin/cnd]
|
||||
mode: 0755
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
|
||||
|
||||
[vendor/bin/slim_daemon]
|
||||
mode: 0755
|
||||
user: AID_GPS
|
||||
group: AID_GPS
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[system/vendor/bin/slim_daemon]
|
||||
mode: 0755
|
||||
user: AID_GPS
|
||||
group: AID_GPS
|
||||
caps: NET_BIND_SERVICE
|
||||
|
||||
[vendor/bin/xtwifi-client]
|
||||
mode: 0755
|
||||
user: AID_GPS
|
||||
group: AID_GPS
|
||||
caps: NET_BIND_SERVICE BLOCK_SUSPEND
|
||||
|
||||
[firmware/]
|
||||
mode: 0771
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: 0
|
||||
|
||||
[bt_firmware/]
|
||||
mode: 0771
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: 0
|
||||
|
||||
[persist/]
|
||||
mode: 0771
|
||||
user: AID_SYSTEM
|
||||
group: AID_SYSTEM
|
||||
caps: 0
|
||||
|
||||
[dsp/]
|
||||
mode: 0771
|
||||
user: AID_MEDIA
|
||||
group: AID_MEDIA
|
||||
caps: 0
|
188
configs/audio/audio_effects.conf
Normal file
188
configs/audio/audio_effects.conf
Normal file
|
@ -0,0 +1,188 @@
|
|||
# List of effect libraries to load. Each library element must contain a "path" element
|
||||
# giving the full path of the library .so file.
|
||||
# libraries {
|
||||
# <lib name> {
|
||||
# path <lib path>
|
||||
# }
|
||||
# }
|
||||
libraries {
|
||||
# This is a proxy library that will be an abstraction for
|
||||
# the HW and SW effects
|
||||
|
||||
#proxy {
|
||||
#path /vendor/lib/soundfx/libeffectproxy.so
|
||||
#}
|
||||
|
||||
# This is the SW implementation library of the effect
|
||||
#libSW {
|
||||
#path /vendor/lib/soundfx/libswwrapper.so
|
||||
#}
|
||||
|
||||
# This is the HW implementation library for the effect
|
||||
#libHW {
|
||||
#path /vendor/lib/soundfx/libhwwrapper.so
|
||||
#}
|
||||
|
||||
bundle {
|
||||
path /vendor/lib/soundfx/libbundlewrapper.so
|
||||
}
|
||||
reverb {
|
||||
path /vendor/lib/soundfx/libreverbwrapper.so
|
||||
}
|
||||
visualizer {
|
||||
path /vendor/lib/soundfx/libvisualizer.so
|
||||
}
|
||||
downmix {
|
||||
path /vendor/lib/soundfx/libdownmix.so
|
||||
}
|
||||
loudness_enhancer {
|
||||
path /vendor/lib/soundfx/libldnhncr.so
|
||||
}
|
||||
}
|
||||
|
||||
# Default pre-processing library. Add to audio_effect.conf "libraries" section if
|
||||
# audio HAL implements support for default software audio pre-processing effects
|
||||
#
|
||||
# pre_processing {
|
||||
# path /vendor/lib/soundfx/libaudiopreprocessing.so
|
||||
# }
|
||||
|
||||
# list of effects to load. Each effect element must contain a "library" and a "uuid" element.
|
||||
# The value of the "library" element must correspond to the name of one library element in the
|
||||
# "libraries" element.
|
||||
# The name of the effect element is indicative, only the value of the "uuid" element
|
||||
# designates the effect.
|
||||
# The uuid is the implementation specific UUID as specified by the effect vendor. This is not the
|
||||
# generic effect type UUID.
|
||||
# effects {
|
||||
# <fx name> {
|
||||
# library <lib name>
|
||||
# uuid <effect uuid>
|
||||
# }
|
||||
# ...
|
||||
# }
|
||||
|
||||
effects {
|
||||
|
||||
# additions for the proxy implementation
|
||||
# Proxy implementation
|
||||
#effectname {
|
||||
#library proxy
|
||||
#uuid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
|
||||
# SW implemetation of the effect. Added as a node under the proxy to
|
||||
# indicate this as a sub effect.
|
||||
#libsw {
|
||||
#library libSW
|
||||
#uuid yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
|
||||
#} End of SW effect
|
||||
|
||||
# HW implementation of the effect. Added as a node under the proxy to
|
||||
# indicate this as a sub effect.
|
||||
#libhw {
|
||||
#library libHW
|
||||
#uuid zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz
|
||||
#}End of HW effect
|
||||
#} End of effect proxy
|
||||
|
||||
bassboost {
|
||||
library bundle
|
||||
uuid 8631f300-72e2-11df-b57e-0002a5d5c51b
|
||||
}
|
||||
virtualizer {
|
||||
library bundle
|
||||
uuid 1d4033c0-8557-11df-9f2d-0002a5d5c51b
|
||||
}
|
||||
equalizer {
|
||||
library bundle
|
||||
uuid ce772f20-847d-11df-bb17-0002a5d5c51b
|
||||
}
|
||||
volume {
|
||||
library bundle
|
||||
uuid 119341a0-8469-11df-81f9-0002a5d5c51b
|
||||
}
|
||||
reverb_env_aux {
|
||||
library reverb
|
||||
uuid 4a387fc0-8ab3-11df-8bad-0002a5d5c51b
|
||||
}
|
||||
reverb_env_ins {
|
||||
library reverb
|
||||
uuid c7a511a0-a3bb-11df-860e-0002a5d5c51b
|
||||
}
|
||||
reverb_pre_aux {
|
||||
library reverb
|
||||
uuid f29a1400-a3bb-11df-8ddc-0002a5d5c51b
|
||||
}
|
||||
reverb_pre_ins {
|
||||
library reverb
|
||||
uuid 172cdf00-a3bc-11df-a72f-0002a5d5c51b
|
||||
}
|
||||
visualizer {
|
||||
library visualizer
|
||||
uuid d069d9e0-8329-11df-9168-0002a5d5c51b
|
||||
}
|
||||
downmix {
|
||||
library downmix
|
||||
uuid 93f04452-e4fe-41cc-91f9-e475b6d1d69f
|
||||
}
|
||||
loudness_enhancer {
|
||||
library loudness_enhancer
|
||||
uuid fa415329-2034-4bea-b5dc-5b381c8d1e2c
|
||||
}
|
||||
}
|
||||
|
||||
# Default pre-processing effects. Add to audio_effect.conf "effects" section if
|
||||
# audio HAL implements support for them.
|
||||
#
|
||||
# agc {
|
||||
# library pre_processing
|
||||
# uuid aa8130e0-66fc-11e0-bad0-0002a5d5c51b
|
||||
# }
|
||||
# aec {
|
||||
# library pre_processing
|
||||
# uuid bb392ec0-8d4d-11e0-a896-0002a5d5c51b
|
||||
# }
|
||||
# ns {
|
||||
# library pre_processing
|
||||
# uuid c06c8400-8e06-11e0-9cb6-0002a5d5c51b
|
||||
# }
|
||||
|
||||
# Audio preprocessor configurations.
|
||||
# The pre processor configuration consists in a list of elements each describing
|
||||
# pre processor settings for a given input source. Valid input source names are:
|
||||
# "mic", "camcorder", "voice_recognition", "voice_communication"
|
||||
# Each input source element contains a list of effects elements. The name of the effect
|
||||
# element must be the name of one of the effects in the "effects" list of the file.
|
||||
# Each effect element may optionally contain a list of parameters and their
|
||||
# default value to apply when the pre processor effect is created.
|
||||
# A parameter is defined by a "param" element and a "value" element. Each of these elements
|
||||
# consists in one or more elements specifying a type followed by a value.
|
||||
# The types defined are: "int", "short", "float", "bool" and "string"
|
||||
# When both "param" and "value" are a single int, a simple form is allowed where just
|
||||
# the param and value pair is present in the parameter description
|
||||
# pre_processing {
|
||||
# <input source name> {
|
||||
# <fx name> {
|
||||
# <param 1 name> {
|
||||
# param {
|
||||
# int|short|float|bool|string <value>
|
||||
# [ int|short|float|bool|string <value> ]
|
||||
# ...
|
||||
# }
|
||||
# value {
|
||||
# int|short|float|bool|string <value>
|
||||
# [ int|short|float|bool|string <value> ]
|
||||
# ...
|
||||
# }
|
||||
# }
|
||||
# <param 2 name > {<param> <value>}
|
||||
# ...
|
||||
# }
|
||||
# ...
|
||||
# }
|
||||
# ...
|
||||
# }
|
||||
|
||||
#
|
||||
# TODO: add default audio pre processor configurations after debug and tuning phase
|
||||
#
|
63
configs/audio/audio_output_policy.conf
Normal file
63
configs/audio/audio_output_policy.conf
Normal file
|
@ -0,0 +1,63 @@
|
|||
# List of profiles for the output device session where stream is routed.
|
||||
# A stream opened with the inputs attributes which match the "flags" and
|
||||
# "formats" as specified in the profile is routed to a device at
|
||||
# sample rate specified under "sampling_rates" and bit width under
|
||||
# "bit_width" and the topology extracted from the acdb data against
|
||||
# the "app_type".
|
||||
#
|
||||
# the flags and formats are specified using the strings corresponding to
|
||||
# enums in audio.h and audio_policy.h. They are concatenated with "|"
|
||||
# without space or "\n".
|
||||
# the flags and formats should match the ones in "audio_policy.conf"
|
||||
|
||||
outputs {
|
||||
default {
|
||||
flags AUDIO_OUTPUT_FLAG_PRIMARY
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
sampling_rates 48000
|
||||
bit_width 16
|
||||
app_type 69937
|
||||
}
|
||||
deep_buffer {
|
||||
flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
sampling_rates 48000
|
||||
bit_width 16
|
||||
app_type 69936
|
||||
}
|
||||
direct_pcm_16 {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT
|
||||
formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT
|
||||
sampling_rates 44100|48000|96000|192000
|
||||
bit_width 16
|
||||
app_type 69936
|
||||
}
|
||||
direct_pcm_24 {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT
|
||||
formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT
|
||||
sampling_rates 44100|48000|96000|192000
|
||||
bit_width 24
|
||||
app_type 69940
|
||||
}
|
||||
compress_passthrough {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING|AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH
|
||||
formats AUDIO_FORMAT_AC3|AUDIO_FORMAT_E_AC3|AUDIO_FORMAT_E_AC3_JOC|AUDIO_FORMAT_DTS|AUDIO_FORMAT_DTS_HD
|
||||
sampling_rates 32000|44100|48000|88200|96000|176400|192000
|
||||
bit_width 16
|
||||
app_type 69941
|
||||
}
|
||||
compress_offload_16 {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
|
||||
formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2
|
||||
sampling_rates 44100|48000|96000|192000
|
||||
bit_width 16
|
||||
app_type 69936
|
||||
}
|
||||
compress_offload_24 {
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
|
||||
formats AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO
|
||||
sampling_rates 44100|48000|96000|192000
|
||||
bit_width 24
|
||||
app_type 69940
|
||||
}
|
||||
}
|
58
configs/audio/audio_platform_info.xml
Normal file
58
configs/audio/audio_platform_info.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!-- Copyright (c) 2014, 2016, 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, -->
|
||||
<!-- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -->
|
||||
<!-- IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
|
||||
<audio_platform_info>
|
||||
<acdb_ids>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER" acdb_id="15"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_REVERSE" acdb_id="15"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_PROTECTED" acdb_id="124"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER" acdb_id="15"/>
|
||||
</acdb_ids>
|
||||
<bit_width_configs>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER" bit_width="24"/>
|
||||
</bit_width_configs>
|
||||
<config_params>
|
||||
<param key="spkr_1_tz_name" value="wsatz.11"/>
|
||||
<param key="spkr_2_tz_name" value="wsatz.12"/>
|
||||
<!-- In the below value string, first parameter indicates size -->
|
||||
<!-- followed by perf lock options -->
|
||||
<param key="perf_lock_opts" value="4, 0x101, 0x704, 0x20F, 0x1E01"/>
|
||||
<param key="native_audio_mode" value="src"/>
|
||||
<param key="input_mic_max_count" value="4"/>
|
||||
</config_params>
|
||||
<pcm_ids>
|
||||
<usecase name="USECASE_AUDIO_RECORD_LOW_LATENCY" type="in" id="15" />
|
||||
<usecase name="USECASE_AUDIO_PLAYBACK_ULL" type="out" id="4" />
|
||||
</pcm_ids>
|
||||
<backend_names>
|
||||
<device name="SND_DEVICE_OUT_HEADPHONES" backend="headphones" interface="SLIMBUS_6_RX"/>
|
||||
<device name="SND_DEVICE_OUT_LINE" backend="headphones" interface="SLIMBUS_6_RX"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER" backend="speaker" interface="PRI_TDM_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_SPEAKER_REVERSE" backend="speaker" interface="PRI_TDM_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_SPEAKER" backend="speaker" interface="PRI_TDM_RX_0"/>
|
||||
<device name="SND_DEVICE_OUT_VOICE_HEADPHONES" backend="headphones" interface="SLIMBUS_6_RX"/>
|
||||
</backend_names>
|
||||
</audio_platform_info>
|
129
configs/audio/audio_policy.conf
Normal file
129
configs/audio/audio_policy.conf
Normal file
|
@ -0,0 +1,129 @@
|
|||
global_configuration {
|
||||
attached_output_devices AUDIO_DEVICE_OUT_SPEAKER
|
||||
default_output_device AUDIO_DEVICE_OUT_SPEAKER
|
||||
attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_PLAYBACK
|
||||
}
|
||||
|
||||
audio_hw_modules {
|
||||
primary {
|
||||
outputs {
|
||||
primary {
|
||||
sampling_rates 48000
|
||||
channel_masks AUDIO_CHANNEL_OUT_STEREO
|
||||
formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT
|
||||
devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO
|
||||
flags AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_DEEP_BUFFER
|
||||
}
|
||||
fast {
|
||||
sampling_rates 48000
|
||||
channel_masks AUDIO_CHANNEL_OUT_STEREO
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO
|
||||
flags AUDIO_OUTPUT_FLAG_FAST
|
||||
}
|
||||
compress_offload {
|
||||
sampling_rates 11025|16000|22050|32000|44100|48000
|
||||
channel_masks AUDIO_CHANNEL_OUT_MONO|AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_2POINT1|AUDIO_CHANNEL_OUT_QUAD|AUDIO_CHANNEL_OUT_PENTA|AUDIO_CHANNEL_OUT_5POINT1|AUDIO_CHANNEL_OUT_6POINT1|AUDIO_CHANNEL_OUT_7POINT1
|
||||
formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2
|
||||
devices AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO
|
||||
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
|
||||
}
|
||||
}
|
||||
inputs {
|
||||
primary {
|
||||
sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000
|
||||
channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_FRONT_BACK|AUDIO_CHANNEL_IN_VOICE_UPLINK|AUDIO_CHANNEL_IN_VOICE_DNLINK
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADPHONE|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_AUX_DIGITAL|AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_FM
|
||||
}
|
||||
}
|
||||
}
|
||||
a2dp {
|
||||
outputs {
|
||||
a2dp {
|
||||
sampling_rates dynamic
|
||||
channel_masks dynamic
|
||||
formats dynamic
|
||||
devices AUDIO_DEVICE_OUT_BLUETOOTH_A2DP|AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES|AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER
|
||||
}
|
||||
}
|
||||
inputs {
|
||||
a2dp {
|
||||
sampling_rates 44100|48000
|
||||
channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
devices AUDIO_DEVICE_IN_BLUETOOTH_A2DP
|
||||
}
|
||||
}
|
||||
}
|
||||
usb {
|
||||
outputs {
|
||||
usb_accessory {
|
||||
sampling_rates 44100
|
||||
channel_masks AUDIO_CHANNEL_OUT_STEREO
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
devices AUDIO_DEVICE_OUT_USB_ACCESSORY
|
||||
}
|
||||
usb_device {
|
||||
sampling_rates dynamic
|
||||
channel_masks dynamic
|
||||
formats dynamic
|
||||
devices AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET
|
||||
}
|
||||
}
|
||||
inputs {
|
||||
usb_device {
|
||||
sampling_rates dynamic
|
||||
channel_masks dynamic
|
||||
formats dynamic
|
||||
devices AUDIO_DEVICE_IN_USB_DEVICE
|
||||
}
|
||||
}
|
||||
}
|
||||
r_submix {
|
||||
outputs {
|
||||
submix {
|
||||
sampling_rates 48000
|
||||
channel_masks AUDIO_CHANNEL_OUT_STEREO
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
|
||||
}
|
||||
}
|
||||
inputs {
|
||||
submix {
|
||||
sampling_rates 48000
|
||||
channel_masks AUDIO_CHANNEL_IN_STEREO
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
|
||||
}
|
||||
}
|
||||
}
|
||||
tms {
|
||||
outputs {
|
||||
tms {
|
||||
sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000
|
||||
channel_masks AUDIO_CHANNEL_OUT_STEREO
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
devices AUDIO_DEVICE_OUT_EXTERNAL_TMS
|
||||
}
|
||||
}
|
||||
inputs {
|
||||
tms {
|
||||
sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000
|
||||
channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
devices AUDIO_DEVICE_IN_EXTERNAL_TMS
|
||||
}
|
||||
}
|
||||
}
|
||||
playback_record {
|
||||
inputs {
|
||||
playback_record {
|
||||
sampling_rates 48000
|
||||
channel_masks AUDIO_CHANNEL_IN_STEREO
|
||||
formats AUDIO_FORMAT_PCM_16_BIT
|
||||
devices AUDIO_DEVICE_IN_PLAYBACK
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
42
configs/audio/listen_platform_info.xml
Normal file
42
configs/audio/listen_platform_info.xml
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--- Copyright (c) 2014, 2016, 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. -->
|
||||
<listen_platform_info>
|
||||
<device name="DEVICE_HANDSET_APE_ACDB_ID" acdb_id="100" />
|
||||
<device name="DEVICE_HANDSET_CPE_ACDB_ID" acdb_id="128" />
|
||||
<ctrl name="execution_type" value="CPE" /> <!-- value: "CPE" "APE" -->
|
||||
<ctrl name="max_cpe_sessions" value="1" />
|
||||
<ctrl name="max_cpe_keywords" value="6" />
|
||||
<ctrl name="max_cpe_kw_user_pairs" value="6" />
|
||||
<ctrl name="max_ape_sessions" value="8" />
|
||||
<ctrl name="max_ape_keywords" value="10" />
|
||||
<ctrl name="max_ape_kw_user_pairs" value="10" />
|
||||
<ctrl name="dump_lab_data" value="false" /> <!-- value: "true" "false" -->
|
||||
<!-- If value is true, it requires write permissions to /data folder to -->
|
||||
<!-- dump lab data to file under /data/LHAL foloder. Do "chmod 777 /data/" -->
|
||||
</listen_platform_info>
|
||||
|
3767
configs/audio/mixer_paths_tasha.xml
Normal file
3767
configs/audio/mixer_paths_tasha.xml
Normal file
File diff suppressed because it is too large
Load diff
58
configs/compatibility_matrix.xml
Normal file
58
configs/compatibility_matrix.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<compatibility-matrix version="1.0" type="device">
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.frameworks.schedulerservice</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISchedulingPolicyService</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- <hal format="hidl" optional="false">
|
||||
<name>android.frameworks.sensorservice</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISensorManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal> -->
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.allocator</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAllocator</name>
|
||||
<instance>ashmem</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.manager</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IServiceManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.memory</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IMapper</name>
|
||||
<instance>ashmem</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.hidl.token</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ITokenManager</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl" optional="false">
|
||||
<name>android.system.wifi.keystore</name>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IKeystore</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</compatibility-matrix>
|
844
configs/data/dsi_config.xml
Normal file
844
configs/data/dsi_config.xml
Normal file
|
@ -0,0 +1,844 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<list name="dsi_config">
|
||||
|
||||
<!-- Configuration for legacy MSM targets -->
|
||||
<listitem name="msm">
|
||||
|
||||
<data name="qos_enabled" type="int"> 0 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 0 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 0 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet0 </data>
|
||||
<data type="string"> rmnet1 </data>
|
||||
<data type="string"> rmnet2 </data>
|
||||
<data type="string"> rmnet3 </data>
|
||||
<data type="string"> rmnet4 </data>
|
||||
<data type="string"> rmnet5 </data>
|
||||
<data type="string"> rmnet6 </data>
|
||||
<data type="string"> rmnet7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet0 </data>
|
||||
<data type="string"> rmnet1 </data>
|
||||
<data type="string"> rmnet2 </data>
|
||||
<data type="string"> rmnet3 </data>
|
||||
<data type="string"> rmnet4 </data>
|
||||
<data type="string"> rmnet5 </data>
|
||||
<data type="string"> rmnet6 </data>
|
||||
<data type="string"> rmnet7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for fusion4 -->
|
||||
<listitem name="mdm">
|
||||
|
||||
<data name="qos_enabled" type="int"> 0 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_usb0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 0 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet_usb0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_usb0 </data>
|
||||
<data type="string"> rmnet_usb1 </data>
|
||||
<data type="string"> rmnet_usb2 </data>
|
||||
<data type="string"> rmnet_usb3 </data>
|
||||
<data type="string"> rmnet_usb4 </data>
|
||||
<data type="string"> rmnet_usb5 </data>
|
||||
<data type="string"> rmnet_usb6 </data>
|
||||
<data type="string"> rmnet_usb7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for fusion4.5 PCIe -->
|
||||
<listitem name="fusion4_5_pcie">
|
||||
|
||||
<data name="qos_enabled" type="int"> 0 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_mhi0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet_mhi0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for MSM8994 -->
|
||||
<listitem name="msm8994">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for dpm_2_0 targets -->
|
||||
<listitem name="dpm_2_0">
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for Jolokia -->
|
||||
<listitem name="jolokia">
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for MSM8992 -->
|
||||
<listitem name="msm8992">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for 9X40/9X45 LE (Tesla) -->
|
||||
<listitem name="tesla">
|
||||
<data name="qos_enabled" type="int"> 0 </data>
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for MSM8952/MSM8956 -->
|
||||
<listitem name="tabasco">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
<!-- Configuration for MSM8976 -->
|
||||
<listitem name="Eldarion">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for MSM8953 -->
|
||||
<listitem name="jacala">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for MSM8940 -->
|
||||
<listitem name="feero6">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for MSM8920 -->
|
||||
<listitem name="feerolite6">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for SDM660 -->
|
||||
<listitem name="Starlord">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for SDM630 -->
|
||||
<listitem name="Starhawk">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for MSM8996 -->
|
||||
<listitem name="msm8996">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for Fusion 8084 + 9x45 PCIe -->
|
||||
<listitem name="fusion_8084_9x45_pcie">
|
||||
<data name="qos_enabled" type="int"> 0 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_mhi0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet_mhi0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for 9X50/9X55 LE (Atlas) -->
|
||||
<listitem name="atlas">
|
||||
<data name="qos_enabled" type="int"> 0 </data>
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for Fusion 8096 + 9x55 PCIe -->
|
||||
<listitem name="fusion_8096_9x55_pcie">
|
||||
<data name="qos_enabled" type="int"> 0 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_mhi0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet_mhi0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
<!-- Configuration for lykan -->
|
||||
<listitem name="lykan">
|
||||
<data name="qos_enabled" type="int"> 0 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
<!-- Configuration for feero -->
|
||||
<listitem name="feero">
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for msm8998 -->
|
||||
<listitem name="msm8998">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for SDM845 -->
|
||||
<listitem name="SDM845">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for SDM670 -->
|
||||
<listitem name="Warlock">
|
||||
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_ipa0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Configuration for Fusion 8998 + SDX50 standalone -->
|
||||
<listitem name="fusion_8998_sdx50_sa">
|
||||
<data name="qos_enabled" type="int"> 1 </data>
|
||||
<data name="rmnet_data_enabled" type="int"> 1 </data>
|
||||
<data name="phys_net_dev" type="string"> rmnet_mhi0 </data>
|
||||
|
||||
<data name="single_qmux_channel_enabled" type="int"> 1 </data>
|
||||
<data name="single_qmux_channel_name" type="string"> rmnet_mhi0 </data>
|
||||
|
||||
<data name="num_dsi_handles" type="int"> 8 </data>
|
||||
<list name="device_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
|
||||
<list name="control_port_names">
|
||||
<data type="string"> rmnet_data0 </data>
|
||||
<data type="string"> rmnet_data1 </data>
|
||||
<data type="string"> rmnet_data2 </data>
|
||||
<data type="string"> rmnet_data3 </data>
|
||||
<data type="string"> rmnet_data4 </data>
|
||||
<data type="string"> rmnet_data5 </data>
|
||||
<data type="string"> rmnet_data6 </data>
|
||||
<data type="string"> rmnet_data7 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
</list>
|
||||
|
2127
configs/data/netmgr_config.xml
Normal file
2127
configs/data/netmgr_config.xml
Normal file
File diff suppressed because it is too large
Load diff
944
configs/data/qmi_config.xml
Normal file
944
configs/data/qmi_config.xml
Normal file
|
@ -0,0 +1,944 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- QMI configuration -->
|
||||
<list name="qmi_config">
|
||||
|
||||
<!-- Fusion4.5 (PCIe) parameters -->
|
||||
<listitem name = "fusion4_5_pcie">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_MHI_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_MHI_1 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_MHI_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_MHI_1 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/mhi_pipe_14 </data>
|
||||
<data type="string"> /dev/mhi_pipe_16 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/mhi_pipe_14 </data>
|
||||
<data type="string"> /tmp/data/mhi_pipe_16 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> MHICTL0 </data>
|
||||
<data type="string"> MHICTL1 </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_MHI </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_MHI </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- Fusion 8084 + 9x45 parameters-->
|
||||
<listitem name = "fusion_8084_9x45_pcie">
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_MHI_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_MHI_1 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_MHI_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_MHI_1 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/mhi_pipe_14 </data>
|
||||
<data type="string"> /dev/mhi_pipe_16 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> MHICTL0 </data>
|
||||
<data type="string"> MHICTL1 </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_MHI </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_MHI </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- MSM8994 parameters -->
|
||||
<listitem name = "msm8994">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 1 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_IPA_0 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA14_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- MDM9X40/MDM9X45 (Tesla) parameters -->
|
||||
<listitem name = "tesla">
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_BAM </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_BAM </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- MSM8992 parameters -->
|
||||
<listitem name = "msm8992">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- MSM8952/MSM8956 parameters -->
|
||||
<listitem name = "tabasco">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- MSM8996 parameters -->
|
||||
<listitem name = "msm8996">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 1 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
|
||||
<!-- MSM8937 parameters -->
|
||||
<listitem name = "feero">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 1 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- MSM8940 parameters -->
|
||||
<listitem name = "feero6">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 0 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- MSM8920 parameters -->
|
||||
<listitem name = "feerolite6">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 0 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- SDM660 parameters -->
|
||||
<listitem name = "Starlord">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 0 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- SDM630 parameters -->
|
||||
<listitem name = "Starhawk">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 0 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- SDM670 parameters -->
|
||||
<listitem name = "Warlock">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 0 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- MSM8976 parameters -->
|
||||
<listitem name = "Eldarion">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- MSM8953 parameters -->
|
||||
<listitem name = "jacala">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl0 </data>
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- MDM9X50/MDM9X55 (Atlas) parameters -->
|
||||
<listitem name = "atlas">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl0 </data>
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA5_CNTL </data>
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_BAM </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_BAM </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- Fusion 8096 + 9x55 parameters-->
|
||||
<listitem name = "fusion_8096_9x55_pcie">
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 2 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_MHI_0 </data>
|
||||
<data type="string"> QMI_PORT_RMNET_MHI_1 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_MHI_0 </data>
|
||||
<data type="string"> QMI_CONN_ID_RMNET_MHI_1 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/mhi_pipe_14 </data>
|
||||
<data type="string"> /dev/mhi_pipe_16 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> MHICTL0 </data>
|
||||
<data type="string"> MHICTL1 </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_MHI </data>
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_MHI </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 1 </data>
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- msm8998 parameters -->
|
||||
<listitem name = "msm8998">
|
||||
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 1 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 0 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
|
||||
</listitem>
|
||||
|
||||
<!-- MSMNILE parameters -->
|
||||
<listitem name = "msmnile">
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 1 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 0 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
|
||||
<!-- SDM845 parameters -->
|
||||
<listitem name = "SDM845">
|
||||
<data name="single_qmux_ch" type="int"> 1 </data>
|
||||
<data name="control_ports_len" type="int"> 1 </data>
|
||||
<data name="dpm_enabled" type="int"> 1 </data>
|
||||
<data name="use_qmuxd" type="int"> 0 </data>
|
||||
|
||||
<list name="conn_str">
|
||||
<data type="string"> QMI_PORT_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="conn_id">
|
||||
<data type="string"> QMI_CONN_ID_RMNET_8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name">
|
||||
<data type="string"> /dev/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="dev_name_test">
|
||||
<data type="string"> /tmp/data/smdcntl8 </data>
|
||||
</list>
|
||||
|
||||
<list name="ch_name">
|
||||
<data type="string"> DATA40_CNTL </data>
|
||||
</list>
|
||||
|
||||
<list name="transport">
|
||||
<data type="string"> LINUX_QMI_TRANSPORT_SMD </data>
|
||||
</list>
|
||||
|
||||
<list name="enabled">
|
||||
<data type="int"> 1 </data>
|
||||
</list>
|
||||
|
||||
<list name="open_at_powerup">
|
||||
<data type="int"> 0 </data>
|
||||
</list>
|
||||
</listitem>
|
||||
</list>
|
||||
|
71
configs/display/hdr_tm_config.xml
Normal file
71
configs/display/hdr_tm_config.xml
Normal file
|
@ -0,0 +1,71 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<hdr_lib version="1.0" >
|
||||
<panel_color_mode> DCIP3 </panel_color_mode> <!-- string sRGB or DCIP3 -->
|
||||
<panel_max_luminance> 530 </panel_max_luminance> <!-- int panel max luminance at white point (nits) 425.71 -->
|
||||
<panel_min_luminance> 0.05 </panel_min_luminance> <!-- float panel min luminance, black leakage (nits) -->
|
||||
<nominal_peak_luminance> 1000.0 </nominal_peak_luminance><!-- used by HLG playback -->
|
||||
<output_gamma_space>
|
||||
<space> 2p2 </space><!-- string linear, 2d2, sRGB, BT709 or custom -->
|
||||
<val> 2.2 </val> <!-- the gamma value is picked up here when it's custom mode-->
|
||||
</output_gamma_space>
|
||||
<panel_pcc> <!-- spell this out explicitly to avoid confusion over order -->
|
||||
<r>
|
||||
<c> 0.0 </c> <!-- float constant component -->
|
||||
<r> 0.843852149479179000 </r>
|
||||
<g> 0.033367570391448800 </g>
|
||||
<b> 0.115455603771749000 </b>
|
||||
<rr> -0.070137936695935100 </rr>
|
||||
<gg> 0.019330337226746800 </gg>
|
||||
<bb> -0.082245714818059600 </bb>
|
||||
<rg> 0.056248257671527800 </rg>
|
||||
<gb> 0.005648886133210710 </gb>
|
||||
<rb> 0.088615923116008800 </rb>
|
||||
<rgb> -0.010483183384981400 </rgb>
|
||||
</r>
|
||||
<g>
|
||||
<c> 0.0 </c> <!-- float constant component -->
|
||||
<r> 0.042089872950367900 </r>
|
||||
<g> 0.891239777307560000 </g>
|
||||
<b> 0.067251336007707200 </b>
|
||||
<rr> -0.024006494195320800 </rr>
|
||||
<gg> -0.109946890251288000 </gg>
|
||||
<bb> -0.066884125937343900 </bb>
|
||||
<rg> 0.036195155979943700 </rg>
|
||||
<gb> 0.150946408464095000 </gb>
|
||||
<rb> 0.006068075006304140 </rb>
|
||||
<rgb> 0.007521620453658000 </rgb>
|
||||
</g>
|
||||
<b>
|
||||
<c> 0.0 </c> <!-- float constant component -->
|
||||
<r> 0.002390841586013620 </r>
|
||||
<g> 0.018634887229954300 </g>
|
||||
<b> 0.975517676238062000 </b>
|
||||
<rr> -0.004012576799164200 </rr>
|
||||
<gg> -0.009934385624627710 </gg>
|
||||
<bb> -0.023002823242893800 </bb>
|
||||
<rg> -0.002238465642428940 </rg>
|
||||
<gb> 0.058111241033631200 </gb>
|
||||
<rb> -0.009972137842975040 </rb>
|
||||
<rgb> -0.006043115883195230 </rgb>
|
||||
</b>
|
||||
</panel_pcc>
|
||||
<tone_map_curve_control>
|
||||
<t0> 0.0005 </t0> <!-- float (nits) intercept of first transition segment with panel min -->
|
||||
<intl> 125.0 </intl> <!-- float (nits) intercept of first transition segment with linear segment -->
|
||||
<inth> 325.0 </inth> <!-- float (nits) intercept of second transtion segment with linear segment -->
|
||||
<slope> 0.77 </slope> <!-- float slope of linear segment -->
|
||||
<pivot> 1000.0 </pivot> <!-- pivot point around which the linear segment is rotated to achieve slope -->
|
||||
<sharp> 2.0 </sharp> <!-- sharpness factor for second transition section -->
|
||||
</tone_map_curve_control>
|
||||
<bright>
|
||||
<tlower> 0.03</tlower>
|
||||
<tupper> 460.0</tupper>
|
||||
<sysGamma> 1.00</sysGamma>
|
||||
</bright>
|
||||
<sat>
|
||||
<enable> 0 </enable>
|
||||
<t1> 0.005 </t1>
|
||||
<t2> 0.05 </t2>
|
||||
<kmax> 1.30 </kmax>
|
||||
</sat>
|
||||
</hdr_lib>
|
File diff suppressed because one or more lines are too long
1
configs/idc/Tab_S3_Book_Cover_Keyboard.idc
Normal file
1
configs/idc/Tab_S3_Book_Cover_Keyboard.idc
Normal file
|
@ -0,0 +1 @@
|
|||
device.internal = 0
|
2
configs/idc/sec_e-pen.idc
Normal file
2
configs/idc/sec_e-pen.idc
Normal file
|
@ -0,0 +1,2 @@
|
|||
touch.deviceType = pointer
|
||||
touch.orientationAware = 1
|
95
configs/keylayout/Tab_S3_Book_Cover_Keyboard.kl
Normal file
95
configs/keylayout/Tab_S3_Book_Cover_Keyboard.kl
Normal file
|
@ -0,0 +1,95 @@
|
|||
# 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.
|
||||
|
||||
#
|
||||
# key layout file for full alphabetic US English PC style external keyboards.
|
||||
#
|
||||
# This file is supporting the logitech (vid = 0x046d) keyboard (pid = 0xb344) with standard
|
||||
# mapping, as well as access to enhanced functionnality for the user via F13-F24.
|
||||
# This mapping file also restores access to MUSIC, CALENDAR and CONTACTS apps via standard
|
||||
# consumerkey usages (USB HUT).
|
||||
#
|
||||
|
||||
key 2 1
|
||||
key 3 2
|
||||
key 4 3
|
||||
key 5 4
|
||||
key 6 5
|
||||
key 7 6
|
||||
key 8 7
|
||||
key 9 8
|
||||
key 10 9
|
||||
key 11 0
|
||||
key 12 MINUS
|
||||
key 13 EQUALS
|
||||
key 14 DEL
|
||||
key 15 TAB
|
||||
key 16 Q
|
||||
key 17 W
|
||||
key 18 E
|
||||
key 19 R
|
||||
key 20 T
|
||||
key 21 Y
|
||||
key 22 U
|
||||
key 23 I
|
||||
key 24 O
|
||||
key 25 P
|
||||
key 26 LEFT_BRACKET
|
||||
key 27 RIGHT_BRACKET
|
||||
key 28 ENTER
|
||||
key 29 CTRL_LEFT
|
||||
key 30 A
|
||||
key 31 S
|
||||
key 32 D
|
||||
key 33 F
|
||||
key 34 G
|
||||
key 35 H
|
||||
key 36 J
|
||||
key 37 K
|
||||
key 38 L
|
||||
key 39 SEMICOLON
|
||||
key 40 APOSTROPHE
|
||||
key 41 GRAVE
|
||||
key 42 SHIFT_LEFT
|
||||
key 43 BACKSLASH
|
||||
key 44 Z
|
||||
key 45 X
|
||||
key 46 C
|
||||
key 47 V
|
||||
key 48 B
|
||||
key 49 N
|
||||
key 50 M
|
||||
key 51 COMMA
|
||||
key 52 PERIOD
|
||||
key 53 SLASH
|
||||
key 54 SHIFT_RIGHT
|
||||
|
||||
key 56 ALT_LEFT
|
||||
key 57 SPACE
|
||||
key 58 CAPS_LOCK
|
||||
key 86 BACKSLASH
|
||||
key 100 ALT_RIGHT
|
||||
|
||||
key 103 DPAD_UP
|
||||
|
||||
key 105 DPAD_LEFT
|
||||
key 106 DPAD_RIGHT
|
||||
key 107 MOVE_END
|
||||
key 108 DPAD_DOWN
|
||||
key 122 LANG
|
||||
key 125 META_LEFT
|
||||
key 142 SLEEP
|
||||
key 143 WAKEUP
|
||||
key 217 SEARCH
|
||||
key 706 SIP_ON_OFF
|
36
configs/keylayout/gpio-keys.kl
Normal file
36
configs/keylayout/gpio-keys.kl
Normal file
|
@ -0,0 +1,36 @@
|
|||
# Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# 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.
|
||||
|
||||
key 115 VOLUME_UP
|
||||
key 114 VOLUME_DOWN
|
||||
key 172 HOME
|
||||
key 528 FOCUS
|
||||
key 766 CAMERA
|
||||
key 158 BACK
|
||||
key 252 USER
|
||||
key 254 APP_SWITCH
|
||||
|
29
configs/keylayout/sec_e-pen.kl
Normal file
29
configs/keylayout/sec_e-pen.kl
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Copyright (c) 2012, 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
|
||||
|
||||
#event3
|
||||
key 158 BACK
|
||||
key 254 APP_SWITCH
|
18
configs/keylayout/sec_touchkey.kl
Normal file
18
configs/keylayout/sec_touchkey.kl
Normal file
|
@ -0,0 +1,18 @@
|
|||
#
|
||||
# Copyright (C) 2017 The LineageOS Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
key 158 BACK VIRTUAL
|
||||
key 254 APP_SWITCH VIRTUAL
|
31
configs/keylayout/synaptics_dsx.kl
Normal file
31
configs/keylayout/synaptics_dsx.kl
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are
|
||||
# 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.
|
||||
|
||||
key 158 BACK
|
||||
key 139 MENU
|
||||
key 102 HOME
|
||||
key 217 SEARCH
|
483
configs/manifest.xml
Normal file
483
configs/manifest.xml
Normal file
|
@ -0,0 +1,483 @@
|
|||
<manifest version="1.0" type="device">
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.biometrics.fingerprint</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.1</version>
|
||||
<interface>
|
||||
<name>IBiometricsFingerprint</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.audio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IDevicesFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.audio.effect</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IEffectsFactory</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- <hal format="hidl">
|
||||
<name>android.hardware.bluetooth</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IBluetoothHci</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal> -->
|
||||
<!-- <hal format="hidl">
|
||||
<name>android.hardware.camera.provider</name>
|
||||
<transport arch="32">passthrough</transport>
|
||||
<version>2.4</version>
|
||||
<interface>
|
||||
<name>ICameraProvider</name>
|
||||
<instance>legacy/0</instance>
|
||||
</interface>
|
||||
</hal> -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.configstore</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISurfaceFlingerConfigs</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.drm</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ICryptoFactory</name>
|
||||
<instance>default</instance>
|
||||
<instance>widevine</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IDrmFactory</name>
|
||||
<instance>default</instance>
|
||||
<instance>widevine</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.gatekeeper</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IGatekeeper</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.gnss</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IGnss</name>
|
||||
<instance>default</instance>
|
||||
<instance>gnss_vendor</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.graphics.allocator</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IAllocator</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.graphics.composer</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.1</version>
|
||||
<interface>
|
||||
<name>IComposer</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.graphics.mapper</name>
|
||||
<transport arch="32+64">passthrough</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IMapper</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.health</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IHealth</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<!-- <hal format="hidl">
|
||||
<name>android.hardware.keymaster</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>3.0</version>
|
||||
<interface>
|
||||
<name>IKeymasterDevice</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal> -->
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.media.omx</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOmx</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>IOmxStore</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.memtrack</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IMemtrack</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.power</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IPower</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.radio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IRadio</name>
|
||||
<instance>slot1</instance>
|
||||
</interface>
|
||||
<interface>
|
||||
<name>ISap</name>
|
||||
<instance>slot1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.radio.deprecated</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOemHook</name>
|
||||
<instance>slot1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.renderscript</name>
|
||||
<transport arch="32+64">passthrough</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IDevice</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.sensors</name>
|
||||
<transport arch="32+64">passthrough</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISensors</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.soundtrigger</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>ISoundTriggerHw</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.tetheroffload.config</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOffloadConfig</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.tetheroffload.control</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IOffloadControl</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.vibrator</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IVibrator</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.wifi</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IWifi</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>android.hardware.wifi.supplicant</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ISupplicant</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.dpm.api</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IdpmQmi</name>
|
||||
<instance>dpmQmiService</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.imscmservice</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IImsCmService</name>
|
||||
<instance>qti.ims.connectionmanagerservice</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.qualcomm.qti.uceservice</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IUceService</name>
|
||||
<instance>com.qualcomm.qti.uceservice</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.quicinc.cne.api</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IApiService</name>
|
||||
<instance>cnd</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>com.quicinc.cne.server</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>2.0</version>
|
||||
<interface>
|
||||
<name>IServer</name>
|
||||
<instance>cnd</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.display.color</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IDisplayColor</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.display.config</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.1</version>
|
||||
<interface>
|
||||
<name>IDisplayConfig</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.display.postproc</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IDisplayPostproc</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.lineage.livedisplay</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IColor</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.lineage.power</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ILineagePower</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.gnss</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>ILocHidlGnss</name>
|
||||
<instance>gnss_vendor</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.iop</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IIop</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.perf</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IPerf</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.qdutils_disp</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQdutilsDisp</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.am</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQcRilAudio</name>
|
||||
<instance>slot1</instance>
|
||||
<instance>slot2</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.atcmdfwd</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IAtCmdFwd</name>
|
||||
<instance>AtCmdFwdService</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.ims</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IImsRadio</name>
|
||||
<instance>imsradio0</instance>
|
||||
<instance>imsradio1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.lpa</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IUimLpa</name>
|
||||
<instance>UimLpa0</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.qcrilhook</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQtiOemHook</name>
|
||||
<instance>oemhook0</instance>
|
||||
<instance>oemhook1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.qtiradio</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IQtiRadio</name>
|
||||
<instance>slot1</instance>
|
||||
<instance>slot2</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.uim</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IUim</name>
|
||||
<instance>Uim0</instance>
|
||||
<instance>Uim1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.uim_remote_client</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IUimRemoteServiceClient</name>
|
||||
<instance>uimRemoteClient0</instance>
|
||||
<instance>uimRemoteClient1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.hardware.radio.uim_remote_server</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IUimRemoteServiceServer</name>
|
||||
<instance>uimRemoteServer0</instance>
|
||||
<instance>uimRemoteServer1</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="hidl">
|
||||
<name>vendor.qti.imsrtpservice</name>
|
||||
<transport>hwbinder</transport>
|
||||
<version>1.0</version>
|
||||
<interface>
|
||||
<name>IRTPService</name>
|
||||
<instance>imsrtpservice</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
</manifest>
|
392
configs/media/media_codecs.xml
Normal file
392
configs/media/media_codecs.xml
Normal file
|
@ -0,0 +1,392 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2012-2013 The Android Open Source Project
|
||||
Copyright (C) 2012-2016 The Linux Foundation. All rights reserved.
|
||||
Not a contribution.
|
||||
|
||||
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.
|
||||
-->
|
||||
|
||||
<!--
|
||||
<!DOCTYPE MediaCodecs [
|
||||
<!ELEMENT Include EMPTY>
|
||||
<!ATTLIST Include href CDATA #REQUIRED>
|
||||
<!ELEMENT MediaCodecs (Decoders|Encoders|Include)*>
|
||||
<!ELEMENT Decoders (MediaCodec|Include)*>
|
||||
<!ELEMENT Encoders (MediaCodec|Include)*>
|
||||
<!ELEMENT MediaCodec (Type|Quirk|Include)*>
|
||||
<!ATTLIST MediaCodec name CDATA #REQUIRED>
|
||||
<!ATTLIST MediaCodec type CDATA>
|
||||
<!ELEMENT Type EMPTY>
|
||||
<!ATTLIST Type name CDATA #REQUIRED>
|
||||
<!ELEMENT Quirk EMPTY>
|
||||
<!ATTLIST Quirk name CDATA #REQUIRED>
|
||||
]>
|
||||
|
||||
There's a simple and a complex syntax to declare the availability of a
|
||||
media codec:
|
||||
|
||||
A codec that properly follows the OpenMax spec and therefore doesn't have any
|
||||
quirks and that only supports a single content type can be declared like so:
|
||||
|
||||
<MediaCodec name="OMX.foo.bar" type="something/interesting" />
|
||||
|
||||
If a codec has quirks OR supports multiple content types, the following syntax
|
||||
can be used:
|
||||
|
||||
<MediaCodec name="OMX.foo.bar" >
|
||||
<Type name="something/interesting" />
|
||||
<Type name="something/else" />
|
||||
...
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="output-buffers-are-unreadable" />
|
||||
</MediaCodec>
|
||||
|
||||
Only the three quirks included above are recognized at this point:
|
||||
|
||||
"requires-allocate-on-input-ports"
|
||||
must be advertised if the component does not properly support specification
|
||||
of input buffers using the OMX_UseBuffer(...) API but instead requires
|
||||
OMX_AllocateBuffer to be used.
|
||||
|
||||
"requires-allocate-on-output-ports"
|
||||
must be advertised if the component does not properly support specification
|
||||
of output buffers using the OMX_UseBuffer(...) API but instead requires
|
||||
OMX_AllocateBuffer to be used.
|
||||
|
||||
"output-buffers-are-unreadable"
|
||||
must be advertised if the emitted output buffers of a decoder component
|
||||
are not readable, i.e. use a custom format even though abusing one of
|
||||
the official OMX colorspace constants.
|
||||
Clients of such decoders will not be able to access the decoded data,
|
||||
naturally making the component much less useful. The only use for
|
||||
a component with this quirk is to render the output to the screen.
|
||||
Audio decoders MUST NOT advertise this quirk.
|
||||
Video decoders that advertise this quirk must be accompanied by a
|
||||
corresponding color space converter for thumbnail extraction,
|
||||
matching surfaceflinger support that can render the custom format to
|
||||
a texture and possibly other code, so just DON'T USE THIS QUIRK.
|
||||
|
||||
|
||||
-->
|
||||
|
||||
<!--
|
||||
8996 Decoder capabilities
|
||||
__________________________________________________________________
|
||||
| Codec | W H fps Mbps MB/s | Secure-dec |
|
||||
|__________|_________________________________________|____________|
|
||||
| h264 | 3840 2160 60 100 1958400 | Y |
|
||||
| | (4096) (2160) (56) (100) | |
|
||||
| hevc | 3840 2160 60 100 1958400 | Y |
|
||||
| | (4096) (2160) (56) (100) | |
|
||||
| mpeg4 | 1920 1088 60 60 489600 | N |
|
||||
| vc1 | 1920 1088 60 60 489600 | Y |
|
||||
| vp8 | 3840 2160 30 100 979200 | N |
|
||||
| vp9 | 3840 2160 30 100 979200 | Y |
|
||||
| divx3 | 720 480 30 2 40500 | N |
|
||||
| div4/5/6 | 1920 1088 30 10 244800 | N |
|
||||
| h263 | 864 480 30 2 48600 | N |
|
||||
| mpeg2 | 1920 1088 30 40 244800 | Y |
|
||||
|__________|_________________________________________|____________|
|
||||
|
||||
|
||||
8996 Encoder capabilities
|
||||
______________________________________________________
|
||||
| Codec | W H fps Mbps MB/s |
|
||||
|__________|_________________________________________|
|
||||
| h264 | 3840 2160 30 100 979200 |
|
||||
| hevc | 3840 2160 30 100 979200 |
|
||||
| mpeg4 | 1920 1088 60 60 489600 |
|
||||
| vp8 | 3840 2160 30 100 979200 |
|
||||
| h263 | 864 480 30 2 48600 |
|
||||
|__________|_________________________________________|
|
||||
-->
|
||||
|
||||
<MediaCodecs>
|
||||
<Include href="media_codecs_google_audio.xml" />
|
||||
<Include href="media_codecs_google_telephony.xml" />
|
||||
<Settings>
|
||||
<Setting name="max-video-encoder-input-buffers" value="11" />
|
||||
</Settings>
|
||||
<Encoders>
|
||||
<!-- Audio Hardware -->
|
||||
<!-- Audio Software -->
|
||||
<!-- Video Hardware -->
|
||||
<MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||
<Limit name="size" min="96x96" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Feature name="intra-refresh" />
|
||||
<Feature name="can-swap-width-height" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="requires-loaded-to-idle-after-allocation"/>
|
||||
<Limit name="size" min="96x64" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||
<Limit name="size" min="96x64" max="864x480" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="48600" />
|
||||
<Limit name="bitrate" range="1-2000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||
<Limit name="size" min="96x64" max="3840x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Feature name="intra-refresh" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Quirk name="requires-loaded-to-idle-after-allocation" />
|
||||
<Limit name="size" min="162x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Feature name="intra-refresh" />
|
||||
</MediaCodec>
|
||||
</Encoders>
|
||||
<Decoders>
|
||||
<!-- Video Hardware -->
|
||||
<MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="1958400" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
<Feature name="can-swap-width-height" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.avc.secure" type="video/avc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="1958400" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="6" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports"/>
|
||||
<Limit name="size" min="64x64" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.mpeg2" type="video/mpeg2" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="96x64" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="244800" />
|
||||
<Limit name="bitrate" range="1-40000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.mpeg2.secure" type="video/mpeg2" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="96x64" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="244800" />
|
||||
<Limit name="bitrate" range="1-40000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="6" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="864x480" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="489600" />
|
||||
<Limit name="bitrate" range="1-2000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vc1" type="video/x-ms-wmv" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vc1.secure" type="video/x-ms-wmv" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="489600" />
|
||||
<Limit name="bitrate" range="1-60000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="6" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.divx" type="video/divx" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="244800" />
|
||||
<Limit name="bitrate" range="1-10000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.divx311" type="video/divx311" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="720x480" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="40500" />
|
||||
<Limit name="bitrate" range="1-2000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.divx4" type="video/divx4" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="1920x1088" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="244800" />
|
||||
<Limit name="bitrate" range="1-10000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="3840x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="3840x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vp9.secure" type="video/x-vnd.on2.vp9" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="3840x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="979200" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="6" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="1958400" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Limit name="concurrent-instances" max="16" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.hevc.secure" type="video/hevc" >
|
||||
<Quirk name="requires-allocate-on-input-ports" />
|
||||
<Quirk name="requires-allocate-on-output-ports" />
|
||||
<Limit name="size" min="64x64" max="4096x2160" />
|
||||
<Limit name="alignment" value="2x2" />
|
||||
<Limit name="block-size" value="16x16" />
|
||||
<Limit name="blocks-per-second" min="1" max="1958400" />
|
||||
<Limit name="bitrate" range="1-100000000" />
|
||||
<Limit name="frame-rate" range="1-240" />
|
||||
<Feature name="adaptive-playback" />
|
||||
<Feature name="secure-playback" required="true" />
|
||||
<Limit name="concurrent-instances" max="6" />
|
||||
</MediaCodec>
|
||||
</Decoders>
|
||||
<Include href="media_codecs_google_video.xml" />
|
||||
</MediaCodecs>
|
141
configs/media/media_codecs_performance.xml
Normal file
141
configs/media/media_codecs_performance.xml
Normal file
|
@ -0,0 +1,141 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
||||
|
||||
Not a Contribution.
|
||||
|
||||
Copyright 2015 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.
|
||||
-->
|
||||
|
||||
<MediaCodecs>
|
||||
<Encoders>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.avc" type="video/avc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="238-238" />
|
||||
<Limit name="measured-frame-rate-720x480" range="123-123" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="50-50" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="16-40" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.hevc" type="video/hevc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="226-226" />
|
||||
<Limit name="measured-frame-rate-720x480" range="121-121" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="49-49" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="16-45" />
|
||||
<Limit name="measured-frame-rate-3840x2160" range="6-24" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.h263" type="video/3gpp" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="303-303" />
|
||||
<Limit name="measured-frame-rate-352x288" range="259-259" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.mpeg4" type="video/mp4v-es" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="299-299" />
|
||||
<Limit name="measured-frame-rate-352x288" range="245-245" />
|
||||
<Limit name="measured-frame-rate-640x480" range="148-148" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.encoder.vp8" type="video/x-vnd.on2.vp8" update="true">
|
||||
<Limit name="measured-frame-rate-320x180" range="266-266" />
|
||||
<Limit name="measured-frame-rate-640x360" range="165-165" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="49-49" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="16-40" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.h264.encoder" type="video/avc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="375-430" />
|
||||
<Limit name="measured-frame-rate-720x480" range="156-193" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="32-46" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="20-20" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.h263.encoder" type="video/3gpp" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="200-260" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.mpeg4.encoder" type="video/mp4v-es" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="411-524" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" update="true">
|
||||
<Limit name="measured-frame-rate-320x180" range="240-250" />
|
||||
<Limit name="measured-frame-rate-640x360" range="50-57" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="17-24" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="8-12" />
|
||||
</MediaCodec>
|
||||
</Encoders>
|
||||
<Decoders>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="221-221" />
|
||||
<Limit name="measured-frame-rate-720x480" range="156-156" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="270-270" />
|
||||
<Limit name="measured-frame-rate-1920x1088" range="206-211" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.hevc" type="video/hevc" update="true">
|
||||
<Limit name="measured-frame-rate-352x288" range="222-222" />
|
||||
<Limit name="measured-frame-rate-720x480" range="165-165" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="292-292" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="240-240" />
|
||||
<Limit name="measured-frame-rate-3840x2160" range="68-68" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.h263" type="video/3gpp" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="356-356" />
|
||||
<Limit name="measured-frame-rate-352x288" range="292-292" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.mpeg4" type="video/mp4v-es" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="146-146" />
|
||||
<Limit name="measured-frame-rate-480x360" range="145-145" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vp8" type="video/x-vnd.on2.vp8" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="337-337" />
|
||||
<Limit name="measured-frame-rate-640x360" range="337-337" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="337-337" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="248-248" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.qcom.video.decoder.vp9" type="video/x-vnd.on2.vp9" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="377-377" />
|
||||
<Limit name="measured-frame-rate-640x360" range="323-323" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="262-262" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="220-220" />
|
||||
<Limit name="measured-frame-rate-3840x2160" range="19-19" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.h264.decoder" type="video/avc" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="577-847" />
|
||||
<Limit name="measured-frame-rate-720x480" range="248-248" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="84-84" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="46-46" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" update="true">
|
||||
<Limit name="measured-frame-rate-176x144" range="104-279" />
|
||||
<Limit name="measured-frame-rate-352x288" range="200-200" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.hevc.decoder" type="video/hevc" update="true">
|
||||
<Limit name="measured-frame-rate-352x288" range="170-170" />
|
||||
<Limit name="measured-frame-rate-640x360" range="209-209" />
|
||||
<Limit name="measured-frame-rate-720x480" range="190-190" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="32-32" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="21-21" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.mpeg4.decoder" update="true">
|
||||
<Type name="video/mp4v-es">
|
||||
<Limit name="measured-frame-rate-176x144" range="290-350" />
|
||||
</Type>
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="330-381" />
|
||||
<Limit name="measured-frame-rate-640x360" range="139-185" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="22-38" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="9-18" />
|
||||
</MediaCodec>
|
||||
<MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" update="true">
|
||||
<Limit name="measured-frame-rate-320x240" range="200-230" />
|
||||
<Limit name="measured-frame-rate-640x360" range="315-360" />
|
||||
<Limit name="measured-frame-rate-1280x720" range="143-146" />
|
||||
<Limit name="measured-frame-rate-1920x1080" range="84-87" />
|
||||
</MediaCodec>
|
||||
</Decoders>
|
||||
</MediaCodecs>
|
665
configs/media/media_profiles_V1_0.xml
Normal file
665
configs/media/media_profiles_V1_0.xml
Normal file
|
@ -0,0 +1,665 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 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.
|
||||
-->
|
||||
<!DOCTYPE MediaSettings SYSTEM "/system/etc/media_profiles_V1_0.dtd">
|
||||
<!--
|
||||
This file is used to declare the multimedia profiles and capabilities
|
||||
on an android-powered device.
|
||||
-->
|
||||
<MediaSettings>
|
||||
<!-- Each camcorder profile defines a set of predefined configuration parameters -->
|
||||
<!-- Back Camera -->
|
||||
<CamcorderProfiles cameraId="0">
|
||||
|
||||
<EncoderProfile quality="low" fileFormat="3gp" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="high" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="3840"
|
||||
height="2160"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="qvga" fileFormat="mp4" duration="60">
|
||||
<Video codec="h264"
|
||||
bitRate="512000"
|
||||
width="320"
|
||||
height="240"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="cif" fileFormat="3gp" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="720000"
|
||||
width="352"
|
||||
height="288"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="2000000"
|
||||
width="720"
|
||||
height="480"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="14000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="20000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="2160p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="3840"
|
||||
height="2160"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="qcif" fileFormat="3gp" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapselow" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="3840"
|
||||
height="2160"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="720000"
|
||||
width="352"
|
||||
height="288"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
|
||||
<EncoderProfile quality="timelapseqvga" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="512000"
|
||||
width="320"
|
||||
height="240"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="2000000"
|
||||
width="640"
|
||||
height="480"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="14000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="20000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse2160p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="3840"
|
||||
height="2160"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<!-- CAMCORDER_QUALITY_HIGH_SPEED_LOW/720P : 720p@120fps; 27.0 Mbps -->
|
||||
<EncoderProfile quality="highspeedlow" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="27000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="120" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<!-- CAMCORDER_QUALITY_HIGH_SPEED_HIGH/1080P : 1080p@120fps; 42.0 Mbps -->
|
||||
<EncoderProfile quality="highspeedhigh" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="120" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="highspeed720p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="27000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="120" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="highspeed1080p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="42000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="120" />
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<ImageEncoding quality="95" />
|
||||
<ImageEncoding quality="80" />
|
||||
<ImageEncoding quality="70" />
|
||||
<ImageDecoding memCap="20000000" />
|
||||
|
||||
</CamcorderProfiles>
|
||||
<!-- Front Camera -->
|
||||
<CamcorderProfiles cameraId="1">
|
||||
|
||||
<EncoderProfile quality="low" fileFormat="3gp" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="high" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="20000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="qvga" fileFormat="mp4" duration="60">
|
||||
<Video codec="h264"
|
||||
bitRate="512000"
|
||||
width="320"
|
||||
height="240"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="cif" fileFormat="3gp" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="720000"
|
||||
width="352"
|
||||
height="288"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="480p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="2000000"
|
||||
width="720"
|
||||
height="480"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="720p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="14000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="20000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="qcif" fileFormat="3gp" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<!-- TIMELAPSE profiles for front camera -->
|
||||
<EncoderProfile quality="timelapselow" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="20000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="192000"
|
||||
width="176"
|
||||
height="144"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapsecif" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="1200000"
|
||||
width="352"
|
||||
height="288"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapseqvga" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="512000"
|
||||
width="320"
|
||||
height="240"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="amrnb"
|
||||
bitRate="12200"
|
||||
sampleRate="8000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="5000000"
|
||||
width="720"
|
||||
height="480"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="8000000"
|
||||
width="1280"
|
||||
height="720"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="96000"
|
||||
sampleRate="48000"
|
||||
channels="1" />
|
||||
</EncoderProfile>
|
||||
|
||||
<EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
|
||||
<Video codec="h264"
|
||||
bitRate="20000000"
|
||||
width="1920"
|
||||
height="1080"
|
||||
frameRate="30" />
|
||||
|
||||
<!-- audio setting is ignored -->
|
||||
<Audio codec="aac"
|
||||
bitRate="156000"
|
||||
sampleRate="48000"
|
||||
channels="2" />
|
||||
</EncoderProfile>
|
||||
|
||||
<ImageEncoding quality="95" />
|
||||
<ImageEncoding quality="80" />
|
||||
<ImageEncoding quality="70" />
|
||||
<ImageDecoding memCap="20000000" />
|
||||
|
||||
</CamcorderProfiles>
|
||||
|
||||
<EncoderOutputFileFormat name="3gp" />
|
||||
<EncoderOutputFileFormat name="mp4" />
|
||||
|
||||
<!--
|
||||
If a codec is not enabled, it is invisible to the applications
|
||||
In other words, the applications won't be able to use the codec
|
||||
or query the capabilities of the codec at all if it is disabled
|
||||
-->
|
||||
<VideoEncoderCap name="h264" enabled="true"
|
||||
minBitRate="64000" maxBitRate="42000000"
|
||||
minFrameWidth="176" maxFrameWidth="4096"
|
||||
minFrameHeight="144" maxFrameHeight="2160"
|
||||
minFrameRate="15" maxFrameRate="30"
|
||||
maxHFRFrameWidth="1920" maxHFRFrameHeight="1080"
|
||||
maxHFRMode="120" />
|
||||
|
||||
<VideoEncoderCap name="h263" enabled="true"
|
||||
minBitRate="64000" maxBitRate="2000000"
|
||||
minFrameWidth="176" maxFrameWidth="800"
|
||||
minFrameHeight="144" maxFrameHeight="480"
|
||||
minFrameRate="15" maxFrameRate="30"
|
||||
maxHFRFrameWidth="0" maxHFRFrameHeight="0"
|
||||
maxHFRMode="0" />
|
||||
|
||||
<VideoEncoderCap name="m4v" enabled="true"
|
||||
minBitRate="64000" maxBitRate="20000000"
|
||||
minFrameWidth="176" maxFrameWidth="1920"
|
||||
minFrameHeight="144" maxFrameHeight="1088"
|
||||
minFrameRate="15" maxFrameRate="30"
|
||||
maxHFRFrameWidth="0" maxHFRFrameHeight="0"
|
||||
maxHFRMode="0" />
|
||||
|
||||
<VideoEncoderCap name="hevc" enabled="true"
|
||||
minBitRate="64000" maxBitRate="100000000"
|
||||
minFrameWidth="176" maxFrameWidth="4096"
|
||||
minFrameHeight="144" maxFrameHeight="2160"
|
||||
minFrameRate="15" maxFrameRate="30"
|
||||
maxHFRFrameWidth="0" maxHFRFrameHeight="0"
|
||||
maxHFRMode="0" />
|
||||
|
||||
<AudioEncoderCap name="aac" enabled="true"
|
||||
minBitRate="8000" maxBitRate="192000"
|
||||
minSampleRate="8000" maxSampleRate="48000"
|
||||
minChannels="1" maxChannels="6" />
|
||||
|
||||
<AudioEncoderCap name="heaac" enabled="true"
|
||||
minBitRate="8000" maxBitRate="64000"
|
||||
minSampleRate="16000" maxSampleRate="48000"
|
||||
minChannels="1" maxChannels="1" />
|
||||
|
||||
<AudioEncoderCap name="aaceld" enabled="true"
|
||||
minBitRate="16000" maxBitRate="192000"
|
||||
minSampleRate="16000" maxSampleRate="48000"
|
||||
minChannels="1" maxChannels="1" />
|
||||
|
||||
<AudioEncoderCap name="amrwb" enabled="true"
|
||||
minBitRate="6600" maxBitRate="23850"
|
||||
minSampleRate="16000" maxSampleRate="16000"
|
||||
minChannels="1" maxChannels="1" />
|
||||
|
||||
<AudioEncoderCap name="amrnb" enabled="true"
|
||||
minBitRate="5525" maxBitRate="12200"
|
||||
minSampleRate="8000" maxSampleRate="8000"
|
||||
minChannels="1" maxChannels="1" />
|
||||
|
||||
<!--
|
||||
FIXME:
|
||||
We do not check decoder capabilities at present
|
||||
At present, we only check whether windows media is visible
|
||||
for TEST applications. For other applications, we do
|
||||
not perform any checks at all.
|
||||
-->
|
||||
<VideoDecoderCap name="wmv" enabled="true"/>
|
||||
<AudioDecoderCap name="wma" enabled="true"/>
|
||||
|
||||
<!--
|
||||
The VideoEditor Capability configuration:
|
||||
- maxInputFrameWidth: maximum video width of imported video clip.
|
||||
- maxInputFrameHeight: maximum video height of imported video clip.
|
||||
- maxOutputFrameWidth: maximum video width of exported video clip.
|
||||
- maxOutputFrameHeight: maximum video height of exported video clip.
|
||||
- maxPrefetchYUVFrames: maximum prefetch YUV frames for encoder,
|
||||
used to limit the amount of memory for prefetched YUV frames.
|
||||
For this platform, it allows maximum 30MB(3MB per 1080p frame x 10
|
||||
frames) memory.
|
||||
-->
|
||||
<VideoEditorCap maxInputFrameWidth="1920"
|
||||
maxInputFrameHeight="1088" maxOutputFrameWidth="1920"
|
||||
maxOutputFrameHeight="1088" maxPrefetchYUVFrames="10"/>
|
||||
<!--
|
||||
The VideoEditor Export codec profile and level values
|
||||
correspond to the values in OMX_Video.h.
|
||||
E.g. for h264, profile value 1 means OMX_VIDEO_AVCProfileBaseline
|
||||
and level 4096 means OMX_VIDEO_AVCLevel41.
|
||||
Please note that the values are in decimal.
|
||||
These values are for video encoder.
|
||||
-->
|
||||
<!--
|
||||
Codec = h.264, Baseline profile, level 4.0
|
||||
-->
|
||||
<ExportVideoProfile name="h264" profile= "1" level="2048"/>
|
||||
<!--
|
||||
Codec = h.263, Baseline profile, level 70
|
||||
-->
|
||||
<ExportVideoProfile name="h263" profile= "1" level="128"/>
|
||||
<!--
|
||||
Codec = mpeg4, Simple profile, level 5
|
||||
-->
|
||||
<ExportVideoProfile name="m4v" profile= "1" level="128"/>
|
||||
</MediaSettings>
|
2
configs/msm_irqbalance.conf
Normal file
2
configs/msm_irqbalance.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
PRIO=1,1,0,0
|
||||
IGNORED_IRQ=27,62,171
|
125
configs/powerhint.xml
Normal file
125
configs/powerhint.xml
Normal file
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<!--
|
||||
/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2018, The LineageOS Project.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<HintConfigs>
|
||||
<Powerhint>
|
||||
<!--preview-->
|
||||
<!-- B CPU - above_hispeed_delay of 40 ms -->
|
||||
<!-- B CPU - go hispeed load 95 -->
|
||||
<!-- B CPU - hispeed freq of 556 MHz -->
|
||||
<!-- B CPU - target load of 90 -->
|
||||
<!-- L CPU - above_hispeed_delay of 40 ms -->
|
||||
<!-- L CPU - go hispeed load 95 -->
|
||||
<!-- L CPU - hispeed freq of 556 MHz- -->
|
||||
<!-- L CPU - target load of 90 -->
|
||||
<!-- CPUBW low power ceil mpbs of 2500 -->
|
||||
<!-- CPUBW low power io percent of 50 -->
|
||||
|
||||
<Config
|
||||
Id="0x00001300" Enable="true" Target="msm8996"
|
||||
Resources="0x41400000, 0x4, 0x41410000, 0x5F, 0x41414000, 0x22C, 0x41420000, 0x5A, 0x41400100, 0x4, 0x41410100, 0x5F
|
||||
, 0x41414100, 0x22C, 0x41420100, 0x5A, 0x41810000, 0x9C4, 0x41814000, 0x32" />
|
||||
|
||||
<!--video encode 30 fps-->
|
||||
<!-- B CPU - above_hispeed_delay of 40 ms -->
|
||||
<!-- B CPU - go hispeed load 95 -->
|
||||
<!-- B CPU - hispeed freq of 806 MHz -->
|
||||
<!-- B CPU - target load of 90 -->
|
||||
<!-- L CPU - above_hispeed_delay of 40 ms -->
|
||||
<!-- L CPU - go hispeed load 95 -->
|
||||
<!-- L CPU - hispeed freq of 556 MHz- -->
|
||||
<!-- L CPU - target load of 90 -->
|
||||
<!-- CPUBW low power ceil mpbs of 2500 -->
|
||||
<!-- CPUBW low power io percent of 50 -->
|
||||
<!-- CPUBW disable hysteresis -->
|
||||
<!-- CPUBW sample_ms of 10ms -->
|
||||
<!-- L CPU - disable ignore_hispeed_notif -->
|
||||
<!-- B CPU - disable ignore_hispeed_notif -->
|
||||
<Config
|
||||
Id="0x00001203" Enable="true" Target="msm8996"
|
||||
Resources="0x41400000, 0x4, 0x41410000, 0x5F ,0x41414000, 0x326, 0x41420000, 0x5A, 0x41400100, 0x4, 0x41410100
|
||||
, 0x5F, 0x41414100, 0x22C, 0x41420100, 0x5A, 0x41810000 ,0x9C4, 0x41814000,
|
||||
0x32, 0x4180C000 ,0x0, 0x41820000, 0xA, 0x41438100, 0x0, 0x41438000, 0x0" />
|
||||
|
||||
<!--video decode-->
|
||||
<!-- L CPU - above_hispeed_delay of 40 ms -->
|
||||
<!-- L CPU - go hispeed load 95 -->
|
||||
<!-- L CPU - hispeed freq of 768 MHz- -->
|
||||
<!-- L CPU - target load of 90 -->
|
||||
<!-- B CPU - above_hispeed_delay of 40 ms -->
|
||||
<!-- B CPU - go hispeed load 95 -->
|
||||
<!-- B CPU - hispeed freq of 729 MHz -->
|
||||
<!-- B CPU - target load of 90 -->
|
||||
<Config
|
||||
Id="0x00001204" Enable="true" Target="msm8996"
|
||||
Resources="0x41400100, 0x4, 0x41410100, 0x5F ,0x41414100, 0x2D9, 0x41420100, 0x5A, 0x41400000, 0x4, 0x41410000
|
||||
, 0x5F, 0x41414000, 0x2D9, 0x41420000, 0x5A" />
|
||||
|
||||
<!--sustained performance-->
|
||||
<!-- B CPU - Cluster min freq uncapped -->
|
||||
<!-- L CPU - Cluster min freq uncapped -->
|
||||
<!-- B CPU - Cluster max freq ~1.2 GHz -->
|
||||
<!-- L CPU - Cluster max freq ~1.2 Ghz -->
|
||||
<!-- GPU - min freq 180 Mhz -->
|
||||
<!-- GPU - max freq 342 Mhz -->
|
||||
<!-- GPUBW freq uncapped -->
|
||||
<Config
|
||||
Id="0x00001206" Enable="true" Target="msm8996"
|
||||
Resources="0x40800000, 0x0, 0x40800100, 0x0, 0x40804000, 0x4E0, 0x40804100, 0x4E0,
|
||||
0x4280C000, 0xB4, 0x42810000, 0x156, 0x42814000, 0x0"/>
|
||||
<!--vr mode-->
|
||||
<!-- B CPU - Cluster min freq ~1.4 Ghz -->
|
||||
<!-- L CPU - Cluster min freq ~1.4 Ghz -->
|
||||
<!-- B CPU - Cluster max freq ~1.4 Ghz -->
|
||||
<!-- L CPU - Cluster max freq ~1.4 Ghz -->
|
||||
<!-- GPU - min freq 510 Mhz -->
|
||||
<!-- GPU - max freq 510 Mhz -->
|
||||
<!-- GPUBW freq 775 Mhz-->
|
||||
<Config
|
||||
Id="0x00001207" Enable="true" Target="msm8996"
|
||||
Resources="0x40800000, 0x579, 0x40800100, 0x579, 0x40804000, 0x579, 0x40804100, 0x579,
|
||||
0x4280C000, 0x203, 0x42810000, 0x203, 0x42814000, 0x1E4F"/>
|
||||
|
||||
<!--vr mode sustained performance-->
|
||||
<!-- B CPU - Cluster min freq ~1.2 Ghz -->
|
||||
<!-- L CPU - Cluster min freq ~1.2 Ghz -->
|
||||
<!-- B CPU - Cluster max freq ~1.2 Ghz -->
|
||||
<!-- L CPU - Cluster max freq ~1.2 Ghz -->
|
||||
<!-- GPU - min freq 342 Mhz -->
|
||||
<!-- GPU - max freq 342 Mhz -->
|
||||
<!-- GPUBW freq 775 Mhz -->
|
||||
<Config
|
||||
Id="0x00001301" Enable="true" Target="msm8996"
|
||||
Resources="0x40800000, 0x4E0, 0x40800100, 0x4E0, 0x40804000, 0x4E0, 0x40804100, 0x4E0, 0x4280C000, 0x156,
|
||||
0x42810000, 0x156, 0x42814000, 0x1E4F"/>
|
||||
</Powerhint>
|
||||
</HintConfigs>
|
324
configs/sec_config
Normal file
324
configs/sec_config
Normal file
|
@ -0,0 +1,324 @@
|
|||
/* IPC Security Config */
|
||||
/* <GPS QMI Service ID - 16>:<GPS QMI Instance ID - all instances>:<Client Group ID> */
|
||||
16:4294967295:1000:1021
|
||||
/* <LOWI QMI Service ID - 38>:<LOWI QMI Instance ID - all instances>:<Client Group ID> */
|
||||
56:4294967295:1021
|
||||
/* Allow SS CTL service to be used by system and net_raw processes */
|
||||
43:4294967295:1000:3004
|
||||
/* <UIMHTTP QMI Service ID - 16>:<UIMHTTP QMI Instance ID - all instances>:<Client Group ID> */
|
||||
71:4294967295:1001
|
||||
/* <UIMRMT QMI Service ID - 16>:<UIMRMT QMI Instance ID - all instances>:<Client Group ID> */
|
||||
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
|
||||
257:4294967295:1000:1006:1013:1021:1047
|
||||
258:4294967295:1000:1006:1013:1021:1047
|
||||
259:4294967295:1000:1006:1013:1021:1047
|
||||
260:4294967295:1000:1006:1013:1021:1047
|
||||
261:4294967295:1000:1006:1013:1021:1047
|
||||
262:4294967295:1000:1006:1013:1021:1047
|
||||
263:4294967295:1000:1006:1013:1021:1047
|
||||
264:4294967295:1000:1006:1013:1021:1047
|
||||
265:4294967295:1000:1006:1013:1021:1047
|
||||
266:4294967295:1000:1006:1013:1021:1047
|
||||
267:4294967295:1000:1006:1013:1021:1047
|
||||
268:4294967295:1000:1006:1013:1021:1047
|
||||
269:4294967295:1000:1006:1013:1021:1047
|
||||
270:4294967295:1000:1006:1013:1021:1047
|
||||
271:4294967295:1000:1006:1013:1021:1047
|
||||
272:4294967295:1000:1006:1013:1021:1047
|
||||
273:4294967295:1000:1006:1013:1021:1047
|
||||
274:4294967295:1000:1006:1013:1021:1047
|
||||
275:4294967295:1000:1006:1013:1021:1047
|
||||
276:4294967295:1000:1006:1013:1021:1047
|
||||
277:4294967295:1000:1006:1013:1021:1047
|
||||
278:4294967295:1000:1006:1013:1021:1047
|
||||
279:4294967295:1000:1006:1013:1021:1047
|
||||
280:4294967295:1000:1006:1013:1021:1047
|
||||
281:4294967295:1000:1006:1013:1021:1047
|
||||
282:4294967295:1000:1006:1013:1021:1047
|
||||
283:4294967295:1000:1006:1013:1021:1047
|
||||
284:4294967295:1000:1006:1013:1021:1047
|
||||
285:4294967295:1000:1006:1013:1021:1047
|
||||
286:4294967295:1000:1006:1013:1021:1047
|
||||
287:4294967295:1000:1006:1013:1021:1047
|
||||
288:4294967295:1000:1006:1013:1021:1047
|
||||
289:4294967295:1000:1006:1013:1021:1047
|
||||
290:4294967295:1000:1006:1013:1021:1047
|
||||
291:4294967295:1000:1006:1013:1021:1047
|
||||
292:4294967295:1000:1006:1013:1021:1047
|
||||
293:4294967295:1000:1006:1013:1021:1047
|
||||
294:4294967295:1000:1006:1013:1021:1047
|
||||
295:4294967295:1000:1006:1013:1021:1047
|
||||
296:4294967295:1000:1006:1013:1021:1047
|
||||
297:4294967295:1000:1006:1013:1021:1047
|
||||
298:4294967295:1000:1006:1013:1021:1047
|
||||
299:4294967295:1000:1006:1013:1021:1047
|
||||
300:4294967295:1000:1006:1013:1021:1047
|
||||
301:4294967295:1000:1006:1013:1021:1047
|
||||
302:4294967295:1000:1006:1013:1021:1047
|
||||
303:4294967295:1000:1006:1013:1021:1047
|
||||
304:4294967295:1000:1006:1013:1021:1047
|
||||
305:4294967295:1000:1006:1013:1021:1047
|
||||
306:4294967295:1000:1006:1013:1021:1047
|
||||
307:4294967295:1000:1006:1013:1021:1047
|
||||
308:4294967295:1000:1006:1013:1021:1047
|
||||
309:4294967295:1000:1006:1013:1021:1047
|
||||
310:4294967295:1000:1006:1013:1021:1047
|
||||
311:4294967295:1000:1006:1013:1021:1047
|
||||
312:4294967295:1000:1006:1013:1021:1047
|
||||
313:4294967295:1000:1006:1013:1021:1047
|
||||
314:4294967295:1000:1006:1013:1021:1047
|
||||
315:4294967295:1000:1006:1013:1021:1047
|
||||
316:4294967295:1000:1006:1013:1021:1047
|
||||
317:4294967295:1000:1006:1013:1021:1047
|
||||
318:4294967295:1000:1006:1013:1021:1047
|
||||
319:4294967295:1000:1006:1013:1021:1047
|
||||
320:4294967295:1000:1006:1013:1021:1047
|
||||
321:4294967295:1000:1006:1013:1021:1047
|
||||
322:4294967295:1000:1006:1013:1021:1047
|
||||
323:4294967295:1000:1006:1013:1021:1047
|
||||
324:4294967295:1000:1006:1013:1021:1047
|
||||
325:4294967295:1000:1006:1013:1021:1047
|
||||
326:4294967295:1000:1006:1013:1021:1047
|
||||
327:4294967295:1000:1006:1013:1021:1047
|
||||
328:4294967295:1000:1006:1013:1021:1047
|
||||
329:4294967295:1000:1006:1013:1021:1047
|
||||
330:4294967295:1000:1006:1013:1021:1047
|
||||
331:4294967295:1000:1006:1013:1021:1047
|
||||
332:4294967295:1000:1006:1013:1021:1047
|
||||
333:4294967295:1000:1006:1013:1021:1047
|
||||
334:4294967295:1000:1006:1013:1021:1047
|
||||
335:4294967295:1000:1006:1013:1021:1047
|
||||
336:4294967295:1000:1006:1013:1021:1047
|
||||
337:4294967295:1000:1006:1013:1021:1047
|
||||
338:4294967295:1000:1006:1013:1021:1047
|
||||
339:4294967295:1000:1006:1013:1021:1047
|
||||
340:4294967295:1000:1006:1013:1021:1047
|
||||
341:4294967295:1000:1006:1013:1021:1047
|
||||
342:4294967295:1000:1006:1013:1021:1047
|
||||
343:4294967295:1000:1006:1013:1021:1047
|
||||
344:4294967295:1000:1006:1013:1021:1047
|
||||
345:4294967295:1000:1006:1013:1021:1047
|
||||
346:4294967295:1000:1006:1013:1021:1047
|
||||
347:4294967295:1000:1006:1013:1021:1047
|
||||
348:4294967295:1000:1006:1013:1021:1047
|
||||
349:4294967295:1000:1006:1013:1021:1047
|
||||
350:4294967295:1000:1006:1013:1021:1047
|
||||
351:4294967295:1000:1006:1013:1021:1047
|
||||
352:4294967295:1000:1006:1013:1021:1047
|
||||
353:4294967295:1000:1006:1013:1021:1047
|
||||
354:4294967295:1000:1006:1013:1021:1047
|
||||
355:4294967295:1000:1006:1013:1021:1047
|
||||
356:4294967295:1000:1006:1013:1021:1047
|
||||
357:4294967295:1000:1006:1013:1021:1047
|
||||
358:4294967295:1000:1006:1013:1021:1047
|
||||
359:4294967295:1000:1006:1013:1021:1047
|
||||
360:4294967295:1000:1006:1013:1021:1047
|
||||
361:4294967295:1000:1006:1013:1021:1047
|
||||
362:4294967295:1000:1006:1013:1021:1047
|
||||
363:4294967295:1000:1006:1013:1021:1047
|
||||
364:4294967295:1000:1006:1013:1021:1047
|
||||
365:4294967295:1000:1006:1013:1021:1047
|
||||
366:4294967295:1000:1006:1013:1021:1047
|
||||
367:4294967295:1000:1006:1013:1021:1047
|
||||
368:4294967295:1000:1006:1013:1021:1047
|
||||
369:4294967295:1000:1006:1013:1021:1047
|
||||
370:4294967295:1000:1006:1013:1021:1047
|
||||
371:4294967295:1000:1006:1013:1021:1047
|
||||
372:4294967295:1000:1006:1013:1021:1047
|
||||
373:4294967295:1000:1006:1013:1021:1047
|
||||
374:4294967295:1000:1006:1013:1021:1047
|
||||
375:4294967295:1000:1006:1013:1021:1047
|
||||
376:4294967295:1000:1006:1013:1021:1047
|
||||
377:4294967295:1000:1006:1013:1021:1047
|
||||
378:4294967295:1000:1006:1013:1021:1047
|
||||
379:4294967295:1000:1006:1013:1021:1047
|
||||
380:4294967295:1000:1006:1013:1021:1047
|
||||
381:4294967295:1000:1006:1013:1021:1047
|
||||
382:4294967295:1000:1006:1013:1021:1047
|
||||
383:4294967295:1000:1006:1013:1021:1047
|
||||
384:4294967295:1000:1006:1013:1021:1047
|
||||
385:4294967295:1000:1006:1013:1021:1047
|
||||
386:4294967295:1000:1006:1013:1021:1047
|
||||
387:4294967295:1000:1006:1013:1021:1047
|
||||
388:4294967295:1000:1006:1013:1021:1047
|
||||
389:4294967295:1000:1006:1013:1021:1047
|
||||
390:4294967295:1000:1006:1013:1021:1047
|
||||
391:4294967295:1000:1006:1013:1021:1047
|
||||
392:4294967295:1000:1006:1013:1021:1047
|
||||
393:4294967295:1000:1006:1013:1021:1047
|
||||
394:4294967295:1000:1006:1013:1021:1047
|
||||
395:4294967295:1000:1006:1013:1021:1047
|
||||
396:4294967295:1000:1006:1013:1021:1047
|
||||
397:4294967295:1000:1006:1013:1021:1047
|
||||
398:4294967295:1000:1006:1013:1021:1047
|
||||
399:4294967295:1000:1006:1013:1021:1047
|
||||
400:4294967295:1000:1006:1013:1021:1047
|
||||
401:4294967295:1000:1006:1013:1021:1047
|
||||
402:4294967295:1000:1006:1013:1021:1047
|
||||
403:4294967295:1000:1006:1013:1021:1047
|
||||
404:4294967295:1000:1006:1013:1021:1047
|
||||
405:4294967295:1000:1006:1013:1021:1047
|
||||
406:4294967295:1000:1006:1013:1021:1047
|
||||
407:4294967295:1000:1006:1013:1021:1047
|
||||
408:4294967295:1000:1006:1013:1021:1047
|
||||
409:4294967295:1000:1006:1013:1021:1047
|
||||
410:4294967295:1000:1006:1013:1021:1047
|
||||
411:4294967295:1000:1006:1013:1021:1047
|
||||
412:4294967295:1000:1006:1013:1021:1047
|
||||
413:4294967295:1000:1006:1013:1021:1047
|
||||
414:4294967295:1000:1006:1013:1021:1047
|
||||
415:4294967295:1000:1006:1013:1021:1047
|
||||
416:4294967295:1000:1006:1013:1021:1047
|
||||
417:4294967295:1000:1006:1013:1021:1047
|
||||
418:4294967295:1000:1006:1013:1021:1047
|
||||
419:4294967295:1000:1006:1013:1021:1047
|
||||
420:4294967295:1000:1006:1013:1021:1047
|
||||
421:4294967295:1000:1006:1013:1021:1047
|
||||
422:4294967295:1000:1006:1013:1021:1047
|
||||
423:4294967295:1000:1006:1013:1021:1047
|
||||
424:4294967295:1000:1006:1013:1021:1047
|
||||
425:4294967295:1000:1006:1013:1021:1047
|
||||
426:4294967295:1000:1006:1013:1021:1047
|
||||
427:4294967295:1000:1006:1013:1021:1047
|
||||
428:4294967295:1000:1006:1013:1021:1047
|
||||
429:4294967295:1000:1006:1013:1021:1047
|
||||
430:4294967295:1000:1006:1013:1021:1047
|
||||
431:4294967295:1000:1006:1013:1021:1047
|
||||
432:4294967295:1000:1006:1013:1021:1047
|
||||
433:4294967295:1000:1006:1013:1021:1047
|
||||
434:4294967295:1000:1006:1013:1021:1047
|
||||
435:4294967295:1000:1006:1013:1021:1047
|
||||
436:4294967295:1000:1006:1013:1021:1047
|
||||
437:4294967295:1000:1006:1013:1021:1047
|
||||
438:4294967295:1000:1006:1013:1021:1047
|
||||
439:4294967295:1000:1006:1013:1021:1047
|
||||
440:4294967295:1000:1006:1013:1021:1047
|
||||
441:4294967295:1000:1006:1013:1021:1047
|
||||
442:4294967295:1000:1006:1013:1021:1047
|
||||
443:4294967295:1000:1006:1013:1021:1047
|
||||
444:4294967295:1000:1006:1013:1021:1047
|
||||
445:4294967295:1000:1006:1013:1021:1047
|
||||
446:4294967295:1000:1006:1013:1021:1047
|
||||
447:4294967295:1000:1006:1013:1021:1047
|
||||
448:4294967295:1000:1006:1013:1021:1047
|
||||
449:4294967295:1000:1006:1013:1021:1047
|
||||
450:4294967295:1000:1006:1013:1021:1047
|
||||
451:4294967295:1000:1006:1013:1021:1047
|
||||
452:4294967295:1000:1006:1013:1021:1047
|
||||
453:4294967295:1000:1006:1013:1021:1047
|
||||
454:4294967295:1000:1006:1013:1021:1047
|
||||
455:4294967295:1000:1006:1013:1021:1047
|
||||
456:4294967295:1000:1006:1013:1021:1047
|
||||
457:4294967295:1000:1006:1013:1021:1047
|
||||
458:4294967295:1000:1006:1013:1021:1047
|
||||
459:4294967295:1000:1006:1013:1021:1047
|
||||
460:4294967295:1000:1006:1013:1021:1047
|
||||
461:4294967295:1000:1006:1013:1021:1047
|
||||
462:4294967295:1000:1006:1013:1021:1047
|
||||
463:4294967295:1000:1006:1013:1021:1047
|
||||
464:4294967295:1000:1006:1013:1021:1047
|
||||
465:4294967295:1000:1006:1013:1021:1047
|
||||
466:4294967295:1000:1006:1013:1021:1047
|
||||
467:4294967295:1000:1006:1013:1021:1047
|
||||
468:4294967295:1000:1006:1013:1021:1047
|
||||
469:4294967295:1000:1006:1013:1021:1047
|
||||
470:4294967295:1000:1006:1013:1021:1047
|
||||
471:4294967295:1000:1006:1013:1021:1047
|
||||
472:4294967295:1000:1006:1013:1021:1047
|
||||
473:4294967295:1000:1006:1013:1021:1047
|
||||
474:4294967295:1000:1006:1013:1021:1047
|
||||
475:4294967295:1000:1006:1013:1021:1047
|
||||
476:4294967295:1000:1006:1013:1021:1047
|
||||
477:4294967295:1000:1006:1013:1021:1047
|
||||
478:4294967295:1000:1006:1013:1021:1047
|
||||
479:4294967295:1000:1006:1013:1021:1047
|
||||
480:4294967295:1000:1006:1013:1021:1047
|
||||
481:4294967295:1000:1006:1013:1021:1047
|
||||
482:4294967295:1000:1006:1013:1021:1047
|
||||
483:4294967295:1000:1006:1013:1021:1047
|
||||
484:4294967295:1000:1006:1013:1021:1047
|
||||
485:4294967295:1000:1006:1013:1021:1047
|
||||
486:4294967295:1000:1006:1013:1021:1047
|
||||
487:4294967295:1000:1006:1013:1021:1047
|
||||
488:4294967295:1000:1006:1013:1021:1047
|
||||
489:4294967295:1000:1006:1013:1021:1047
|
||||
490:4294967295:1000:1006:1013:1021:1047
|
||||
491:4294967295:1000:1006:1013:1021:1047
|
||||
492:4294967295:1000:1006:1013:1021:1047
|
||||
493:4294967295:1000:1006:1013:1021:1047
|
||||
494:4294967295:1000:1006:1013:1021:1047
|
||||
495:4294967295:1000:1006:1013:1021:1047
|
||||
496:4294967295:1000:1006:1013:1021:1047
|
||||
497:4294967295:1000:1006:1013:1021:1047
|
||||
498:4294967295:1000:1006:1013:1021:1047
|
||||
499:4294967295:1000:1006:1013:1021:1047
|
||||
500:4294967295:1000:1006:1013:1021:1047
|
||||
501:4294967295:1000:1006:1013:1021:1047
|
||||
502:4294967295:1000:1006:1013:1021:1047
|
||||
503:4294967295:1000:1006:1013:1021:1047
|
||||
504:4294967295:1000:1006:1013:1021:1047
|
||||
505:4294967295:1000:1006:1013:1021:1047
|
||||
506:4294967295:1000:1006:1013:1021:1047
|
||||
507:4294967295:1000:1006:1013:1021:1047
|
||||
508:4294967295:1000:1006:1013:1021:1047
|
||||
509:4294967295:1000:1006:1013:1021:1047
|
||||
510:4294967295:1000:1006:1013:1021:1047
|
||||
511:4294967295:1000:1006:1013:1021:1047
|
||||
/* Allow RCS service to aquire net_raw permission */
|
||||
18:4294967295:1001:3004
|
||||
/* Allow QMID service to aquire net_raw permission */
|
||||
3:4294967295:1001:1021:3004
|
||||
2:4294967295:1000: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 <Service id>:<all instances>:<radio> */
|
||||
/* 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
|
||||
/*SERVREG_NOTIF*/
|
||||
64:4294967295:1001
|
||||
66:4294967295:1001
|
||||
/*LTE*/
|
||||
70:4294967295:1001
|
||||
/* Allow Data dpmd to access QMI DFS */
|
||||
48:4294967295:1000:3004
|
||||
/* DIAG */
|
||||
4097:4294967295:2002:2950:3009:2901
|
||||
/* <WLFW QMI Service ID - 0x45>:<WLFW QMI Instance ID - all instances>:<Client Group ID> */
|
||||
69:4294967295:1000
|
||||
/* <WLPS QMI Service ID - 0x39>:<WLFW QMI Instance ID - all instances>:<Client Group ID> */
|
||||
57:4294967295:1000
|
||||
/* VSS GPS */
|
||||
232:4294967295:1001:3004:1021
|
6
configs/sec_config_oem
Normal file
6
configs/sec_config_oem
Normal file
|
@ -0,0 +1,6 @@
|
|||
/* Allow communication to some OEM - QMI services with radio privilages */
|
||||
/* Format is <Service id>:<all instances>:<radio>:<net_raw> */
|
||||
/* VSS */
|
||||
227:4294967295:1001:3004
|
||||
/*COEX*/
|
||||
34:4294967295:1001
|
1
configs/sensors/hals.conf
Normal file
1
configs/sensors/hals.conf
Normal file
|
@ -0,0 +1 @@
|
|||
sensors.ssc.so
|
405
configs/sensors/sensor_def_qcomdev.conf
Normal file
405
configs/sensors/sensor_def_qcomdev.conf
Normal file
|
@ -0,0 +1,405 @@
|
|||
#
|
||||
# File: sensor_def_qcomdev.conf
|
||||
#
|
||||
# Tihs file contains default sensor registry values for Qualcomm development
|
||||
# test platforms.
|
||||
#
|
||||
# Copyright (c) 2013-2015 Qualcomm Technologies, Inc.
|
||||
# All Rights Reserved.
|
||||
# Confidential and Proprietary - Qualcomm Technologies, Inc.
|
||||
|
||||
|
||||
# File format:
|
||||
#
|
||||
# Lines starting with "#" are comments and ignored.
|
||||
#
|
||||
# File metadata uses this format:
|
||||
# :key value1 value2
|
||||
#
|
||||
# The following keys are defined:
|
||||
# - "version" : value1 is non-zero positive version number of the file. This
|
||||
# number will be stored in the sensors registry. It should be equal to the
|
||||
# largest version of any item. It will be saved in the sensors registry for
|
||||
# later use when initializing values. See the item format below.
|
||||
# This value should only be specified once in the file.
|
||||
#
|
||||
# - "hardware" : The value1 will be compared to the "Hardware" string from
|
||||
# the property of ro.board.platform.
|
||||
# Items will only be used as default values in the registry if the hardware
|
||||
# string value is a substring of the ro.board.platform string.
|
||||
# This metadata key can be used more than once, so that one file can support
|
||||
# more than one type of hardware.
|
||||
# The value may be NULL, indicating common item values for all hardware.
|
||||
#
|
||||
# - "platform" : Similar to the "hardware" key, but this string will need to
|
||||
# match the text of either /sys/devices/soc0/hw_platform or
|
||||
# /sys/devices/soc0/platform_subtype.
|
||||
#
|
||||
# - "soc_id" : Similar to the "hardware" key, but this string will need to
|
||||
# match the text of /sys/devices/soc0/soc_id.
|
||||
#
|
||||
# - "subtype" : Similar to the "hardware" key, but this string will need to
|
||||
# match the text of /sys/devices/soc0/platform_subtype.
|
||||
#
|
||||
# - "soc_rev" : Similar to the "hardware" key, but this string will need to
|
||||
# match the text of /sys/devices/soc0/revision.
|
||||
#
|
||||
# - "property" : value1 is the Android system property key, and value2 is
|
||||
# the desired property value. If the system property value matches the
|
||||
# desired property value, then the following items will be applied.
|
||||
# This metadata key can be used more than once, in which case the new
|
||||
# property value overrides the old.
|
||||
# value1 and 2 may be NULL, indicating common item values for all properties.
|
||||
#
|
||||
# Registry items are in lines with the following format:
|
||||
# <itemID> <value> <version>
|
||||
# Where:
|
||||
# itemID is the numeric item ID defined in sns_reg_api_v02.h
|
||||
#
|
||||
# "value" is the numeric value of the item.
|
||||
#
|
||||
# "version" is a non-zero version of the item value.
|
||||
# The version field will be compared against the previous saved
|
||||
# value in the sensors registry. If this value is greater than the
|
||||
# saved value, the default will be applied. Otherwise, the default
|
||||
# will be skipped.
|
||||
#
|
||||
# Registry item values will only be applied if the hardware, platform, and
|
||||
# property values match for the current hardware configuration.
|
||||
#
|
||||
# The numeric fields are parsed with the strtoull function, base 0.
|
||||
#
|
||||
|
||||
# If you update the conf version, you have to update the item version for magnetic calibration.
|
||||
# 401 ~ 414, 3903, 3904, 3905, 3915
|
||||
|
||||
:version 0x00010003
|
||||
|
||||
#######################################################################
|
||||
### 8996 Chipsets - REV00
|
||||
#######################################################################
|
||||
:hardware msm8996
|
||||
:platform
|
||||
:property
|
||||
:hw_rev 0
|
||||
# Orientation of sensors
|
||||
# accel x/y/z
|
||||
700 2 0x00010003 #accel-x-axis
|
||||
701 -1 0x00010003 #accel-y-axis
|
||||
702 3 0x00010003 #accel-z-axis
|
||||
# gyro x/y/z
|
||||
800 2 0x00010003 #gyro-x-axis
|
||||
801 -1 0x00010003 #gyro-y-axis
|
||||
802 3 0x00010003 #gyro-z-axis
|
||||
# mag x/y/z
|
||||
900 1 0x00010005 #max-x-axis
|
||||
901 2 0x00010005 #mag-y-axis
|
||||
902 3 0x00010005 #mag-z-axis
|
||||
# SSI SMGR Version
|
||||
1900 1 0x00010001 #Maj Ver
|
||||
1901 2 0x00010001 #Min Ver
|
||||
|
||||
# SAM config
|
||||
#
|
||||
203 65536 0x10001 # AMD
|
||||
225 983040 0x10001 # RMD
|
||||
504 65536 0x10001 # Gyro Cal
|
||||
1703 65536 0x10001 # Ped
|
||||
2800 983040 0x10001 # basic ges
|
||||
2900 983040 0x10001 # Facing
|
||||
3400 65536 0x10001 # CMC
|
||||
609 983040 0x10001 # FMV
|
||||
1005 983040 0x10001 # Grav
|
||||
1103 983040 0x10001 # orientation
|
||||
3000 983040 0x10001 # gyro quat
|
||||
3100 983040 0x10001 # rot vec
|
||||
3500 983040 0x10001 # game rv
|
||||
4112 65536 0x10001 # SMD
|
||||
4103 5 0x10001 # SMD_ACC_WIN_TIME
|
||||
|
||||
#MAG Cal registry
|
||||
401 0x00000000 0x00010005 # Mag_fac_cal_bias_valid
|
||||
402 0x00000001 0x00010005 # Mag_fac_cal_matrix_valid
|
||||
403 0x00006C6C 0x00010005 # X_offset
|
||||
404 0xFFFFDB8B 0x00010005 # Y_offset
|
||||
405 0xFFFFF5F2 0x00010005 # Z_offset
|
||||
406 0x0000E0F2 0x00010007 # Compensation_matrix_0_0
|
||||
407 0x0000019D 0x00010007 # Compensation_matrix_0_1
|
||||
408 0xFFFFFFC5 0x00010007 # Compensation_matrix_0_2
|
||||
409 0xFFFFF7A1 0x00010007 # Compensation_matrix_1_0
|
||||
410 0x0000FC5D 0x00010007 # Compensation_matrix_1_1
|
||||
411 0x00000803 0x00010007 # Compensation_matrix_1_2
|
||||
412 0xFFFFF92A 0x00010007 # Compensation_matrix_2_0
|
||||
413 0xFFFFF525 0x00010007 # Compensation_matrix_2_1
|
||||
414 0x00010ADB 0x00010007 # Compensation_matrix_2_2
|
||||
|
||||
#ALS/Proxi registry
|
||||
100 0x14 0x00010001 #visible_ratio
|
||||
101 0x50 0x00010001 #ir_ratio
|
||||
102 0 0x00010001 #dc_offset
|
||||
103 2000 0x00010002 #thresh_near
|
||||
104 1400 0x00010002 #thresh_far
|
||||
105 0 0x00010001 #prx_crosstalk
|
||||
106 0x356 0x00010001 #als_factor
|
||||
107 50 0x00010001 #ams_num
|
||||
108 1 0x00010001 #drv_ID
|
||||
109 1 0x00010001 #calibratePhone
|
||||
110 1 0x00010001 #device
|
||||
111 250 0x00010001 #calLuxLower
|
||||
112 500 0x00010001 #calLuxUpper
|
||||
113 3367 0x00010003 #d_factor
|
||||
114 300 0x00010002 #r_coef
|
||||
115 1000 0x00010002 #g_coef
|
||||
116 -10 0x00010002 #b_coef
|
||||
117 3699 0x00010002 #ct_coef
|
||||
118 1687 0x00010002 #ct_offset
|
||||
119 2000 0x00010001 #proxDetect
|
||||
120 1400 0x00010001 #proxRelease
|
||||
121 1024 0x00010001 #luxCorrection
|
||||
122 6 0x00010001 #led enable gpio num
|
||||
123 0 0x00010001 #cancelation
|
||||
124 0x000F 0x00010001 #trim
|
||||
|
||||
# sam parameters for BMI160
|
||||
200 0x000a0000 0x00010001 #AMD_ACC_SAMP_RATE_HZ_Q16
|
||||
201 0x00000cdc 0x00010001 #AMD_INT_cfg_prm1
|
||||
202 0x00008000 0x00010001 #AMD_INT_cfg_prm2
|
||||
211 0x000010db 0x00010001 #VMD_INT_cfg_prm1
|
||||
220 0x001e0000 0x00010001 #RMD_ACC_SAMP_RATE_HZ_Q16
|
||||
221 0x0001b333 0x00010001 #RMD_INT_cfg_prm1
|
||||
222 0x00003333 0x00010001 #RMD_INT_cfg_prm2
|
||||
223 0x00050000 0x00010001 #RMD_INT_cfg_prm3
|
||||
224 0x00003333 0x00010001 #RMD_INT_cfg_prm4
|
||||
|
||||
# LSM6DS3 - accel
|
||||
# {0xaa,0x2b,0xa9,0x09,0xcb,0xe1,0x46,0x12,0x8e,0x50,0x6c,0x95,0xd5,0xd9,0x0b,0x1a}
|
||||
1902 0x1246e1cb09a92baa 0x00010001 #UUID
|
||||
1903 0x1a0bd9d5956c508e 0x00010001 #UUID
|
||||
1904 100000 0x00010001 #off_to_idle
|
||||
1905 0 0x00010002 #idle_to_ready
|
||||
1906 0x1001 0x00010001 #SPI_bus
|
||||
1907 1000 0x00010001 #reg_group_id
|
||||
1908 0 0x00010001 #cal_grp_id
|
||||
1909 122 0x00010001 #gpio1
|
||||
1910 0xFFFF 0x00010001 #gpio2
|
||||
1911 0 0x00010001 #sensor_id
|
||||
1912 0x0 0x00010001 #i2c_address // SPI
|
||||
1913 1 0x00010001 #data_type1
|
||||
1914 0 0x00010001 #data_type2
|
||||
1915 -1 0x00010001 #rel_sns_idx
|
||||
1916 1 0x00010004 #sens_default
|
||||
1917 0xD0 0x00010001 #flags
|
||||
1982 0 0x00010001 #device_select
|
||||
1987 0x2 0x00010004 #vdd
|
||||
1988 0x2 0x00010001 #vddio
|
||||
|
||||
# LSM6DS3 - gyro
|
||||
# {0xaa,0x2b,0xa9,0x09,0xcb,0xe1,0x46,0x12,0x8e,0x50,0x6c,0x95,0xd5,0xd9,0x0b,0x1a}
|
||||
1918 0x1246e1cb09a92baa 0x00010001 #UUID
|
||||
1919 0x1a0bd9d5956c508e 0x00010001 #UUID
|
||||
1920 100000 0x00010001 #off_to_idle
|
||||
1921 0 0x00010002 #idle_to_ready
|
||||
1922 0x1001 0x00010001 #SPI_bus
|
||||
1923 1010 0x00010001 #reg_group_id
|
||||
1924 10 0x00010001 #cal_grp_id
|
||||
1925 122 0x00010001 #gpio1
|
||||
1926 0xFFFF 0x00010001 #gpio2
|
||||
1927 10 0x00010001 #sensor_id
|
||||
1928 0x0 0x00010001 #i2c_address // SPI
|
||||
1929 3 0x00010001 #data_type1
|
||||
1930 0 0x00010001 #data_type2
|
||||
1931 -1 0x00010001 #rel_sns_idx
|
||||
1932 2 0x00010004 #sens_default
|
||||
1933 0xD0 0x00010001 #flags
|
||||
1983 0 0x00010001 #device_select
|
||||
1989 0x2 0x00010004 #vdd
|
||||
1990 0x2 0x00010001 #vddio
|
||||
|
||||
# AKM099xx_FIFO
|
||||
# {0xf6,0xae,0x80,0xfe,0x94,0x2b,0x4d,0x56, 0x8f,0x16,0x61,0xd5,0x98,0x1b,0x61,0x90}
|
||||
1934 0x564d2b94fe80aef6 0x00010001 #UUID
|
||||
1935 0x90611b98d561168f 0x00010001 #UUID
|
||||
1936 3000 0x00010004 #off_to_idle
|
||||
1937 10000 0x00010004 #idle_to_ready
|
||||
1938 3 0x00010001 #i2c_bus
|
||||
1939 1020 0x00010001 #reg_group_id
|
||||
1940 0x0014 0x00010002 #cal_grp_id
|
||||
1941 0xFFFF 0x00010001 #gpio1
|
||||
1942 0xFFFF 0x00010001 #gpio2
|
||||
1943 20 0x00010001 #sensor_id
|
||||
1944 0x0C 0x00010001 #i2c_address
|
||||
1945 2 0x00010001 #data_type1
|
||||
1946 0 0x00010001 #data_type2
|
||||
1947 0xFF 0x00010001 #rel_sns_idx
|
||||
1948 0 0x00010001 #sens_default
|
||||
1949 0 0x00010001 #flags
|
||||
1984 0 0x00010001 #device_select
|
||||
1991 0x2 0x00010004 #vdd
|
||||
1992 0x2 0x00010001 #vddio
|
||||
|
||||
# CM3323 - light
|
||||
# {0xa9,0xd5,0xce,0xe6,0x42,0xca,0x4e,0xa9,0x9c,0x29,0x7e,0x1a,0xc7,0x9e,0x78,0x4b}
|
||||
1950 0xa94eca42e6ced5a9 0x00010003 #UUID
|
||||
1951 0x4b789ec71a7e299c 0x00010003 #UUID
|
||||
1952 5000 0x00010003 #off_to_idle
|
||||
1953 150000 0x00010003 #idle_to_ready
|
||||
1954 2 0x00010003 #i2c_bus
|
||||
1955 1040 0x00010003 #reg_group_id
|
||||
1956 0xFFFF 0x00010003 #cal_grp_id
|
||||
1957 0xFFFF 0x00010003 #gpio1
|
||||
1958 0xFFFF 0x00010003 #gpio2
|
||||
1959 40 0x00010003 #sensor_id
|
||||
1960 0x10 0x00010003 #i2c_address
|
||||
1961 0 0x00010003 #data_type1
|
||||
1962 6 0x00010003 #data_type2
|
||||
1963 0xFF 0x00010003 #rel_sns_idx
|
||||
1964 0 0x00010003 #sens_default
|
||||
1965 0x80 0x00010004 #flags
|
||||
1985 0 0x00010003 #device_select
|
||||
1993 0x96 0x00010004 #vdd
|
||||
1994 0x96 0x00010004 #vddio
|
||||
|
||||
# SSI SMGR Cfg 4:
|
||||
# {0xbc,0x46,0xfd,0x1b,0x43,0xb8,0x25,0x0b,0x61,0xc6,0x95,0x37,0x96,0x75,0x40,0xc1}
|
||||
1966 0 0x00010003 #UUID low
|
||||
1967 0 0x00010003 #UUID high
|
||||
1968 300000 0x00010002 #off_to_idle
|
||||
1969 0 0x00010002 #idle_to_ready
|
||||
1970 2 0x00010002 #i2c_bus
|
||||
1971 1080 0x00010002 #reg_group_id
|
||||
1972 0xFFFF 0x00010002 #cal_grp_id
|
||||
1973 0xFFFF 0x00010002 #gpio1
|
||||
1974 0xFFFF 0x00010002 #gpio2
|
||||
1975 60 0x00010002 #sensor_id
|
||||
1976 0x1C 0x00010002 #i2c_address
|
||||
1977 28 0x00010002 #data_type1
|
||||
1978 29 0x00010002 #data_type2
|
||||
1979 0xFF 0x00010002 #rel_sns_idx
|
||||
1980 0 0x00010002 #sens_default
|
||||
1981 0 0x00010002 #flags
|
||||
1986 0 0x00010002 #device_select
|
||||
|
||||
# SSI SMGR Version
|
||||
3600 1 0x00010001 #Maj Ver
|
||||
3601 2 0x00010001 #Min Ver
|
||||
|
||||
# SSI SMGR Cfg 5:
|
||||
3602 0 0x00010001 #UUID low
|
||||
3603 0 0x00010001 #UUID high
|
||||
3604 300000 0x00010001 #off_to_idle
|
||||
3605 0 0x00010001 #idle_to_ready
|
||||
3606 2 0x00010001 #i2c_bus
|
||||
3607 1080 0x00010001 #reg_group_id
|
||||
3608 0xFFFF 0x00010001 #cal_grp_id
|
||||
3609 0xFFFF 0x00010001 #gpio1
|
||||
3610 0xFFFF 0x00010001 #gpio2
|
||||
3611 60 0x00010001 #sensor_id
|
||||
3612 0x1C 0x00010001 #i2c_address
|
||||
3613 28 0x00010001 #data_type1
|
||||
3614 29 0x00010001 #data_type2
|
||||
3615 0xFF 0x00010001 #rel_sns_idx
|
||||
3616 0 0x00010001 #sens_default
|
||||
3617 0 0x00010001 #flags
|
||||
3682 0 0x00010001 #device_select
|
||||
3687 0x2 0x00010001 #vdd
|
||||
3688 0x2 0x00010001 #vddio
|
||||
|
||||
# SSI SMGR Cfg 6:
|
||||
3618 0 0x00010003 #UUID
|
||||
3619 0 0x00010003 #UUID
|
||||
3620 5700 0x00010003 #off_to_idle
|
||||
3621 10000 0x00010003 #idle_to_ready
|
||||
3622 3 0x00010003 #i2c_bus
|
||||
3623 1040 0x00010003 #reg_group_id
|
||||
3624 0xFFFF 0x00010003 #cal_grp_id
|
||||
3625 118 0x00010003 #gpio1
|
||||
3626 0xFFFF 0x00010003 #gpio2
|
||||
3627 60 0x00010003 #sensor_id
|
||||
3628 0x39 0x00010003 #i2c_address
|
||||
3629 28 0x00010003 #data_type1
|
||||
3630 0 0x00010003 #data_type2
|
||||
3631 0xFF 0x00010003 #rel_sns_idx
|
||||
3632 0 0x00010003 #sens_default
|
||||
3633 0x80 0x00010003 #flags
|
||||
3683 0 0x00010003 #device_select
|
||||
3689 0x2 0x00010003 #vdd
|
||||
3690 0x2 0x00010003 #vddio
|
||||
|
||||
#
|
||||
# SSI GPIO configuration
|
||||
#-----------------------------
|
||||
2700 1 0x00010001 #maj ver
|
||||
2701 0 0x00010001 # min ver
|
||||
2706 0xFFFF 0x00010004 # RESET pin
|
||||
|
||||
#
|
||||
# SSC GPIO CFG (SSC_4,5 as active)
|
||||
#-----------------------------
|
||||
6300 1 0x00010003 # version
|
||||
6301 0x0104 0x00010003 # gpio num
|
||||
6302 1 0x00010003 # active func sel
|
||||
6303 1 0x00010003 # active dir
|
||||
6304 0 0x00010003 # active pull
|
||||
6305 0 0x00010003 # active drive
|
||||
6306 1 0x00010003 # inactive func sel
|
||||
6307 1 0x00010003 # inactive dir
|
||||
6308 2 0x00010003 # inactive pull
|
||||
6309 0 0x00010003 # inactive drive
|
||||
|
||||
6310 1 0x00010003 # version
|
||||
6311 0x0105 0x00010003 # gpio num
|
||||
6312 1 0x00010003 # active func sel
|
||||
6313 1 0x00010003 # active dir
|
||||
6314 0 0x00010003 # active pull
|
||||
6315 0 0x00010003 # active drive
|
||||
6316 1 0x00010003 # inactive func sel
|
||||
6317 1 0x00010003 # inactive dir
|
||||
6318 2 0x00010003 # inactive pull
|
||||
6319 0 0x00010003 # inactive drive
|
||||
|
||||
#
|
||||
# SSC GPIO CFG
|
||||
#-----------------------------
|
||||
6350 1 0x00010001 # version
|
||||
6351 0x0106 0x00010001 # gpio num (SSC GPIO 6)
|
||||
6352 0 0x00010001 # active func sel
|
||||
6353 0 0x00010001 # active dir
|
||||
6354 0 0x00010001 # active pull
|
||||
6355 0 0x00010001 # active drive
|
||||
6356 0 0x00010001 # inactive func sel
|
||||
6357 0 0x00010001 # inactive dir
|
||||
6358 0 0x00010001 # inactive pull
|
||||
6359 0 0x00010001 # inactive drive
|
||||
|
||||
#
|
||||
# SSC GPIO CFG
|
||||
#-----------------------------
|
||||
6360 1 0x00010001 # version
|
||||
6361 0x0107 0x00010001 # gpio num (SSC GPIO 7)
|
||||
6362 0 0x00010001 # active func sel
|
||||
6363 0 0x00010001 # active dir
|
||||
6364 3 0x00010001 # active pull
|
||||
6365 0 0x00010001 # active drive
|
||||
6366 0 0x00010001 # inactive func sel
|
||||
6367 0 0x00010001 # inactive dir
|
||||
6368 3 0x00010001 # inactive pull
|
||||
6369 0 0x00010001 # inactive drive
|
||||
|
||||
#
|
||||
# MSM GPIO CFG
|
||||
#-----------------------------
|
||||
6450 1 0x00010001 # version
|
||||
6451 0xFFFF 0x00010003 # gpio num 0x76 - 118 (MSM GPIO 118) // Disable
|
||||
6452 0 0x00010001 # active func sel
|
||||
6453 0 0x00010001 # active dir
|
||||
6454 0 0x00010001 # active pull
|
||||
6455 0 0x00010001 # active drive
|
||||
6456 0 0x00010001 # inactive func sel
|
||||
6457 0 0x00010001 # inactive dir
|
||||
6458 0 0x00010001 # inactive pull
|
||||
6459 0 0x00010001 # inactive drive
|
||||
|
||||
# Mag Cal config
|
||||
#-----------------------------
|
||||
3801 1 0x00010001
|
||||
3804 0x000a0000 0x10001 #Sample Rate
|
150
configs/thermal-engine-8996-lite.conf
Normal file
150
configs/thermal-engine-8996-lite.conf
Normal file
|
@ -0,0 +1,150 @@
|
|||
[SS-CLUSTER1-SP0]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster1
|
||||
set_point 43000
|
||||
set_point_clr 41000
|
||||
time_constant 0
|
||||
device_perf_floor 1478400
|
||||
|
||||
[SS-CLUSTER1-SP1]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster1
|
||||
set_point 45000
|
||||
set_point_clr 43000
|
||||
time_constant 0
|
||||
device_perf_floor 1113600
|
||||
|
||||
[SS-CLUSTER1-SP2]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster1
|
||||
set_point 48000
|
||||
set_point_clr 45000
|
||||
time_constant 0
|
||||
device_perf_floor 940800
|
||||
|
||||
[SS-CLUSTER0-SP0]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster0
|
||||
set_point 43000
|
||||
set_point_clr 41000
|
||||
time_constant 0
|
||||
device_perf_floor 1128800
|
||||
|
||||
[SS-CLUSTER0-SP1]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster0
|
||||
set_point 45000
|
||||
set_point_clr 43000
|
||||
time_constant 0
|
||||
device_perf_floor 960000
|
||||
|
||||
[SS-CLUSTER0-SP2]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster0
|
||||
set_point 48000
|
||||
set_point_clr 45000
|
||||
time_constant 0
|
||||
device_perf_floor 844800
|
||||
|
||||
[SKIN-SS-CPUS-ALL-1]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cpu_voltage
|
||||
set_point 50000
|
||||
set_point_clr 48000
|
||||
time_constant 0
|
||||
|
||||
[SS-GPU]
|
||||
#algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device gpu
|
||||
set_point 47000
|
||||
set_point_clr 43000
|
||||
time_constant 0
|
||||
|
||||
[GPU_management]
|
||||
algo_type monitor
|
||||
sensor xo_therm_buf
|
||||
sampling 1000
|
||||
thresholds 41000 43000
|
||||
thresholds_clr 38000 41000
|
||||
actions gpu gpu
|
||||
action_info 510000000 401800000
|
||||
|
||||
|
||||
[SKIN-BATTERY-MONITOR]
|
||||
algo_type monitor
|
||||
sampling 1000
|
||||
sensor xo_therm_buf
|
||||
thresholds 43000 45000 48000 60000
|
||||
thresholds_clr 41000 43000 45000 48000
|
||||
actions battery battery battery battery
|
||||
action_info 0 1 2 3
|
||||
|
||||
[CAMERA-CAMCORDER-MONITOR]
|
||||
algo_type monitor
|
||||
sampling 1000
|
||||
sensor xo_therm_buf
|
||||
thresholds 42000 45000 50000
|
||||
thresholds_clr 40000 42000 45000
|
||||
actions camera+camcorder camera+camcorder camera+camcorder
|
||||
action_info 1 2 3
|
||||
|
||||
[HISTORY-XO]
|
||||
algo_type history
|
||||
sampling 1000
|
||||
sensor xo_therm_buf
|
||||
thresholds 31000 41000 46000 51000 56000 61000
|
||||
thresholds_clr 30000 40000 45000 50000 55000 60000
|
||||
actions history_log history_log history_log history_log history_log history_log
|
||||
action_info 0 1 2 3 4 5
|
||||
|
||||
[HISTORY-CPU0]
|
||||
algo_type history
|
||||
sampling 1000
|
||||
sensor tsens_tz_sensor3
|
||||
thresholds 61000 76000 91000
|
||||
thresholds_clr 60000 75000 90000
|
||||
actions history_log history_log history_log
|
||||
action_info 0 1 2
|
||||
|
||||
[HISTORY-CPU4]
|
||||
algo_type history
|
||||
sampling 1000
|
||||
sensor tsens_tz_sensor8
|
||||
thresholds 61000 76000 91000
|
||||
thresholds_clr 60000 75000 90000
|
||||
actions history_log history_log history_log
|
||||
action_info 0 1 2
|
||||
|
||||
[HISTORY-MODEM-PA0]
|
||||
algo_type history
|
||||
sampling 1000
|
||||
sensor pa_therm0
|
||||
thresholds 31000 36000 41000 46000 51000 56000 61000
|
||||
thresholds_clr 30000 35000 40000 45000 50000 55000 60000
|
||||
actions history_log history_log history_log history_log history_log history_log history_log
|
||||
action_info 0 1 2 3 4 5 6
|
||||
|
||||
[HISTORY-MODEM-PA1]
|
||||
algo_type history
|
||||
sampling 1000
|
||||
sensor pa_therm1
|
||||
thresholds 31000 36000 41000 46000 51000 56000 61000
|
||||
thresholds_clr 30000 35000 40000 45000 50000 55000 60000
|
||||
actions history_log history_log history_log history_log history_log history_log history_log
|
||||
action_info 0 1 2 3 4 5 6
|
150
configs/thermal-engine-8996.conf
Normal file
150
configs/thermal-engine-8996.conf
Normal file
|
@ -0,0 +1,150 @@
|
|||
[SS-CLUSTER1-SP0]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster1
|
||||
set_point 41000
|
||||
set_point_clr 38000
|
||||
time_constant 0
|
||||
device_perf_floor 1824000
|
||||
|
||||
[SS-CLUSTER1-SP1]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster1
|
||||
set_point 43000
|
||||
set_point_clr 41000
|
||||
time_constant 0
|
||||
device_perf_floor 1478400
|
||||
|
||||
[SS-CLUSTER1-SP2]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster1
|
||||
set_point 45000
|
||||
set_point_clr 43000
|
||||
time_constant 0
|
||||
device_perf_floor 940800
|
||||
|
||||
[SS-CLUSTER0-SP0]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster0
|
||||
set_point 41000
|
||||
set_point_clr 38000
|
||||
time_constant 0
|
||||
device_perf_floor 1401600
|
||||
|
||||
[SS-CLUSTER0-SP1]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster0
|
||||
set_point 43000
|
||||
set_point_clr 41000
|
||||
time_constant 0
|
||||
device_perf_floor 1190400
|
||||
|
||||
[SS-CLUSTER0-SP2]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cluster0
|
||||
set_point 45000
|
||||
set_point_clr 43000
|
||||
time_constant 0
|
||||
device_perf_floor 960000
|
||||
|
||||
[SKIN-SS-CPUS-ALL-1]
|
||||
algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device cpu_voltage
|
||||
set_point 50000
|
||||
set_point_clr 45000
|
||||
time_constant 0
|
||||
|
||||
[SS-GPU]
|
||||
#algo_type ss
|
||||
sampling 250
|
||||
sensor xo_therm_buf
|
||||
device gpu
|
||||
set_point 47000
|
||||
set_point_clr 43000
|
||||
time_constant 0
|
||||
|
||||
[GPU_management]
|
||||
algo_type monitor
|
||||
sensor xo_therm_buf
|
||||
sampling 1000
|
||||
thresholds 41000 43000
|
||||
thresholds_clr 38000 41000
|
||||
actions gpu gpu
|
||||
action_info 510000000 401800000
|
||||
|
||||
|
||||
[SKIN-BATTERY-MONITOR]
|
||||
algo_type monitor
|
||||
sampling 1000
|
||||
sensor xo_therm_buf
|
||||
thresholds 43000 45000 48000 60000
|
||||
thresholds_clr 41000 43000 45000 48000
|
||||
actions battery battery battery battery
|
||||
action_info 0 1 2 3
|
||||
|
||||
[CAMERA-CAMCORDER-MONITOR]
|
||||
algo_type monitor
|
||||
sampling 1000
|
||||
sensor xo_therm_buf
|
||||
thresholds 42000 45000 50000
|
||||
thresholds_clr 40000 42000 45000
|
||||
actions camera+camcorder camera+camcorder camera+camcorder
|
||||
action_info 1 2 3
|
||||
|
||||
[HISTORY-XO]
|
||||
algo_type history
|
||||
sampling 1000
|
||||
sensor xo_therm_buf
|
||||
thresholds 31000 41000 46000 51000 56000 61000
|
||||
thresholds_clr 30000 40000 45000 50000 55000 60000
|
||||
actions history_log history_log history_log history_log history_log history_log
|
||||
action_info 0 1 2 3 4 5
|
||||
|
||||
[HISTORY-CPU0]
|
||||
algo_type history
|
||||
sampling 1000
|
||||
sensor tsens_tz_sensor3
|
||||
thresholds 61000 76000 91000
|
||||
thresholds_clr 60000 75000 90000
|
||||
actions history_log history_log history_log
|
||||
action_info 0 1 2
|
||||
|
||||
[HISTORY-CPU4]
|
||||
algo_type history
|
||||
sampling 1000
|
||||
sensor tsens_tz_sensor8
|
||||
thresholds 61000 76000 91000
|
||||
thresholds_clr 60000 75000 90000
|
||||
actions history_log history_log history_log
|
||||
action_info 0 1 2
|
||||
|
||||
[HISTORY-MODEM-PA0]
|
||||
algo_type history
|
||||
sampling 1000
|
||||
sensor pa_therm0
|
||||
thresholds 31000 36000 41000 46000 51000 56000 61000
|
||||
thresholds_clr 30000 35000 40000 45000 50000 55000 60000
|
||||
actions history_log history_log history_log history_log history_log history_log history_log
|
||||
action_info 0 1 2 3 4 5 6
|
||||
|
||||
[HISTORY-MODEM-PA1]
|
||||
algo_type history
|
||||
sampling 1000
|
||||
sensor pa_therm1
|
||||
thresholds 31000 36000 41000 46000 51000 56000 61000
|
||||
thresholds_clr 30000 35000 40000 45000 50000 55000 60000
|
||||
actions history_log history_log history_log history_log history_log history_log history_log
|
||||
action_info 0 1 2 3 4 5 6
|
379
device.mk
Executable file → Normal file
379
device.mk
Executable file → Normal file
|
@ -1,5 +1,6 @@
|
|||
#
|
||||
# Copyright (C) 2016 The CyanogenMod Project
|
||||
# Copyright (C) 2017 The LineageOS Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
@ -14,19 +15,383 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
|
||||
# call the proprietary setup
|
||||
# Get non-open-source specific aspects
|
||||
$(call inherit-product-if-exists, vendor/samsung/gts3llte/gts3llte-vendor.mk)
|
||||
|
||||
LOCAL_PATH := device/samsung/gts3llte
|
||||
|
||||
# Overlay
|
||||
DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay
|
||||
|
||||
# Audio configuration
|
||||
# Screen density
|
||||
PRODUCT_AAPT_CONFIG := normal
|
||||
PRODUCT_AAPT_PREF_CONFIG := xxhdpi
|
||||
|
||||
# Boot animation
|
||||
TARGET_SCREEN_HEIGHT := 2048
|
||||
TARGET_SCREEN_WIDTH := 1536
|
||||
#TARGET_BOOTANIMATION_HALF_RES := true
|
||||
|
||||
# Device characteristics
|
||||
PRODUCT_CHARACTERISTICS := tablet
|
||||
|
||||
$(call inherit-product, frameworks/native/build/phone-xxhdpi-3072-dalvik-heap.mk)
|
||||
|
||||
$(call inherit-product-if-exists, frameworks/native/build/phone-xxhdpi-3072-hwui-memory.mk)
|
||||
|
||||
# Permissions
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/audio/mixer_paths.xml:system/etc/mixer_paths.xml
|
||||
frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml \
|
||||
frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml \
|
||||
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
|
||||
frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
|
||||
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
|
||||
frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
|
||||
frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
|
||||
frameworks/native/data/etc/android.hardware.fingerprint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.fingerprint.xml \
|
||||
frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \
|
||||
frameworks/native/data/etc/android.hardware.opengles.aep.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.opengles.aep.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
|
||||
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml \
|
||||
frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
|
||||
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
|
||||
frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
|
||||
frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute.xml \
|
||||
frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \
|
||||
frameworks/native/data/etc/android.hardware.vulkan.version-1_0_3.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \
|
||||
frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
|
||||
frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
|
||||
frameworks/native/data/etc/android.software.freeform_window_management.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.freeform_window_management.xml \
|
||||
frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml \
|
||||
frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \
|
||||
frameworks/native/data/etc/tablet_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/tablet_core_hardware.xml \
|
||||
frameworks/native/data/etc/android.hardware.telephony.cdma.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.cdma.xml \
|
||||
frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml
|
||||
|
||||
# QMI
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/data/dsi_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/data/dsi_config.xml \
|
||||
$(LOCAL_PATH)/configs/data/netmgr_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/data/netmgr_config.xml \
|
||||
$(LOCAL_PATH)/configs/data/qmi_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/data/qmi_config.xml
|
||||
|
||||
# ANT+
|
||||
PRODUCT_PACKAGES += \
|
||||
AntHalService \
|
||||
com.dsi.ant.antradio_library \
|
||||
libantradio
|
||||
|
||||
# Audio
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.audio@2.0-impl \
|
||||
android.hardware.audio@2.0-service \
|
||||
android.hardware.audio.effect@2.0-impl \
|
||||
android.hardware.soundtrigger@2.0-impl \
|
||||
audio.a2dp.default \
|
||||
audio.primary.msm8996 \
|
||||
audio.r_submix.default \
|
||||
audio.usb.default \
|
||||
libaudio-resampler \
|
||||
libaudioroute \
|
||||
libqcompostprocbundle \
|
||||
libqcomvisualizer \
|
||||
libqcomvoiceprocessing \
|
||||
libvolumelistener \
|
||||
tinymix
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/audio/audio_effects.conf:system/etc/audio_effects.conf \
|
||||
$(LOCAL_PATH)/configs/audio/listen_platform_info.xml:system/etc/listen_platform_info.xml \
|
||||
$(LOCAL_PATH)/configs/audio/audio_output_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_output_policy.conf \
|
||||
$(LOCAL_PATH)/configs/audio/audio_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info.xml \
|
||||
$(LOCAL_PATH)/configs/audio/audio_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy.conf \
|
||||
$(LOCAL_PATH)/configs/audio/mixer_paths_tasha.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_tasha.xml
|
||||
|
||||
# Bluetooth
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.bluetooth@1.0-impl \
|
||||
android.hardware.bluetooth@1.0-service \
|
||||
libbt-vendor
|
||||
|
||||
# Camera
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.camera.provider@2.4-impl \
|
||||
camera.device@3.2-impl \
|
||||
libshims_cameraclient
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.qti.hardware.camera.device@1.0 \
|
||||
vendor.qti.hardware.camera.device@1.0_vendor
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
Snap
|
||||
|
||||
# CNE
|
||||
PRODUCT_PACKAGES += \
|
||||
libcnefeatureconfig
|
||||
|
||||
# Display
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.graphics.allocator@2.0-impl \
|
||||
android.hardware.graphics.allocator@2.0-service \
|
||||
android.hardware.graphics.composer@2.1-impl \
|
||||
android.hardware.graphics.composer@2.1-service \
|
||||
android.hardware.graphics.mapper@2.0-impl \
|
||||
android.hardware.memtrack@1.0-impl \
|
||||
android.hardware.memtrack@1.0-service \
|
||||
copybit.msm8996 \
|
||||
gralloc.msm8996 \
|
||||
hwcomposer.msm8996 \
|
||||
memtrack.msm8996 \
|
||||
libdisplayconfig \
|
||||
liboverlay \
|
||||
libqdMetaData.system \
|
||||
libtinyxml
|
||||
|
||||
# Display
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/display/hdr_tm_config.xml:$(TARGET_COPY_OUT_VENDOR)/etc/hdr_tm_config.xml \
|
||||
$(LOCAL_PATH)/configs/display/qdcm_calib_data_ss_dsi_panel_ANA38401_AMS968HH01_QXGA.xml:$(TARGET_COPY_OUT_VENDOR)/etc/qdcm_calib_data_ss_dsi_panel_ANA38401_AMS968HH01_QXGA.xml
|
||||
|
||||
# Doze mode
|
||||
PRODUCT_PACKAGES += \
|
||||
SamsungDoze
|
||||
|
||||
# DRM
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.drm@1.0-impl \
|
||||
android.hardware.drm@1.0-service
|
||||
|
||||
# Fingerprint
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.biometrics.fingerprint@2.1-service \
|
||||
fingerprint.msm8996 \
|
||||
libbauthtzcommon_shim
|
||||
|
||||
# For config.fs
|
||||
PRODUCT_PACKAGES += \
|
||||
fs_config_files
|
||||
|
||||
# Gatekeeper
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.gatekeeper@1.0-impl \
|
||||
android.hardware.gatekeeper@1.0-service
|
||||
|
||||
# GPS
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.gnss@1.0-impl-qti \
|
||||
libcurl \
|
||||
libgnss \
|
||||
libgnsspps
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/gps/etc/apdr.conf:$(TARGET_COPY_OUT_VENDOR)/etc/apdr.conf \
|
||||
$(LOCAL_PATH)/gps/etc/flp.conf:$(TARGET_COPY_OUT_VENDOR)/etc/flp.conf \
|
||||
$(LOCAL_PATH)/gps/etc/gps.conf:$(TARGET_COPY_OUT_VENDOR)/etc/gps.conf \
|
||||
$(LOCAL_PATH)/gps/etc/izat.conf:$(TARGET_COPY_OUT_VENDOR)/etc/izat.conf \
|
||||
$(LOCAL_PATH)/gps/etc/lowi.conf:$(TARGET_COPY_OUT_VENDOR)/etc/lowi.conf \
|
||||
$(LOCAL_PATH)/gps/etc/sap.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sap.conf \
|
||||
$(LOCAL_PATH)/gps/etc/xtwifi.conf:$(TARGET_COPY_OUT_VENDOR)/etc/xtwifi.conf
|
||||
|
||||
# Healthd
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.health@1.0-impl \
|
||||
android.hardware.health@1.0-service
|
||||
|
||||
# HIDL
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hidl.base@1.0 \
|
||||
android.hidl.manager@1.0
|
||||
|
||||
# IMS
|
||||
PRODUCT_PACKAGES += \
|
||||
ims-ext-common
|
||||
|
||||
# IPA Manager
|
||||
PRODUCT_PACKAGES += \
|
||||
ipacm \
|
||||
IPACM_cfg.xml
|
||||
|
||||
# IPC router config
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/sec_config:$(TARGET_COPY_OUT_VENDOR)/etc/sec_config \
|
||||
$(LOCAL_PATH)/configs/sec_config_oem:$(TARGET_COPY_OUT_VENDOR)/etc/sec_config_oem
|
||||
|
||||
# IPv6
|
||||
PRODUCT_PACKAGES += \
|
||||
ebtables \
|
||||
ethertypes \
|
||||
libebtc
|
||||
|
||||
# IRQ
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/msm_irqbalance.conf:$(TARGET_COPY_OUT_VENDOR)/etc/msm_irqbalance.conf
|
||||
|
||||
# Keylayout
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/keylayout/gpio-keys.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/gpio-keys.kl \
|
||||
$(LOCAL_PATH)/configs/keylayout/sec_e-pen.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/sec_e-pen.kl \
|
||||
$(LOCAL_PATH)/configs/keylayout/sec_touchkey.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/sec_touchkey.kl \
|
||||
$(LOCAL_PATH)/configs/keylayout/synaptics_dsx.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/synaptics_dsx.kl \
|
||||
$(LOCAL_PATH)/configs/keylayout/Tab_S3_Book_Cover_Keyboard.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/Tab_S3_Book_Cover_Keyboard.kl \
|
||||
|
||||
# idc
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/idc/sec_e-pen.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/sec_e-pen.idc \
|
||||
$(LOCAL_PATH)/configs/idc/Tab_S3_Book_Cover_Keyboard.idc:$(TARGET_COPY_OUT_VENDOR)/usr/idc/Tab_S3_Book_Cover_Keyboard.idc
|
||||
|
||||
# Keymaster
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.keymaster@3.0-impl \
|
||||
android.hardware.keymaster@3.0-service
|
||||
|
||||
# Lights
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.light@2.0-impl \
|
||||
lights.MSM8996
|
||||
|
||||
# LiveDisplay native
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.lineage.livedisplay@1.0-service-sdm
|
||||
|
||||
# Media
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/media/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
|
||||
$(LOCAL_PATH)/configs/media/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
|
||||
$(LOCAL_PATH)/configs/media/media_profiles_V1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
|
||||
frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \
|
||||
frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml
|
||||
|
||||
# Net
|
||||
PRODUCT_PACKAGES += \
|
||||
android.system.net.netd@1.0 \
|
||||
libandroid_net \
|
||||
netutils-wrapper-1.0
|
||||
|
||||
# OMX
|
||||
PRODUCT_PACKAGES += \
|
||||
libc2dcolorconvert \
|
||||
libextmedia_jni \
|
||||
libOmxAacEnc \
|
||||
libOmxAmrEnc \
|
||||
libOmxCore \
|
||||
libOmxEvrcEnc \
|
||||
libOmxQcelp13Enc \
|
||||
libOmxVdec \
|
||||
libOmxVenc \
|
||||
libstagefrighthw
|
||||
|
||||
# Power
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.power@1.0-service-qti
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/powerhint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.xml
|
||||
|
||||
# RCS
|
||||
PRODUCT_PACKAGES += \
|
||||
rcs_service_aidl \
|
||||
rcs_service_aidl.xml \
|
||||
rcs_service_api \
|
||||
rcs_service_api.xml
|
||||
|
||||
# Ramdisk
|
||||
PRODUCT_PACKAGES += \
|
||||
fstab.qcom \
|
||||
init.qcom.rc \
|
||||
init.qcom.power.rc \
|
||||
init.qcom.usb.rc \
|
||||
init.samsung.rc \
|
||||
init.target.rc \
|
||||
ueventd.qcom.rc \
|
||||
init.qcom.sh
|
||||
|
||||
# RenderScript
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.renderscript@1.0-impl
|
||||
|
||||
# RIL
|
||||
PRODUCT_PACKAGES += \
|
||||
libprotobuf-cpp-full \
|
||||
librmnetctl \
|
||||
libxml2
|
||||
|
||||
# Seccomp policy
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/seccomp_policy/mediacodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \
|
||||
$(LOCAL_PATH)/seccomp_policy/mediaextractor.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediaextractor.policy
|
||||
|
||||
# Sensors
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.sensors@1.0-impl
|
||||
|
||||
# Sensors
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/sensors/hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf \
|
||||
$(LOCAL_PATH)/configs/sensors/sensor_def_qcomdev.conf:system/etc/sensors/sensor_def_qcomdev.conf
|
||||
|
||||
# Thermal engine
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/configs/thermal-engine.conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermal-engine.conf
|
||||
|
||||
# USB
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.usb@1.0-service
|
||||
|
||||
# Vibrator
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.vibrator@1.0-impl \
|
||||
android.hardware.vibrator@1.0-service
|
||||
|
||||
# Telephony
|
||||
PRODUCT_PACKAGES += \
|
||||
telephony-ext
|
||||
|
||||
PRODUCT_BOOT_JARS += \
|
||||
telephony-ext
|
||||
|
||||
# TextClassifier
|
||||
PRODUCT_PACKAGES += \
|
||||
textclassifier.smartselection.bundle1
|
||||
|
||||
# VNDK
|
||||
PRODUCT_PACKAGES += \
|
||||
vndk-sp
|
||||
|
||||
# WCNSS
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/wifi/WCNSS_cfg.dat:$(TARGET_COPY_OUT_VENDOR)/etc/firmware/wlan/qca_cld/WCNSS_cfg.dat \
|
||||
$(LOCAL_PATH)/wifi/WCNSS_qcom_cfg.ini:$(TARGET_COPY_OUT_VENDOR)/etc/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/wifi/WCNSS_cfg.dat:system/etc/firmware/wlan/qca_cld/WCNSS_cfg.dat \
|
||||
$(LOCAL_PATH)/wifi/WCNSS_qcom_cfg.ini:system/etc/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini
|
||||
|
||||
# Wifi
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.wifi@1.0-service \
|
||||
libqsap_sdk \
|
||||
libQWiFiSoftApCfg \
|
||||
libwpa_client \
|
||||
hostapd \
|
||||
wpa_supplicant \
|
||||
wpa_supplicant.conf
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/wifi/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf \
|
||||
$(LOCAL_PATH)/wifi/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf
|
||||
|
||||
# ADB
|
||||
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
|
||||
persist.sys.usb.config=adb \
|
||||
ro.adb.secure=0
|
||||
|
||||
# Root
|
||||
PRODUCT_PACKAGES += \
|
||||
su
|
||||
|
||||
# Inherit from msm8996-common
|
||||
$(call inherit-product, device/samsung/msm8996-common/msm8996.mk)
|
||||
su
|
||||
|
|
33
doze/Android.mk
Normal file
33
doze/Android.mk
Normal file
|
@ -0,0 +1,33 @@
|
|||
LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src)
|
||||
|
||||
LOCAL_PACKAGE_NAME := SamsungDoze
|
||||
LOCAL_CERTIFICATE := platform
|
||||
LOCAL_PRIVILEGED_MODULE := true
|
||||
|
||||
LOCAL_USE_AAPT2 := true
|
||||
|
||||
LOCAL_STATIC_ANDROID_LIBRARIES := \
|
||||
android-support-v4 \
|
||||
android-support-v13 \
|
||||
android-support-v7-recyclerview \
|
||||
android-support-v7-preference \
|
||||
android-support-v7-appcompat \
|
||||
android-support-v14-preference \
|
||||
|
||||
LOCAL_STATIC_JAVA_LIBRARIES := \
|
||||
org.lineageos.platform.internal
|
||||
|
||||
LOCAL_RESOURCE_DIR := \
|
||||
$(LOCAL_PATH)/res \
|
||||
$(TOP)/packages/resources/devicesettings/res
|
||||
|
||||
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
|
||||
|
||||
include $(BUILD_PACKAGE)
|
||||
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
59
doze/AndroidManifest.xml
Normal file
59
doze/AndroidManifest.xml
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015-2016 The CyanogenMod Project
|
||||
2017 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.lineageos.settings.doze"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0"
|
||||
android:sharedUserId="android.uid.system">
|
||||
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
<protected-broadcast android:name="com.android.systemui.doze.pulse" />
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="26"
|
||||
android:targetSdkVersion="26"/>
|
||||
|
||||
<application
|
||||
android:label="@string/device_settings_app_name"
|
||||
android:persistent="true">
|
||||
|
||||
<receiver android:name="org.lineageos.settings.doze.BootCompletedReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service android:name=".DozeService"
|
||||
android:permission="SamsungDozeService">
|
||||
</service>
|
||||
|
||||
<activity
|
||||
android:name=".DozeSettingsActivity"
|
||||
android:label="@string/ambient_display_title"
|
||||
android:theme="@style/Theme.Main">
|
||||
<intent-filter>
|
||||
<action android:name="org.lineageos.settings.device.DOZE_SETTINGS" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
</application>
|
||||
</manifest>
|
8
doze/proguard.flags
Normal file
8
doze/proguard.flags
Normal file
|
@ -0,0 +1,8 @@
|
|||
-keepclasseswithmembers class * {
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
}
|
||||
|
||||
-keep class ** extends android.support.v14.preference.PreferenceFragment
|
||||
-keep class org.lineageos.settings.doze.* {
|
||||
*;
|
||||
}
|
20
doze/res/drawable/switchbar_background.xml
Normal file
20
doze/res/drawable/switchbar_background.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2014 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.
|
||||
-->
|
||||
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:attr/colorControlHighlight">
|
||||
<item android:drawable="?android:attr/colorSecondary" />
|
||||
</ripple>
|
28
doze/res/layout/doze.xml
Normal file
28
doze/res/layout/doze.xml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
** Copyright 2014, 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
|
||||
<include layout="@layout/switch_bar" />
|
||||
|
||||
</LinearLayout>
|
||||
|
47
doze/res/layout/switch_bar.xml
Normal file
47
doze/res/layout/switch_bar.xml
Normal file
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/switch_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:background="@drawable/switchbar_background"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:clickable="true"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView android:id="@+id/switch_text"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingStart="48dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Title"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textAlignment="viewStart" />
|
||||
|
||||
<Switch
|
||||
android:id="@android:id/switch_widget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:theme="@style/Theme.Main.SwitchBar" />
|
||||
|
||||
</LinearLayout>
|
57
doze/res/values/styles.xml
Normal file
57
doze/res/values/styles.xml
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015-2016 The CyanogenMod Project
|
||||
2017 The LineageOS Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<style name="Theme.Main" parent="@android:style/Theme.DeviceDefault.Settings">
|
||||
<item name="dialogPreferenceStyle">@style/Theme.Main.DialogPreferenceStyle</item>
|
||||
<item name="preferenceCategoryStyle">@style/Theme.Main.PreferenceCategoryStyle</item>
|
||||
<item name="preferenceFragmentStyle">@style/Theme.Main.PreferenceFragmentStyle</item>
|
||||
<item name="preferenceStyle">@style/Theme.Main.PreferenceStyle</item>
|
||||
<item name="preferenceTheme">@style/Theme.Main.PreferenceTheme</item>
|
||||
<item name="switchPreferenceStyle">@style/Theme.Main.SwitchPreferenceStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Main.DialogPreferenceStyle" parent="@style/Theme.Main.PreferenceStyle">
|
||||
</style>
|
||||
|
||||
<style name="Theme.Main.PreferenceCategoryStyle" parent="@*android:style/Preference.DeviceDefault.Category">
|
||||
<item name="allowDividerAbove">true</item>
|
||||
<item name="allowDividerBelow">true</item>
|
||||
<item name="android:layout">@layout/preference_category_material_settings</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Main.PreferenceFragmentStyle" parent="@*android:style/PreferenceFragment.Material">
|
||||
<item name="allowDividerAfterLastItem">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Main.PreferenceStyle" parent="@*android:style/Preference.DeviceDefault">
|
||||
<item name="allowDividerAbove">false</item>
|
||||
<item name="allowDividerBelow">true</item>
|
||||
<item name="singleLineTitle">false</item>
|
||||
<item name="android:layout">@layout/preference_material_settings</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Main.PreferenceTheme">
|
||||
</style>
|
||||
|
||||
<style name="Theme.Main.SwitchPreferenceStyle" parent="@style/Theme.Main.PreferenceStyle">
|
||||
<item name="widgetLayout">@*android:layout/preference_widget_switch</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Main.SwitchBar" parent="@android:style/ThemeOverlay.Material.ActionBar">
|
||||
</style>
|
||||
</resources>
|
49
doze/res/xml/doze_settings.xml
Normal file
49
doze/res/xml/doze_settings.xml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The CyanogenMod Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="tilt_sensor"
|
||||
android:title="@string/tilt_sensor_title">
|
||||
|
||||
<SwitchPreference
|
||||
android:key="gesture_pick_up"
|
||||
android:defaultValue="false"
|
||||
android:title="@string/pick_up_gesture_title"
|
||||
android:summary="@string/pick_up_gesture_summary" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="proximity_sensor"
|
||||
android:title="@string/proximity_sensor_title">
|
||||
|
||||
<SwitchPreference
|
||||
android:key="gesture_hand_wave"
|
||||
android:defaultValue="false"
|
||||
android:title="@string/hand_wave_gesture_title"
|
||||
android:summary="@string/hand_wave_gesture_summary" />
|
||||
|
||||
<SwitchPreference
|
||||
android:key="gesture_pocket"
|
||||
android:defaultValue="false"
|
||||
android:title="@string/pocket_gesture_title"
|
||||
android:summary="@string/pocket_gesture_summary" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (C) 2015 The CyanogenMod Project
|
||||
* 2017 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.doze;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
public class BootCompletedReceiver extends BroadcastReceiver {
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
private static final String TAG = "SamsungDoze";
|
||||
|
||||
@Override
|
||||
public void onReceive(final Context context, Intent intent) {
|
||||
if (Utils.isDozeEnabled(context) && Utils.sensorsEnabled(context)) {
|
||||
if (DEBUG) Log.d(TAG, "Starting service");
|
||||
Utils.startService(context);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
109
doze/src/org/lineageos/settings/doze/DozeService.java
Normal file
109
doze/src/org/lineageos/settings/doze/DozeService.java
Normal file
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
* Copyright (c) 2015 The CyanogenMod Project
|
||||
* 2017 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.doze;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
|
||||
public class DozeService extends Service
|
||||
{
|
||||
private static final String TAG = "DozeService";
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private ProximitySensor mProximitySensor;
|
||||
private TiltSensor mTiltSensor;
|
||||
private SignificantSensor mSignificantSensor;
|
||||
|
||||
@Override
|
||||
public void onCreate()
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Creating service");
|
||||
mProximitySensor = new ProximitySensor(this);
|
||||
mTiltSensor = new TiltSensor(this);
|
||||
mSignificantSensor = new SignificantSensor(this);
|
||||
|
||||
IntentFilter screenStateFilter = new IntentFilter(Intent.ACTION_SCREEN_ON);
|
||||
screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF);
|
||||
registerReceiver(mScreenStateReceiver, screenStateFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId)
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Starting service");
|
||||
return START_STICKY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Destroying service");
|
||||
super.onDestroy();
|
||||
this.unregisterReceiver(mScreenStateReceiver);
|
||||
mProximitySensor.disable();
|
||||
mTiltSensor.disable();
|
||||
mSignificantSensor.disable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
private void onDisplayOn()
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Display on");
|
||||
if (Utils.pickUpEnabled(this))
|
||||
{
|
||||
mTiltSensor.disable();
|
||||
mSignificantSensor.disable();
|
||||
}
|
||||
if (Utils.handwaveGestureEnabled(this) || Utils.pocketGestureEnabled(this))
|
||||
mProximitySensor.disable();
|
||||
}
|
||||
|
||||
private void onDisplayOff()
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Display off");
|
||||
if (Utils.pickUpEnabled(this))
|
||||
{
|
||||
mTiltSensor.enable();
|
||||
mSignificantSensor.enable();
|
||||
}
|
||||
if (Utils.handwaveGestureEnabled(this) || Utils.pocketGestureEnabled(this))
|
||||
mProximitySensor.enable();
|
||||
}
|
||||
|
||||
private BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver()
|
||||
{
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
if (intent.getAction().equals(Intent.ACTION_SCREEN_ON))
|
||||
onDisplayOn();
|
||||
else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF))
|
||||
onDisplayOff();
|
||||
}
|
||||
};
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2016 The CyanogenMod Project
|
||||
* 2017 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.doze;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceActivity;
|
||||
|
||||
public class DozeSettingsActivity extends PreferenceActivity {
|
||||
|
||||
private static final String TAG_DOZE = "doze";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getFragmentManager().beginTransaction().replace(android.R.id.content,
|
||||
new DozeSettingsFragment(), TAG_DOZE).commit();
|
||||
}
|
||||
}
|
158
doze/src/org/lineageos/settings/doze/DozeSettingsFragment.java
Normal file
158
doze/src/org/lineageos/settings/doze/DozeSettingsFragment.java
Normal file
|
@ -0,0 +1,158 @@
|
|||
/*
|
||||
* Copyright (C) 2015 The CyanogenMod Project
|
||||
* 2017-2018 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.doze;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.support.v14.preference.PreferenceFragment;
|
||||
import android.support.v14.preference.SwitchPreference;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceCategory;
|
||||
import android.support.v7.preference.Preference.OnPreferenceChangeListener;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class DozeSettingsFragment extends PreferenceFragment implements OnPreferenceChangeListener,
|
||||
CompoundButton.OnCheckedChangeListener {
|
||||
|
||||
private TextView mTextView;
|
||||
|
||||
private SwitchPreference mPickUpPreference;
|
||||
private SwitchPreference mHandwavePreference;
|
||||
private SwitchPreference mPocketPreference;
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
addPreferencesFromResource(R.xml.doze_settings);
|
||||
final ActionBar actionBar = getActivity().getActionBar();
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
SharedPreferences prefs = getActivity().getSharedPreferences("doze_settings",
|
||||
Activity.MODE_PRIVATE);
|
||||
if (savedInstanceState == null && !prefs.getBoolean("first_help_shown", false)) {
|
||||
showHelp();
|
||||
}
|
||||
|
||||
boolean dozeEnabled = Utils.isDozeEnabled(getActivity());
|
||||
|
||||
PreferenceCategory proximitySensorCategory =
|
||||
(PreferenceCategory) getPreferenceScreen().findPreference(Utils.CATEG_PROX_SENSOR);
|
||||
|
||||
mPickUpPreference = (SwitchPreference) findPreference(Utils.GESTURE_PICK_UP_KEY);
|
||||
mPickUpPreference.setEnabled(dozeEnabled);
|
||||
|
||||
mHandwavePreference = (SwitchPreference) findPreference(Utils.GESTURE_HAND_WAVE_KEY);
|
||||
mHandwavePreference.setEnabled(dozeEnabled);
|
||||
|
||||
mPocketPreference = (SwitchPreference) findPreference(Utils.GESTURE_POCKET_KEY);
|
||||
mPocketPreference.setEnabled(dozeEnabled);
|
||||
|
||||
// Hide proximity sensor related features if the device doesn't support them
|
||||
if (!Utils.getProxCheckBeforePulse(getActivity())) {
|
||||
getPreferenceScreen().removePreference(proximitySensorCategory);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
final View view = LayoutInflater.from(getContext()).inflate(R.layout.doze, container, false);
|
||||
((ViewGroup) view).addView(super.onCreateView(inflater, container, savedInstanceState));
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
boolean dozeEnabled = Utils.isDozeEnabled(getActivity());
|
||||
|
||||
mTextView = view.findViewById(R.id.switch_text);
|
||||
mTextView.setText(getString(dozeEnabled ?
|
||||
R.string.switch_bar_on : R.string.switch_bar_off));
|
||||
|
||||
View switchBar = view.findViewById(R.id.switch_bar);
|
||||
Switch switchWidget = switchBar.findViewById(android.R.id.switch_widget);
|
||||
switchWidget.setChecked(dozeEnabled);
|
||||
switchWidget.setOnCheckedChangeListener(this);
|
||||
switchBar.setOnClickListener(v -> switchWidget.setChecked(!switchWidget.isChecked()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
Utils.checkDozeService(getActivity());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||
Utils.enableDoze(b, getActivity());
|
||||
Utils.checkDozeService(getActivity());
|
||||
|
||||
mTextView.setText(getString(b ? R.string.switch_bar_on : R.string.switch_bar_off));
|
||||
|
||||
mPickUpPreference.setEnabled(b);
|
||||
mHandwavePreference.setEnabled(b);
|
||||
mPocketPreference.setEnabled(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == android.R.id.home) {
|
||||
getActivity().onBackPressed();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static class HelpDialogFragment extends DialogFragment {
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setTitle(R.string.doze_settings_help_title)
|
||||
.setMessage(R.string.doze_settings_help_text)
|
||||
.setNegativeButton(R.string.dialog_ok, (dialog, which) -> dialog.cancel())
|
||||
.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
getActivity().getSharedPreferences("doze_settings", Activity.MODE_PRIVATE)
|
||||
.edit()
|
||||
.putBoolean("first_help_shown", true)
|
||||
.commit();
|
||||
}
|
||||
}
|
||||
|
||||
private void showHelp() {
|
||||
HelpDialogFragment fragment = new HelpDialogFragment();
|
||||
fragment.show(getFragmentManager(), "help_dialog");
|
||||
}
|
||||
}
|
91
doze/src/org/lineageos/settings/doze/ProximitySensor.java
Normal file
91
doze/src/org/lineageos/settings/doze/ProximitySensor.java
Normal file
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* Copyright (c) 2015 The CyanogenMod Project
|
||||
* 2017-2018 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.doze;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorEvent;
|
||||
import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorManager;
|
||||
import android.util.Log;
|
||||
|
||||
public class ProximitySensor implements SensorEventListener {
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
private static final String TAG = "ProximitySensor";
|
||||
|
||||
// Maximum time for the hand to cover the sensor: 1s
|
||||
private static final int HANDWAVE_MAX_DELTA_NS = 1000 * 1000 * 1000;
|
||||
|
||||
// Minimum time until the device is considered to have been in the pocket: 2s
|
||||
private static final int POCKET_MIN_DELTA_NS = 2000 * 1000 * 1000;
|
||||
|
||||
private SensorManager mSensorManager;
|
||||
private Sensor mSensor;
|
||||
private Context mContext;
|
||||
|
||||
private boolean mSawNear = false;
|
||||
private long mInPocketTime = 0;
|
||||
|
||||
public ProximitySensor(Context context) {
|
||||
mContext = context;
|
||||
mSensorManager = mContext.getSystemService(SensorManager.class);
|
||||
mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSensorChanged(SensorEvent event) {
|
||||
/* boolean isNear = event.values[0] < mSensor.getMaximumRange();
|
||||
if (mSawNear && !isNear) {
|
||||
if (shouldPulse(event.timestamp)) {
|
||||
Utils.launchDozePulse(mContext);
|
||||
}
|
||||
} else {
|
||||
mInPocketTime = event.timestamp;
|
||||
}
|
||||
mSawNear = isNear;*/
|
||||
}
|
||||
|
||||
private boolean shouldPulse(long timestamp) {
|
||||
long delta = timestamp - mInPocketTime;
|
||||
|
||||
if (Utils.handwaveGestureEnabled(mContext) && Utils.pocketGestureEnabled(mContext)) {
|
||||
return true;
|
||||
} else if (Utils.handwaveGestureEnabled(mContext)) {
|
||||
return delta < HANDWAVE_MAX_DELTA_NS;
|
||||
} else if (Utils.pocketGestureEnabled(mContext)) {
|
||||
return delta >= POCKET_MIN_DELTA_NS;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
||||
/* Empty */
|
||||
}
|
||||
|
||||
protected void enable() {
|
||||
if (DEBUG) Log.d(TAG, "Enabling");
|
||||
mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
|
||||
}
|
||||
|
||||
protected void disable() {
|
||||
if (DEBUG) Log.d(TAG, "Disabling");
|
||||
mSensorManager.unregisterListener(this, mSensor);
|
||||
}
|
||||
}
|
82
doze/src/org/lineageos/settings/doze/SignificantSensor.java
Normal file
82
doze/src/org/lineageos/settings/doze/SignificantSensor.java
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* Copyright (c) 2015 The CyanogenMod Project
|
||||
* 2017-2018 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.doze;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorEvent;
|
||||
import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorManager;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
public class SignificantSensor implements SensorEventListener
|
||||
{
|
||||
private static final boolean DEBUG = false;
|
||||
private static final String TAG = "SignificantSensor";
|
||||
|
||||
private static final int BATCH_LATENCY_IN_MS = 100;
|
||||
private static final int MIN_PULSE_INTERVAL_MS = 2500;
|
||||
|
||||
private SensorManager mSensorManager;
|
||||
private Sensor mSensor;
|
||||
private Context mContext;
|
||||
|
||||
private long mEntryTimestamp;
|
||||
|
||||
public SignificantSensor(Context context)
|
||||
{
|
||||
mContext = context;
|
||||
mSensorManager = mContext.getSystemService(SensorManager.class);
|
||||
mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_SIGNIFICANT_MOTION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSensorChanged(SensorEvent event)
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Got sensor event: " + event.values[0]);
|
||||
|
||||
/* long delta = SystemClock.elapsedRealtime() - mEntryTimestamp;
|
||||
if (delta < MIN_PULSE_INTERVAL_MS)
|
||||
return;
|
||||
|
||||
mEntryTimestamp = SystemClock.elapsedRealtime();
|
||||
|
||||
if (event.values[0] == 1)
|
||||
Utils.launchDozePulse(mContext);*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccuracyChanged(Sensor sensor, int accuracy)
|
||||
{
|
||||
/* Empty */
|
||||
}
|
||||
|
||||
protected void enable()
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Enabling");
|
||||
mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL, BATCH_LATENCY_IN_MS * 1000);
|
||||
mEntryTimestamp = SystemClock.elapsedRealtime();
|
||||
}
|
||||
|
||||
protected void disable()
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Disabling");
|
||||
mSensorManager.unregisterListener(this, mSensor);
|
||||
}
|
||||
}
|
82
doze/src/org/lineageos/settings/doze/TiltSensor.java
Normal file
82
doze/src/org/lineageos/settings/doze/TiltSensor.java
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* Copyright (c) 2015 The CyanogenMod Project
|
||||
* 2017-2018 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.doze;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorEvent;
|
||||
import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorManager;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
public class TiltSensor implements SensorEventListener
|
||||
{
|
||||
private static final boolean DEBUG = false;
|
||||
private static final String TAG = "TiltSensor";
|
||||
|
||||
private static final int BATCH_LATENCY_IN_MS = 100;
|
||||
private static final int MIN_PULSE_INTERVAL_MS = 2500;
|
||||
|
||||
private SensorManager mSensorManager;
|
||||
private Sensor mSensor;
|
||||
private Context mContext;
|
||||
|
||||
private long mEntryTimestamp;
|
||||
|
||||
public TiltSensor(Context context)
|
||||
{
|
||||
mContext = context;
|
||||
mSensorManager = mContext.getSystemService(SensorManager.class);
|
||||
mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_TILT_DETECTOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSensorChanged(SensorEvent event)
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Got sensor event: " + event.values[0]);
|
||||
|
||||
/* long delta = SystemClock.elapsedRealtime() - mEntryTimestamp;
|
||||
if (delta < MIN_PULSE_INTERVAL_MS)
|
||||
return;
|
||||
|
||||
mEntryTimestamp = SystemClock.elapsedRealtime();
|
||||
|
||||
if (event.values[0] == 1)
|
||||
Utils.launchDozePulse(mContext);*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAccuracyChanged(Sensor sensor, int accuracy)
|
||||
{
|
||||
/* Empty */
|
||||
}
|
||||
|
||||
protected void enable()
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Enabling");
|
||||
mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL, BATCH_LATENCY_IN_MS * 1000);
|
||||
mEntryTimestamp = SystemClock.elapsedRealtime();
|
||||
}
|
||||
|
||||
protected void disable()
|
||||
{
|
||||
if (DEBUG) Log.d(TAG, "Disabling");
|
||||
mSensorManager.unregisterListener(this, mSensor);
|
||||
}
|
||||
}
|
109
doze/src/org/lineageos/settings/doze/Utils.java
Normal file
109
doze/src/org/lineageos/settings/doze/Utils.java
Normal file
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
* Copyright (c) 2015 The CyanogenMod Project
|
||||
* 2017 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.lineageos.settings.doze;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.UserHandle;
|
||||
import android.support.v7.preference.PreferenceManager;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import static android.provider.Settings.Secure.DOZE_ENABLED;
|
||||
|
||||
public final class Utils {
|
||||
|
||||
private static final String TAG = "DozeUtils";
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final String DOZE_INTENT = "com.android.systemui.doze.pulse";
|
||||
|
||||
protected static final String CATEG_PROX_SENSOR = "proximity_sensor";
|
||||
|
||||
protected static final String GESTURE_PICK_UP_KEY = "gesture_pick_up";
|
||||
protected static final String GESTURE_HAND_WAVE_KEY = "gesture_hand_wave";
|
||||
protected static final String GESTURE_POCKET_KEY = "gesture_pocket";
|
||||
|
||||
protected static void startService(Context context) {
|
||||
if (DEBUG) Log.d(TAG, "Starting service");
|
||||
context.startServiceAsUser(new Intent(context, DozeService.class),
|
||||
UserHandle.CURRENT);
|
||||
}
|
||||
|
||||
protected static void stopService(Context context) {
|
||||
if (DEBUG) Log.d(TAG, "Stopping service");
|
||||
context.stopServiceAsUser(new Intent(context, DozeService.class),
|
||||
UserHandle.CURRENT);
|
||||
}
|
||||
|
||||
protected static void checkDozeService(Context context) {
|
||||
if (isDozeEnabled(context) && sensorsEnabled(context)) {
|
||||
startService(context);
|
||||
} else {
|
||||
stopService(context);
|
||||
}
|
||||
}
|
||||
|
||||
protected static boolean getProxCheckBeforePulse(Context context) {
|
||||
try {
|
||||
Context con = context.createPackageContext("com.android.systemui", 0);
|
||||
int id = con.getResources().getIdentifier("doze_proximity_check_before_pulse",
|
||||
"bool", "com.android.systemui");
|
||||
return con.getResources().getBoolean(id);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected static boolean isDozeEnabled(Context context) {
|
||||
return Settings.Secure.getInt(context.getContentResolver(),
|
||||
DOZE_ENABLED, 1) != 0;
|
||||
}
|
||||
|
||||
protected static boolean enableDoze(boolean enable, Context context) {
|
||||
return Settings.Secure.putInt(context.getContentResolver(),
|
||||
DOZE_ENABLED, enable ? 1 : 0);
|
||||
}
|
||||
|
||||
protected static void launchDozePulse(Context context) {
|
||||
if (DEBUG) Log.d(TAG, "Launch doze pulse");
|
||||
context.sendBroadcastAsUser(new Intent(DOZE_INTENT),
|
||||
new UserHandle(UserHandle.USER_CURRENT));
|
||||
}
|
||||
|
||||
protected static boolean pickUpEnabled(Context context) {
|
||||
return PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.getBoolean(GESTURE_PICK_UP_KEY, false);
|
||||
}
|
||||
|
||||
protected static boolean handwaveGestureEnabled(Context context) {
|
||||
return PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.getBoolean(GESTURE_HAND_WAVE_KEY, false);
|
||||
}
|
||||
|
||||
protected static boolean pocketGestureEnabled(Context context) {
|
||||
return PreferenceManager.getDefaultSharedPreferences(context)
|
||||
.getBoolean(GESTURE_POCKET_KEY, false);
|
||||
}
|
||||
|
||||
protected static boolean sensorsEnabled(Context context) {
|
||||
return pickUpEnabled(context) || handwaveGestureEnabled(context)
|
||||
|| pocketGestureEnabled(context);
|
||||
}
|
||||
}
|
|
@ -1,12 +1,13 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2016 The CyanogenMod Project
|
||||
# Copyright (C) 2017 The LineageOS Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
# 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,
|
||||
|
@ -17,9 +18,46 @@
|
|||
|
||||
set -e
|
||||
|
||||
# Required!
|
||||
export DEVICE=gts3llte
|
||||
export DEVICE_COMMON=msm8976-common
|
||||
export VENDOR=samsung
|
||||
DEVICE=gts3llte
|
||||
VENDOR=samsung
|
||||
SRC=~/system
|
||||
# Load extract_utils and do some sanity checks
|
||||
MY_DIR="${BASH_SOURCE%/*}"
|
||||
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
|
||||
|
||||
./../../$VENDOR/$DEVICE_COMMON/extract-files.sh $@
|
||||
CM_ROOT="$MY_DIR"/../../..
|
||||
|
||||
HELPER="$CM_ROOT"/vendor/lineage/build/tools/extract_utils.sh
|
||||
if [ ! -f "$HELPER" ]; then
|
||||
echo "Unable to find helper script at $HELPER"
|
||||
exit 1
|
||||
fi
|
||||
. "$HELPER"
|
||||
|
||||
# Default to sanitizing the vendor folder before extraction
|
||||
CLEAN_VENDOR=true
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
case $1 in
|
||||
-n | --no-cleanup ) CLEAN_VENDOR=false
|
||||
;;
|
||||
-s | --section ) shift
|
||||
SECTION=$1
|
||||
CLEAN_VENDOR=false
|
||||
;;
|
||||
* ) SRC=$1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$SRC" ]; then
|
||||
SRC=adb
|
||||
fi
|
||||
|
||||
# Initialize the helper
|
||||
setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT" false "$CLEAN_VENDOR"
|
||||
|
||||
extract "$MY_DIR"/proprietary-files.txt "$SRC" "$SECTION"
|
||||
|
||||
"$MY_DIR"/setup-makefiles.sh
|
||||
|
|
2
full_gts3llte.mk
Executable file → Normal file
2
full_gts3llte.mk
Executable file → Normal file
|
@ -16,7 +16,7 @@
|
|||
|
||||
# Inherit from those products. Most specific first.
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
|
||||
|
||||
# Inherit from gts3llte device
|
||||
$(call inherit-product, device/samsung/gts3llte/device.mk)
|
||||
|
|
18
gps/Android.mk
Normal file
18
gps/Android.mk
Normal file
|
@ -0,0 +1,18 @@
|
|||
#
|
||||
# Copyright (C) 2016 The CyanogenMod Project
|
||||
# Copyright (C) 2017-2018 The LineageOS Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
include $(call first-makefiles-under,$(call my-dir))
|
203
gps/android/AGnss.cpp
Normal file
203
gps/android/AGnss.cpp
Normal file
|
@ -0,0 +1,203 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_AGnssInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "AGnss.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
static AGnss* spAGnss = nullptr;
|
||||
|
||||
AGnss::AGnss(Gnss* gnss) : mGnss(gnss) {
|
||||
spAGnss = this;
|
||||
}
|
||||
|
||||
AGnss::~AGnss() {
|
||||
spAGnss = nullptr;
|
||||
}
|
||||
|
||||
void AGnss::agnssStatusIpV4Cb(AGnssExtStatusIpV4 status){
|
||||
if (nullptr != spAGnss) {
|
||||
spAGnss->statusIpV4Cb(status);
|
||||
}
|
||||
}
|
||||
|
||||
void AGnss::statusIpV4Cb(AGnssExtStatusIpV4 status) {
|
||||
IAGnssCallback::AGnssStatusIpV4 st = {};
|
||||
|
||||
switch (status.type) {
|
||||
case LOC_AGPS_TYPE_SUPL:
|
||||
st.type = IAGnssCallback::AGnssType::TYPE_SUPL;
|
||||
break;
|
||||
case LOC_AGPS_TYPE_C2K:
|
||||
st.type = IAGnssCallback::AGnssType::TYPE_C2K;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("invalid type: %d", status.type);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (status.status) {
|
||||
case LOC_GPS_REQUEST_AGPS_DATA_CONN:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::REQUEST_AGNSS_DATA_CONN;
|
||||
break;
|
||||
case LOC_GPS_RELEASE_AGPS_DATA_CONN:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::RELEASE_AGNSS_DATA_CONN;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONNECTED:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONNECTED;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONN_DONE:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_DONE;
|
||||
break;
|
||||
case LOC_GPS_AGPS_DATA_CONN_FAILED:
|
||||
st.status = IAGnssCallback::AGnssStatusValue::AGNSS_DATA_CONN_FAILED;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("invalid status: %d", status.status);
|
||||
return;
|
||||
}
|
||||
st.ipV4Addr = status.ipV4Addr;
|
||||
|
||||
if (mAGnssCbIface != nullptr) {
|
||||
auto r = mAGnssCbIface->agnssStatusIpV4Cb(st);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGw("Error invoking AGNSS status cb %s", r.description().c_str());
|
||||
}
|
||||
} else {
|
||||
LOC_LOGw("setCallback has not been called yet");
|
||||
}
|
||||
}
|
||||
|
||||
Return<void> AGnss::setCallback(const sp<IAGnssCallback>& callback) {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return Void();
|
||||
}
|
||||
|
||||
// Save the interface
|
||||
mAGnssCbIface = callback;
|
||||
|
||||
AgpsCbInfo cbInfo = {};
|
||||
cbInfo.statusV4Cb = (void*)agnssStatusIpV4Cb;
|
||||
cbInfo.cbPriority = AGPS_CB_PRIORITY_LOW;
|
||||
|
||||
mGnss->getGnssInterface()->agpsInit(cbInfo);
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> AGnss::dataConnClosed() {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
mGnss->getGnssInterface()->agpsDataConnClosed(LOC_AGPS_TYPE_SUPL);
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> AGnss::dataConnFailed() {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
mGnss->getGnssInterface()->agpsDataConnFailed(LOC_AGPS_TYPE_SUPL);
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> AGnss::dataConnOpen(const hidl_string& apn,
|
||||
IAGnss::ApnIpType apnIpType) {
|
||||
|
||||
if(mGnss == nullptr || mGnss->getGnssInterface() == nullptr){
|
||||
LOC_LOGE("Null GNSS interface");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Validate */
|
||||
if(apn.empty()){
|
||||
LOC_LOGE("Invalid APN");
|
||||
return false;
|
||||
}
|
||||
|
||||
LOC_LOGD("dataConnOpen APN name = [%s]", apn.c_str());
|
||||
|
||||
AGpsBearerType bearerType;
|
||||
switch (apnIpType) {
|
||||
case IAGnss::ApnIpType::IPV4:
|
||||
bearerType = AGPS_APN_BEARER_IPV4;
|
||||
break;
|
||||
case IAGnss::ApnIpType::IPV6:
|
||||
bearerType = AGPS_APN_BEARER_IPV6;
|
||||
break;
|
||||
case IAGnss::ApnIpType::IPV4V6:
|
||||
bearerType = AGPS_APN_BEARER_IPV4V6;
|
||||
break;
|
||||
default:
|
||||
bearerType = AGPS_APN_BEARER_IPV4;
|
||||
break;
|
||||
}
|
||||
|
||||
mGnss->getGnssInterface()->agpsDataConnOpen(
|
||||
LOC_AGPS_TYPE_SUPL, apn.c_str(), apn.size(), (int)bearerType);
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> AGnss::setServer(IAGnssCallback::AGnssType type,
|
||||
const hidl_string& hostname,
|
||||
int32_t port) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT;
|
||||
config.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer);
|
||||
if (type == IAGnssCallback::AGnssType::TYPE_SUPL) {
|
||||
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_SUPL;
|
||||
} else if (type == IAGnssCallback::AGnssType::TYPE_C2K) {
|
||||
config.assistanceServer.type = GNSS_ASSISTANCE_TYPE_C2K;
|
||||
} else {
|
||||
LOC_LOGE("%s]: invalid AGnssType: %d", __FUNCTION__, static_cast<int>(type));
|
||||
return false;
|
||||
}
|
||||
config.assistanceServer.hostName = strdup(hostname.c_str());
|
||||
config.assistanceServer.port = port;
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
79
gps/android/AGnss.h
Normal file
79
gps/android/AGnss.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IAGnss.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <gps_extended_c.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IAGnss;
|
||||
using ::android::hardware::gnss::V1_0::IAGnssCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss;
|
||||
struct AGnss : public IAGnss {
|
||||
|
||||
AGnss(Gnss* gnss);
|
||||
~AGnss();
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow.
|
||||
* These declarations were generated from IAGnss.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IAGnssCallback>& callback) override;
|
||||
|
||||
Return<bool> dataConnClosed() override;
|
||||
|
||||
Return<bool> dataConnFailed() override;
|
||||
|
||||
Return<bool> dataConnOpen(const hidl_string& apn,
|
||||
IAGnss::ApnIpType apnIpType) override;
|
||||
|
||||
Return<bool> setServer(IAGnssCallback::AGnssType type,
|
||||
const hidl_string& hostname, int32_t port) override;
|
||||
|
||||
void statusIpV4Cb(AGnssExtStatusIpV4 status);
|
||||
|
||||
/* Data call setup callback passed down to GNSS HAL implementation */
|
||||
static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status);
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
sp<IAGnssCallback> mAGnssCbIface = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
|
93
gps/android/AGnssRil.cpp
Normal file
93
gps/android/AGnssRil.cpp
Normal file
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc__AGnssRilInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "Gnss.h"
|
||||
#include "AGnssRil.h"
|
||||
#include <DataItemConcreteTypesBase.h>
|
||||
|
||||
typedef void* (getLocationInterface)();
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
|
||||
AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
}
|
||||
|
||||
AGnssRil::~AGnssRil() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
}
|
||||
|
||||
Return<bool> AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
|
||||
// for XTRA
|
||||
if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) {
|
||||
int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
||||
switch(type)
|
||||
{
|
||||
case IAGnssRil::NetworkType::MOBILE:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::WIFI:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::MMS:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::SUPL:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::DUN:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::HIPRI:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI;
|
||||
break;
|
||||
case IAGnssRil::NetworkType::WIMAX:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX;
|
||||
break;
|
||||
default:
|
||||
typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
83
gps/android/AGnssRil.h
Normal file
83
gps/android/AGnssRil.h
Normal file
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
|
||||
#define ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
|
||||
|
||||
#include <android/hardware/gnss/1.0/IAGnssRil.h>
|
||||
#include <hidl/Status.h>
|
||||
#include <location_interface.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IAGnssRil;
|
||||
using ::android::hardware::gnss::V1_0::IAGnssRilCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss;
|
||||
/*
|
||||
* Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface Layer interface
|
||||
* allows the GNSS chipset to request radio interface layer information from Android platform.
|
||||
* Examples of such information are reference location, unique subscriber ID, phone number string
|
||||
* and network availability changes. Also contains wrapper methods to allow methods from
|
||||
* IAGnssiRilCallback interface to be passed into the conventional implementation of the GNSS HAL.
|
||||
*/
|
||||
struct AGnssRil : public IAGnssRil {
|
||||
AGnssRil(Gnss* gnss);
|
||||
~AGnssRil();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow.
|
||||
* These declarations were generated from IAGnssRil.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IAGnssRilCallback>& /*callback*/) override {
|
||||
return Void();
|
||||
}
|
||||
Return<void> setRefLocation(const IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override {
|
||||
return Void();
|
||||
}
|
||||
Return<bool> setSetId(IAGnssRil::SetIDType /*type*/, const hidl_string& /*setid*/) override {
|
||||
return false;
|
||||
}
|
||||
Return<bool> updateNetworkAvailability(bool /*available*/,
|
||||
const hidl_string& /*apn*/) override {
|
||||
return false;
|
||||
}
|
||||
Return<bool> updateNetworkState(bool connected, NetworkType type, bool roaming) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_
|
96
gps/android/Android.mk
Normal file
96
gps/android/Android.mk
Normal file
|
@ -0,0 +1,96 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti
|
||||
LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
|
||||
LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_SRC_FILES := \
|
||||
AGnss.cpp \
|
||||
Gnss.cpp \
|
||||
GnssBatching.cpp \
|
||||
GnssGeofencing.cpp \
|
||||
GnssMeasurement.cpp \
|
||||
GnssNi.cpp \
|
||||
GnssConfiguration.cpp \
|
||||
GnssDebug.cpp \
|
||||
AGnssRil.cpp
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
location_api/LocationUtil.cpp \
|
||||
location_api/GnssAPIClient.cpp \
|
||||
location_api/GeofenceAPIClient.cpp \
|
||||
location_api/BatchingAPIClient.cpp \
|
||||
location_api/MeasurementAPIClient.cpp \
|
||||
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/location_api
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
libgps.utils_headers \
|
||||
libloc_core_headers \
|
||||
libloc_pla_headers \
|
||||
liblocation_api_headers
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libhidlbase \
|
||||
libhidltransport \
|
||||
libhwbinder \
|
||||
libutils \
|
||||
android.hardware.gnss@1.0 \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += \
|
||||
libloc_core \
|
||||
libgps.utils \
|
||||
libdl \
|
||||
libloc_pla \
|
||||
liblocation_api \
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
BUILD_GNSS_HIDL_SERVICE := true
|
||||
ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true)
|
||||
ifneq ($(LW_FEATURE_SET),true)
|
||||
ifneq ($(TARGET_HAS_LOW_RAM),true)
|
||||
BUILD_GNSS_HIDL_SERVICE := false
|
||||
endif # TARGET_HAS_LOW_RAM
|
||||
endif # LW_FEATURE_SET
|
||||
endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET
|
||||
|
||||
ifeq ($(BUILD_GNSS_HIDL_SERVICE), true)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := android.hardware.gnss@1.0-service-qti
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
|
||||
LOCAL_MODULE_RELATIVE_PATH := hw
|
||||
LOCAL_VENDOR_MODULE := true
|
||||
LOCAL_MODULE_OWNER := qti
|
||||
LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc
|
||||
LOCAL_SRC_FILES := \
|
||||
service.cpp \
|
||||
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/location_api
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
libgps.utils_headers \
|
||||
libloc_core_headers \
|
||||
libloc_pla_headers \
|
||||
liblocation_api_headers
|
||||
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libcutils \
|
||||
libdl \
|
||||
libbase \
|
||||
libutils \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += \
|
||||
libhwbinder \
|
||||
libhidlbase \
|
||||
libhidltransport \
|
||||
android.hardware.gnss@1.0 \
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
include $(BUILD_EXECUTABLE)
|
||||
endif # BUILD_GNSS_HIDL_SERVICE
|
338
gps/android/Gnss.cpp
Normal file
338
gps/android/Gnss.cpp
Normal file
|
@ -0,0 +1,338 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <dlfcn.h>
|
||||
#include "Gnss.h"
|
||||
typedef void* (getLocationInterface)();
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
if (mGnss != nullptr) {
|
||||
mGnss->stop();
|
||||
mGnss->cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
Gnss::Gnss() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
// clear pending GnssConfig
|
||||
memset(&mPendingConfig, 0, sizeof(GnssConfig));
|
||||
|
||||
mGnssDeathRecipient = new GnssDeathRecipient(this);
|
||||
}
|
||||
|
||||
Gnss::~Gnss() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mApi != nullptr) {
|
||||
delete mApi;
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
GnssAPIClient* Gnss::getApi() {
|
||||
if (mApi == nullptr && (mGnssCbIface != nullptr || mGnssNiCbIface != nullptr)) {
|
||||
mApi = new GnssAPIClient(mGnssCbIface, mGnssNiCbIface);
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s] faild to create GnssAPIClient", __FUNCTION__);
|
||||
return mApi;
|
||||
}
|
||||
|
||||
if (mPendingConfig.size == sizeof(GnssConfig)) {
|
||||
// we have pending GnssConfig
|
||||
mApi->gnssConfigurationUpdate(mPendingConfig);
|
||||
// clear size to invalid mPendingConfig
|
||||
mPendingConfig.size = 0;
|
||||
if (mPendingConfig.assistanceServer.hostName != nullptr) {
|
||||
free((void*)mPendingConfig.assistanceServer.hostName);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGW("%s] GnssAPIClient is not ready", __FUNCTION__);
|
||||
}
|
||||
return mApi;
|
||||
}
|
||||
|
||||
GnssInterface* Gnss::getGnssInterface() {
|
||||
static bool getGnssInterfaceFailed = false;
|
||||
if (nullptr == mGnssInterface && !getGnssInterfaceFailed) {
|
||||
LOC_LOGD("%s]: loading libgnss.so::getGnssInterface ...", __func__);
|
||||
getLocationInterface* getter = NULL;
|
||||
const char *error = NULL;
|
||||
dlerror();
|
||||
void *handle = dlopen("libgnss.so", RTLD_NOW);
|
||||
if (NULL == handle || (error = dlerror()) != NULL) {
|
||||
LOC_LOGW("dlopen for libgnss.so failed, error = %s", error);
|
||||
} else {
|
||||
getter = (getLocationInterface*)dlsym(handle, "getGnssInterface");
|
||||
if ((error = dlerror()) != NULL) {
|
||||
LOC_LOGW("dlsym for libgnss.so::getGnssInterface failed, error = %s", error);
|
||||
getter = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL == getter) {
|
||||
getGnssInterfaceFailed = true;
|
||||
} else {
|
||||
mGnssInterface = (GnssInterface*)(*getter)();
|
||||
}
|
||||
}
|
||||
return mGnssInterface;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setCallback(const sp<IGnssCallback>& callback) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
if (mGnssCbIface != nullptr) {
|
||||
mGnssCbIface->unlinkToDeath(mGnssDeathRecipient);
|
||||
}
|
||||
mGnssCbIface = callback;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
mGnssCbIface->linkToDeath(mGnssDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api != nullptr) {
|
||||
api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface);
|
||||
api->gnssEnable(LOCATION_TECHNOLOGY_TYPE_GNSS);
|
||||
api->requestCapabilities();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setGnssNiCb(const sp<IGnssNiCallback>& callback) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssNiCbIface = callback;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api != nullptr) {
|
||||
api->gnssUpdateCallbacks(mGnssCbIface, mGnssNiCbIface);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::updateConfiguration(GnssConfig& gnssConfig) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
api->gnssConfigurationUpdate(gnssConfig);
|
||||
} else if (gnssConfig.flags != 0) {
|
||||
// api is not ready yet, update mPendingConfig with gnssConfig
|
||||
mPendingConfig.size = sizeof(GnssConfig);
|
||||
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT;
|
||||
mPendingConfig.gpsLock = gnssConfig.gpsLock;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT;
|
||||
mPendingConfig.suplVersion = gnssConfig.suplVersion;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT;
|
||||
mPendingConfig.assistanceServer.size = sizeof(GnssConfigSetAssistanceServer);
|
||||
mPendingConfig.assistanceServer.type = gnssConfig.assistanceServer.type;
|
||||
if (mPendingConfig.assistanceServer.hostName != nullptr) {
|
||||
free((void*)mPendingConfig.assistanceServer.hostName);
|
||||
mPendingConfig.assistanceServer.hostName =
|
||||
strdup(gnssConfig.assistanceServer.hostName);
|
||||
}
|
||||
mPendingConfig.assistanceServer.port = gnssConfig.assistanceServer.port;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
|
||||
mPendingConfig.lppProfile = gnssConfig.lppProfile;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT;
|
||||
mPendingConfig.lppeControlPlaneMask = gnssConfig.lppeControlPlaneMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT;
|
||||
mPendingConfig.lppeUserPlaneMask = gnssConfig.lppeUserPlaneMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
|
||||
mPendingConfig.aGlonassPositionProtocolMask = gnssConfig.aGlonassPositionProtocolMask;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT;
|
||||
mPendingConfig.emergencyPdnForEmergencySupl = gnssConfig.emergencyPdnForEmergencySupl;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT;
|
||||
mPendingConfig.suplEmergencyServices = gnssConfig.suplEmergencyServices;
|
||||
}
|
||||
if (gnssConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) {
|
||||
mPendingConfig.flags |= GNSS_CONFIG_FLAGS_SUPL_MODE_BIT;
|
||||
mPendingConfig.suplModeMask = gnssConfig.suplModeMask;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::start() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
bool retVal = false;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
retVal = api->gnssStart();
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Return<bool> Gnss::stop() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
bool retVal = false;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
retVal = api->gnssStop();
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Return<void> Gnss::cleanup() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
|
||||
if (mApi != nullptr) {
|
||||
mApi->gnssDisable();
|
||||
}
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectLocation(double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
float accuracyMeters) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (nullptr != gnssInterface) {
|
||||
gnssInterface->injectLocation(latitudeDegrees, longitudeDegrees, accuracyMeters);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Return<bool> Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs,
|
||||
int32_t uncertaintyMs) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
GnssInterface* gnssInterface = getGnssInterface();
|
||||
if (nullptr != gnssInterface) {
|
||||
gnssInterface->injectTime(timeMs, timeReferenceMs, uncertaintyMs);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Return<void> Gnss::deleteAidingData(IGnss::GnssAidingData aidingDataFlags) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
api->gnssDeleteAidingData(aidingDataFlags);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> Gnss::setPositionMode(IGnss::GnssPositionMode mode,
|
||||
IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
bool retVal = false;
|
||||
GnssAPIClient* api = getApi();
|
||||
if (api) {
|
||||
retVal = api->gnssSetPositionMode(mode, recurrence, minIntervalMs,
|
||||
preferredAccuracyMeters, preferredTimeMs);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Return<sp<IAGnss>> Gnss::getExtensionAGnss() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mAGnssIface = new AGnss(this);
|
||||
return mAGnssIface;
|
||||
}
|
||||
|
||||
Return<sp<IGnssNi>> Gnss::getExtensionGnssNi() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssNi = new GnssNi(this);
|
||||
return mGnssNi;
|
||||
}
|
||||
|
||||
Return<sp<IGnssMeasurement>> Gnss::getExtensionGnssMeasurement() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssMeasurement = new GnssMeasurement();
|
||||
return mGnssMeasurement;
|
||||
}
|
||||
|
||||
Return<sp<IGnssConfiguration>> Gnss::getExtensionGnssConfiguration() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssConfig = new GnssConfiguration(this);
|
||||
return mGnssConfig;
|
||||
}
|
||||
|
||||
Return<sp<IGnssGeofencing>> Gnss::getExtensionGnssGeofencing() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssGeofencingIface = new GnssGeofencing();
|
||||
return mGnssGeofencingIface;
|
||||
}
|
||||
|
||||
Return<sp<IGnssBatching>> Gnss::getExtensionGnssBatching() {
|
||||
mGnssBatching = new GnssBatching();
|
||||
return mGnssBatching;
|
||||
}
|
||||
|
||||
Return<sp<IGnssDebug>> Gnss::getExtensionGnssDebug() {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
mGnssDebug = new GnssDebug(this);
|
||||
return mGnssDebug;
|
||||
}
|
||||
|
||||
Return<sp<IAGnssRil>> Gnss::getExtensionAGnssRil() {
|
||||
mGnssRil = new AGnssRil(this);
|
||||
return mGnssRil;
|
||||
}
|
||||
|
||||
IGnss* HIDL_FETCH_IGnss(const char* hal) {
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
IGnss* iface = nullptr;
|
||||
iface = new Gnss();
|
||||
if (iface == nullptr) {
|
||||
LOC_LOGE("%s]: failed to get %s", __FUNCTION__, hal);
|
||||
}
|
||||
return iface;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
149
gps/android/Gnss.h
Normal file
149
gps/android/Gnss.h
Normal file
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
||||
|
||||
#include <AGnss.h>
|
||||
#include <AGnssRil.h>
|
||||
#include <GnssBatching.h>
|
||||
#include <GnssConfiguration.h>
|
||||
#include <GnssGeofencing.h>
|
||||
#include <GnssMeasurement.h>
|
||||
#include <GnssNi.h>
|
||||
#include <GnssDebug.h>
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
#include <GnssAPIClient.h>
|
||||
#include <location_interface.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss : public IGnss {
|
||||
Gnss();
|
||||
~Gnss();
|
||||
|
||||
// registerAsService will call interfaceChain to determine the version of service
|
||||
/* comment this out until we know really how to manipulate hidl version
|
||||
using interfaceChain_cb = std::function<
|
||||
void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& descriptors)>;
|
||||
virtual ::android::hardware::Return<void> interfaceChain(interfaceChain_cb _hidl_cb) override {
|
||||
_hidl_cb({
|
||||
"android.hardware.gnss@1.1::IGnss",
|
||||
::android::hidl::base::V1_0::IBase::descriptor,
|
||||
});
|
||||
return ::android::hardware::Void();
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnss follow.
|
||||
* These declarations were generated from Gnss.hal.
|
||||
*/
|
||||
Return<bool> setCallback(const sp<IGnssCallback>& callback) override;
|
||||
Return<bool> start() override;
|
||||
Return<bool> stop() override;
|
||||
Return<void> cleanup() override;
|
||||
Return<bool> injectLocation(double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
float accuracyMeters) override;
|
||||
Return<bool> injectTime(int64_t timeMs,
|
||||
int64_t timeReferenceMs,
|
||||
int32_t uncertaintyMs) override;
|
||||
Return<void> deleteAidingData(IGnss::GnssAidingData aidingDataFlags) override;
|
||||
Return<bool> setPositionMode(IGnss::GnssPositionMode mode,
|
||||
IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs) override;
|
||||
Return<sp<IAGnss>> getExtensionAGnss() override;
|
||||
Return<sp<IGnssNi>> getExtensionGnssNi() override;
|
||||
Return<sp<IGnssMeasurement>> getExtensionGnssMeasurement() override;
|
||||
Return<sp<IGnssConfiguration>> getExtensionGnssConfiguration() override;
|
||||
Return<sp<IGnssGeofencing>> getExtensionGnssGeofencing() override;
|
||||
Return<sp<IGnssBatching>> getExtensionGnssBatching() override;
|
||||
|
||||
Return<sp<IAGnssRil>> getExtensionAGnssRil() override;
|
||||
|
||||
inline Return<sp<IGnssNavigationMessage>> getExtensionGnssNavigationMessage() override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline Return<sp<IGnssXtra>> getExtensionXtra() override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Return<sp<IGnssDebug>> getExtensionGnssDebug() override;
|
||||
|
||||
// These methods are not part of the IGnss base class.
|
||||
GnssAPIClient* getApi();
|
||||
Return<bool> setGnssNiCb(const sp<IGnssNiCallback>& niCb);
|
||||
Return<bool> updateConfiguration(GnssConfig& gnssConfig);
|
||||
GnssInterface* getGnssInterface();
|
||||
|
||||
private:
|
||||
struct GnssDeathRecipient : hidl_death_recipient {
|
||||
GnssDeathRecipient(sp<Gnss> gnss) : mGnss(gnss) {
|
||||
}
|
||||
~GnssDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<Gnss> mGnss;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssDeathRecipient> mGnssDeathRecipient = nullptr;
|
||||
|
||||
sp<AGnss> mAGnssIface = nullptr;
|
||||
sp<GnssNi> mGnssNi = nullptr;
|
||||
sp<GnssMeasurement> mGnssMeasurement = nullptr;
|
||||
sp<GnssConfiguration> mGnssConfig = nullptr;
|
||||
sp<GnssGeofencing> mGnssGeofencingIface = nullptr;
|
||||
sp<GnssBatching> mGnssBatching = nullptr;
|
||||
sp<IGnssDebug> mGnssDebug = nullptr;
|
||||
sp<AGnssRil> mGnssRil = nullptr;
|
||||
|
||||
GnssAPIClient* mApi = nullptr;
|
||||
sp<IGnssCallback> mGnssCbIface = nullptr;
|
||||
sp<IGnssNiCallback> mGnssNiCbIface = nullptr;
|
||||
GnssConfig mPendingConfig;
|
||||
GnssInterface* mGnssInterface = nullptr;
|
||||
};
|
||||
|
||||
extern "C" IGnss* HIDL_FETCH_IGnss(const char* name);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
|
130
gps/android/GnssBatching.cpp
Normal file
130
gps/android/GnssBatching.cpp
Normal file
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssBatchingInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <BatchingAPIClient.h>
|
||||
#include "GnssBatching.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssBatching::GnssBatchingDeathRecipient::serviceDied(
|
||||
uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
if (mGnssBatching != nullptr) {
|
||||
mGnssBatching->stop();
|
||||
mGnssBatching->cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
GnssBatching::GnssBatching() : mApi(nullptr) {
|
||||
mGnssBatchingDeathRecipient = new GnssBatchingDeathRecipient(this);
|
||||
}
|
||||
|
||||
GnssBatching::~GnssBatching() {
|
||||
if (mApi != nullptr) {
|
||||
delete mApi;
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
|
||||
Return<bool> GnssBatching::init(const sp<IGnssBatchingCallback>& callback) {
|
||||
if (mApi != nullptr) {
|
||||
LOC_LOGD("%s]: mApi is NOT nullptr, delete it first", __FUNCTION__);
|
||||
delete mApi;
|
||||
mApi = nullptr;
|
||||
}
|
||||
|
||||
mApi = new BatchingAPIClient(callback);
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
|
||||
}
|
||||
mGnssBatchingCbIface = callback;
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
mGnssBatchingCbIface->linkToDeath(mGnssBatchingDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Return<uint16_t> GnssBatching::getBatchSize() {
|
||||
uint16_t ret = 0;
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
ret = mApi->getBatchSize();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Return<bool> GnssBatching::start(const IGnssBatching::Options& options) {
|
||||
bool ret = false;
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
ret = mApi->startSession(options);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Return<void> GnssBatching::flush() {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->flushBatchedLocations();
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<bool> GnssBatching::stop() {
|
||||
bool ret = false;
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
ret = mApi->stopSession();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Return<void> GnssBatching::cleanup() {
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
mGnssBatchingCbIface->unlinkToDeath(mGnssBatchingDeathRecipient);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
80
gps/android/GnssBatching.h
Normal file
80
gps/android/GnssBatching.h
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssBatching.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatching;
|
||||
using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
|
||||
using ::android::hidl::base::V1_0::IBase;
|
||||
using ::android::hardware::hidl_array;
|
||||
using ::android::hardware::hidl_memory;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::sp;
|
||||
|
||||
class BatchingAPIClient;
|
||||
struct GnssBatching : public IGnssBatching {
|
||||
GnssBatching();
|
||||
~GnssBatching();
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow.
|
||||
Return<bool> init(const sp<IGnssBatchingCallback>& callback) override;
|
||||
Return<uint16_t> getBatchSize() override;
|
||||
Return<bool> start(const IGnssBatching::Options& options ) override;
|
||||
Return<void> flush() override;
|
||||
Return<bool> stop() override;
|
||||
Return<void> cleanup() override;
|
||||
|
||||
private:
|
||||
struct GnssBatchingDeathRecipient : hidl_death_recipient {
|
||||
GnssBatchingDeathRecipient(sp<GnssBatching> gnssBatching) :
|
||||
mGnssBatching(gnssBatching) {
|
||||
}
|
||||
~GnssBatchingDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<GnssBatching> mGnssBatching;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssBatchingDeathRecipient> mGnssBatchingDeathRecipient = nullptr;
|
||||
sp<IGnssBatchingCallback> mGnssBatchingCbIface = nullptr;
|
||||
BatchingAPIClient* mApi = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
|
227
gps/android/GnssConfiguration.cpp
Normal file
227
gps/android/GnssConfiguration.cpp
Normal file
|
@ -0,0 +1,227 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssConfigurationInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssConfiguration.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) {
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gps::V1_0::IGnssConfiguration follow.
|
||||
Return<bool> GnssConfiguration::setSuplEs(bool enabled) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT;
|
||||
config.suplEmergencyServices = (enabled ?
|
||||
GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_YES :
|
||||
GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO);
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setSuplVersion(uint32_t version) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT;
|
||||
switch (version) {
|
||||
case 0x00020002:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_2;
|
||||
break;
|
||||
case 0x00020000:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_2_0_0;
|
||||
break;
|
||||
case 0x00010000:
|
||||
config.suplVersion = GNSS_CONFIG_SUPL_VERSION_1_0_0;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid version: 0x%x.", __FUNCTION__, version);
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setSuplMode(uint8_t mode) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_SUPL_MODE_BIT;
|
||||
switch (mode) {
|
||||
case 0:
|
||||
config.suplModeMask = 0; // STANDALONE ONLY
|
||||
break;
|
||||
case 1:
|
||||
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT;
|
||||
break;
|
||||
case 2:
|
||||
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSA_BIT;
|
||||
break;
|
||||
case 3:
|
||||
config.suplModeMask = GNSS_CONFIG_SUPL_MODE_MSB_BIT | GNSS_CONFIG_SUPL_MODE_MSA_BIT;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid mode: %d.", __FUNCTION__, mode);
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setLppProfile(uint8_t lppProfile) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT;
|
||||
switch (lppProfile) {
|
||||
case 0:
|
||||
config.lppProfile = GNSS_CONFIG_LPP_PROFILE_RRLP_ON_LTE;
|
||||
break;
|
||||
case 1:
|
||||
config.lppProfile = GNSS_CONFIG_LPP_PROFILE_USER_PLANE;
|
||||
break;
|
||||
case 2:
|
||||
config.lppProfile = GNSS_CONFIG_LPP_PROFILE_CONTROL_PLANE;
|
||||
break;
|
||||
case 3:
|
||||
config.lppProfile = GNSS_CONFIG_LPP_PROFILE_USER_PLANE_AND_CONTROL_PLANE;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid lppProfile: %d.", __FUNCTION__, lppProfile);
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setGlonassPositioningProtocol(uint8_t protocol) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
|
||||
config.flags = GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT;
|
||||
if (protocol & (1<<0)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRC_CONTROL_PLANE_BIT;
|
||||
}
|
||||
if (protocol & (1<<1)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_RRLP_USER_PLANE_BIT;
|
||||
}
|
||||
if (protocol & (1<<2)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_USER_PLANE_BIT;
|
||||
}
|
||||
if (protocol & (1<<3)) {
|
||||
config.aGlonassPositionProtocolMask |= GNSS_CONFIG_LLP_CONTROL_PLANE_BIT;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setGpsLock(uint8_t lock) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_GPS_LOCK_VALID_BIT;
|
||||
switch (lock) {
|
||||
case 0:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_NONE;
|
||||
break;
|
||||
case 1:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO;
|
||||
break;
|
||||
case 2:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_NI;
|
||||
break;
|
||||
case 3:
|
||||
config.gpsLock = GNSS_CONFIG_GPS_LOCK_MO_AND_NI;
|
||||
break;
|
||||
default:
|
||||
LOC_LOGE("%s]: invalid lock: %d.", __FUNCTION__, lock);
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
Return<bool> GnssConfiguration::setEmergencySuplPdn(bool enabled) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
GnssConfig config;
|
||||
memset(&config, 0, sizeof(GnssConfig));
|
||||
config.size = sizeof(GnssConfig);
|
||||
config.flags = GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT;
|
||||
config.emergencyPdnForEmergencySupl = (enabled ?
|
||||
GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_YES :
|
||||
GNSS_CONFIG_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_NO);
|
||||
|
||||
return mGnss->updateConfiguration(config);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
71
gps/android/GnssConfiguration.h
Normal file
71
gps/android/GnssConfiguration.h
Normal file
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssConfiguration.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssConfiguration;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
/*
|
||||
* Interface for passing GNSS configuration info from platform to HAL.
|
||||
*/
|
||||
struct Gnss;
|
||||
struct GnssConfiguration : public IGnssConfiguration {
|
||||
GnssConfiguration(Gnss* gnss);
|
||||
~GnssConfiguration() = default;
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow.
|
||||
* These declarations were generated from IGnssConfiguration.hal.
|
||||
*/
|
||||
Return<bool> setSuplVersion(uint32_t version) override;
|
||||
Return<bool> setSuplMode(uint8_t mode) override;
|
||||
Return<bool> setSuplEs(bool enabled) override;
|
||||
Return<bool> setLppProfile(uint8_t lppProfile) override;
|
||||
Return<bool> setGlonassPositioningProtocol(uint8_t protocol) override;
|
||||
Return<bool> setEmergencySuplPdn(bool enable) override;
|
||||
Return<bool> setGpsLock(uint8_t lock) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
|
143
gps/android/GnssDebug.cpp
Normal file
143
gps/android/GnssDebug.cpp
Normal file
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssDebugInterface"
|
||||
|
||||
#include <log/log.h>
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssDebug.h"
|
||||
#include "LocationUtil.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_vec;
|
||||
|
||||
#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000ULL) // 1/1/2017 00:00 GMT
|
||||
#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns
|
||||
|
||||
GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* This methods requests position, time and satellite ephemeris debug information
|
||||
* from the HAL.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb)
|
||||
{
|
||||
LOC_LOGD("%s]: ", __func__);
|
||||
|
||||
DebugData data = { };
|
||||
|
||||
if((nullptr == mGnss) || (nullptr == mGnss->getGnssInterface())){
|
||||
LOC_LOGE("GnssDebug - Null GNSS interface");
|
||||
_hidl_cb(data);
|
||||
return Void();
|
||||
}
|
||||
|
||||
// get debug report snapshot via hal interface
|
||||
GnssDebugReport reports = { };
|
||||
mGnss->getGnssInterface()->getDebugReport(reports);
|
||||
|
||||
// location block
|
||||
if (reports.mLocation.mValid) {
|
||||
data.position.valid = true;
|
||||
data.position.latitudeDegrees = reports.mLocation.mLocation.latitude;
|
||||
data.position.longitudeDegrees = reports.mLocation.mLocation.longitude;
|
||||
data.position.altitudeMeters = reports.mLocation.mLocation.altitude;
|
||||
|
||||
data.position.speedMetersPerSec =
|
||||
(double)(reports.mLocation.mLocation.speed);
|
||||
data.position.bearingDegrees =
|
||||
(double)(reports.mLocation.mLocation.bearing);
|
||||
data.position.horizontalAccuracyMeters =
|
||||
(double)(reports.mLocation.mLocation.accuracy);
|
||||
data.position.verticalAccuracyMeters =
|
||||
reports.mLocation.verticalAccuracyMeters;
|
||||
data.position.speedAccuracyMetersPerSecond =
|
||||
reports.mLocation.speedAccuracyMetersPerSecond;
|
||||
data.position.bearingAccuracyDegrees =
|
||||
reports.mLocation.bearingAccuracyDegrees;
|
||||
|
||||
timeval tv_now, tv_report;
|
||||
tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec;
|
||||
tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL;
|
||||
gettimeofday(&tv_now, NULL);
|
||||
data.position.ageSeconds =
|
||||
(tv_now.tv_sec - tv_report.tv_sec) +
|
||||
(float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000;
|
||||
}
|
||||
else {
|
||||
data.position.valid = false;
|
||||
}
|
||||
|
||||
// time block
|
||||
if (reports.mTime.mValid) {
|
||||
data.time.timeEstimate = reports.mTime.timeEstimate;
|
||||
data.time.timeUncertaintyNs = reports.mTime.timeUncertaintyNs;
|
||||
data.time.frequencyUncertaintyNsPerSec =
|
||||
reports.mTime.frequencyUncertaintyNsPerSec;
|
||||
}
|
||||
else {
|
||||
data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME;
|
||||
data.time.timeUncertaintyNs = (float)(GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC);
|
||||
data.time.frequencyUncertaintyNsPerSec = 0;
|
||||
}
|
||||
|
||||
// satellite data block
|
||||
SatelliteData s = { };
|
||||
std::vector<SatelliteData> s_array = { };
|
||||
|
||||
for (uint32_t i=0; i<reports.mSatelliteInfo.size(); i++) {
|
||||
memset(&s, 0, sizeof(s));
|
||||
s.svid = reports.mSatelliteInfo[i].svid;
|
||||
convertGnssConstellationType(
|
||||
reports.mSatelliteInfo[i].constellation, s.constellation);
|
||||
convertGnssEphemerisType(
|
||||
reports.mSatelliteInfo[i].mEphemerisType, s.ephemerisType);
|
||||
convertGnssEphemerisSource(
|
||||
reports.mSatelliteInfo[i].mEphemerisSource, s.ephemerisSource);
|
||||
convertGnssEphemerisHealth(
|
||||
reports.mSatelliteInfo[i].mEphemerisHealth, s.ephemerisHealth);
|
||||
|
||||
s.ephemerisAgeSeconds =
|
||||
reports.mSatelliteInfo[i].ephemerisAgeSeconds;
|
||||
s.serverPredictionIsAvailable =
|
||||
reports.mSatelliteInfo[i].serverPredictionIsAvailable;
|
||||
s.serverPredictionAgeSeconds =
|
||||
reports.mSatelliteInfo[i].serverPredictionAgeSeconds;
|
||||
|
||||
s_array.push_back(s);
|
||||
}
|
||||
data.satelliteDataArray = s_array;
|
||||
|
||||
// callback HIDL with collected debug data
|
||||
_hidl_cb(data);
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
59
gps/android/GnssDebug.h
Normal file
59
gps/android/GnssDebug.h
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
||||
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssDebug.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssDebug;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
/* Interface for GNSS Debug support. */
|
||||
struct Gnss;
|
||||
struct GnssDebug : public IGnssDebug {
|
||||
GnssDebug(Gnss* gnss);
|
||||
~GnssDebug() {};
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow.
|
||||
* These declarations were generated from IGnssDebug.hal.
|
||||
*/
|
||||
Return<void> getDebugData(getDebugData_cb _hidl_cb) override;
|
||||
|
||||
private:
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
|
141
gps/android/GnssGeofencing.cpp
Normal file
141
gps/android/GnssGeofencing.cpp
Normal file
|
@ -0,0 +1,141 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "GnssHal_GnssGeofencing"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <GeofenceAPIClient.h>
|
||||
#include "GnssGeofencing.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied(
|
||||
uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
if (mGnssGeofencing != nullptr) {
|
||||
mGnssGeofencing->removeAllGeofences();
|
||||
}
|
||||
}
|
||||
|
||||
GnssGeofencing::GnssGeofencing() : mApi(nullptr) {
|
||||
mGnssGeofencingDeathRecipient = new GnssGeofencingDeathRecipient(this);
|
||||
}
|
||||
|
||||
GnssGeofencing::~GnssGeofencing() {
|
||||
if (mApi != nullptr) {
|
||||
delete mApi;
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
|
||||
Return<void> GnssGeofencing::setCallback(const sp<IGnssGeofenceCallback>& callback) {
|
||||
if (mApi != nullptr) {
|
||||
LOC_LOGE("%s]: mApi is NOT nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
mApi = new GeofenceAPIClient(callback);
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: failed to create mApi", __FUNCTION__);
|
||||
}
|
||||
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
mGnssGeofencingCbIface->unlinkToDeath(mGnssGeofencingDeathRecipient);
|
||||
}
|
||||
mGnssGeofencingCbIface = callback;
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
mGnssGeofencingCbIface->linkToDeath(mGnssGeofencingDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::addGeofence(
|
||||
int32_t geofenceId,
|
||||
double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
double radiusMeters,
|
||||
IGnssGeofenceCallback::GeofenceTransition lastTransition,
|
||||
int32_t monitorTransitions,
|
||||
uint32_t notificationResponsivenessMs,
|
||||
uint32_t unknownTimerMs) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceAdd(
|
||||
geofenceId,
|
||||
latitudeDegrees,
|
||||
longitudeDegrees,
|
||||
radiusMeters,
|
||||
static_cast<int32_t>(lastTransition),
|
||||
monitorTransitions,
|
||||
notificationResponsivenessMs,
|
||||
unknownTimerMs);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::pauseGeofence(int32_t geofenceId) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofencePause(geofenceId);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceResume(geofenceId, monitorTransitions);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::removeGeofence(int32_t geofenceId) {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceRemove(geofenceId);
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssGeofencing::removeAllGeofences() {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGD("%s]: mApi is nullptr, do nothing", __FUNCTION__);
|
||||
} else {
|
||||
mApi->geofenceRemoveAll();
|
||||
}
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
91
gps/android/GnssGeofencing.h
Normal file
91
gps/android/GnssGeofencing.h
Normal file
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssGeofencing.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
|
||||
using ::android::hardware::gnss::V1_0::IGnssGeofencing;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
class GeofenceAPIClient;
|
||||
struct GnssGeofencing : public IGnssGeofencing {
|
||||
GnssGeofencing();
|
||||
~GnssGeofencing();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssGeofencing follow.
|
||||
* These declarations were generated from IGnssGeofencing.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IGnssGeofenceCallback>& callback) override;
|
||||
Return<void> addGeofence(int32_t geofenceId,
|
||||
double latitudeDegrees,
|
||||
double longitudeDegrees,
|
||||
double radiusMeters,
|
||||
IGnssGeofenceCallback::GeofenceTransition lastTransition,
|
||||
int32_t monitorTransitions,
|
||||
uint32_t notificationResponsivenessMs,
|
||||
uint32_t unknownTimerMs) override;
|
||||
|
||||
Return<void> pauseGeofence(int32_t geofenceId) override;
|
||||
Return<void> resumeGeofence(int32_t geofenceId, int32_t monitorTransitions) override;
|
||||
Return<void> removeGeofence(int32_t geofenceId) override;
|
||||
|
||||
private:
|
||||
// This method is not part of the IGnss base class.
|
||||
// It is called by GnssGeofencingDeathRecipient to remove all geofences added so far.
|
||||
Return<void> removeAllGeofences();
|
||||
|
||||
private:
|
||||
struct GnssGeofencingDeathRecipient : hidl_death_recipient {
|
||||
GnssGeofencingDeathRecipient(sp<GnssGeofencing> gnssGeofencing) :
|
||||
mGnssGeofencing(gnssGeofencing) {
|
||||
}
|
||||
~GnssGeofencingDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<GnssGeofencing> mGnssGeofencing;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssGeofencingDeathRecipient> mGnssGeofencingDeathRecipient = nullptr;
|
||||
sp<IGnssGeofenceCallback> mGnssGeofencingCbIface = nullptr;
|
||||
GeofenceAPIClient* mApi = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
|
99
gps/android/GnssMeasurement.cpp
Normal file
99
gps/android/GnssMeasurement.cpp
Normal file
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssMeasurementInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <MeasurementAPIClient.h>
|
||||
#include "GnssMeasurement.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied(
|
||||
uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
if (mGnssMeasurement != nullptr) {
|
||||
mGnssMeasurement->close();
|
||||
}
|
||||
}
|
||||
|
||||
GnssMeasurement::GnssMeasurement() {
|
||||
mGnssMeasurementDeathRecipient = new GnssMeasurementDeathRecipient(this);
|
||||
mApi = new MeasurementAPIClient();
|
||||
}
|
||||
|
||||
GnssMeasurement::~GnssMeasurement() {
|
||||
if (mApi) {
|
||||
delete mApi;
|
||||
mApi = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> GnssMeasurement::setCallback(
|
||||
const sp<IGnssMeasurementCallback>& callback) {
|
||||
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> ret =
|
||||
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__);
|
||||
return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT;
|
||||
}
|
||||
|
||||
if (callback == nullptr) {
|
||||
LOC_LOGE("%s]: callback is nullptr", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
mGnssMeasurementCbIface = callback;
|
||||
mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0 /*cookie*/);
|
||||
|
||||
return mApi->measurementSetCallback(callback);
|
||||
}
|
||||
|
||||
Return<void> GnssMeasurement::close() {
|
||||
if (mApi == nullptr) {
|
||||
LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient);
|
||||
mGnssMeasurementCbIface = nullptr;
|
||||
}
|
||||
mApi->measurementClose();
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
76
gps/android/GnssMeasurement.h
Normal file
76
gps/android/GnssMeasurement.h
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
class MeasurementAPIClient;
|
||||
struct GnssMeasurement : public IGnssMeasurement {
|
||||
GnssMeasurement();
|
||||
~GnssMeasurement();
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
|
||||
* These declarations were generated from IGnssMeasurement.hal.
|
||||
*/
|
||||
Return<GnssMeasurementStatus> setCallback(
|
||||
const sp<IGnssMeasurementCallback>& callback) override;
|
||||
Return<void> close() override;
|
||||
|
||||
private:
|
||||
struct GnssMeasurementDeathRecipient : hidl_death_recipient {
|
||||
GnssMeasurementDeathRecipient(sp<GnssMeasurement> gnssMeasurement) :
|
||||
mGnssMeasurement(gnssMeasurement) {
|
||||
}
|
||||
~GnssMeasurementDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<GnssMeasurement> mGnssMeasurement;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
|
||||
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
|
||||
MeasurementAPIClient* mApi;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
|
85
gps/android/GnssNi.cpp
Normal file
85
gps/android/GnssNi.cpp
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "LocSvc_GnssNiInterface"
|
||||
|
||||
#include <log_util.h>
|
||||
#include "Gnss.h"
|
||||
#include "GnssNi.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp<IBase>& who) {
|
||||
LOC_LOGE("%s] service died. cookie: %llu, who: %p",
|
||||
__FUNCTION__, static_cast<unsigned long long>(cookie), &who);
|
||||
// we do nothing here
|
||||
// Gnss::GnssDeathRecipient will stop the session
|
||||
}
|
||||
|
||||
GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) {
|
||||
mGnssNiDeathRecipient = new GnssNiDeathRecipient(this);
|
||||
}
|
||||
|
||||
// Methods from ::android::hardware::gnss::V1_0::IGnssNi follow.
|
||||
Return<void> GnssNi::setCallback(const sp<IGnssNiCallback>& callback) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
mGnss->setGnssNiCb(callback);
|
||||
|
||||
if (mGnssNiCbIface != nullptr) {
|
||||
mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient);
|
||||
}
|
||||
mGnssNiCbIface = callback;
|
||||
if (mGnssNiCbIface != nullptr) {
|
||||
mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/);
|
||||
}
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) {
|
||||
if (mGnss == nullptr) {
|
||||
LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
GnssAPIClient* api = mGnss->getApi();
|
||||
if (api == nullptr) {
|
||||
LOC_LOGE("%s]: api is nullptr", __FUNCTION__);
|
||||
return Void();
|
||||
}
|
||||
|
||||
api->gnssNiRespond(notifId, userResponse);
|
||||
|
||||
return Void();
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
75
gps/android/GnssNi.h
Normal file
75
gps/android/GnssNi.h
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
#define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssNi.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssNi;
|
||||
using ::android::hardware::gnss::V1_0::IGnssNiCallback;
|
||||
using ::android::hardware::Return;
|
||||
using ::android::hardware::Void;
|
||||
using ::android::hardware::hidl_vec;
|
||||
using ::android::hardware::hidl_string;
|
||||
using ::android::sp;
|
||||
|
||||
struct Gnss;
|
||||
struct GnssNi : public IGnssNi {
|
||||
GnssNi(Gnss* gnss);
|
||||
~GnssNi() = default;
|
||||
|
||||
/*
|
||||
* Methods from ::android::hardware::gnss::V1_0::IGnssNi follow.
|
||||
* These declarations were generated from IGnssNi.hal.
|
||||
*/
|
||||
Return<void> setCallback(const sp<IGnssNiCallback>& callback) override;
|
||||
Return<void> respond(int32_t notifId,
|
||||
IGnssNiCallback::GnssUserResponseType userResponse) override;
|
||||
|
||||
private:
|
||||
struct GnssNiDeathRecipient : hidl_death_recipient {
|
||||
GnssNiDeathRecipient(sp<GnssNi> gnssNi) : mGnssNi(gnssNi) {
|
||||
}
|
||||
~GnssNiDeathRecipient() = default;
|
||||
virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
|
||||
sp<GnssNi> mGnssNi;
|
||||
};
|
||||
|
||||
private:
|
||||
sp<GnssNiDeathRecipient> mGnssNiDeathRecipient = nullptr;
|
||||
sp<IGnssNiCallback> mGnssNiCbIface = nullptr;
|
||||
Gnss* mGnss = nullptr;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
|
4
gps/android/android.hardware.gnss@1.0-service-qti.rc
Normal file
4
gps/android/android.hardware.gnss@1.0-service-qti.rc
Normal file
|
@ -0,0 +1,4 @@
|
|||
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti
|
||||
class main
|
||||
user gps
|
||||
group system gps radio
|
191
gps/android/location_api/BatchingAPIClient.cpp
Normal file
191
gps/android/location_api/BatchingAPIClient.cpp
Normal file
|
@ -0,0 +1,191 @@
|
|||
/* Copyright (c) 2017, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_BatchingAPIClient"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "BatchingAPIClient.h"
|
||||
|
||||
#include "limits.h"
|
||||
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
|
||||
LocationCapabilitiesMask mask);
|
||||
|
||||
BatchingAPIClient::BatchingAPIClient(const sp<IGnssBatchingCallback>& callback) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssBatchingCbIface(callback),
|
||||
mDefaultId(UINT_MAX),
|
||||
mLocationCapabilitiesMask(0)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
if (mGnssBatchingCbIface != nullptr) {
|
||||
locationCallbacks.batchingCb = [this](size_t count, Location* location,
|
||||
BatchingOptions batchOptions) {
|
||||
onBatchingCb(count, location, batchOptions);
|
||||
};
|
||||
}
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceStatusCb = nullptr;
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
BatchingAPIClient::~BatchingAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
int BatchingAPIClient::getBatchSize()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
return locAPIGetBatchSize();
|
||||
}
|
||||
|
||||
int BatchingAPIClient::startSession(const IGnssBatching::Options& opts)
|
||||
{
|
||||
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
|
||||
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
|
||||
int retVal = -1;
|
||||
LocationOptions options;
|
||||
convertBatchOption(opts, options, mLocationCapabilitiesMask);
|
||||
uint32_t mode = 0;
|
||||
if (opts.flags == static_cast<uint8_t>(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) {
|
||||
mode = SESSION_MODE_ON_FULL;
|
||||
}
|
||||
if (locAPIStartSession(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) {
|
||||
retVal = 1;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int BatchingAPIClient::updateSessionOptions(const IGnssBatching::Options& opts)
|
||||
{
|
||||
LOC_LOGD("%s]: (%lld %d)", __FUNCTION__,
|
||||
static_cast<long long>(opts.periodNanos), static_cast<uint8_t>(opts.flags));
|
||||
int retVal = -1;
|
||||
LocationOptions options;
|
||||
convertBatchOption(opts, options, mLocationCapabilitiesMask);
|
||||
|
||||
uint32_t mode = 0;
|
||||
if (opts.flags == static_cast<uint8_t>(IGnssBatching::Flag::WAKEUP_ON_FIFO_FULL)) {
|
||||
mode = SESSION_MODE_ON_FULL;
|
||||
}
|
||||
if (locAPIUpdateSessionOptions(mDefaultId, mode, options) == LOCATION_ERROR_SUCCESS) {
|
||||
retVal = 1;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int BatchingAPIClient::stopSession()
|
||||
{
|
||||
LOC_LOGD("%s]: ", __FUNCTION__);
|
||||
int retVal = -1;
|
||||
if (locAPIStopSession(mDefaultId) == LOCATION_ERROR_SUCCESS) {
|
||||
retVal = 1;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void BatchingAPIClient::getBatchedLocation(int last_n_locations)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, last_n_locations);
|
||||
locAPIGetBatchedLocations(mDefaultId, last_n_locations);
|
||||
}
|
||||
|
||||
void BatchingAPIClient::flushBatchedLocations()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
locAPIGetBatchedLocations(mDefaultId, SIZE_MAX);
|
||||
}
|
||||
|
||||
void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
||||
{
|
||||
LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask);
|
||||
mLocationCapabilitiesMask = capabilitiesMask;
|
||||
}
|
||||
|
||||
void BatchingAPIClient::onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions)
|
||||
{
|
||||
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count);
|
||||
if (mGnssBatchingCbIface != nullptr && count > 0) {
|
||||
hidl_vec<GnssLocation> locationVec;
|
||||
locationVec.resize(count);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
convertGnssLocation(location[i], locationVec[i]);
|
||||
}
|
||||
auto r = mGnssBatchingCbIface->gnssLocationBatchCb(locationVec);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssLocationBatchCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
|
||||
LocationCapabilitiesMask mask)
|
||||
{
|
||||
memset(&out, 0, sizeof(LocationOptions));
|
||||
out.size = sizeof(LocationOptions);
|
||||
out.minInterval = (uint32_t)(in.periodNanos / 1000000L);
|
||||
out.minDistance = 0;
|
||||
out.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
if (mask & LOCATION_CAPABILITIES_GNSS_MSA_BIT)
|
||||
out.mode = GNSS_SUPL_MODE_MSA;
|
||||
if (mask & LOCATION_CAPABILITIES_GNSS_MSB_BIT)
|
||||
out.mode = GNSS_SUPL_MODE_MSB;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
75
gps/android/location_api/BatchingAPIClient.h
Normal file
75
gps/android/location_api/BatchingAPIClient.h
Normal file
|
@ -0,0 +1,75 @@
|
|||
/* Copyright (c) 2017, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BATCHING_API_CLINET_H
|
||||
#define BATCHING_API_CLINET_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssBatching.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssBatchingCallback.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
class BatchingAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
BatchingAPIClient(const sp<IGnssBatchingCallback>& callback);
|
||||
~BatchingAPIClient();
|
||||
int getBatchSize();
|
||||
int startSession(const IGnssBatching::Options& options);
|
||||
int updateSessionOptions(const IGnssBatching::Options& options);
|
||||
int stopSession();
|
||||
void getBatchedLocation(int last_n_locations);
|
||||
void flushBatchedLocations();
|
||||
|
||||
inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; }
|
||||
|
||||
// callbacks
|
||||
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
|
||||
void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final;
|
||||
|
||||
private:
|
||||
sp<IGnssBatchingCallback> mGnssBatchingCbIface;
|
||||
uint32_t mDefaultId;
|
||||
int mBatchSize;
|
||||
LocationCapabilitiesMask mLocationCapabilitiesMask;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // BATCHING_API_CLINET_H
|
273
gps/android/location_api/GeofenceAPIClient.cpp
Normal file
273
gps/android/location_api/GeofenceAPIClient.cpp
Normal file
|
@ -0,0 +1,273 @@
|
|||
/* Copyright (c) 2017, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_GeofenceApiClient"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "GeofenceAPIClient.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
|
||||
GeofenceAPIClient::GeofenceAPIClient(const sp<IGnssGeofenceCallback>& callback) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssGeofencingCbIface(callback)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
locationCallbacks.geofenceBreachCb =
|
||||
[this](GeofenceBreachNotification geofenceBreachNotification) {
|
||||
onGeofenceBreachCb(geofenceBreachNotification);
|
||||
};
|
||||
|
||||
locationCallbacks.geofenceStatusCb =
|
||||
[this](GeofenceStatusNotification geofenceStatusNotification) {
|
||||
onGeofenceStatusCb(geofenceStatusNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceAdd(uint32_t geofence_id, double latitude, double longitude,
|
||||
double radius_meters, int32_t last_transition, int32_t monitor_transitions,
|
||||
uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %f %f %f %d %d %d %d)", __FUNCTION__,
|
||||
geofence_id, latitude, longitude, radius_meters,
|
||||
last_transition, monitor_transitions, notification_responsiveness_ms, unknown_timer_ms);
|
||||
|
||||
GeofenceOption options;
|
||||
memset(&options, 0, sizeof(GeofenceOption));
|
||||
options.size = sizeof(GeofenceOption);
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED)
|
||||
options.breachTypeMask |= GEOFENCE_BREACH_ENTER_BIT;
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED)
|
||||
options.breachTypeMask |= GEOFENCE_BREACH_EXIT_BIT;
|
||||
options.responsiveness = notification_responsiveness_ms;
|
||||
|
||||
GeofenceInfo data;
|
||||
data.size = sizeof(GeofenceInfo);
|
||||
data.latitude = latitude;
|
||||
data.longitude = longitude;
|
||||
data.radius = radius_meters;
|
||||
|
||||
LocationError err = (LocationError)locAPIAddGeofences(1, &geofence_id, &options, &data);
|
||||
if (LOCATION_ERROR_SUCCESS != err) {
|
||||
onAddGeofencesCb(1, &err, &geofence_id);
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofencePause(uint32_t geofence_id)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id);
|
||||
locAPIPauseGeofences(1, &geofence_id);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceResume(uint32_t geofence_id, int32_t monitor_transitions)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %d)", __FUNCTION__, geofence_id, monitor_transitions);
|
||||
GeofenceBreachTypeMask mask = 0;
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::ENTERED)
|
||||
mask |= GEOFENCE_BREACH_ENTER_BIT;
|
||||
if (monitor_transitions & IGnssGeofenceCallback::GeofenceTransition::EXITED)
|
||||
mask |= GEOFENCE_BREACH_EXIT_BIT;
|
||||
locAPIResumeGeofences(1, &geofence_id, &mask);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceRemove(uint32_t geofence_id)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofence_id);
|
||||
locAPIRemoveGeofences(1, &geofence_id);
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::geofenceRemoveAll()
|
||||
{
|
||||
LOC_LOGD("%s]", __FUNCTION__);
|
||||
// TODO locAPIRemoveAllGeofences();
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, geofenceBreachNotification.count);
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
for (size_t i = 0; i < geofenceBreachNotification.count; i++) {
|
||||
GnssLocation gnssLocation;
|
||||
convertGnssLocation(geofenceBreachNotification.location, gnssLocation);
|
||||
|
||||
IGnssGeofenceCallback::GeofenceTransition transition;
|
||||
if (geofenceBreachNotification.type == GEOFENCE_BREACH_ENTER)
|
||||
transition = IGnssGeofenceCallback::GeofenceTransition::ENTERED;
|
||||
else if (geofenceBreachNotification.type == GEOFENCE_BREACH_EXIT)
|
||||
transition = IGnssGeofenceCallback::GeofenceTransition::EXITED;
|
||||
else {
|
||||
// continue with other breach if transition is
|
||||
// nether GPS_GEOFENCE_ENTERED nor GPS_GEOFENCE_EXITED
|
||||
continue;
|
||||
}
|
||||
|
||||
auto r = mGnssGeofencingCbIface->gnssGeofenceTransitionCb(
|
||||
geofenceBreachNotification.ids[i], gnssLocation, transition,
|
||||
static_cast<GnssUtcTime>(geofenceBreachNotification.timestamp));
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceTransitionCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, geofenceStatusNotification.available);
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
IGnssGeofenceCallback::GeofenceAvailability status =
|
||||
IGnssGeofenceCallback::GeofenceAvailability::UNAVAILABLE;
|
||||
if (geofenceStatusNotification.available == GEOFENCE_STATUS_AVAILABILE_YES) {
|
||||
status = IGnssGeofenceCallback::GeofenceAvailability::AVAILABLE;
|
||||
}
|
||||
GnssLocation gnssLocation;
|
||||
memset(&gnssLocation, 0, sizeof(GnssLocation));
|
||||
auto r = mGnssGeofencingCbIface->gnssGeofenceStatusCb(status, gnssLocation);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceStatusCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_EXISTS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_EXISTS;
|
||||
auto r = mGnssGeofencingCbIface->gnssGeofenceAddCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceAddCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
|
||||
auto r = mGnssGeofencingCbIface->gnssGeofenceRemoveCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceRemoveCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
|
||||
auto r = mGnssGeofencingCbIface->gnssGeofencePauseCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofencePauseCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids)
|
||||
{
|
||||
LOC_LOGD("%s]: (%zu)", __FUNCTION__, count);
|
||||
if (mGnssGeofencingCbIface != nullptr) {
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
IGnssGeofenceCallback::GeofenceStatus status =
|
||||
IGnssGeofenceCallback::GeofenceStatus::ERROR_GENERIC;
|
||||
if (errors[i] == LOCATION_ERROR_SUCCESS)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::OPERATION_SUCCESS;
|
||||
else if (errors[i] == LOCATION_ERROR_ID_UNKNOWN)
|
||||
status = IGnssGeofenceCallback::GeofenceStatus::ERROR_ID_UNKNOWN;
|
||||
auto r = mGnssGeofencingCbIface->gnssGeofenceResumeCb(ids[i], status);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssGeofenceResumeCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
76
gps/android/location_api/GeofenceAPIClient.h
Normal file
76
gps/android/location_api/GeofenceAPIClient.h
Normal file
|
@ -0,0 +1,76 @@
|
|||
/* Copyright (c) 2017, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GEOFENCE_API_CLINET_H
|
||||
#define GEOFENCE_API_CLINET_H
|
||||
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnssGeofenceCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
||||
class GeofenceAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
GeofenceAPIClient(const sp<IGnssGeofenceCallback>& callback);
|
||||
virtual ~GeofenceAPIClient() = default;
|
||||
|
||||
void geofenceAdd(uint32_t geofence_id, double latitude, double longitude,
|
||||
double radius_meters, int32_t last_transition, int32_t monitor_transitions,
|
||||
uint32_t notification_responsiveness_ms, uint32_t unknown_timer_ms);
|
||||
void geofencePause(uint32_t geofence_id);
|
||||
void geofenceResume(uint32_t geofence_id, int32_t monitor_transitions);
|
||||
void geofenceRemove(uint32_t geofence_id);
|
||||
void geofenceRemoveAll();
|
||||
|
||||
// callbacks
|
||||
void onGeofenceBreachCb(GeofenceBreachNotification geofenceBreachNotification) final;
|
||||
void onGeofenceStatusCb(GeofenceStatusNotification geofenceStatusNotification) final;
|
||||
void onAddGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
void onRemoveGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
void onPauseGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
|
||||
|
||||
private:
|
||||
sp<IGnssGeofenceCallback> mGnssGeofencingCbIface;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // GEOFENCE_API_CLINET_H
|
528
gps/android/location_api/GnssAPIClient.cpp
Normal file
528
gps/android/location_api/GnssAPIClient.cpp
Normal file
|
@ -0,0 +1,528 @@
|
|||
/* Copyright (c) 2017, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_GnssAPIClient"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "GnssAPIClient.h"
|
||||
#include <LocDualContext.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out);
|
||||
|
||||
GnssAPIClient::GnssAPIClient(const sp<IGnssCallback>& gpsCb,
|
||||
const sp<IGnssNiCallback>& niCb) :
|
||||
LocationAPIClientBase(),
|
||||
mGnssCbIface(nullptr),
|
||||
mGnssNiCbIface(nullptr),
|
||||
mControlClient(new LocationAPIControlClient()),
|
||||
mLocationCapabilitiesMask(0),
|
||||
mLocationCapabilitiesCached(false)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb);
|
||||
|
||||
// set default LocationOptions.
|
||||
memset(&mLocationOptions, 0, sizeof(LocationOptions));
|
||||
mLocationOptions.size = sizeof(LocationOptions);
|
||||
mLocationOptions.minInterval = 1000;
|
||||
mLocationOptions.minDistance = 0;
|
||||
mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
|
||||
gnssUpdateCallbacks(gpsCb, niCb);
|
||||
}
|
||||
|
||||
GnssAPIClient::~GnssAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
if (mControlClient) {
|
||||
delete mControlClient;
|
||||
mControlClient = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// for GpsInterface
|
||||
void GnssAPIClient::gnssUpdateCallbacks(const sp<IGnssCallback>& gpsCb,
|
||||
const sp<IGnssNiCallback>& niCb)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p %p)", __FUNCTION__, &gpsCb, &niCb);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssCbIface = gpsCb;
|
||||
mGnssNiCbIface = niCb;
|
||||
mMutex.unlock();
|
||||
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
locationCallbacks.trackingCb = [this](Location location) {
|
||||
onTrackingCb(location);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceStatusCb = nullptr;
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
loc_core::ContextBase* context =
|
||||
loc_core::LocDualContext::getLocFgContext(
|
||||
NULL, NULL,
|
||||
loc_core::LocDualContext::mLocationHalName, false);
|
||||
if (mGnssNiCbIface != nullptr && !context->hasAgpsExtendedCapabilities()) {
|
||||
LOC_LOGD("Registering NI CB");
|
||||
locationCallbacks.gnssNiCb = [this](uint32_t id, GnssNiNotification gnssNiNotification) {
|
||||
onGnssNiCb(id, gnssNiNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
locationCallbacks.gnssSvCb = [this](GnssSvNotification gnssSvNotification) {
|
||||
onGnssSvCb(gnssSvNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
if (mGnssCbIface != nullptr) {
|
||||
locationCallbacks.gnssNmeaCb = [this](GnssNmeaNotification gnssNmeaNotification) {
|
||||
onGnssNmeaCb(gnssNmeaNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssStart()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
bool retVal = true;
|
||||
locAPIStartTracking(mLocationOptions);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssStop()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
bool retVal = true;
|
||||
locAPIStopTracking();
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode,
|
||||
IGnss::GnssPositionRecurrence recurrence, uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters, uint32_t preferredTimeMs)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %d %d %d %d)", __FUNCTION__,
|
||||
(int)mode, recurrence, minIntervalMs, preferredAccuracyMeters, preferredTimeMs);
|
||||
bool retVal = true;
|
||||
memset(&mLocationOptions, 0, sizeof(LocationOptions));
|
||||
mLocationOptions.size = sizeof(LocationOptions);
|
||||
mLocationOptions.minInterval = minIntervalMs;
|
||||
mLocationOptions.minDistance = preferredAccuracyMeters;
|
||||
if (mode == IGnss::GnssPositionMode::STANDALONE)
|
||||
mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
else if (mode == IGnss::GnssPositionMode::MS_BASED)
|
||||
mLocationOptions.mode = GNSS_SUPL_MODE_MSB;
|
||||
else if (mode == IGnss::GnssPositionMode::MS_ASSISTED)
|
||||
mLocationOptions.mode = GNSS_SUPL_MODE_MSA;
|
||||
else {
|
||||
LOC_LOGD("%s]: invalid GnssPositionMode: %d", __FUNCTION__, (int)mode);
|
||||
retVal = false;
|
||||
}
|
||||
locAPIUpdateTrackingOptions(mLocationOptions);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
// for GpsNiInterface
|
||||
void GnssAPIClient::gnssNiRespond(int32_t notifId,
|
||||
IGnssNiCallback::GnssUserResponseType userResponse)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d %d)", __FUNCTION__, notifId, static_cast<int>(userResponse));
|
||||
GnssNiResponse data = GNSS_NI_RESPONSE_IGNORE;
|
||||
if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT)
|
||||
data = GNSS_NI_RESPONSE_ACCEPT;
|
||||
else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY)
|
||||
data = GNSS_NI_RESPONSE_DENY;
|
||||
else if (userResponse == IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP)
|
||||
data = GNSS_NI_RESPONSE_NO_RESPONSE;
|
||||
else {
|
||||
LOC_LOGD("%s]: invalid GnssUserResponseType: %d", __FUNCTION__, (int)userResponse);
|
||||
return;
|
||||
}
|
||||
locAPIGnssNiResponse(notifId, data);
|
||||
}
|
||||
|
||||
// these apis using LocationAPIControlClient
|
||||
void GnssAPIClient::gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags)
|
||||
{
|
||||
LOC_LOGD("%s]: (%02hx)", __FUNCTION__, aidingDataFlags);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
GnssAidingData data;
|
||||
memset(&data, 0, sizeof (GnssAidingData));
|
||||
data.sv.svTypeMask = GNSS_AIDING_DATA_SV_TYPE_GPS_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_GLONASS_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_QZSS_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_BEIDOU_BIT |
|
||||
GNSS_AIDING_DATA_SV_TYPE_GALILEO_BIT;
|
||||
|
||||
if (aidingDataFlags == IGnss::GnssAidingData::DELETE_ALL)
|
||||
data.deleteAll = true;
|
||||
else {
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_EPHEMERIS)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_EPHEMERIS_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_ALMANAC)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_ALMANAC_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_POSITION)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_POSITION_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_TIME)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_TIME_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_IONO)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_IONOSPHERE_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_UTC)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_UTC_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_HEALTH)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_HEALTH_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVDIR)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_DIRECTION_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SVSTEER)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_STEER_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_SADATA)
|
||||
data.sv.svMask |= GNSS_AIDING_DATA_SV_SA_DATA_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_RTI)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_RTI_BIT;
|
||||
if (aidingDataFlags & IGnss::GnssAidingData::DELETE_CELLDB_INFO)
|
||||
data.common.mask |= GNSS_AIDING_DATA_COMMON_CELLDB_BIT;
|
||||
}
|
||||
mControlClient->locAPIGnssDeleteAidingData(data);
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssEnable(LocationTechnologyType techType)
|
||||
{
|
||||
LOC_LOGD("%s]: (%0d)", __FUNCTION__, techType);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
mControlClient->locAPIEnable(techType);
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssDisable()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
mControlClient->locAPIDisable();
|
||||
}
|
||||
|
||||
void GnssAPIClient::gnssConfigurationUpdate(const GnssConfig& gnssConfig)
|
||||
{
|
||||
LOC_LOGD("%s]: (%02x)", __FUNCTION__, gnssConfig.flags);
|
||||
if (mControlClient == nullptr) {
|
||||
return;
|
||||
}
|
||||
mControlClient->locAPIGnssUpdateConfig(gnssConfig);
|
||||
}
|
||||
|
||||
void GnssAPIClient::requestCapabilities() {
|
||||
// only send capablities if it's already cached, otherwise the first time LocationAPI
|
||||
// is initialized, capabilities will be sent by LocationAPI
|
||||
if (mLocationCapabilitiesCached) {
|
||||
onCapabilitiesCb(mLocationCapabilitiesMask);
|
||||
}
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void GnssAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask)
|
||||
{
|
||||
LOC_LOGD("%s]: (%02x)", __FUNCTION__, capabilitiesMask);
|
||||
mLocationCapabilitiesMask = capabilitiesMask;
|
||||
mLocationCapabilitiesCached = true;
|
||||
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
uint32_t data = 0;
|
||||
if ((capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT) ||
|
||||
(capabilitiesMask & LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT) ||
|
||||
(capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT) ||
|
||||
(capabilitiesMask & LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT))
|
||||
data |= IGnssCallback::Capabilities::SCHEDULING;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GEOFENCE_BIT)
|
||||
data |= IGnssCallback::Capabilities::GEOFENCING;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT)
|
||||
data |= IGnssCallback::Capabilities::MEASUREMENTS;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSB_BIT)
|
||||
data |= IGnssCallback::Capabilities::MSB;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MSA_BIT)
|
||||
data |= IGnssCallback::Capabilities::MSA;
|
||||
auto r = gnssCbIface->gnssSetCapabilitesCb(data);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetCapabilitesCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
if (gnssCbIface != nullptr) {
|
||||
IGnssCallback::GnssSystemInfo gnssInfo;
|
||||
if (capabilitiesMask & LOCATION_CAPABILITIES_DEBUG_NMEA_BIT) {
|
||||
gnssInfo.yearOfHw = 2017;
|
||||
} else if (capabilitiesMask & LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT) {
|
||||
gnssInfo.yearOfHw = 2016;
|
||||
} else {
|
||||
gnssInfo.yearOfHw = 2015;
|
||||
}
|
||||
LOC_LOGV("%s:%d] set_system_info_cb (%d)", __FUNCTION__, __LINE__, gnssInfo.yearOfHw);
|
||||
auto r = gnssCbIface->gnssSetSystemInfoCb(gnssInfo);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSetSystemInfoCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onTrackingCb(Location location)
|
||||
{
|
||||
LOC_LOGD("%s]: (flags: %02x)", __FUNCTION__, location.flags);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
GnssLocation gnssLocation;
|
||||
convertGnssLocation(location, gnssLocation);
|
||||
auto r = gnssCbIface->gnssLocationCb(gnssLocation);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssLocationCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (id: %d)", __FUNCTION__, id);
|
||||
mMutex.lock();
|
||||
auto gnssNiCbIface(mGnssNiCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssNiCbIface == nullptr) {
|
||||
LOC_LOGE("%s]: mGnssNiCbIface is nullptr", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
IGnssNiCallback::GnssNiNotification notificationGnss = {};
|
||||
|
||||
notificationGnss.notificationId = id;
|
||||
|
||||
if (gnssNiNotification.type == GNSS_NI_TYPE_VOICE)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::VOICE;
|
||||
else if (gnssNiNotification.type == GNSS_NI_TYPE_SUPL)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_SUPL;
|
||||
else if (gnssNiNotification.type == GNSS_NI_TYPE_CONTROL_PLANE)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::UMTS_CTRL_PLANE;
|
||||
else if (gnssNiNotification.type == GNSS_NI_TYPE_EMERGENCY_SUPL)
|
||||
notificationGnss.niType = IGnssNiCallback::GnssNiType::EMERGENCY_SUPL;
|
||||
|
||||
if (gnssNiNotification.options & GNSS_NI_OPTIONS_NOTIFICATION_BIT)
|
||||
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_NOTIFY;
|
||||
if (gnssNiNotification.options & GNSS_NI_OPTIONS_VERIFICATION_BIT)
|
||||
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::NEED_VERIFY;
|
||||
if (gnssNiNotification.options & GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT)
|
||||
notificationGnss.notifyFlags |= IGnssNiCallback::GnssNiNotifyFlags::PRIVACY_OVERRIDE;
|
||||
|
||||
notificationGnss.timeoutSec = gnssNiNotification.timeout;
|
||||
|
||||
if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_ACCEPT)
|
||||
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_ACCEPT;
|
||||
else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_DENY)
|
||||
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_DENY;
|
||||
else if (gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_NO_RESPONSE ||
|
||||
gnssNiNotification.timeoutResponse == GNSS_NI_RESPONSE_IGNORE)
|
||||
notificationGnss.defaultResponse = IGnssNiCallback::GnssUserResponseType::RESPONSE_NORESP;
|
||||
|
||||
notificationGnss.requestorId = gnssNiNotification.requestor;
|
||||
|
||||
notificationGnss.notificationMessage = gnssNiNotification.message;
|
||||
|
||||
if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_NONE)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_NONE;
|
||||
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT;
|
||||
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UTF8)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8;
|
||||
else if (gnssNiNotification.requestorEncoding == GNSS_NI_ENCODING_TYPE_UCS2)
|
||||
notificationGnss.requestorIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2;
|
||||
|
||||
if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_NONE)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_NONE;
|
||||
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_GSM_DEFAULT)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_GSM_DEFAULT;
|
||||
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UTF8)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UTF8;
|
||||
else if (gnssNiNotification.messageEncoding == GNSS_NI_ENCODING_TYPE_UCS2)
|
||||
notificationGnss.notificationIdEncoding =
|
||||
IGnssNiCallback::GnssNiEncodingType::ENC_SUPL_UCS2;
|
||||
|
||||
gnssNiCbIface->niNotifyCb(notificationGnss);
|
||||
}
|
||||
|
||||
void GnssAPIClient::onGnssSvCb(GnssSvNotification gnssSvNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, gnssSvNotification.count);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
IGnssCallback::GnssSvStatus svStatus;
|
||||
convertGnssSvStatus(gnssSvNotification, svStatus);
|
||||
auto r = gnssCbIface->gnssSvStatusCb(svStatus);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssSvStatusCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification)
|
||||
{
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssCbIface != nullptr) {
|
||||
android::hardware::hidl_string nmeaString;
|
||||
nmeaString.setToExternal(gnssNmeaNotification.nmea, gnssNmeaNotification.length);
|
||||
auto r = gnssCbIface->gnssNmeaCb(
|
||||
static_cast<GnssUtcTime>(gnssNmeaNotification.timestamp), nmeaString);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__,
|
||||
gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onStartTrackingCb(LocationError error)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, error);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) {
|
||||
auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_ON);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb ENGINE_ON description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_BEGIN);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb SESSION_BEGIN description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GnssAPIClient::onStopTrackingCb(LocationError error)
|
||||
{
|
||||
LOC_LOGD("%s]: (%d)", __FUNCTION__, error);
|
||||
mMutex.lock();
|
||||
auto gnssCbIface(mGnssCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (error == LOCATION_ERROR_SUCCESS && gnssCbIface != nullptr) {
|
||||
auto r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::SESSION_END);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb SESSION_END description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
r = gnssCbIface->gnssStatusCb(IGnssCallback::GnssStatusValue::ENGINE_OFF);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from gnssStatusCb ENGINE_OFF description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus));
|
||||
out.numSvs = in.count;
|
||||
if (out.numSvs > static_cast<uint32_t>(GnssMax::SVS_COUNT)) {
|
||||
LOC_LOGW("%s]: Too many satellites %zd. Clamps to %d.",
|
||||
__FUNCTION__, out.numSvs, GnssMax::SVS_COUNT);
|
||||
out.numSvs = static_cast<uint32_t>(GnssMax::SVS_COUNT);
|
||||
}
|
||||
for (size_t i = 0; i < out.numSvs; i++) {
|
||||
IGnssCallback::GnssSvInfo& info = out.gnssSvList[i];
|
||||
info.svid = in.gnssSvs[i].svId;
|
||||
convertGnssConstellationType(in.gnssSvs[i].type, info.constellation);
|
||||
info.cN0Dbhz = in.gnssSvs[i].cN0Dbhz;
|
||||
info.elevationDegrees = in.gnssSvs[i].elevation;
|
||||
info.azimuthDegrees = in.gnssSvs[i].azimuth;
|
||||
info.svFlag = static_cast<uint8_t>(IGnssCallback::GnssSvFlags::NONE);
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_EPHEMER_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_EPHEMERIS_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_HAS_ALMANAC_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::HAS_ALMANAC_DATA;
|
||||
if (in.gnssSvs[i].gnssSvOptionsMask & GNSS_SV_OPTIONS_USED_IN_FIX_BIT)
|
||||
info.svFlag |= IGnssCallback::GnssSvFlags::USED_IN_FIX;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
106
gps/android/location_api/GnssAPIClient.h
Normal file
106
gps/android/location_api/GnssAPIClient.h
Normal file
|
@ -0,0 +1,106 @@
|
|||
/* Copyright (c) 2017, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GNSS_API_CLINET_H
|
||||
#define GNSS_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssCallback.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssNiCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::sp;
|
||||
|
||||
class GnssAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
GnssAPIClient(const sp<IGnssCallback>& gpsCb,
|
||||
const sp<IGnssNiCallback>& niCb);
|
||||
virtual ~GnssAPIClient();
|
||||
GnssAPIClient(const GnssAPIClient&) = delete;
|
||||
GnssAPIClient& operator=(const GnssAPIClient&) = delete;
|
||||
|
||||
// for GpsInterface
|
||||
void gnssUpdateCallbacks(const sp<IGnssCallback>& gpsCb,
|
||||
const sp<IGnssNiCallback>& niCb);
|
||||
bool gnssStart();
|
||||
bool gnssStop();
|
||||
bool gnssSetPositionMode(IGnss::GnssPositionMode mode,
|
||||
IGnss::GnssPositionRecurrence recurrence,
|
||||
uint32_t minIntervalMs,
|
||||
uint32_t preferredAccuracyMeters,
|
||||
uint32_t preferredTimeMs);
|
||||
|
||||
// for GpsNiInterface
|
||||
void gnssNiRespond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse);
|
||||
|
||||
// these apis using LocationAPIControlClient
|
||||
void gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags);
|
||||
void gnssEnable(LocationTechnologyType techType);
|
||||
void gnssDisable();
|
||||
void gnssConfigurationUpdate(const GnssConfig& gnssConfig);
|
||||
|
||||
inline LocationCapabilitiesMask gnssGetCapabilities() const {
|
||||
return mLocationCapabilitiesMask;
|
||||
}
|
||||
void requestCapabilities();
|
||||
|
||||
// callbacks we are interested in
|
||||
void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final;
|
||||
void onTrackingCb(Location location) final;
|
||||
void onGnssNiCb(uint32_t id, GnssNiNotification gnssNiNotification) final;
|
||||
void onGnssSvCb(GnssSvNotification gnssSvNotification) final;
|
||||
void onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification) final;
|
||||
|
||||
void onStartTrackingCb(LocationError error) final;
|
||||
void onStopTrackingCb(LocationError error) final;
|
||||
|
||||
private:
|
||||
sp<IGnssCallback> mGnssCbIface;
|
||||
sp<IGnssNiCallback> mGnssNiCbIface;
|
||||
std::mutex mMutex;
|
||||
LocationAPIControlClient* mControlClient;
|
||||
LocationCapabilitiesMask mLocationCapabilitiesMask;
|
||||
bool mLocationCapabilitiesCached;
|
||||
LocationOptions mLocationOptions;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // GNSS_API_CLINET_H
|
153
gps/android/location_api/LocationUtil.cpp
Normal file
153
gps/android/location_api/LocationUtil.cpp
Normal file
|
@ -0,0 +1,153 @@
|
|||
/* Copyright (c) 2017, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <LocationUtil.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void convertGnssLocation(Location& in, GnssLocation& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(GnssLocation));
|
||||
if (in.flags & LOCATION_HAS_LAT_LONG_BIT)
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_LAT_LONG;
|
||||
if (in.flags & LOCATION_HAS_ALTITUDE_BIT)
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_ALTITUDE;
|
||||
if (in.flags & LOCATION_HAS_SPEED_BIT)
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED;
|
||||
if (in.flags & LOCATION_HAS_BEARING_BIT)
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING;
|
||||
if (in.flags & LOCATION_HAS_ACCURACY_BIT)
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_HORIZONTAL_ACCURACY;
|
||||
if (in.flags & LOCATION_HAS_VERTICAL_ACCURACY_BIT)
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_VERTICAL_ACCURACY;
|
||||
if (in.flags & LOCATION_HAS_SPEED_ACCURACY_BIT)
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_SPEED_ACCURACY;
|
||||
if (in.flags & LOCATION_HAS_BEARING_ACCURACY_BIT)
|
||||
out.gnssLocationFlags |= GnssLocationFlags::HAS_BEARING_ACCURACY;
|
||||
out.latitudeDegrees = in.latitude;
|
||||
out.longitudeDegrees = in.longitude;
|
||||
out.altitudeMeters = in.altitude;
|
||||
out.speedMetersPerSec = in.speed;
|
||||
out.bearingDegrees = in.bearing;
|
||||
out.horizontalAccuracyMeters = in.accuracy;
|
||||
out.verticalAccuracyMeters = in.verticalAccuracy;
|
||||
out.speedAccuracyMetersPerSecond = in.speedAccuracy;
|
||||
out.bearingAccuracyDegrees = in.bearingAccuracy;
|
||||
out.timestamp = static_cast<GnssUtcTime>(in.timestamp);
|
||||
}
|
||||
|
||||
void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_SV_TYPE_GPS:
|
||||
out = GnssConstellationType::GPS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_SBAS:
|
||||
out = GnssConstellationType::SBAS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GLONASS:
|
||||
out = GnssConstellationType::GLONASS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_QZSS:
|
||||
out = GnssConstellationType::QZSS;
|
||||
break;
|
||||
case GNSS_SV_TYPE_BEIDOU:
|
||||
out = GnssConstellationType::BEIDOU;
|
||||
break;
|
||||
case GNSS_SV_TYPE_GALILEO:
|
||||
out = GnssConstellationType::GALILEO;
|
||||
break;
|
||||
case GNSS_SV_TYPE_UNKNOWN:
|
||||
default:
|
||||
out = GnssConstellationType::UNKNOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_EPH_TYPE_EPHEMERIS:
|
||||
out = GnssDebug::SatelliteEphemerisType::EPHEMERIS;
|
||||
break;
|
||||
case GNSS_EPH_TYPE_ALMANAC:
|
||||
out = GnssDebug::SatelliteEphemerisType::ALMANAC_ONLY;
|
||||
break;
|
||||
case GNSS_EPH_TYPE_UNKNOWN:
|
||||
default:
|
||||
out = GnssDebug::SatelliteEphemerisType::NOT_AVAILABLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_EPH_SOURCE_DEMODULATED:
|
||||
out = GnssDebug::SatelliteEphemerisSource::DEMODULATED;
|
||||
break;
|
||||
case GNSS_EPH_SOURCE_SUPL_PROVIDED:
|
||||
out = GnssDebug::SatelliteEphemerisSource::SUPL_PROVIDED;
|
||||
break;
|
||||
case GNSS_EPH_SOURCE_OTHER_SERVER_PROVIDED:
|
||||
out = GnssDebug::SatelliteEphemerisSource::OTHER_SERVER_PROVIDED;
|
||||
break;
|
||||
case GNSS_EPH_SOURCE_LOCAL:
|
||||
case GNSS_EPH_SOURCE_UNKNOWN:
|
||||
default:
|
||||
out = GnssDebug::SatelliteEphemerisSource::OTHER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out)
|
||||
{
|
||||
switch(in) {
|
||||
case GNSS_EPH_HEALTH_GOOD:
|
||||
out = GnssDebug::SatelliteEphemerisHealth::GOOD;
|
||||
break;
|
||||
case GNSS_EPH_HEALTH_BAD:
|
||||
out = GnssDebug::SatelliteEphemerisHealth::BAD;
|
||||
break;
|
||||
case GNSS_EPH_HEALTH_UNKNOWN:
|
||||
default:
|
||||
out = GnssDebug::SatelliteEphemerisHealth::UNKNOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
54
gps/android/location_api/LocationUtil.h
Normal file
54
gps/android/location_api/LocationUtil.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
/* Copyright (c) 2017, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOCATION_UTIL_H
|
||||
#define LOCATION_UTIL_H
|
||||
|
||||
#include <android/hardware/gnss/1.0/types.h>
|
||||
#include <LocationAPI.h>
|
||||
#include <GnssDebug.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
void convertGnssLocation(Location& in, GnssLocation& out);
|
||||
void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out);
|
||||
void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out);
|
||||
void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out);
|
||||
void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // LOCATION_UTIL_H
|
263
gps/android/location_api/MeasurementAPIClient.cpp
Normal file
263
gps/android/location_api/MeasurementAPIClient.cpp
Normal file
|
@ -0,0 +1,263 @@
|
|||
/* Copyright (c) 2017, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_MeasurementAPIClient"
|
||||
|
||||
#include <log_util.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#include "LocationUtil.h"
|
||||
#include "MeasurementAPIClient.h"
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
static void convertGnssData(GnssMeasurementsNotification& in,
|
||||
IGnssMeasurementCallback::GnssData& out);
|
||||
static void convertGnssMeasurement(GnssMeasurementsData& in,
|
||||
IGnssMeasurementCallback::GnssMeasurement& out);
|
||||
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out);
|
||||
|
||||
MeasurementAPIClient::MeasurementAPIClient() :
|
||||
mGnssMeasurementCbIface(nullptr),
|
||||
mTracking(false)
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
MeasurementAPIClient::~MeasurementAPIClient()
|
||||
{
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
}
|
||||
|
||||
// for GpsInterface
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus>
|
||||
MeasurementAPIClient::measurementSetCallback(const sp<IGnssMeasurementCallback>& callback)
|
||||
{
|
||||
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
|
||||
|
||||
mMutex.lock();
|
||||
mGnssMeasurementCbIface = callback;
|
||||
mMutex.unlock();
|
||||
|
||||
LocationCallbacks locationCallbacks;
|
||||
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
|
||||
locationCallbacks.size = sizeof(LocationCallbacks);
|
||||
|
||||
locationCallbacks.trackingCb = nullptr;
|
||||
locationCallbacks.batchingCb = nullptr;
|
||||
locationCallbacks.geofenceBreachCb = nullptr;
|
||||
locationCallbacks.geofenceStatusCb = nullptr;
|
||||
locationCallbacks.gnssLocationInfoCb = nullptr;
|
||||
locationCallbacks.gnssNiCb = nullptr;
|
||||
locationCallbacks.gnssSvCb = nullptr;
|
||||
locationCallbacks.gnssNmeaCb = nullptr;
|
||||
|
||||
locationCallbacks.gnssMeasurementsCb = nullptr;
|
||||
if (mGnssMeasurementCbIface != nullptr) {
|
||||
locationCallbacks.gnssMeasurementsCb =
|
||||
[this](GnssMeasurementsNotification gnssMeasurementsNotification) {
|
||||
onGnssMeasurementsCb(gnssMeasurementsNotification);
|
||||
};
|
||||
}
|
||||
|
||||
locAPISetCallbacks(locationCallbacks);
|
||||
LocationOptions options;
|
||||
memset(&options, 0, sizeof(LocationOptions));
|
||||
options.size = sizeof(LocationOptions);
|
||||
options.minInterval = 1000;
|
||||
options.mode = GNSS_SUPL_MODE_STANDALONE;
|
||||
mTracking = true;
|
||||
LOC_LOGD("%s]: start tracking session", __FUNCTION__);
|
||||
locAPIStartTracking(options);
|
||||
|
||||
return IGnssMeasurement::GnssMeasurementStatus::SUCCESS;
|
||||
}
|
||||
|
||||
// for GpsMeasurementInterface
|
||||
void MeasurementAPIClient::measurementClose() {
|
||||
LOC_LOGD("%s]: ()", __FUNCTION__);
|
||||
mTracking = false;
|
||||
locAPIStopTracking();
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void MeasurementAPIClient::onGnssMeasurementsCb(
|
||||
GnssMeasurementsNotification gnssMeasurementsNotification)
|
||||
{
|
||||
LOC_LOGD("%s]: (count: %zu active: %zu)",
|
||||
__FUNCTION__, gnssMeasurementsNotification.count, mTracking);
|
||||
if (mTracking) {
|
||||
mMutex.lock();
|
||||
auto gnssMeasurementCbIface(mGnssMeasurementCbIface);
|
||||
mMutex.unlock();
|
||||
|
||||
if (gnssMeasurementCbIface != nullptr) {
|
||||
IGnssMeasurementCallback::GnssData gnssData;
|
||||
convertGnssData(gnssMeasurementsNotification, gnssData);
|
||||
auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData);
|
||||
if (!r.isOk()) {
|
||||
LOC_LOGE("%s] Error from GnssMeasurementCb description=%s",
|
||||
__func__, r.description().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void convertGnssMeasurement(GnssMeasurementsData& in,
|
||||
IGnssMeasurementCallback::GnssMeasurement& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssMeasurement));
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_SNR;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_FREQUENCY_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_FREQUENCY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_CYCLES_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_CYCLES;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_CARRIER_PHASE_UNCERTAINTY_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_CARRIER_PHASE_UNCERTAINTY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_DATA_AUTOMATIC_GAIN_CONTROL_BIT)
|
||||
out.flags |= IGnssMeasurementCallback::GnssMeasurementFlags::HAS_AUTOMATIC_GAIN_CONTROL;
|
||||
out.svid = in.svId;
|
||||
convertGnssConstellationType(in.svType, out.constellation);
|
||||
out.timeOffsetNs = in.timeOffsetNs;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_CODE_LOCK_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_CODE_LOCK;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BIT_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BIT_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SUBFRAME_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SUBFRAME_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_TOW_DECODED_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_TOW_DECODED;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_MSEC_AMBIGUOUS_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_MSEC_AMBIGUOUS;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SYMBOL_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SYMBOL_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_STRING_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_STRING_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GLO_TOD_DECODED_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GLO_TOD_DECODED;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_BIT_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_BIT_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_BDS_D2_SUBFRAME_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_BDS_D2_SUBFRAME_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1BC_CODE_LOCK_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1BC_CODE_LOCK;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1C_2ND_CODE_LOCK_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1C_2ND_CODE_LOCK;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_GAL_E1B_PAGE_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_GAL_E1B_PAGE_SYNC;
|
||||
if (in.stateMask & GNSS_MEASUREMENTS_STATE_SBAS_SYNC_BIT)
|
||||
out.state |= IGnssMeasurementCallback::GnssMeasurementState::STATE_SBAS_SYNC;
|
||||
out.receivedSvTimeInNs = in.receivedSvTimeNs;
|
||||
out.receivedSvTimeUncertaintyInNs = in.receivedSvTimeUncertaintyNs;
|
||||
out.cN0DbHz = in.carrierToNoiseDbHz;
|
||||
out.pseudorangeRateMps = in.pseudorangeRateMps;
|
||||
out.pseudorangeRateUncertaintyMps = in.pseudorangeRateUncertaintyMps;
|
||||
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_VALID_BIT)
|
||||
out.accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_VALID;
|
||||
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_RESET_BIT)
|
||||
out.accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_RESET;
|
||||
if (in.adrStateMask & GNSS_MEASUREMENTS_ACCUMULATED_DELTA_RANGE_STATE_CYCLE_SLIP_BIT)
|
||||
out.accumulatedDeltaRangeState |=
|
||||
IGnssMeasurementCallback::GnssAccumulatedDeltaRangeState::ADR_STATE_CYCLE_SLIP;
|
||||
out.accumulatedDeltaRangeM = in.adrMeters;
|
||||
out.accumulatedDeltaRangeUncertaintyM = in.adrUncertaintyMeters;
|
||||
out.carrierFrequencyHz = in.carrierFrequencyHz;
|
||||
out.carrierCycles = in.carrierCycles;
|
||||
out.carrierPhase = in.carrierPhase;
|
||||
out.carrierPhaseUncertainty = in.carrierPhaseUncertainty;
|
||||
uint8_t indicator =
|
||||
static_cast<uint8_t>(IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_UNKNOWN);
|
||||
if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_PRESENT)
|
||||
indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATOR_PRESENT;
|
||||
if (in.multipathIndicator & GNSS_MEASUREMENTS_MULTIPATH_INDICATOR_NOT_PRESENT)
|
||||
indicator |= IGnssMeasurementCallback::GnssMultipathIndicator::INDICATIOR_NOT_PRESENT;
|
||||
out.multipathIndicator =
|
||||
static_cast<IGnssMeasurementCallback::GnssMultipathIndicator>(indicator);
|
||||
out.snrDb = in.signalToNoiseRatioDb;
|
||||
out.agcLevelDb = in.agcLevelDb;
|
||||
}
|
||||
|
||||
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out)
|
||||
{
|
||||
memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssClock));
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_LEAP_SECOND_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_LEAP_SECOND;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_TIME_UNCERTAINTY_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_TIME_UNCERTAINTY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_FULL_BIAS_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_FULL_BIAS;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_BIAS_UNCERTAINTY_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_BIAS_UNCERTAINTY;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT;
|
||||
if (in.flags & GNSS_MEASUREMENTS_CLOCK_FLAGS_DRIFT_UNCERTAINTY_BIT)
|
||||
out.gnssClockFlags |= IGnssMeasurementCallback::GnssClockFlags::HAS_DRIFT_UNCERTAINTY;
|
||||
out.leapSecond = in.leapSecond;
|
||||
out.timeNs = in.timeNs;
|
||||
out.timeUncertaintyNs = in.timeUncertaintyNs;
|
||||
out.fullBiasNs = in.fullBiasNs;
|
||||
out.biasNs = in.biasNs;
|
||||
out.biasUncertaintyNs = in.biasUncertaintyNs;
|
||||
out.driftNsps = in.driftNsps;
|
||||
out.driftUncertaintyNsps = in.driftUncertaintyNsps;
|
||||
out.hwClockDiscontinuityCount = in.hwClockDiscontinuityCount;
|
||||
}
|
||||
|
||||
static void convertGnssData(GnssMeasurementsNotification& in,
|
||||
IGnssMeasurementCallback::GnssData& out)
|
||||
{
|
||||
out.measurementCount = in.count;
|
||||
if (out.measurementCount > static_cast<uint32_t>(GnssMax::SVS_COUNT)) {
|
||||
LOC_LOGW("%s]: Too many measurement %zd. Clamps to %d.",
|
||||
__FUNCTION__, out.measurementCount, GnssMax::SVS_COUNT);
|
||||
out.measurementCount = static_cast<uint32_t>(GnssMax::SVS_COUNT);
|
||||
}
|
||||
for (size_t i = 0; i < out.measurementCount; i++) {
|
||||
convertGnssMeasurement(in.measurements[i], out.measurements[i]);
|
||||
}
|
||||
convertGnssClock(in.clock, out.clock);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
75
gps/android/location_api/MeasurementAPIClient.h
Normal file
75
gps/android/location_api/MeasurementAPIClient.h
Normal file
|
@ -0,0 +1,75 @@
|
|||
/* Copyright (c) 2017, 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MEASUREMENT_API_CLINET_H
|
||||
#define MEASUREMENT_API_CLINET_H
|
||||
|
||||
#include <mutex>
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurement.h>
|
||||
#include <android/hardware/gnss/1.0/IGnssMeasurementCallback.h>
|
||||
#include <LocationAPIClientBase.h>
|
||||
#include <hidl/Status.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace gnss {
|
||||
namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::gnss::V1_0::IGnssMeasurement;
|
||||
using ::android::sp;
|
||||
|
||||
class MeasurementAPIClient : public LocationAPIClientBase
|
||||
{
|
||||
public:
|
||||
MeasurementAPIClient();
|
||||
virtual ~MeasurementAPIClient();
|
||||
MeasurementAPIClient(const MeasurementAPIClient&) = delete;
|
||||
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
|
||||
|
||||
// for GpsMeasurementInterface
|
||||
Return<IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback(
|
||||
const sp<IGnssMeasurementCallback>& callback);
|
||||
void measurementClose();
|
||||
|
||||
// callbacks we are interested in
|
||||
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
|
||||
|
||||
private:
|
||||
sp<IGnssMeasurementCallback> mGnssMeasurementCbIface;
|
||||
std::mutex mMutex;
|
||||
bool mTracking;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace gnss
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
#endif // MEASUREMENT_API_CLINET_H
|
31
gps/android/service.cpp
Normal file
31
gps/android/service.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Copyright (c) 2017, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution
|
||||
*/
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "android.hardware.gnss@1.0-service-qti"
|
||||
|
||||
#include <android/hardware/gnss/1.0/IGnss.h>
|
||||
#include <hidl/LegacySupport.h>
|
||||
|
||||
using android::hardware::gnss::V1_0::IGnss;
|
||||
using android::hardware::defaultPassthroughServiceImplementation;
|
||||
|
||||
int main() {
|
||||
return defaultPassthroughServiceImplementation<IGnss>();
|
||||
}
|
61
gps/core/Android.mk
Normal file
61
gps/core/Android.mk
Normal file
|
@ -0,0 +1,61 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libloc_core
|
||||
LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
|
||||
LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
ifeq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET),true)
|
||||
LOCAL_CFLAGS += -DPDK_FEATURE_SET
|
||||
endif
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libutils \
|
||||
libcutils \
|
||||
libgps.utils \
|
||||
libdl \
|
||||
liblog \
|
||||
libloc_pla
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
LocApiBase.cpp \
|
||||
LocAdapterBase.cpp \
|
||||
ContextBase.cpp \
|
||||
LocDualContext.cpp \
|
||||
loc_core_log.cpp \
|
||||
data-items/DataItemsFactoryProxy.cpp \
|
||||
data-items/common/ClientIndex.cpp \
|
||||
data-items/common/DataItemIndex.cpp \
|
||||
data-items/common/IndexFactory.cpp \
|
||||
SystemStatusOsObserver.cpp \
|
||||
SystemStatus.cpp
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
-fno-short-enums \
|
||||
-D_ANDROID_
|
||||
|
||||
LOCAL_C_INCLUDES:= \
|
||||
$(LOCAL_PATH)/data-items \
|
||||
$(LOCAL_PATH)/data-items/common \
|
||||
$(LOCAL_PATH)/observer \
|
||||
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
libgps.utils_headers \
|
||||
libloc_pla_headers \
|
||||
liblocation_api_headers
|
||||
|
||||
LOCAL_CFLAGS += $(GNSS_CFLAGS)
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := libloc_core_headers
|
||||
LOCAL_EXPORT_C_INCLUDE_DIRS := \
|
||||
$(LOCAL_PATH) \
|
||||
$(LOCAL_PATH)/data-items \
|
||||
$(LOCAL_PATH)/data-items/common \
|
||||
$(LOCAL_PATH)/observer
|
||||
include $(BUILD_HEADER_LIBRARY)
|
248
gps/core/ContextBase.cpp
Normal file
248
gps/core/ContextBase.cpp
Normal file
|
@ -0,0 +1,248 @@
|
|||
/* Copyright (c) 2011-2014,2016-2017 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.
|
||||
*
|
||||
*/
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_CtxBase"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <cutils/sched_policy.h>
|
||||
#include <unistd.h>
|
||||
#include <ContextBase.h>
|
||||
#include <msg_q.h>
|
||||
#include <loc_target.h>
|
||||
#include <platform_lib_includes.h>
|
||||
#include <loc_log.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
loc_gps_cfg_s_type ContextBase::mGps_conf {};
|
||||
loc_sap_cfg_s_type ContextBase::mSap_conf {};
|
||||
|
||||
const loc_param_s_type ContextBase::mGps_conf_table[] =
|
||||
{
|
||||
{"GPS_LOCK", &mGps_conf.GPS_LOCK, NULL, 'n'},
|
||||
{"SUPL_VER", &mGps_conf.SUPL_VER, NULL, 'n'},
|
||||
{"LPP_PROFILE", &mGps_conf.LPP_PROFILE, NULL, 'n'},
|
||||
{"A_GLONASS_POS_PROTOCOL_SELECT", &mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
|
||||
{"LPPE_CP_TECHNOLOGY", &mGps_conf.LPPE_CP_TECHNOLOGY, NULL, 'n'},
|
||||
{"LPPE_UP_TECHNOLOGY", &mGps_conf.LPPE_UP_TECHNOLOGY, NULL, 'n'},
|
||||
{"AGPS_CERT_WRITABLE_MASK", &mGps_conf.AGPS_CERT_WRITABLE_MASK, NULL, 'n'},
|
||||
{"SUPL_MODE", &mGps_conf.SUPL_MODE, NULL, 'n'},
|
||||
{"SUPL_ES", &mGps_conf.SUPL_ES, NULL, 'n'},
|
||||
{"INTERMEDIATE_POS", &mGps_conf.INTERMEDIATE_POS, NULL, 'n'},
|
||||
{"ACCURACY_THRES", &mGps_conf.ACCURACY_THRES, NULL, 'n'},
|
||||
{"NMEA_PROVIDER", &mGps_conf.NMEA_PROVIDER, NULL, 'n'},
|
||||
{"CAPABILITIES", &mGps_conf.CAPABILITIES, NULL, 'n'},
|
||||
{"XTRA_VERSION_CHECK", &mGps_conf.XTRA_VERSION_CHECK, NULL, 'n'},
|
||||
{"XTRA_SERVER_1", &mGps_conf.XTRA_SERVER_1, NULL, 's'},
|
||||
{"XTRA_SERVER_2", &mGps_conf.XTRA_SERVER_2, NULL, 's'},
|
||||
{"XTRA_SERVER_3", &mGps_conf.XTRA_SERVER_3, NULL, 's'},
|
||||
{"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'},
|
||||
{"AGPS_CONFIG_INJECT", &mGps_conf.AGPS_CONFIG_INJECT, NULL, 'n'},
|
||||
{"EXTERNAL_DR_ENABLED", &mGps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'},
|
||||
};
|
||||
|
||||
const loc_param_s_type ContextBase::mSap_conf_table[] =
|
||||
{
|
||||
{"GYRO_BIAS_RANDOM_WALK", &mSap_conf.GYRO_BIAS_RANDOM_WALK, &mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'},
|
||||
{"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||
{"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||
{"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||
{"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
|
||||
{"SENSOR_ACCEL_BATCHES_PER_SEC", &mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'},
|
||||
{"SENSOR_ACCEL_SAMPLES_PER_BATCH", &mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'},
|
||||
{"SENSOR_GYRO_BATCHES_PER_SEC", &mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'},
|
||||
{"SENSOR_GYRO_SAMPLES_PER_BATCH", &mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'},
|
||||
{"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'},
|
||||
{"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
|
||||
{"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'},
|
||||
{"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
|
||||
{"SENSOR_CONTROL_MODE", &mSap_conf.SENSOR_CONTROL_MODE, NULL, 'n'},
|
||||
{"SENSOR_USAGE", &mSap_conf.SENSOR_USAGE, NULL, 'n'},
|
||||
{"SENSOR_ALGORITHM_CONFIG_MASK", &mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'},
|
||||
{"SENSOR_PROVIDER", &mSap_conf.SENSOR_PROVIDER, NULL, 'n'}
|
||||
};
|
||||
|
||||
void ContextBase::readConfig()
|
||||
{
|
||||
/*Defaults for gps.conf*/
|
||||
mGps_conf.INTERMEDIATE_POS = 0;
|
||||
mGps_conf.ACCURACY_THRES = 0;
|
||||
mGps_conf.NMEA_PROVIDER = 0;
|
||||
mGps_conf.GPS_LOCK = 0;
|
||||
mGps_conf.SUPL_VER = 0x10000;
|
||||
mGps_conf.SUPL_MODE = 0x1;
|
||||
mGps_conf.SUPL_ES = 0;
|
||||
mGps_conf.CAPABILITIES = 0x7;
|
||||
/* LTE Positioning Profile configuration is disable by default*/
|
||||
mGps_conf.LPP_PROFILE = 0;
|
||||
/*By default no positioning protocol is selected on A-GLONASS system*/
|
||||
mGps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0;
|
||||
/*XTRA version check is disabled by default*/
|
||||
mGps_conf.XTRA_VERSION_CHECK=0;
|
||||
/*Use emergency PDN by default*/
|
||||
mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL = 1;
|
||||
/* By default no LPPe CP technology is enabled*/
|
||||
mGps_conf.LPPE_CP_TECHNOLOGY = 0;
|
||||
/* By default no LPPe UP technology is enabled*/
|
||||
mGps_conf.LPPE_UP_TECHNOLOGY = 0;
|
||||
|
||||
/*Defaults for sap.conf*/
|
||||
mSap_conf.GYRO_BIAS_RANDOM_WALK = 0;
|
||||
mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2;
|
||||
mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5;
|
||||
mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2;
|
||||
mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5;
|
||||
mSap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4;
|
||||
mSap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25;
|
||||
mSap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4;
|
||||
mSap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25;
|
||||
mSap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */
|
||||
mSap_conf.SENSOR_USAGE = 0; /* Enabled */
|
||||
mSap_conf.SENSOR_ALGORITHM_CONFIG_MASK = 0; /* INS Disabled = FALSE*/
|
||||
/* Values MUST be set by OEMs in configuration for sensor-assisted
|
||||
navigation to work. There are NO default values */
|
||||
mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||
mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||
mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||
mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0;
|
||||
mSap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0;
|
||||
mSap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||
mSap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||
mSap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||
mSap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
|
||||
/* default provider is SSC */
|
||||
mSap_conf.SENSOR_PROVIDER = 1;
|
||||
|
||||
/* None of the 10 slots for agps certificates are writable by default */
|
||||
mGps_conf.AGPS_CERT_WRITABLE_MASK = 0;
|
||||
|
||||
/* inject supl config to modem with config values from config.xml or gps.conf, default 1 */
|
||||
mGps_conf.AGPS_CONFIG_INJECT = 1;
|
||||
|
||||
UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table);
|
||||
UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table);
|
||||
}
|
||||
|
||||
uint32_t ContextBase::getCarrierCapabilities() {
|
||||
#define carrierMSA (uint32_t)0x2
|
||||
#define carrierMSB (uint32_t)0x1
|
||||
#define gpsConfMSA (uint32_t)0x4
|
||||
#define gpsConfMSB (uint32_t)0x2
|
||||
uint32_t capabilities = mGps_conf.CAPABILITIES;
|
||||
if ((mGps_conf.SUPL_MODE & carrierMSA) != carrierMSA) {
|
||||
capabilities &= ~gpsConfMSA;
|
||||
}
|
||||
if ((mGps_conf.SUPL_MODE & carrierMSB) != carrierMSB) {
|
||||
capabilities &= ~gpsConfMSB;
|
||||
}
|
||||
|
||||
LOC_LOGV("getCarrierCapabilities: CAPABILITIES %x, SUPL_MODE %x, carrier capabilities %x",
|
||||
mGps_conf.CAPABILITIES, mGps_conf.SUPL_MODE, capabilities);
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
LBSProxyBase* ContextBase::getLBSProxy(const char* libName)
|
||||
{
|
||||
LBSProxyBase* proxy = NULL;
|
||||
LOC_LOGD("%s:%d]: getLBSProxy libname: %s\n", __func__, __LINE__, libName);
|
||||
void* lib = dlopen(libName, RTLD_NOW);
|
||||
|
||||
if ((void*)NULL != lib) {
|
||||
getLBSProxy_t* getter = (getLBSProxy_t*)dlsym(lib, "getLBSProxy");
|
||||
if (NULL != getter) {
|
||||
proxy = (*getter)();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOC_LOGW("%s:%d]: FAILED TO LOAD libname: %s\n", __func__, __LINE__, libName);
|
||||
}
|
||||
if (NULL == proxy) {
|
||||
proxy = new LBSProxyBase();
|
||||
}
|
||||
LOC_LOGD("%s:%d]: Exiting\n", __func__, __LINE__);
|
||||
return proxy;
|
||||
}
|
||||
|
||||
LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
|
||||
{
|
||||
LocApiBase* locApi = NULL;
|
||||
|
||||
// Check the target
|
||||
if (TARGET_NO_GNSS != loc_get_target()){
|
||||
|
||||
if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) {
|
||||
void *handle = NULL;
|
||||
//try to see if LocApiV02 is present
|
||||
if ((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) {
|
||||
LOC_LOGD("%s:%d]: libloc_api_v02.so is present", __func__, __LINE__);
|
||||
getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi");
|
||||
if (getter != NULL) {
|
||||
LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__,
|
||||
__LINE__);
|
||||
locApi = (*getter)(mMsgTask, exMask, this);
|
||||
}
|
||||
}
|
||||
// only RPC is the option now
|
||||
else {
|
||||
LOC_LOGD("%s:%d]: libloc_api_v02.so is NOT present. Trying RPC",
|
||||
__func__, __LINE__);
|
||||
handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW);
|
||||
if (NULL != handle) {
|
||||
getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi");
|
||||
if (NULL != getter) {
|
||||
LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__,
|
||||
__LINE__);
|
||||
locApi = (*getter)(mMsgTask, exMask, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// locApi could still be NULL at this time
|
||||
// we would then create a dummy one
|
||||
if (NULL == locApi) {
|
||||
locApi = new LocApiBase(mMsgTask, exMask, this);
|
||||
}
|
||||
|
||||
return locApi;
|
||||
}
|
||||
|
||||
ContextBase::ContextBase(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
const char* libName) :
|
||||
mLBSProxy(getLBSProxy(libName)),
|
||||
mMsgTask(msgTask),
|
||||
mLocApi(createLocApi(exMask)),
|
||||
mLocApiProxy(mLocApi->getLocApiProxy())
|
||||
{
|
||||
}
|
||||
|
||||
}
|
148
gps/core/ContextBase.h
Normal file
148
gps/core/ContextBase.h
Normal file
|
@ -0,0 +1,148 @@
|
|||
/* Copyright (c) 2011-2017, 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.
|
||||
*
|
||||
*/
|
||||
#ifndef __LOC_CONTEXT_BASE__
|
||||
#define __LOC_CONTEXT_BASE__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <ctype.h>
|
||||
#include <MsgTask.h>
|
||||
#include <LocApiBase.h>
|
||||
#include <LBSProxyBase.h>
|
||||
#include <loc_cfg.h>
|
||||
|
||||
#define MAX_XTRA_SERVER_URL_LENGTH 256
|
||||
|
||||
/* GPS.conf support */
|
||||
/* NOTE: the implementaiton of the parser casts number
|
||||
fields to 32 bit. To ensure all 'n' fields working,
|
||||
they must all be 32 bit fields. */
|
||||
typedef struct loc_gps_cfg_s
|
||||
{
|
||||
uint32_t INTERMEDIATE_POS;
|
||||
uint32_t ACCURACY_THRES;
|
||||
uint32_t SUPL_VER;
|
||||
uint32_t SUPL_MODE;
|
||||
uint32_t SUPL_ES;
|
||||
uint32_t CAPABILITIES;
|
||||
uint32_t LPP_PROFILE;
|
||||
uint32_t XTRA_VERSION_CHECK;
|
||||
char XTRA_SERVER_1[MAX_XTRA_SERVER_URL_LENGTH];
|
||||
char XTRA_SERVER_2[MAX_XTRA_SERVER_URL_LENGTH];
|
||||
char XTRA_SERVER_3[MAX_XTRA_SERVER_URL_LENGTH];
|
||||
uint32_t USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL;
|
||||
uint32_t NMEA_PROVIDER;
|
||||
uint32_t GPS_LOCK;
|
||||
uint32_t A_GLONASS_POS_PROTOCOL_SELECT;
|
||||
uint32_t AGPS_CERT_WRITABLE_MASK;
|
||||
uint32_t AGPS_CONFIG_INJECT;
|
||||
uint32_t LPPE_CP_TECHNOLOGY;
|
||||
uint32_t LPPE_UP_TECHNOLOGY;
|
||||
uint32_t EXTERNAL_DR_ENABLED;
|
||||
} loc_gps_cfg_s_type;
|
||||
|
||||
/* NOTE: the implementaiton of the parser casts number
|
||||
fields to 32 bit. To ensure all 'n' fields working,
|
||||
they must all be 32 bit fields. */
|
||||
/* Meanwhile, *_valid fields are 8 bit fields, and 'f'
|
||||
fields are double. Rigid as they are, it is the
|
||||
the status quo, until the parsing mechanism is
|
||||
change, that is. */
|
||||
typedef struct
|
||||
{
|
||||
uint8_t GYRO_BIAS_RANDOM_WALK_VALID;
|
||||
double GYRO_BIAS_RANDOM_WALK;
|
||||
uint32_t SENSOR_ACCEL_BATCHES_PER_SEC;
|
||||
uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH;
|
||||
uint32_t SENSOR_GYRO_BATCHES_PER_SEC;
|
||||
uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH;
|
||||
uint32_t SENSOR_ACCEL_BATCHES_PER_SEC_HIGH;
|
||||
uint32_t SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH;
|
||||
uint32_t SENSOR_GYRO_BATCHES_PER_SEC_HIGH;
|
||||
uint32_t SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH;
|
||||
uint32_t SENSOR_CONTROL_MODE;
|
||||
uint32_t SENSOR_USAGE;
|
||||
uint32_t SENSOR_ALGORITHM_CONFIG_MASK;
|
||||
uint8_t ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double ACCEL_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double ANGLE_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double RATE_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint8_t VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
|
||||
double VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY;
|
||||
uint32_t SENSOR_PROVIDER;
|
||||
} loc_sap_cfg_s_type;
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
class LocAdapterBase;
|
||||
|
||||
class ContextBase {
|
||||
static LBSProxyBase* getLBSProxy(const char* libName);
|
||||
LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask);
|
||||
static const loc_param_s_type mGps_conf_table[];
|
||||
static const loc_param_s_type mSap_conf_table[];
|
||||
protected:
|
||||
const LBSProxyBase* mLBSProxy;
|
||||
const MsgTask* mMsgTask;
|
||||
LocApiBase* mLocApi;
|
||||
LocApiProxyBase *mLocApiProxy;
|
||||
public:
|
||||
ContextBase(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
const char* libName);
|
||||
inline virtual ~ContextBase() { delete mLocApi; delete mLBSProxy; }
|
||||
|
||||
inline const MsgTask* getMsgTask() { return mMsgTask; }
|
||||
inline LocApiBase* getLocApi() { return mLocApi; }
|
||||
inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; }
|
||||
inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); }
|
||||
inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); }
|
||||
inline bool hasNativeXtraClient() { return mLBSProxy->hasNativeXtraClient(); }
|
||||
inline void modemPowerVote(bool power) const { return mLBSProxy->modemPowerVote(power); }
|
||||
inline void requestUlp(LocAdapterBase* adapter,
|
||||
unsigned long capabilities) {
|
||||
mLBSProxy->requestUlp(adapter, capabilities);
|
||||
}
|
||||
inline IzatDevId_t getIzatDevId() const {
|
||||
return mLBSProxy->getIzatDevId();
|
||||
}
|
||||
inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); }
|
||||
|
||||
static loc_gps_cfg_s_type mGps_conf;
|
||||
static loc_sap_cfg_s_type mSap_conf;
|
||||
|
||||
void readConfig();
|
||||
static uint32_t getCarrierCapabilities();
|
||||
|
||||
};
|
||||
|
||||
} // namespace loc_core
|
||||
|
||||
#endif //__LOC_CONTEXT_BASE__
|
80
gps/core/LBSProxyBase.h
Normal file
80
gps/core/LBSProxyBase.h
Normal file
|
@ -0,0 +1,80 @@
|
|||
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
#ifndef IZAT_PROXY_BASE_H
|
||||
#define IZAT_PROXY_BASE_H
|
||||
#include <gps_extended.h>
|
||||
#include <MsgTask.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
class LocApiBase;
|
||||
class LocAdapterBase;
|
||||
class ContextBase;
|
||||
|
||||
class LBSProxyBase {
|
||||
friend class ContextBase;
|
||||
inline virtual LocApiBase*
|
||||
getLocApi(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
ContextBase* context) const {
|
||||
|
||||
(void)msgTask;
|
||||
(void)exMask;
|
||||
(void)context;
|
||||
return NULL;
|
||||
}
|
||||
protected:
|
||||
inline LBSProxyBase() {}
|
||||
public:
|
||||
inline virtual ~LBSProxyBase() {}
|
||||
inline virtual void requestUlp(LocAdapterBase* adapter,
|
||||
unsigned long capabilities) const {
|
||||
|
||||
(void)adapter;
|
||||
(void)capabilities;
|
||||
}
|
||||
inline virtual bool hasAgpsExtendedCapabilities() const { return false; }
|
||||
inline virtual bool hasCPIExtendedCapabilities() const { return false; }
|
||||
inline virtual void modemPowerVote(bool power) const {
|
||||
|
||||
(void)power;
|
||||
}
|
||||
virtual void injectFeatureConfig(ContextBase* context) const {
|
||||
|
||||
(void)context;
|
||||
}
|
||||
inline virtual bool hasNativeXtraClient() const { return false; }
|
||||
inline virtual IzatDevId_t getIzatDevId() const { return 0; }
|
||||
};
|
||||
|
||||
typedef LBSProxyBase* (getLBSProxy_t)();
|
||||
|
||||
} // namespace loc_core
|
||||
|
||||
#endif // IZAT_PROXY_BASE_H
|
164
gps/core/LocAdapterBase.cpp
Normal file
164
gps/core/LocAdapterBase.cpp
Normal file
|
@ -0,0 +1,164 @@
|
|||
/* Copyright (c) 2011-2014, 2016-2017The 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.
|
||||
*
|
||||
*/
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_LocAdapterBase"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <LocAdapterBase.h>
|
||||
#include <loc_target.h>
|
||||
#include <platform_lib_log_util.h>
|
||||
#include <LocAdapterProxyBase.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
// This is the top level class, so the constructor will
|
||||
// always gets called. Here we prepare for the default.
|
||||
// But if getLocApi(targetEnumType target) is overriden,
|
||||
// the right locApi should get created.
|
||||
LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
ContextBase* context, LocAdapterProxyBase *adapterProxyBase) :
|
||||
mEvtMask(mask), mContext(context),
|
||||
mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase),
|
||||
mMsgTask(context->getMsgTask())
|
||||
{
|
||||
mLocApi->addAdapter(this);
|
||||
}
|
||||
|
||||
uint32_t LocAdapterBase::mSessionIdCounter(1);
|
||||
|
||||
uint32_t LocAdapterBase::generateSessionId()
|
||||
{
|
||||
if (++mSessionIdCounter == 0xFFFFFFFF)
|
||||
mSessionIdCounter = 1;
|
||||
|
||||
return mSessionIdCounter;
|
||||
}
|
||||
|
||||
void LocAdapterBase::handleEngineUpEvent()
|
||||
{
|
||||
if (mLocAdapterProxyBase) {
|
||||
mLocAdapterProxyBase->handleEngineUpEvent();
|
||||
}
|
||||
}
|
||||
|
||||
void LocAdapterBase::handleEngineDownEvent()
|
||||
{
|
||||
if (mLocAdapterProxyBase) {
|
||||
mLocAdapterProxyBase->handleEngineDownEvent();
|
||||
}
|
||||
}
|
||||
|
||||
void LocAdapterBase::
|
||||
reportPositionEvent(const UlpLocation& location,
|
||||
const GpsLocationExtended& locationExtended,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask,
|
||||
bool /*fromUlp*/) {
|
||||
if (mLocAdapterProxyBase != NULL) {
|
||||
mLocAdapterProxyBase->reportPositionEvent((UlpLocation&)location,
|
||||
(GpsLocationExtended&)locationExtended,
|
||||
status,
|
||||
loc_technology_mask);
|
||||
} else {
|
||||
DEFAULT_IMPL()
|
||||
}
|
||||
}
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSvEvent(const GnssSvNotification& /*svNotify*/, bool /*fromUlp*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSvMeasurementEvent(GnssSvMeasurementSet &/*svMeasurementSet*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSvPolynomialEvent(GnssSvPolynomial &/*svPolynomial*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::
|
||||
reportStatus(LocGpsStatusValue /*status*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
|
||||
void LocAdapterBase::
|
||||
reportNmeaEvent(const char* /*nmea*/, size_t /*length*/, bool /*fromUlp*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportXtraServer(const char* /*url1*/, const char* /*url2*/,
|
||||
const char* /*url3*/, const int /*maxlength*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestXtraData()
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestTime()
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestLocation()
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestATL(int /*connHandle*/, LocAGpsType /*agps_type*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
releaseATL(int /*connHandle*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestSuplES(int /*connHandle*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportDataCallOpened()
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportDataCallClosed()
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestNiNotifyEvent(const GnssNiNotification &/*notify*/, const void* /*data*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
void LocAdapterBase::
|
||||
reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& /*measurements*/,
|
||||
int /*msInWeek*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportWwanZppFix(LocGpsLocation &/*zppLoc*/)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
} // namespace loc_core
|
160
gps/core/LocAdapterBase.h
Normal file
160
gps/core/LocAdapterBase.h
Normal file
|
@ -0,0 +1,160 @@
|
|||
/* Copyright (c) 2011-2014, 2016-2017 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.
|
||||
*
|
||||
*/
|
||||
#ifndef LOC_API_ADAPTER_BASE_H
|
||||
#define LOC_API_ADAPTER_BASE_H
|
||||
|
||||
#include <gps_extended.h>
|
||||
#include <UlpProxyBase.h>
|
||||
#include <ContextBase.h>
|
||||
#include <LocationAPI.h>
|
||||
#include <map>
|
||||
|
||||
typedef struct LocationSessionKey {
|
||||
LocationAPI* client;
|
||||
uint32_t id;
|
||||
inline LocationSessionKey(LocationAPI* _client, uint32_t _id) :
|
||||
client(_client), id(_id) {}
|
||||
} LocationSessionKey;
|
||||
inline bool operator <(LocationSessionKey const& left, LocationSessionKey const& right) {
|
||||
return left.id < right.id || (left.id == right.id && left.client < right.client);
|
||||
}
|
||||
inline bool operator ==(LocationSessionKey const& left, LocationSessionKey const& right) {
|
||||
return left.id == right.id && left.client == right.client;
|
||||
}
|
||||
inline bool operator !=(LocationSessionKey const& left, LocationSessionKey const& right) {
|
||||
return left.id != right.id || left.client != right.client;
|
||||
}
|
||||
typedef std::map<LocationSessionKey, LocationOptions> LocationSessionMap;
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
class LocAdapterProxyBase;
|
||||
|
||||
class LocAdapterBase {
|
||||
private:
|
||||
static uint32_t mSessionIdCounter;
|
||||
protected:
|
||||
LOC_API_ADAPTER_EVENT_MASK_T mEvtMask;
|
||||
ContextBase* mContext;
|
||||
LocApiBase* mLocApi;
|
||||
LocAdapterProxyBase* mLocAdapterProxyBase;
|
||||
const MsgTask* mMsgTask;
|
||||
inline LocAdapterBase(const MsgTask* msgTask) :
|
||||
mEvtMask(0), mContext(NULL), mLocApi(NULL),
|
||||
mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {}
|
||||
public:
|
||||
inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); }
|
||||
LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
ContextBase* context, LocAdapterProxyBase *adapterProxyBase = NULL);
|
||||
inline LOC_API_ADAPTER_EVENT_MASK_T
|
||||
checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const {
|
||||
return mEvtMask & mask;
|
||||
}
|
||||
|
||||
inline LOC_API_ADAPTER_EVENT_MASK_T getEvtMask() const {
|
||||
return mEvtMask;
|
||||
}
|
||||
|
||||
inline void sendMsg(const LocMsg* msg) const {
|
||||
mMsgTask->sendMsg(msg);
|
||||
}
|
||||
|
||||
inline void sendMsg(const LocMsg* msg) {
|
||||
mMsgTask->sendMsg(msg);
|
||||
}
|
||||
|
||||
inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event,
|
||||
loc_registration_mask_status status)
|
||||
{
|
||||
switch(status) {
|
||||
case (LOC_REGISTRATION_MASK_ENABLED):
|
||||
mEvtMask = mEvtMask | event;
|
||||
break;
|
||||
case (LOC_REGISTRATION_MASK_DISABLED):
|
||||
mEvtMask = mEvtMask &~ event;
|
||||
break;
|
||||
case (LOC_REGISTRATION_MASK_SET):
|
||||
mEvtMask = event;
|
||||
break;
|
||||
}
|
||||
mLocApi->updateEvtMask();
|
||||
}
|
||||
|
||||
inline bool isFeatureSupported(uint8_t featureVal) {
|
||||
return mLocApi->isFeatureSupported(featureVal);
|
||||
}
|
||||
|
||||
uint32_t generateSessionId();
|
||||
|
||||
// This will be overridden by the individual adapters
|
||||
// if necessary.
|
||||
inline virtual void setUlpProxyCommand(UlpProxyBase* ulp) {
|
||||
|
||||
(void)ulp;
|
||||
}
|
||||
virtual void handleEngineUpEvent();
|
||||
virtual void handleEngineDownEvent();
|
||||
inline virtual void setPositionModeCommand(LocPosMode& posMode) {
|
||||
|
||||
(void)posMode;
|
||||
}
|
||||
virtual void startTrackingCommand() {}
|
||||
virtual void stopTrackingCommand() {}
|
||||
virtual void getZppCommand() {}
|
||||
virtual void reportPositionEvent(const UlpLocation& location,
|
||||
const GpsLocationExtended& locationExtended,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask,
|
||||
bool fromUlp=false);
|
||||
virtual void reportSvEvent(const GnssSvNotification& svNotify, bool fromUlp=false);
|
||||
virtual void reportNmeaEvent(const char* nmea, size_t length, bool fromUlp=false);
|
||||
virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet);
|
||||
virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial);
|
||||
virtual void reportStatus(LocGpsStatusValue status);
|
||||
virtual bool reportXtraServer(const char* url1, const char* url2,
|
||||
const char* url3, const int maxlength);
|
||||
virtual bool requestXtraData();
|
||||
virtual bool requestTime();
|
||||
virtual bool requestLocation();
|
||||
virtual bool requestATL(int connHandle, LocAGpsType agps_type);
|
||||
virtual bool releaseATL(int connHandle);
|
||||
virtual bool requestSuplES(int connHandle);
|
||||
virtual bool reportDataCallOpened();
|
||||
virtual bool reportDataCallClosed();
|
||||
virtual bool requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* data);
|
||||
inline virtual bool isInSession() { return false; }
|
||||
ContextBase* getContext() const { return mContext; }
|
||||
virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements,
|
||||
int msInWeek);
|
||||
virtual bool reportWwanZppFix(LocGpsLocation &zppLoc);
|
||||
};
|
||||
|
||||
} // namespace loc_core
|
||||
|
||||
#endif //LOC_API_ADAPTER_BASE_H
|
78
gps/core/LocAdapterProxyBase.h
Normal file
78
gps/core/LocAdapterProxyBase.h
Normal file
|
@ -0,0 +1,78 @@
|
|||
/* Copyright (c) 2014, 2016-2017 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LOC_ADAPTER_PROXY_BASE_H
|
||||
#define LOC_ADAPTER_PROXY_BASE_H
|
||||
|
||||
#include <ContextBase.h>
|
||||
#include <gps_extended.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
class LocAdapterProxyBase {
|
||||
private:
|
||||
LocAdapterBase *mLocAdapterBase;
|
||||
protected:
|
||||
inline LocAdapterProxyBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
ContextBase* context):
|
||||
mLocAdapterBase(new LocAdapterBase(mask, context, this)) {
|
||||
}
|
||||
inline virtual ~LocAdapterProxyBase() {
|
||||
delete mLocAdapterBase;
|
||||
}
|
||||
inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event,
|
||||
loc_registration_mask_status isEnabled) {
|
||||
mLocAdapterBase->updateEvtMask(event,isEnabled);
|
||||
}
|
||||
|
||||
inline uint32_t generateSessionId() {
|
||||
return mLocAdapterBase->generateSessionId();
|
||||
}
|
||||
public:
|
||||
inline ContextBase* getContext() const {
|
||||
return mLocAdapterBase->getContext();
|
||||
}
|
||||
|
||||
inline virtual void handleEngineUpEvent() {};
|
||||
inline virtual void handleEngineDownEvent() {};
|
||||
inline virtual void reportPositionEvent(UlpLocation &location,
|
||||
GpsLocationExtended &locationExtended,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask) {
|
||||
|
||||
(void)location;
|
||||
(void)locationExtended;
|
||||
(void)status;
|
||||
(void)loc_technology_mask;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace loc_core
|
||||
|
||||
#endif //LOC_ADAPTER_PROXY_BASE_H
|
608
gps/core/LocApiBase.cpp
Normal file
608
gps/core/LocApiBase.cpp
Normal file
|
@ -0,0 +1,608 @@
|
|||
/* Copyright (c) 2011-2014, 2016-2017 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.
|
||||
*
|
||||
*/
|
||||
#define LOG_NDEBUG 0 //Define to enable LOGV
|
||||
#define LOG_TAG "LocSvc_LocApiBase"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <inttypes.h>
|
||||
#include <LocApiBase.h>
|
||||
#include <LocAdapterBase.h>
|
||||
#include <platform_lib_log_util.h>
|
||||
#include <LocDualContext.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
#define TO_ALL_LOCADAPTERS(call) TO_ALL_ADAPTERS(mLocAdapters, (call))
|
||||
#define TO_1ST_HANDLING_LOCADAPTERS(call) TO_1ST_HANDLING_ADAPTER(mLocAdapters, (call))
|
||||
|
||||
int hexcode(char *hexstring, int string_size,
|
||||
const char *data, int data_size)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < data_size; i++)
|
||||
{
|
||||
char ch = data[i];
|
||||
if (i*2 + 3 <= string_size)
|
||||
{
|
||||
snprintf(&hexstring[i*2], 3, "%02X", ch);
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
int decodeAddress(char *addr_string, int string_size,
|
||||
const char *data, int data_size)
|
||||
{
|
||||
const char addr_prefix = 0x91;
|
||||
int i, idxOutput = 0;
|
||||
|
||||
if (!data || !addr_string) { return 0; }
|
||||
|
||||
if (data[0] != addr_prefix)
|
||||
{
|
||||
LOC_LOGW("decodeAddress: address prefix is not 0x%x but 0x%x", addr_prefix, data[0]);
|
||||
addr_string[0] = '\0';
|
||||
return 0; // prefix not correct
|
||||
}
|
||||
|
||||
for (i = 1; i < data_size; i++)
|
||||
{
|
||||
unsigned char ch = data[i], low = ch & 0x0F, hi = ch >> 4;
|
||||
if (low <= 9 && idxOutput < string_size - 1) { addr_string[idxOutput++] = low + '0'; }
|
||||
if (hi <= 9 && idxOutput < string_size - 1) { addr_string[idxOutput++] = hi + '0'; }
|
||||
}
|
||||
|
||||
addr_string[idxOutput] = '\0'; // Terminates the string
|
||||
|
||||
return idxOutput;
|
||||
}
|
||||
|
||||
struct LocSsrMsg : public LocMsg {
|
||||
LocApiBase* mLocApi;
|
||||
inline LocSsrMsg(LocApiBase* locApi) :
|
||||
LocMsg(), mLocApi(locApi)
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mLocApi->close();
|
||||
mLocApi->open(mLocApi->getEvtMask());
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("LocSsrMsg");
|
||||
}
|
||||
inline virtual void log() const {
|
||||
locallog();
|
||||
}
|
||||
};
|
||||
|
||||
struct LocOpenMsg : public LocMsg {
|
||||
LocApiBase* mLocApi;
|
||||
LOC_API_ADAPTER_EVENT_MASK_T mMask;
|
||||
inline LocOpenMsg(LocApiBase* locApi,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T mask) :
|
||||
LocMsg(), mLocApi(locApi), mMask(mask)
|
||||
{
|
||||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mLocApi->open(mMask);
|
||||
}
|
||||
inline void locallog() const {
|
||||
LOC_LOGV("%s:%d]: LocOpen Mask: %x\n",
|
||||
__func__, __LINE__, mMask);
|
||||
}
|
||||
inline virtual void log() const {
|
||||
locallog();
|
||||
}
|
||||
};
|
||||
|
||||
LocApiBase::LocApiBase(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
|
||||
ContextBase* context) :
|
||||
mMsgTask(msgTask), mContext(context), mSupportedMsg(0),
|
||||
mMask(0), mExcludedMask(excludedMask)
|
||||
{
|
||||
memset(mLocAdapters, 0, sizeof(mLocAdapters));
|
||||
memset(mFeaturesSupported, 0, sizeof(mFeaturesSupported));
|
||||
}
|
||||
|
||||
LOC_API_ADAPTER_EVENT_MASK_T LocApiBase::getEvtMask()
|
||||
{
|
||||
LOC_API_ADAPTER_EVENT_MASK_T mask = 0;
|
||||
|
||||
TO_ALL_LOCADAPTERS(mask |= mLocAdapters[i]->getEvtMask());
|
||||
|
||||
return mask & ~mExcludedMask;
|
||||
}
|
||||
|
||||
bool LocApiBase::isInSession()
|
||||
{
|
||||
bool inSession = false;
|
||||
|
||||
for (int i = 0;
|
||||
!inSession && i < MAX_ADAPTERS && NULL != mLocAdapters[i];
|
||||
i++) {
|
||||
inSession = mLocAdapters[i]->isInSession();
|
||||
}
|
||||
|
||||
return inSession;
|
||||
}
|
||||
|
||||
void LocApiBase::addAdapter(LocAdapterBase* adapter)
|
||||
{
|
||||
for (int i = 0; i < MAX_ADAPTERS && mLocAdapters[i] != adapter; i++) {
|
||||
if (mLocAdapters[i] == NULL) {
|
||||
mLocAdapters[i] = adapter;
|
||||
mMsgTask->sendMsg(new LocOpenMsg(this,
|
||||
(adapter->getEvtMask())));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LocApiBase::removeAdapter(LocAdapterBase* adapter)
|
||||
{
|
||||
for (int i = 0;
|
||||
i < MAX_ADAPTERS && NULL != mLocAdapters[i];
|
||||
i++) {
|
||||
if (mLocAdapters[i] == adapter) {
|
||||
mLocAdapters[i] = NULL;
|
||||
|
||||
// shift the rest of the adapters up so that the pointers
|
||||
// in the array do not have holes. This should be more
|
||||
// performant, because the array maintenance is much much
|
||||
// less frequent than event handlings, which need to linear
|
||||
// search all the adapters
|
||||
int j = i;
|
||||
while (++i < MAX_ADAPTERS && mLocAdapters[i] != NULL);
|
||||
|
||||
// i would be MAX_ADAPTERS or point to a NULL
|
||||
i--;
|
||||
// i now should point to a none NULL adapter within valid
|
||||
// range although i could be equal to j, but it won't hurt.
|
||||
// No need to check it, as it gains nothing.
|
||||
mLocAdapters[j] = mLocAdapters[i];
|
||||
// this makes sure that we exit the for loop
|
||||
mLocAdapters[i] = NULL;
|
||||
|
||||
// if we have an empty list of adapters
|
||||
if (0 == i) {
|
||||
close();
|
||||
} else {
|
||||
// else we need to remove the bit
|
||||
mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LocApiBase::updateEvtMask()
|
||||
{
|
||||
mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask()));
|
||||
}
|
||||
|
||||
void LocApiBase::handleEngineUpEvent()
|
||||
{
|
||||
// This will take care of renegotiating the loc handle
|
||||
mMsgTask->sendMsg(new LocSsrMsg(this));
|
||||
|
||||
LocDualContext::injectFeatureConfig(mContext);
|
||||
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineUpEvent());
|
||||
}
|
||||
|
||||
void LocApiBase::handleEngineDownEvent()
|
||||
{
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->handleEngineDownEvent());
|
||||
}
|
||||
|
||||
void LocApiBase::reportPosition(UlpLocation& location,
|
||||
GpsLocationExtended& locationExtended,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask)
|
||||
{
|
||||
// print the location info before delivering
|
||||
LOC_LOGD("flags: %d\n source: %d\n latitude: %f\n longitude: %f\n "
|
||||
"altitude: %f\n speed: %f\n bearing: %f\n accuracy: %f\n "
|
||||
"timestamp: %" PRId64 "\n rawDataSize: %d\n rawData: %p\n "
|
||||
"Session status: %d\n Technology mask: %u\n "
|
||||
"SV used in fix (gps/glo/bds/gal/qzss) : \
|
||||
(%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 "/%" PRIx64 ")",
|
||||
location.gpsLocation.flags, location.position_source,
|
||||
location.gpsLocation.latitude, location.gpsLocation.longitude,
|
||||
location.gpsLocation.altitude, location.gpsLocation.speed,
|
||||
location.gpsLocation.bearing, location.gpsLocation.accuracy,
|
||||
location.gpsLocation.timestamp, location.rawDataSize,
|
||||
location.rawData, status, loc_technology_mask,
|
||||
locationExtended.gnss_sv_used_ids.gps_sv_used_ids_mask,
|
||||
locationExtended.gnss_sv_used_ids.glo_sv_used_ids_mask,
|
||||
locationExtended.gnss_sv_used_ids.bds_sv_used_ids_mask,
|
||||
locationExtended.gnss_sv_used_ids.gal_sv_used_ids_mask,
|
||||
locationExtended.gnss_sv_used_ids.qzss_sv_used_ids_mask);
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(
|
||||
mLocAdapters[i]->reportPositionEvent(location, locationExtended,
|
||||
status, loc_technology_mask)
|
||||
);
|
||||
}
|
||||
|
||||
void LocApiBase::reportWwanZppFix(LocGpsLocation &zppLoc)
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc));
|
||||
}
|
||||
|
||||
void LocApiBase::reportSv(GnssSvNotification& svNotify)
|
||||
{
|
||||
const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS",
|
||||
"QZSS", "BEIDOU", "GALILEO" };
|
||||
|
||||
// print the SV info before delivering
|
||||
LOC_LOGV("num sv: %zu\n"
|
||||
" sv: constellation svid cN0"
|
||||
" elevation azimuth flags",
|
||||
svNotify.count);
|
||||
for (size_t i = 0; i < svNotify.count && i < LOC_GNSS_MAX_SVS; i++) {
|
||||
if (svNotify.gnssSvs[i].type >
|
||||
sizeof(constellationString) / sizeof(constellationString[0]) - 1) {
|
||||
svNotify.gnssSvs[i].type = GNSS_SV_TYPE_UNKNOWN;
|
||||
}
|
||||
LOC_LOGV(" %03zu: %*s %02d %f %f %f 0x%02X",
|
||||
i,
|
||||
13,
|
||||
constellationString[svNotify.gnssSvs[i].type],
|
||||
svNotify.gnssSvs[i].svId,
|
||||
svNotify.gnssSvs[i].cN0Dbhz,
|
||||
svNotify.gnssSvs[i].elevation,
|
||||
svNotify.gnssSvs[i].azimuth,
|
||||
svNotify.gnssSvs[i].gnssSvOptionsMask);
|
||||
}
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(
|
||||
mLocAdapters[i]->reportSvEvent(svNotify)
|
||||
);
|
||||
}
|
||||
|
||||
void LocApiBase::reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet)
|
||||
{
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(
|
||||
mLocAdapters[i]->reportSvMeasurementEvent(svMeasurementSet)
|
||||
);
|
||||
}
|
||||
|
||||
void LocApiBase::reportSvPolynomial(GnssSvPolynomial &svPolynomial)
|
||||
{
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(
|
||||
mLocAdapters[i]->reportSvPolynomialEvent(svPolynomial)
|
||||
);
|
||||
}
|
||||
|
||||
void LocApiBase::reportStatus(LocGpsStatusValue status)
|
||||
{
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportStatus(status));
|
||||
}
|
||||
|
||||
void LocApiBase::reportNmea(const char* nmea, int length)
|
||||
{
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportNmeaEvent(nmea, length));
|
||||
}
|
||||
|
||||
void LocApiBase::reportXtraServer(const char* url1, const char* url2,
|
||||
const char* url3, const int maxlength)
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportXtraServer(url1, url2, url3, maxlength));
|
||||
|
||||
}
|
||||
|
||||
void LocApiBase::requestXtraData()
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestXtraData());
|
||||
}
|
||||
|
||||
void LocApiBase::requestTime()
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestTime());
|
||||
}
|
||||
|
||||
void LocApiBase::requestLocation()
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestLocation());
|
||||
}
|
||||
|
||||
void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type)
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type));
|
||||
}
|
||||
|
||||
void LocApiBase::releaseATL(int connHandle)
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->releaseATL(connHandle));
|
||||
}
|
||||
|
||||
void LocApiBase::requestSuplES(int connHandle)
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestSuplES(connHandle));
|
||||
}
|
||||
|
||||
void LocApiBase::reportDataCallOpened()
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallOpened());
|
||||
}
|
||||
|
||||
void LocApiBase::reportDataCallClosed()
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallClosed());
|
||||
}
|
||||
|
||||
void LocApiBase::requestNiNotify(GnssNiNotification ¬ify, const void* data)
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotifyEvent(notify, data));
|
||||
}
|
||||
|
||||
void LocApiBase::saveSupportedMsgList(uint64_t supportedMsgList)
|
||||
{
|
||||
mSupportedMsg = supportedMsgList;
|
||||
}
|
||||
|
||||
void LocApiBase::saveSupportedFeatureList(uint8_t *featureList)
|
||||
{
|
||||
memcpy((void *)mFeaturesSupported, (void *)featureList, sizeof(mFeaturesSupported));
|
||||
}
|
||||
|
||||
void* LocApiBase :: getSibling()
|
||||
DEFAULT_IMPL(NULL)
|
||||
|
||||
LocApiProxyBase* LocApiBase :: getLocApiProxy()
|
||||
DEFAULT_IMPL(NULL)
|
||||
|
||||
void LocApiBase::reportGnssMeasurementData(GnssMeasurementsNotification& measurements,
|
||||
int msInWeek)
|
||||
{
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementDataEvent(measurements, msInWeek));
|
||||
}
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
open(LOC_API_ADAPTER_EVENT_MASK_T /*mask*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
close()
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
startFix(const LocPosMode& /*posMode*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
stopFix()
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
LocationError LocApiBase::
|
||||
deleteAidingData(const GnssAidingData& /*data*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
enableData(int /*enable*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setAPN(char* /*apn*/, int /*len*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
injectPosition(double /*latitude*/, double /*longitude*/, float /*accuracy*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setXtraData(char* /*data*/, int /*length*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
requestXtraServer()
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/,
|
||||
AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
atlCloseStatus(int /*handle*/, int /*is_succ*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setPositionMode(const LocPosMode& /*posMode*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
LocationError LocApiBase::
|
||||
setServer(const char* /*url*/, int /*len*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
LocationError LocApiBase::
|
||||
setServer(unsigned int /*ip*/, int /*port*/, LocServerType /*type*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
LocationError LocApiBase::
|
||||
informNiResponse(GnssNiResponse /*userResponse*/, const void* /*passThroughData*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
LocationError LocApiBase::
|
||||
setSUPLVersion(GnssConfigSuplVersion /*version*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setNMEATypes (uint32_t /*typesMask*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
LocationError LocApiBase::
|
||||
setLPPConfig(GnssConfigLppProfile /*profile*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setSensorControlConfig(int /*sensorUsage*/,
|
||||
int /*sensorProvider*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setSensorProperties(bool /*gyroBiasVarianceRandomWalk_valid*/,
|
||||
float /*gyroBiasVarianceRandomWalk*/,
|
||||
bool /*accelBiasVarianceRandomWalk_valid*/,
|
||||
float /*accelBiasVarianceRandomWalk*/,
|
||||
bool /*angleBiasVarianceRandomWalk_valid*/,
|
||||
float /*angleBiasVarianceRandomWalk*/,
|
||||
bool /*rateBiasVarianceRandomWalk_valid*/,
|
||||
float /*rateBiasVarianceRandomWalk*/,
|
||||
bool /*velocityBiasVarianceRandomWalk_valid*/,
|
||||
float /*velocityBiasVarianceRandomWalk*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setSensorPerfControlConfig(int /*controlMode*/,
|
||||
int /*accelSamplesPerBatch*/,
|
||||
int /*accelBatchesPerSec*/,
|
||||
int /*gyroSamplesPerBatch*/,
|
||||
int /*gyroBatchesPerSec*/,
|
||||
int /*accelSamplesPerBatchHigh*/,
|
||||
int /*accelBatchesPerSecHigh*/,
|
||||
int /*gyroSamplesPerBatchHigh*/,
|
||||
int /*gyroBatchesPerSecHigh*/,
|
||||
int /*algorithmConfig*/)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
LocationError LocApiBase::
|
||||
setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask /*aGlonassProtocol*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
LocationError LocApiBase::
|
||||
setLPPeProtocolCp(GnssConfigLppeControlPlaneMask /*lppeCP*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
LocationError LocApiBase::
|
||||
setLPPeProtocolUp(GnssConfigLppeUserPlaneMask /*lppeUP*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
getWwanZppFix()
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
getBestAvailableZppFix(LocGpsLocation& zppLoc)
|
||||
{
|
||||
memset(&zppLoc, 0, sizeof(zppLoc));
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
}
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended,
|
||||
LocPosTechMask & tech_mask)
|
||||
{
|
||||
memset(&zppLoc, 0, sizeof(zppLoc));
|
||||
memset(&tech_mask, 0, sizeof(tech_mask));
|
||||
memset(&locationExtended, 0, sizeof (locationExtended));
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
}
|
||||
|
||||
int LocApiBase::
|
||||
initDataServiceClient(bool /*isDueToSsr*/)
|
||||
DEFAULT_IMPL(-1)
|
||||
|
||||
int LocApiBase::
|
||||
openAndStartDataCall()
|
||||
DEFAULT_IMPL(-1)
|
||||
|
||||
void LocApiBase::
|
||||
stopDataCall()
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocApiBase::
|
||||
closeDataCall()
|
||||
DEFAULT_IMPL()
|
||||
|
||||
void LocApiBase::
|
||||
releaseDataServiceClient()
|
||||
DEFAULT_IMPL()
|
||||
|
||||
LocationError LocApiBase::
|
||||
setGpsLock(GnssConfigGpsLock /*lock*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
void LocApiBase::
|
||||
installAGpsCert(const LocDerEncodedCertificate* /*pData*/,
|
||||
size_t /*length*/,
|
||||
uint32_t /*slotBitMask*/)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
int LocApiBase::
|
||||
getGpsLock()
|
||||
DEFAULT_IMPL(-1)
|
||||
|
||||
LocationError LocApiBase::
|
||||
setXtraVersionCheck(uint32_t /*check*/)
|
||||
DEFAULT_IMPL(LOCATION_ERROR_SUCCESS)
|
||||
|
||||
bool LocApiBase::
|
||||
gnssConstellationConfig()
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocApiBase::
|
||||
isFeatureSupported(uint8_t featureVal)
|
||||
{
|
||||
uint8_t arrayIndex = featureVal >> 3;
|
||||
uint8_t bitPos = featureVal & 7;
|
||||
|
||||
if (arrayIndex >= MAX_FEATURE_LENGTH) return false;
|
||||
return ((mFeaturesSupported[arrayIndex] >> bitPos ) & 0x1);
|
||||
}
|
||||
|
||||
} // namespace loc_core
|
266
gps/core/LocApiBase.h
Normal file
266
gps/core/LocApiBase.h
Normal file
|
@ -0,0 +1,266 @@
|
|||
/* Copyright (c) 2011-2014, 2016-2017 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.
|
||||
*
|
||||
*/
|
||||
#ifndef LOC_API_BASE_H
|
||||
#define LOC_API_BASE_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <ctype.h>
|
||||
#include <gps_extended.h>
|
||||
#include <LocationAPI.h>
|
||||
#include <MsgTask.h>
|
||||
#include <platform_lib_log_util.h>
|
||||
|
||||
namespace loc_core {
|
||||
class ContextBase;
|
||||
|
||||
int hexcode(char *hexstring, int string_size,
|
||||
const char *data, int data_size);
|
||||
int decodeAddress(char *addr_string, int string_size,
|
||||
const char *data, int data_size);
|
||||
|
||||
#define MAX_ADAPTERS 10
|
||||
#define MAX_FEATURE_LENGTH 100
|
||||
|
||||
#define TO_ALL_ADAPTERS(adapters, call) \
|
||||
for (int i = 0; i < MAX_ADAPTERS && NULL != (adapters)[i]; i++) { \
|
||||
call; \
|
||||
}
|
||||
|
||||
#define TO_1ST_HANDLING_ADAPTER(adapters, call) \
|
||||
for (int i = 0; i <MAX_ADAPTERS && NULL != (adapters)[i] && !(call); i++);
|
||||
|
||||
enum xtra_version_check {
|
||||
DISABLED,
|
||||
AUTO,
|
||||
XTRA2,
|
||||
XTRA3
|
||||
};
|
||||
|
||||
class LocAdapterBase;
|
||||
struct LocSsrMsg;
|
||||
struct LocOpenMsg;
|
||||
|
||||
class LocApiProxyBase {
|
||||
public:
|
||||
inline LocApiProxyBase() {}
|
||||
inline virtual ~LocApiProxyBase() {}
|
||||
inline virtual void* getSibling2() { return NULL; }
|
||||
};
|
||||
|
||||
class LocApiBase {
|
||||
friend struct LocSsrMsg;
|
||||
//LocOpenMsg calls open() which makes it necessary to declare
|
||||
//it as a friend
|
||||
friend struct LocOpenMsg;
|
||||
friend class ContextBase;
|
||||
const MsgTask* mMsgTask;
|
||||
ContextBase *mContext;
|
||||
LocAdapterBase* mLocAdapters[MAX_ADAPTERS];
|
||||
uint64_t mSupportedMsg;
|
||||
uint8_t mFeaturesSupported[MAX_FEATURE_LENGTH];
|
||||
|
||||
protected:
|
||||
virtual enum loc_api_adapter_err
|
||||
open(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
||||
virtual enum loc_api_adapter_err
|
||||
close();
|
||||
LOC_API_ADAPTER_EVENT_MASK_T getEvtMask();
|
||||
LOC_API_ADAPTER_EVENT_MASK_T mMask;
|
||||
LocApiBase(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T excludedMask,
|
||||
ContextBase* context = NULL);
|
||||
inline virtual ~LocApiBase() { close(); }
|
||||
bool isInSession();
|
||||
const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask;
|
||||
|
||||
public:
|
||||
inline void sendMsg(const LocMsg* msg) const {
|
||||
mMsgTask->sendMsg(msg);
|
||||
}
|
||||
void addAdapter(LocAdapterBase* adapter);
|
||||
void removeAdapter(LocAdapterBase* adapter);
|
||||
|
||||
// upward calls
|
||||
void handleEngineUpEvent();
|
||||
void handleEngineDownEvent();
|
||||
void reportPosition(UlpLocation& location,
|
||||
GpsLocationExtended& locationExtended,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask =
|
||||
LOC_POS_TECH_MASK_DEFAULT);
|
||||
void reportSv(GnssSvNotification& svNotify);
|
||||
void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
||||
void reportSvPolynomial(GnssSvPolynomial &svPolynomial);
|
||||
void reportStatus(LocGpsStatusValue status);
|
||||
void reportNmea(const char* nmea, int length);
|
||||
void reportXtraServer(const char* url1, const char* url2,
|
||||
const char* url3, const int maxlength);
|
||||
void requestXtraData();
|
||||
void requestTime();
|
||||
void requestLocation();
|
||||
void requestATL(int connHandle, LocAGpsType agps_type);
|
||||
void releaseATL(int connHandle);
|
||||
void requestSuplES(int connHandle);
|
||||
void reportDataCallOpened();
|
||||
void reportDataCallClosed();
|
||||
void requestNiNotify(GnssNiNotification ¬ify, const void* data);
|
||||
void saveSupportedMsgList(uint64_t supportedMsgList);
|
||||
void reportGnssMeasurementData(GnssMeasurementsNotification& measurements, int msInWeek);
|
||||
void saveSupportedFeatureList(uint8_t *featureList);
|
||||
void reportWwanZppFix(LocGpsLocation &zppLoc);
|
||||
|
||||
// downward calls
|
||||
// All below functions are to be defined by adapter specific modules:
|
||||
// RPC, QMI, etc. The default implementation is empty.
|
||||
|
||||
virtual void* getSibling();
|
||||
virtual LocApiProxyBase* getLocApiProxy();
|
||||
virtual enum loc_api_adapter_err
|
||||
startFix(const LocPosMode& posMode);
|
||||
virtual enum loc_api_adapter_err
|
||||
stopFix();
|
||||
virtual LocationError
|
||||
deleteAidingData(const GnssAidingData& data);
|
||||
virtual enum loc_api_adapter_err
|
||||
enableData(int enable);
|
||||
virtual enum loc_api_adapter_err
|
||||
setAPN(char* apn, int len);
|
||||
virtual enum loc_api_adapter_err
|
||||
injectPosition(double latitude, double longitude, float accuracy);
|
||||
virtual enum loc_api_adapter_err
|
||||
setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||
virtual enum loc_api_adapter_err
|
||||
setXtraData(char* data, int length);
|
||||
virtual enum loc_api_adapter_err
|
||||
requestXtraServer();
|
||||
virtual enum loc_api_adapter_err
|
||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, LocAGpsType agpsType);
|
||||
virtual enum loc_api_adapter_err
|
||||
atlCloseStatus(int handle, int is_succ);
|
||||
virtual enum loc_api_adapter_err
|
||||
setPositionMode(const LocPosMode& posMode);
|
||||
virtual LocationError
|
||||
setServer(const char* url, int len);
|
||||
virtual LocationError
|
||||
setServer(unsigned int ip, int port,
|
||||
LocServerType type);
|
||||
virtual LocationError
|
||||
informNiResponse(GnssNiResponse userResponse, const void* passThroughData);
|
||||
virtual LocationError setSUPLVersion(GnssConfigSuplVersion version);
|
||||
virtual enum loc_api_adapter_err
|
||||
setNMEATypes (uint32_t typesMask);
|
||||
virtual LocationError setLPPConfig(GnssConfigLppProfile profile);
|
||||
virtual enum loc_api_adapter_err
|
||||
setSensorControlConfig(int sensorUsage, int sensorProvider);
|
||||
virtual enum loc_api_adapter_err
|
||||
setSensorProperties(bool gyroBiasVarianceRandomWalk_valid,
|
||||
float gyroBiasVarianceRandomWalk,
|
||||
bool accelBiasVarianceRandomWalk_valid,
|
||||
float accelBiasVarianceRandomWalk,
|
||||
bool angleBiasVarianceRandomWalk_valid,
|
||||
float angleBiasVarianceRandomWalk,
|
||||
bool rateBiasVarianceRandomWalk_valid,
|
||||
float rateBiasVarianceRandomWalk,
|
||||
bool velocityBiasVarianceRandomWalk_valid,
|
||||
float velocityBiasVarianceRandomWalk);
|
||||
virtual enum loc_api_adapter_err
|
||||
setSensorPerfControlConfig(int controlMode,
|
||||
int accelSamplesPerBatch,
|
||||
int accelBatchesPerSec,
|
||||
int gyroSamplesPerBatch,
|
||||
int gyroBatchesPerSec,
|
||||
int accelSamplesPerBatchHigh,
|
||||
int accelBatchesPerSecHigh,
|
||||
int gyroSamplesPerBatchHigh,
|
||||
int gyroBatchesPerSecHigh,
|
||||
int algorithmConfig);
|
||||
virtual LocationError
|
||||
setAGLONASSProtocol(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol);
|
||||
virtual LocationError setLPPeProtocolCp(GnssConfigLppeControlPlaneMask lppeCP);
|
||||
virtual LocationError setLPPeProtocolUp(GnssConfigLppeUserPlaneMask lppeUP);
|
||||
virtual enum loc_api_adapter_err
|
||||
getWwanZppFix();
|
||||
virtual enum loc_api_adapter_err
|
||||
getBestAvailableZppFix(LocGpsLocation & zppLoc);
|
||||
virtual enum loc_api_adapter_err
|
||||
getBestAvailableZppFix(LocGpsLocation & zppLoc, GpsLocationExtended & locationExtended,
|
||||
LocPosTechMask & tech_mask);
|
||||
virtual int initDataServiceClient(bool isDueToSsr);
|
||||
virtual int openAndStartDataCall();
|
||||
virtual void stopDataCall();
|
||||
virtual void closeDataCall();
|
||||
virtual void releaseDataServiceClient();
|
||||
virtual void installAGpsCert(const LocDerEncodedCertificate* pData,
|
||||
size_t length,
|
||||
uint32_t slotBitMask);
|
||||
inline virtual void setInSession(bool inSession) {
|
||||
|
||||
(void)inSession;
|
||||
}
|
||||
inline bool isMessageSupported (LocCheckingMessagesID msgID) const {
|
||||
|
||||
// confirm if msgID is not larger than the number of bits in
|
||||
// mSupportedMsg
|
||||
if ((uint64_t)msgID > (sizeof(mSupportedMsg) << 3)) {
|
||||
return false;
|
||||
} else {
|
||||
uint32_t messageChecker = 1 << msgID;
|
||||
return (messageChecker & mSupportedMsg) == messageChecker;
|
||||
}
|
||||
}
|
||||
|
||||
void updateEvtMask();
|
||||
|
||||
virtual LocationError setGpsLock(GnssConfigGpsLock lock);
|
||||
/*
|
||||
Returns
|
||||
Current value of GPS Lock on success
|
||||
-1 on failure
|
||||
*/
|
||||
virtual int getGpsLock(void);
|
||||
|
||||
virtual LocationError setXtraVersionCheck(uint32_t check);
|
||||
/*
|
||||
Check if the modem support the service
|
||||
*/
|
||||
virtual bool gnssConstellationConfig();
|
||||
|
||||
/*
|
||||
Check if a feature is supported
|
||||
*/
|
||||
bool isFeatureSupported(uint8_t featureVal);
|
||||
};
|
||||
|
||||
typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask,
|
||||
ContextBase *context);
|
||||
|
||||
} // namespace loc_core
|
||||
|
||||
#endif //LOC_API_BASE_H
|
150
gps/core/LocDualContext.cpp
Normal file
150
gps/core/LocDualContext.cpp
Normal file
|
@ -0,0 +1,150 @@
|
|||
/* Copyright (c) 2011-2014, 2016-2017 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.
|
||||
*
|
||||
*/
|
||||
#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "LocSvc_DualCtx"
|
||||
|
||||
#include <cutils/sched_policy.h>
|
||||
#include <unistd.h>
|
||||
#include <LocDualContext.h>
|
||||
#include <msg_q.h>
|
||||
#include <platform_lib_log_util.h>
|
||||
#include <loc_log.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
// nothing exclude for foreground
|
||||
const LOC_API_ADAPTER_EVENT_MASK_T
|
||||
LocDualContext::mFgExclMask = 0;
|
||||
// excluded events for background clients
|
||||
const LOC_API_ADAPTER_EVENT_MASK_T
|
||||
LocDualContext::mBgExclMask =
|
||||
(LOC_API_ADAPTER_BIT_SATELLITE_REPORT |
|
||||
LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT |
|
||||
LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT |
|
||||
LOC_API_ADAPTER_BIT_IOCTL_REPORT |
|
||||
LOC_API_ADAPTER_BIT_STATUS_REPORT |
|
||||
LOC_API_ADAPTER_BIT_GEOFENCE_GEN_ALERT |
|
||||
LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT);
|
||||
|
||||
const MsgTask* LocDualContext::mMsgTask = NULL;
|
||||
ContextBase* LocDualContext::mFgContext = NULL;
|
||||
ContextBase* LocDualContext::mBgContext = NULL;
|
||||
ContextBase* LocDualContext::mInjectContext = NULL;
|
||||
// the name must be shorter than 15 chars
|
||||
const char* LocDualContext::mLocationHalName = "Loc_hal_worker";
|
||||
#ifndef USE_GLIB
|
||||
const char* LocDualContext::mLBSLibName = "liblbs_core.so";
|
||||
#else
|
||||
const char* LocDualContext::mLBSLibName = "liblbs_core.so.1";
|
||||
#endif
|
||||
|
||||
pthread_mutex_t LocDualContext::mGetLocContextMutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
const MsgTask* LocDualContext::getMsgTask(LocThread::tCreate tCreator,
|
||||
const char* name, bool joinable)
|
||||
{
|
||||
if (NULL == mMsgTask) {
|
||||
mMsgTask = new MsgTask(tCreator, name, joinable);
|
||||
}
|
||||
return mMsgTask;
|
||||
}
|
||||
|
||||
inline
|
||||
const MsgTask* LocDualContext::getMsgTask(const char* name, bool joinable) {
|
||||
return getMsgTask((LocThread::tCreate)NULL, name, joinable);
|
||||
}
|
||||
|
||||
ContextBase* LocDualContext::getLocFgContext(LocThread::tCreate tCreator,
|
||||
LocMsg* firstMsg, const char* name, bool joinable)
|
||||
{
|
||||
pthread_mutex_lock(&LocDualContext::mGetLocContextMutex);
|
||||
LOC_LOGD("%s:%d]: querying ContextBase with tCreator", __func__, __LINE__);
|
||||
if (NULL == mFgContext) {
|
||||
LOC_LOGD("%s:%d]: creating msgTask with tCreator", __func__, __LINE__);
|
||||
const MsgTask* msgTask = getMsgTask(tCreator, name, joinable);
|
||||
mFgContext = new LocDualContext(msgTask,
|
||||
mFgExclMask);
|
||||
}
|
||||
if(NULL == mInjectContext) {
|
||||
LOC_LOGD("%s:%d]: mInjectContext is FgContext", __func__, __LINE__);
|
||||
mInjectContext = mFgContext;
|
||||
injectFeatureConfig(mInjectContext);
|
||||
}
|
||||
pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex);
|
||||
|
||||
if (firstMsg) {
|
||||
mFgContext->sendMsg(firstMsg);
|
||||
}
|
||||
|
||||
return mFgContext;
|
||||
}
|
||||
|
||||
ContextBase* LocDualContext::getLocBgContext(LocThread::tCreate tCreator,
|
||||
LocMsg* firstMsg, const char* name, bool joinable)
|
||||
{
|
||||
pthread_mutex_lock(&LocDualContext::mGetLocContextMutex);
|
||||
LOC_LOGD("%s:%d]: querying ContextBase with tCreator", __func__, __LINE__);
|
||||
if (NULL == mBgContext) {
|
||||
LOC_LOGD("%s:%d]: creating msgTask with tCreator", __func__, __LINE__);
|
||||
const MsgTask* msgTask = getMsgTask(tCreator, name, joinable);
|
||||
mBgContext = new LocDualContext(msgTask,
|
||||
mBgExclMask);
|
||||
}
|
||||
if(NULL == mInjectContext) {
|
||||
LOC_LOGD("%s:%d]: mInjectContext is BgContext", __func__, __LINE__);
|
||||
mInjectContext = mBgContext;
|
||||
injectFeatureConfig(mInjectContext);
|
||||
}
|
||||
pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex);
|
||||
|
||||
if (firstMsg) {
|
||||
mBgContext->sendMsg(firstMsg);
|
||||
}
|
||||
|
||||
return mBgContext;
|
||||
}
|
||||
|
||||
void LocDualContext :: injectFeatureConfig(ContextBase *curContext)
|
||||
{
|
||||
LOC_LOGD("%s:%d]: Enter", __func__, __LINE__);
|
||||
if(curContext == mInjectContext) {
|
||||
LOC_LOGD("%s:%d]: Calling LBSProxy (%p) to inject feature config",
|
||||
__func__, __LINE__, ((LocDualContext *)mInjectContext)->mLBSProxy);
|
||||
((LocDualContext *)mInjectContext)->mLBSProxy->injectFeatureConfig(curContext);
|
||||
}
|
||||
LOC_LOGD("%s:%d]: Exit", __func__, __LINE__);
|
||||
}
|
||||
|
||||
LocDualContext::LocDualContext(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask) :
|
||||
ContextBase(msgTask, exMask, mLBSLibName)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
76
gps/core/LocDualContext.h
Normal file
76
gps/core/LocDualContext.h
Normal file
|
@ -0,0 +1,76 @@
|
|||
/* Copyright (c) 2011-2014, 2017 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.
|
||||
*
|
||||
*/
|
||||
#ifndef __LOC_ENG_CONTEXT__
|
||||
#define __LOC_ENG_CONTEXT__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <ctype.h>
|
||||
#include <dlfcn.h>
|
||||
#include <ContextBase.h>
|
||||
|
||||
namespace loc_core {
|
||||
|
||||
class LocDualContext : public ContextBase {
|
||||
static const MsgTask* mMsgTask;
|
||||
static ContextBase* mFgContext;
|
||||
static ContextBase* mBgContext;
|
||||
static ContextBase* mInjectContext;
|
||||
static const MsgTask* getMsgTask(LocThread::tCreate tCreator,
|
||||
const char* name, bool joinable = true);
|
||||
static const MsgTask* getMsgTask(const char* name, bool joinable = true);
|
||||
static pthread_mutex_t mGetLocContextMutex;
|
||||
|
||||
protected:
|
||||
LocDualContext(const MsgTask* msgTask,
|
||||
LOC_API_ADAPTER_EVENT_MASK_T exMask);
|
||||
inline virtual ~LocDualContext() {}
|
||||
|
||||
public:
|
||||
static const char* mLBSLibName;
|
||||
static const LOC_API_ADAPTER_EVENT_MASK_T mFgExclMask;
|
||||
static const LOC_API_ADAPTER_EVENT_MASK_T mBgExclMask;
|
||||
static const char* mLocationHalName;
|
||||
|
||||
static ContextBase* getLocFgContext(LocThread::tCreate tCreator, LocMsg* firstMsg,
|
||||
const char* name, bool joinable = true);
|
||||
inline static ContextBase* getLocFgContext(const char* name, bool joinable = true) {
|
||||
return getLocFgContext(NULL, NULL, name, joinable);
|
||||
}
|
||||
static ContextBase* getLocBgContext(LocThread::tCreate tCreator, LocMsg* firstMsg,
|
||||
const char* name, bool joinable = true);
|
||||
inline static ContextBase* getLocBgContext(const char* name, bool joinable = true) {
|
||||
return getLocBgContext(NULL, NULL, name, joinable);
|
||||
}
|
||||
|
||||
static void injectFeatureConfig(ContextBase *context);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //__LOC_ENG_CONTEXT__
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue