aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpegelius <spegelius@gmail.com>2014-09-12 17:55:34 +0300
committerSpegelius <spegelius@gmail.com>2014-09-16 21:03:18 +0300
commit089b564fa48bfc746df1eeaac0c6f47a6cd0c054 (patch)
tree5c206f356677e9c54591bc7d0335bfa359693b4c
parent646034a63fb3ade2ba21c0164cde51add6ad5e40 (diff)
Moved stuff to jf-common
- jactive addition created need for common ancestor for jflte and jactive - most of previous version of jflte is now jf-common Change-Id: Ie0f420d3597ef3d88f5f76d6b08cae8b39c81f74
-rw-r--r--Android.mk38
-rw-r--r--BoardConfig.mk162
-rw-r--r--README4
-rw-r--r--audio/audio_policy.conf102
-rw-r--r--audio/snd_soc_msm_2x_Fusion35115
-rw-r--r--bluetooth/bcm4335_prepatch.hcdbin70 -> 0 bytes
-rw-r--r--bluetooth/bdroid_buildcfg.h26
-rw-r--r--bluetooth/vnd_jf.txt14
-rw-r--r--camera/Android.mk18
-rw-r--r--camera/CameraWrapper.cpp638
-rw-r--r--cm.dependencies8
-rw-r--r--cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java51
-rw-r--r--cmhw/org/cyanogenmod/hardware/KeyDisabler.java64
-rw-r--r--configs/egl.cfg2
-rw-r--r--configs/libnfc-brcm.conf350
-rw-r--r--configs/media_codecs.xml148
-rw-r--r--configs/media_profiles.xml594
-rw-r--r--configs/nfcee_access.xml10
-rw-r--r--configs/thermal-engine.conf38
-rw-r--r--configs/thermald.conf92
-rw-r--r--consumerir/Android.mk28
-rw-r--r--consumerir/consumerir.c133
-rw-r--r--device-proprietary-files.txt29
-rw-r--r--device.mk190
-rwxr-xr-xextract-files.sh53
-rw-r--r--gps/Android.mk27
-rw-r--r--gps/CleanSpec.mk50
-rw-r--r--gps/core/Android.mk51
-rw-r--r--gps/core/ContextBase.cpp114
-rw-r--r--gps/core/ContextBase.h69
-rw-r--r--gps/core/LBSProxyBase.h60
-rw-r--r--gps/core/LocAdapterBase.cpp119
-rw-r--r--gps/core/LocAdapterBase.h105
-rw-r--r--gps/core/LocApiBase.cpp476
-rw-r--r--gps/core/LocApiBase.h222
-rw-r--r--gps/core/LocDualContext.cpp134
-rw-r--r--gps/core/LocDualContext.h72
-rw-r--r--gps/core/MsgTask.cpp147
-rw-r--r--gps/core/MsgTask.h67
-rw-r--r--gps/core/UlpProxyBase.h74
-rw-r--r--gps/core/gps_extended.h92
-rw-r--r--gps/core/gps_extended_c.h349
-rw-r--r--gps/core/loc_core_log.cpp258
-rw-r--r--gps/core/loc_core_log.h58
-rw-r--r--gps/etc/Android.mk12
-rw-r--r--gps/etc/gps.conf79
-rw-r--r--gps/etc/sap.conf42
-rw-r--r--gps/loc_api/Android.mk13
-rw-r--r--gps/loc_api/NOTICE13
-rw-r--r--gps/loc_api/libloc_api_50001/Android.mk101
-rw-r--r--gps/loc_api/libloc_api_50001/LocEngAdapter.cpp304
-rw-r--r--gps/loc_api/libloc_api_50001/LocEngAdapter.h303
-rw-r--r--gps/loc_api/libloc_api_50001/Makefile.am76
-rw-r--r--gps/loc_api/libloc_api_50001/gps.c72
-rw-r--r--gps/loc_api/libloc_api_50001/loc.cpp889
-rw-r--r--gps/loc_api/libloc_api_50001/loc.h66
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng.cpp2609
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng.h242
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_agps.cpp970
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_agps.h419
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp270
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h59
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c223
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h51
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c214
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h50
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp237
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h106
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c399
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h74
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_log.cpp35
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_log.h44
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_msg.h296
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_ni.cpp414
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_ni.h59
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp833
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_nmea.h42
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp167
-rw-r--r--gps/loc_api/libloc_api_50001/loc_eng_xtra.h47
-rw-r--r--gps/platform_lib_abstractions/elapsed_millis_since_boot.cpp46
-rw-r--r--gps/platform_lib_abstractions/platform_lib_includes.h35
-rw-r--r--gps/platform_lib_abstractions/platform_lib_macros.h81
-rw-r--r--gps/platform_lib_abstractions/platform_lib_time.h35
-rw-r--r--gps/utils/Android.mk60
-rw-r--r--gps/utils/Makefile.am44
-rw-r--r--gps/utils/linked_list.c328
-rw-r--r--gps/utils/linked_list.h217
-rw-r--r--gps/utils/loc_cfg.cpp300
-rw-r--r--gps/utils/loc_cfg.h84
-rw-r--r--gps/utils/loc_log.cpp234
-rw-r--r--gps/utils/loc_log.h68
-rw-r--r--gps/utils/loc_misc_utils.cpp114
-rw-r--r--gps/utils/loc_misc_utils.h99
-rw-r--r--gps/utils/loc_target.cpp237
-rw-r--r--gps/utils/loc_target.h75
-rw-r--r--gps/utils/loc_timer.c186
-rw-r--r--gps/utils/loc_timer.h63
-rw-r--r--gps/utils/log_util.h181
-rw-r--r--gps/utils/msg_q.c336
-rw-r--r--gps/utils/msg_q.h207
-rw-r--r--gps/utils/sec_gps.c12
-rw-r--r--include/device_perms.h23
-rw-r--r--include/hardware/gps.h966
-rw-r--r--init/Android.mk10
-rw-r--r--init/init_jflte.c165
-rw-r--r--keylayout/Button_Jack.kl1
-rw-r--r--keylayout/atmel_mxt_ts.kl30
-rw-r--r--keylayout/gpio-keys.kl31
-rw-r--r--keylayout/philips_remote_ir.kl63
-rw-r--r--keylayout/samsung_remote_ir.kl62
-rw-r--r--keylayout/sec_touchkey.kl4
-rw-r--r--keylayout/ue_rf4ce_remote.kl68
-rw-r--r--liblights/Android.mk31
-rw-r--r--liblights/NOTICE190
-rw-r--r--liblights/lights.c360
-rw-r--r--overlay/frameworks/base/core/res/res/values/config.xml284
-rw-r--r--overlay/frameworks/base/core/res/res/xml/power_profile.xml56
-rw-r--r--overlay/frameworks/base/core/res/res/xml/storage_list.xml53
-rw-r--r--overlay/frameworks/base/packages/SettingsProvider/res/values/config.xml23
-rw-r--r--overlay/frameworks/base/packages/SystemUI/res/values/config.xml28
-rw-r--r--overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml23
-rw-r--r--overlay/packages/apps/Camera2/res/values/config.xml25
-rw-r--r--overlay/packages/apps/Camera2/res/values/qcomstrings.xml25
-rw-r--r--overlay/packages/apps/Settings/res/values/bools.xml20
-rw-r--r--overlay/packages/apps/Settings/res/values/config.xml25
-rw-r--r--overlay/packages/apps/Torch/res/values/config.xml33
-rw-r--r--overlay/packages/services/Telephony/res/values/config.xml33
-rw-r--r--proprietary-files.txt220
-rw-r--r--releasetools/Android.mk47
-rw-r--r--releasetools/LICENSE25
-rw-r--r--releasetools/loki-recovery.sh48
-rw-r--r--releasetools/loki.h88
-rw-r--r--releasetools/loki.sh28
-rw-r--r--releasetools/loki_bootloaders8
-rw-r--r--releasetools/loki_find.c91
-rw-r--r--releasetools/loki_flash.c145
-rw-r--r--releasetools/loki_main.c56
-rw-r--r--releasetools/loki_patch.c670
-rw-r--r--releasetools/loki_unlok.c152
-rw-r--r--releasetools/releasetools.py39
-rw-r--r--rootdir/Android.mk58
-rw-r--r--rootdir/etc/fstab.qcom16
-rw-r--r--rootdir/etc/init.carrier.rc50
-rw-r--r--rootdir/etc/init.crda.sh34
-rw-r--r--rootdir/etc/init.qcom.rc807
-rw-r--r--rootdir/etc/init.qcom.usb.rc724
-rw-r--r--rootdir/etc/init.target.rc360
-rw-r--r--rootdir/etc/ueventd.qcom.rc174
-rw-r--r--sepolicy/app.te3
-rw-r--r--sepolicy/bluetooth.te1
-rw-r--r--sepolicy/device.te17
-rw-r--r--sepolicy/domain.te1
-rw-r--r--sepolicy/drmserver.te3
-rw-r--r--sepolicy/file.te11
-rw-r--r--sepolicy/file_contexts33
-rw-r--r--sepolicy/hci_init.te6
-rw-r--r--sepolicy/healthd.te1
-rw-r--r--sepolicy/init.te1
-rw-r--r--sepolicy/init_shell.te6
-rw-r--r--sepolicy/keystore.te3
-rw-r--r--sepolicy/kickstart.te5
-rw-r--r--sepolicy/mediaserver.te13
-rw-r--r--sepolicy/nfc.te1
-rw-r--r--sepolicy/rild.te5
-rw-r--r--sepolicy/surfaceflinger.te9
-rw-r--r--sepolicy/system.te10
-rw-r--r--sepolicy/ueventd.te6
-rw-r--r--sepolicy/wpa.te2
-rw-r--r--sepolicy/wpa_socket.te1
-rw-r--r--system.prop62
-rw-r--r--wifi/p2p_supplicant_overlay.conf1
-rw-r--r--wifi/wpa_supplicant_overlay.conf2
172 files changed, 43 insertions, 29955 deletions
diff --git a/Android.mk b/Android.mk
index ead2562..227c0e6 100644
--- a/Android.mk
+++ b/Android.mk
@@ -26,42 +26,4 @@ ifeq ($(TARGET_DEVICE),jflte)
include $(call all-makefiles-under,$(LOCAL_PATH))
-include $(CLEAR_VARS)
-
-# Create /firmware-mdm links
-FIRMWARE_MDM_IMAGES := \
- acdb.mbn \
- apps.mbn \
- dsp1.mbn dsp2.mbn dsp3.mbn \
- efs1.mbn efs2.mbn efs3.mbn \
- mdm_acdb.img \
- rpm.mbn \
- sbl1.mbn \
- sbl2.mbn
-
-FIRMWARE_MDM_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(FIRMWARE_MDM_IMAGES)))
-$(FIRMWARE_MDM_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
- @echo "Firmware link: $@"
- @mkdir -p $(dir $@)
- @rm -rf $@
- $(hide) ln -sf /firmware-mdm/image/$(notdir $@) $@
-
-ALL_DEFAULT_INSTALLED_MODULES += $(FIRMWARE_MDM_SYMLINKS)
-
-
-# Create /firmware links
-FIRMWARE_IMAGES := \
- q6.b00 q6.b01 q6.b03 q6.b04 q6.b05 q6.b06 q6.mdt \
- tzapps.b00 tzapps.b01 tzapps.b02 tzapps.b03 tzapps.mdt \
- vidc.b00 vidc.b01 vidc.b02 vidc.b03 vidc.mdt
-
-FIRMWARE_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(FIRMWARE_IMAGES)))
-$(FIRMWARE_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
- @echo "Firmware link: $@"
- @mkdir -p $(dir $@)
- @rm -rf $@
- $(hide) ln -sf /firmware/image/$(notdir $@) $@
-
-ALL_DEFAULT_INSTALLED_MODULES += $(FIRMWARE_SYMLINKS)
-
endif
diff --git a/BoardConfig.mk b/BoardConfig.mk
index d84efa2..fbeb005 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -20,165 +20,11 @@
# definition file).
#
-# inherit from qcom-common
--include device/samsung/qcom-common/BoardConfigCommon.mk
+# inherit from common JF
+include device/samsung/jf-common/BoardConfigCommon.mk
-TARGET_SPECIFIC_HEADER_PATH := device/samsung/jflte/include
-
-# Platform
-TARGET_BOARD_PLATFORM := msm8960
-TARGET_BOARD_PLATFORM_GPU := qcom-adreno200
-
-# Architecture
-TARGET_CPU_VARIANT := krait
-
-# Bootloader
-TARGET_BOOTLOADER_BOARD_NAME := MSM8960
+# inherit from the proprietary version
+-include vendor/samsung/jflte/BoardConfigVendor.mk
# Assert
TARGET_OTA_ASSERT_DEVICE := jflte,jfltexx,i9505,GT-I9505,jgedlte,i9505g,GT-I9505G,jfltevzw,jfltespr,jflterefreshspr,jfltetmo,jfltecri,jfltecsp,jflteatt,jfltecan,jflteusc,jfltezm
-
-# Kernel
-BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom user_debug=31 zcache msm_rtb.filter=0x3F ehci-hcd.park=3
-BOARD_KERNEL_BASE := 0x80200000
-BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x02000000
-BOARD_KERNEL_PAGESIZE := 2048
-TARGET_KERNEL_CONFIG := cyanogen_jf_defconfig
-TARGET_KERNEL_SOURCE := kernel/samsung/jf
-
-# Audio
-BOARD_HAVE_AUDIENCE_ES325_2MIC := true
-BOARD_HAVE_DOCK_USBAUDIO := true
-BOARD_HAVE_SAMSUNG_AUDIO := true
-BOARD_HAVE_SAMSUNG_CSDCLIENT := true
-BOARD_USES_ALSA_AUDIO := true
-BOARD_USES_FLUENCE_INCALL := true
-BOARD_USES_FLUENCE_FOR_VOIP := true
-BOARD_USES_LEGACY_ALSA_AUDIO := true
-BOARD_USES_SEPERATED_AUDIO_INPUT := true
-BOARD_USES_SEPERATED_HEADSET_MIC := true
-BOARD_USES_SEPERATED_VOICE_SPEAKER := true
-BOARD_USES_SEPERATED_VOIP := true
-TARGET_QCOM_AUDIO_VARIANT := caf
-TARGET_USES_QCOM_COMPRESSED_AUDIO := true
-
-# Bluetooth
-BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/samsung/jflte/bluetooth
-BOARD_BLUEDROID_VENDOR_CONF := device/samsung/jflte/bluetooth/vnd_jf.txt
-BOARD_BLUETOOTH_USES_HCIATTACH_PROPERTY := false
-BOARD_HAVE_BLUETOOTH := true
-BOARD_HAVE_BLUETOOTH_BCM := true
-
-# Camera
-COMMON_GLOBAL_CFLAGS += -DSAMSUNG_CAMERA_HARDWARE
-TARGET_PROVIDES_CAMERA_HAL := true
-USE_DEVICE_SPECIFIC_CAMERA := true
-
-# Charger
-BOARD_BATTERY_DEVICE_NAME := "battery"
-BOARD_CHARGING_CMDLINE_NAME := "androidboot.bootchg"
-BOARD_CHARGING_CMDLINE_VALUE := "true"
-
-# CMHW
-BOARD_HARDWARE_CLASS += device/samsung/jflte/cmhw
-
-# Display
-BOARD_EGL_CFG := device/samsung/jflte/configs/egl.cfg
-COMMON_GLOBAL_CFLAGS += -DNEW_ION_API
-OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
-TARGET_DISPLAY_USE_RETIRE_FENCE := true
-TARGET_NO_INITLOGO := true
-TARGET_QCOM_DISPLAY_VARIANT := caf
-
-# GPS
-TARGET_NO_RPC := true
-
-# Lights
-TARGET_PROVIDES_LIBLIGHT := true
-
-# Media
-TARGET_ENABLE_QC_AV_ENHANCEMENTS := true
-TARGET_QCOM_MEDIA_VARIANT := caf
-
-# NFC
-BOARD_NFC_HAL_SUFFIX := msm8960
-
-# Partitions
-TARGET_USERIMAGES_USE_EXT4 := true
-BOARD_BOOTIMAGE_PARTITION_SIZE := 0x00A00000
-BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00A00000
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1572864000
-BOARD_USERDATAIMAGE_PARTITION_SIZE := 28651290624
-BOARD_FLASH_BLOCK_SIZE := 131072
-
-# Power
-TARGET_POWERHAL_VARIANT := qcom
-
-# Qualcomm support
-COMMON_GLOBAL_CFLAGS += -DQCOM_BSP
-TARGET_USES_QCOM_BSP := true
-
-# Recovery
-BOARD_USE_CUSTOM_RECOVERY_FONT := \"roboto_23x41.h\"
-BOARD_USES_MMCUTILS := true
-BOARD_HAS_LARGE_FILESYSTEM := true
-BOARD_HAS_NO_MISC_PARTITION := true
-BOARD_HAS_NO_SELECT_BUTTON := true
-BOARD_RECOVERY_SWIPE := true
-TARGET_RECOVERY_FSTAB := device/samsung/jflte/rootdir/etc/fstab.qcom
-
-# Releasetools
-TARGET_RELEASETOOLS_EXTENSIONS := device/samsung/jflte/releasetools
-
-# SELinux
-BOARD_SEPOLICY_DIRS += \
- device/samsung/jflte/sepolicy
-
-BOARD_SEPOLICY_UNION += \
- file_contexts \
- app.te \
- bluetooth.te \
- device.te \
- domain.te \
- drmserver.te \
- file.te \
- hci_init.te \
- healthd.te \
- init.te \
- init_shell.te \
- keystore.te \
- kickstart.te \
- mediaserver.te \
- nfc.te \
- rild.te \
- surfaceflinger.te \
- system.te \
- ueventd.te \
- wpa.te \
- wpa_socket.te
-
-# Time services
-BOARD_USES_QC_TIME_SERVICES := true
-
-# Vendor Init
-TARGET_UNIFIED_DEVICE := true
-TARGET_INIT_VENDOR_LIB := libinit_jflte
-TARGET_LIBINIT_DEFINES_FILE := device/samsung/jflte/init/init_jflte.c
-
-# Vold
-BOARD_VOLD_EMMC_SHARES_DEV_MAJOR := true
-BOARD_VOLD_MAX_PARTITIONS := 28
-TARGET_USE_CUSTOM_LUN_FILE_PATH := /sys/devices/platform/msm_hsusb/gadget/lun%d/file
-
-# Wifi module
-BOARD_WLAN_DEVICE := bcmdhd
-BOARD_HAVE_SAMSUNG_WIFI := true
-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_BAND := 802_11_ABG
-WIFI_DRIVER_FW_PATH_AP := "/system/etc/wifi/bcmdhd_apsta.bin"
-WIFI_DRIVER_FW_PATH_PARAM := "/sys/module/dhd/parameters/firmware_path"
-WIFI_DRIVER_FW_PATH_STA := "/system/etc/wifi/bcmdhd_sta.bin"
diff --git a/README b/README
index ffc1335..4bc0b5e 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-Copyright 2012 - The CyanogenMod Project
+Copyright 2013 - The CyanogenMod Project
-Common device configuration for Samsung Galaxy S4 (Qualcomm Variants)
+Device configuration for Samsung Galaxy S4 (Qualcomm Variants)
WORK IN PROGRESS. WILL EAT YOUR CAT.
diff --git a/audio/audio_policy.conf b/audio/audio_policy.conf
deleted file mode 100644
index 0369605..0000000
--- a/audio/audio_policy.conf
+++ /dev/null
@@ -1,102 +0,0 @@
-# Global configuration section: lists input and output devices always present on the device
-# as well as the output device selected by default.
-# Devices are designated by a string that corresponds to the enum in audio.h
-
-global_configuration {
- attached_output_devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE
- default_output_device AUDIO_DEVICE_OUT_SPEAKER
- attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_BACK_MIC
-}
-
-# audio hardware module section: contains descriptors for all audio hw modules present on the
-# device. Each hw module node is named after the corresponding hw module library base name.
-# For instance, "primary" corresponds to audio.primary.<device>.so.
-# The "primary" module is mandatory and must include at least one output with
-# AUDIO_OUTPUT_FLAG_PRIMARY flag.
-# Each module descriptor contains one or more output profile descriptors and zero or more
-# input profile descriptors. Each profile lists all the parameters supported by a given output
-# or input stream category.
-# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding
-# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n".
-
-audio_hw_modules {
- primary {
- outputs {
- hdmi {
- sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000
- channel_masks dynamic
- formats AUDIO_FORMAT_PCM_16_BIT
- devices AUDIO_DEVICE_OUT_AUX_DIGITAL
- flags AUDIO_OUTPUT_FLAG_DIRECT
- }
- primary {
- sampling_rates 44100|48000
- channel_masks AUDIO_CHANNEL_OUT_STEREO
- formats AUDIO_FORMAT_PCM_16_BIT
- devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_ALL_A2DP|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET|AUDIO_DEVICE_OUT_ALL_USB
- flags AUDIO_OUTPUT_FLAG_PRIMARY
- }
- lpa {
- sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000
- channel_masks AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_MONO
- formats AUDIO_FORMAT_PCM_16_BIT
- devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_ALL_A2DP|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_ALL_USB
- flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_LPA
- }
- voip_rx {
- sampling_rates 8000|16000
- channel_masks AUDIO_CHANNEL_OUT_MONO
- formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_AMR_NB|AUDIO_FORMAT_AMR_WB|AUDIO_FORMAT_QCELP|AUDIO_FORMAT_EVRC|AUDIO_FORMAT_EVRCB|AUDIO_FORMAT_EVRCWB
- devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_ALL_USB|AUDIO_DEVICE_OUT_ALL_SCO
- flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX
- }
- tunnel {
- sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000
- channel_masks AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_MONO|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|AUDIO_FORMAT_AMR_WB|AUDIO_FORMAT_AMR_WB_PLUS
- devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_ALL_A2DP|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_ALL_USB
- flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_TUNNEL
- }
- fast {
- 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_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_ALL_A2DP|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_ALL_USB|AUDIO_DEVICE_OUT_FM|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_FM_TX
- flags AUDIO_OUTPUT_FLAG_FAST
- }
- }
- 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_VOICE_CALL_MONO|AUDIO_CHANNEL_IN_VOICE_DNLINK_MONO|AUDIO_CHANNEL_IN_VOICE_UPLINK_MONO
- formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_AMR_WB
- devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_AUX_DIGITAL|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_PROXY|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET|AUDIO_DEVICE_IN_COMMUNICATION
- }
- voip_tx {
- sampling_rates 8000|16000
- channel_masks AUDIO_CHANNEL_IN_MONO
- formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_AMR_NB|AUDIO_FORMAT_AMR_WB|AUDIO_FORMAT_QCELP|AUDIO_FORMAT_EVRC|AUDIO_FORMAT_EVRCB|AUDIO_FORMAT_EVRCWB
- devices AUDIO_DEVICE_IN_COMMUNICATION
- }
- }
- }
- r_submix {
- outputs {
- submix {
- sampling_rates 44100|48000
- channel_masks AUDIO_CHANNEL_OUT_STEREO
- formats AUDIO_FORMAT_PCM_16_BIT
- devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
- }
- }
- inputs {
- submix {
- sampling_rates 44100|48000
- channel_masks AUDIO_CHANNEL_IN_STEREO
- formats AUDIO_FORMAT_PCM_16_BIT
- devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
- }
- }
- }
-
-}
diff --git a/audio/snd_soc_msm_2x_Fusion3 b/audio/snd_soc_msm_2x_Fusion3
deleted file mode 100644
index bd039c0..0000000
--- a/audio/snd_soc_msm_2x_Fusion3
+++ /dev/null
@@ -1,5115 +0,0 @@
-# Master file for snd_soc_msm tabla 2.0 sound card
-# Lists all use case verbs
-SectionUseCase."HiFi" {
-Comment "Music playback use case"
-SectionVerb
- Name "HiFi"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiSpeaker FM Tx"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiFM Tx"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiHDMI"
-
- EnableSequence
- 'HDMI Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiHDMI Speaker"
-
- EnableSequence
- 'HDMI Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-EndSection
-
-SectionVerb
- Name "HiFiBT SCO Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiBT SCO WB Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiPROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiPROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiUSB PROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiUSB PROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiPROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiUSB PROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiPROXY Rx Earpiece"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiPROXY Rx Headphones"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFiPROXY Rx Speaker Headset"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-}
-SectionUseCase."HiFi Low Power" {
-Comment "LPA use case"
-SectionVerb
- Name "HiFi Low Power"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerSpeaker FM Tx"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- 'INTERNAL_FM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- 'INTERNAL_FM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerFM Tx"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerHDMI"
-
- EnableSequence
- 'HDMI Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerHDMI Speaker"
-
- EnableSequence
- 'HDMI Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerBT SCO Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerBT SCO WB Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerPROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerPROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerUSB PROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerUSB PROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerPROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerUSB PROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerPROXY Rx Earpiece"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerPROXY Rx Headphones"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionVerb
- Name "HiFi Low PowerPROXY Rx Speaker Headset"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-}
-SectionUseCase."HiFi Rec" {
-Comment "Recording use case"
-SectionVerb
- Name "HiFi Rec"
-
- EnableSequence
- 'MultiMedia1 Mixer SLIM_0_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer SLIM_0_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFi RecBT SCO Tx"
-
- EnableSequence
- 'MultiMedia1 Mixer AUX_PCM_UL_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer AUX_PCM_UL_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFi RecBT SCO WB Tx"
-
- EnableSequence
- 'MultiMedia1 Mixer AUX_PCM_UL_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer AUX_PCM_UL_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFi RecPROXY Tx"
-
- EnableSequence
- 'MultiMedia1 Mixer AFE_PCM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer AFE_PCM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionVerb
- Name "HiFi RecUSB PROXY Tx"
-
- EnableSequence
- 'MultiMedia1 Mixer AFE_PCM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer AFE_PCM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-}
-SectionUseCase."HiFi Rec Compressed" {
-Comment "HiFi Rec Compressed use case"
-SectionVerb
- Name "HiFi Rec Compressed"
-
- EnableSequence
- 'MultiMedia4 Mixer SLIM_0_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia4 Mixer SLIM_0_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 9
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi Rec CompressedMI2S"
-
- EnableSequence
- 'MultiMedia4 Mixer MI2S_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia4 Mixer MI2S_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 9
- PlaybackPCM 9
-
-EndSection
-}
-SectionUseCase."Voice Call" {
-Comment "Voice Call use case"
-SectionVerb
- Name "Voice Call"
-
- EnableSequence
- 'STUB_RX Mixer Voice Stub':1:1
- 'Voice Stub Tx Mixer STUB_TX_HL':1:1
- EndSequence
-
- DisableSequence
- 'STUB_RX Mixer Voice Stub':1:0
- 'Voice Stub Tx Mixer STUB_TX_HL':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionVerb
- Name "Voice CallHDMI"
-
- EnableSequence
- 'Voice Stub Tx Mixer SLIM_3_TX':1:0
- 'HDMI_RX_Voice Mixer Voice Stub':1:0
- 'HDMI_RX Port Mixer SLIM_3_TX':1:0
- 'Voice Stub Tx Mixer STUB_TX_HL':1:0
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionVerb
- Name "Voice CallHDMI Tx"
-
- EnableSequence
- 'Voice Stub Tx Mixer SLIM_3_TX':1:1
- 'HDMI_RX_Voice Mixer Voice Stub':1:1
- 'HDMI_RX Port Mixer SLIM_3_TX':1:1
- 'Voice Stub Tx Mixer STUB_TX_HL':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionVerb
- Name "Voice CallBT SCO Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'Voice Stub Tx Mixer AUX_PCM_UL_TX':1:0
- 'SLIMBUS_1_RX Mixer Voice Stub':1:0
- 'Voice Stub Tx Mixer SLIM_1_TX':1:0
- 'AUX_PCM_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_1_RX Port Mixer AUX_PCM_UL_TX':1:0
- 'AUXPCM_RX Port Mixer SLIM_1_TX':1:0
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_3_RX Port Mixer AUX_PCM_DL_RX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionVerb
- Name "Voice CallBT SCO Tx"
-
- EnableSequence
- 'Voice Stub Tx Mixer AUX_PCM_UL_TX':1:1
- 'SLIMBUS_1_RX Mixer Voice Stub':1:1
- 'Voice Stub Tx Mixer SLIM_1_TX':1:1
- 'AUX_PCM_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_1_RX Port Mixer AUX_PCM_UL_TX':1:1
- 'AUXPCM_RX Port Mixer SLIM_1_TX':1:1
- 'SLIM_3_RX Channels':0:One
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_3_RX Port Mixer AUX_PCM_DL_RX':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionVerb
- Name "Voice CallBT SCO WB Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'SLIM_1 SampleRate':1:8000
- 'Voice Stub Tx Mixer AUX_PCM_UL_TX':1:0
- 'SLIMBUS_1_RX Mixer Voice Stub':1:0
- 'Voice Stub Tx Mixer SLIM_1_TX':1:0
- 'AUX_PCM_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_1_RX Port Mixer AUX_PCM_UL_TX':1:0
- 'AUXPCM_RX Port Mixer SLIM_1_TX':1:0
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_3_RX Port Mixer AUX_PCM_DL_RX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionVerb
- Name "Voice CallBT SCO WB Tx"
-
- EnableSequence
- 'Voice Stub Tx Mixer AUX_PCM_UL_TX':1:1
- 'SLIMBUS_1_RX Mixer Voice Stub':1:1
- 'Voice Stub Tx Mixer SLIM_1_TX':1:1
- 'AUX_PCM_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_1_RX Port Mixer AUX_PCM_UL_TX':1:1
- 'AUXPCM_RX Port Mixer SLIM_1_TX':1:1
- 'SLIM_3_RX Channels':0:One
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_3_RX Port Mixer AUX_PCM_DL_RX':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionVerb
- Name "Voice CallUSB PROXY Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'SLIM_1 SampleRate':1:8000
- 'SLIM_1_TX Channels':0:One
- 'Voice Stub Tx Mixer AFE_PCM_TX':1:0
- 'SLIMBUS_1_RX Mixer Voice Stub':1:0
- 'Voice Stub Tx Mixer SLIM_1_TX':1:0
- 'AFE_PCM_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_1_RX Port Mixer AFE_PCM_TX':1:0
- 'AFE_PCM_RX Port Mixer SLIM_1_TX':1:0
- 'SLIM_3_RX Channels':0:One
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_3_RX Port Mixer AFE_PCM_RX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionVerb
- Name "Voice CallUSB PROXY Tx"
-
- EnableSequence
- 'SLIM_1 SampleRate':1:48000
- 'SLIM_1_TX Channels':0:Two
- 'Voice Stub Tx Mixer AFE_PCM_TX':1:1
- 'SLIMBUS_1_RX Mixer Voice Stub':1:1
- 'Voice Stub Tx Mixer SLIM_1_TX':1:1
- 'AFE_PCM_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_1_RX Port Mixer AFE_PCM_TX':1:1
- 'AFE_PCM_RX Port Mixer SLIM_1_TX':1:1
- 'SLIM_3_RX Channels':0:Two
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_3_RX Port Mixer AFE_PCM_RX':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-}
-SectionUseCase."Voice Call IP" {
-Comment "VOIP Call use case"
-SectionVerb
- Name "Voice Call IP"
-
- EnableSequence
- 'SLIM_0_RX_Voice Mixer Voip':1:1
- 'Voip_Tx Mixer SLIM_0_TX_Voip':1:1
- EndSequence
-
- DisableSequence
- 'SLIM_0_RX_Voice Mixer Voip':1:0
- 'Voip_Tx Mixer SLIM_0_TX_Voip':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionVerb
- Name "Voice Call IPHDMI Tx"
-
- EnableSequence
- 'HDMI_RX_Voice Mixer Voip':1:1
- 'Voip_Tx Mixer SLIM_0_TX_Voip':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionVerb
- Name "Voice Call IPBT SCO Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX_Voice Mixer Voip':1:0
- 'Voip_Tx Mixer AUX_PCM_TX_Voip':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionVerb
- Name "Voice Call IPBT SCO Tx"
-
- EnableSequence
- 'AUX_PCM_RX_Voice Mixer Voip':1:1
- 'Voip_Tx Mixer AUX_PCM_UL_Voip':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionVerb
- Name "Voice Call IPBT SCO WB Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX_Voice Mixer Voip':1:0
- 'Voip_Tx Mixer AUX_PCM_TX_Voip':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionVerb
- Name "Voice Call IPBT SCO WB Tx"
-
- EnableSequence
- 'AUX_PCM_RX_Voice Mixer Voip':1:1
- 'Voip_Tx Mixer AUX_PCM_TX_Voip':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionVerb
- Name "Voice Call IPHDMI"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'HDMI_RX_Voice Mixer Voip':1:0
- 'Voip_Tx Mixer SLIM_0_TX_Voip':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionVerb
- Name "Voice Call IPFM Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'SLIM_0_RX_Voice Mixer Voip':1:0
- 'Voip_Tx Mixer SLIM_0_TX_Voip':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-}
-
-SectionUseCase."FM Digital Radio" {
-Comment "FM Radio use case"
-SectionVerb
- Name "FM Digital Radio"
-
- EnableSequence
- 'Internal FM RX Volume':1:0
- 'SLIMBUS_0_RX Port Mixer INTERNAL_FM_TX':1:1
- 'SLIMBUS_DL_HL Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Port Mixer INTERNAL_FM_TX':1:0
- 'SLIMBUS_DL_HL Switch':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 5
- CapturePCM 6
-
-EndSection
-
-SectionVerb
- Name "FM Digital RadioPROXY Rx"
-
- EnableSequence
- 'Internal FM RX Volume':1:0
- 'AFE_PCM_RX Port Mixer INTERNAL_FM_TX':1:1
- 'PCM_RX_DL_HL Switch':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Port Mixer INTERNAL_FM_TX':1:0
- 'PCM_RX_DL_HL Switch':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 5
- CapturePCM 6
-
-EndSection
-
-SectionVerb
- Name "FM Digital RadioPROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 5
- CapturePCM 6
-
-EndSection
-
-
-SectionVerb
- Name "FM Digital RadioUSB PROXY Rx"
-
- EnableSequence
- 'Internal FM RX Volume':1:0
- 'AFE_PCM_RX Port Mixer INTERNAL_FM_TX':1:1
- 'PCM_RX_DL_HL Switch':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Port Mixer INTERNAL_FM_TX':1:0
- 'PCM_RX_DL_HL Switch':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 5
- CapturePCM 6
-
-EndSection
-
-SectionVerb
- Name "FM Digital RadioUSB PROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 5
- CapturePCM 6
-
-EndSection
-}
-SectionUseCase."FM REC" {
-Comment "FM Recording use case"
-SectionVerb
- Name "FM REC"
-
- EnableSequence
- 'MultiMedia1 Mixer INTERNAL_FM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer INTERNAL_FM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 0
- CapturePCM 0
-
-EndSection
-}
-SectionUseCase."FM A2DP REC" {
-Comment "FM A2DP playback use case"
-SectionVerb
- Name "FM A2DP REC"
-
- EnableSequence
- 'MultiMedia2 Mixer INTERNAL_FM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia2 Mixer INTERNAL_FM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 1
- CapturePCM 1
-
-EndSection
-}
-SectionUseCase."Incall REC" {
-Comment "Voice Recording use case"
-SectionVerb
- Name "Incall REC"
-
- EnableSequence
- 'MultiMedia1 Mixer VOC_REC_UL':1:1
- 'MultiMedia1 Mixer VOC_REC_DL':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer VOC_REC_UL':1:0
- 'MultiMedia1 Mixer VOC_REC_DL':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 0
- CapturePCM 0
-
-EndSection
-}
-SectionUseCase."HiFi Tunnel" {
-Comment "Tunnel mode playback use case"
-SectionVerb
- Name "HiFi Tunnel"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelSpeaker FM Tx"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- 'INTERNAL_FM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- 'INTERNAL_FM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelFM Tx"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelHDMI"
-
- EnableSequence
- 'HDMI Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelHDMI Speaker"
-
- EnableSequence
- 'HDMI Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelBT SCO Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelBT SCO WB Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelPROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelUSB PROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelPROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelUSB PROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelPROXY Rx Earpiece"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelPROXY Rx Headphones"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionVerb
- Name "HiFi TunnelPROXY Rx Speaker Headset"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-}
-SectionUseCase."ADSP testfwk" {
-Comment "ADSP testfwk use case"
-
-SectionVerb
- Name "ADSP testfwk"
-
- EnableSequence
- 'SLIMBUS_DL_HL Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_DL_HL Switch':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 5
- CapturePCM 5
-
-EndSection
-}
-
-SectionUseCase."HiFi Lowlatency Rec" {
-Comment "Recording use case"
-SectionVerb
- Name "HiFi Lowlatency Rec"
-
- EnableSequence
- 'MultiMedia5 Mixer SLIM_0_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer SLIM_0_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi Lowlatency RecBT SCO Tx"
-
- EnableSequence
- 'MultiMedia5 Mixer AUX_PCM_UL_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer AUX_PCM_UL_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi Lowlatency RecBT SCO WB Tx"
-
- EnableSequence
- 'MultiMedia5 Mixer AUX_PCM_UL_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer AUX_PCM_UL_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi Lowlatency RecPROXY Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi Lowlatency RecPROXY Tx"
-
- EnableSequence
- 'MultiMedia5 Mixer AFE_PCM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer AFE_PCM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi Lowlatency RecUSB PROXY Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi Lowlatency RecUSB PROXY Tx"
-
- EnableSequence
- 'MultiMedia5 Mixer AFE_PCM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer AFE_PCM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-}
-
-SectionUseCase."HiFi Lowlatency" {
-Comment "LowLatnecy mode playback use case"
-SectionVerb
- Name "HiFi Lowlatency"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
- CapturePCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencySpeaker FM Tx"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- 'INTERNAL_FM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- 'INTERNAL_FM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyFM Tx"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyHDMI"
-
- EnableSequence
- 'HDMI Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyHDMI SPDIF"
-
- EnableSequence
- 'HDMI Mixer MultiMedia5':1:1
- 'SEC_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia4':1:0
- 'SEC_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyHDMI Speaker"
-
- EnableSequence
- 'HDMI Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyBT SCO Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyBT SCO WB Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyPROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyPROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyUSB PROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyUSB PROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencySPDIF"
-
- EnableSequence
- 'SEC_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'SEC_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencySPDIF Speaker"
-
- EnableSequence
- 'SEC_RX Audio Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'SEC_RX Audio Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-
-SectionVerb
- Name "HiFi LowlatencySPDIF Earpiece"
-
- EnableSequence
- 'SEC_RX Audio Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'SEC_RX Audio Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-
-SectionVerb
- Name "HiFi LowlatencySPDIF Headphones"
-
- EnableSequence
- 'SEC_RX Audio Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'SEC_RX Audio Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-
-SectionVerb
- Name "HiFi LowlatencySPDIF Speaker Headset"
-
- EnableSequence
- 'SEC_RX Audio Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'SEC_RX Audio Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyPROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyUSB PROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-
-SectionVerb
- Name "HiFi LowlatencyPROXY Rx Earpiece"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-SectionVerb
- Name "HiFi LowlatencyPROXY Rx Headphones"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-SectionVerb
- Name "HiFi LowlatencyPROXY Rx Speaker Headset"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 14
-
-EndSection
-}
-
-SectionDevice
- Name "Earpiece"
- Comment "Handset Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:One
- 'RX1 MIX1 INP1':0:RX1
- 'RX1 MIX1 INP2':0:RX6
- 'EAR PA Gain':0:POS_6_DB
- 'DAC1 Switch':1:1
- 'RX1 Digital Volume':2:71%
- EndSequence
-
- DisableSequence
- 'RX1 MIX1 INP1':0:ZERO
- 'RX1 MIX1 INP2':0:ZERO
- 'DAC1 Switch':1:0
- 'EAR PA Gain':0:ZERO
- 'RX1 Digital Volume':1:0
- EndSequence
-
- ACDBID 7:1
-
-EndSection
-
-SectionDevice
- Name "Voice Earpiece Extra Gain"
- Comment "Handset Extra Gain Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:One
- 'RX1 MIX1 INP1':0:RX1
- 'RX1 MIX1 INP2':0:RX6
- 'EAR PA Gain':0:POS_6_DB
- 'DAC1 Switch':1:1
- 'RX1 Digital Volume':2:71%
- 'ES325 RX2 Enable':1:1
- EndSequence
-
- DisableSequence
- 'RX1 MIX1 INP1':0:ZERO
- 'RX1 MIX1 INP2':0:ZERO
- 'DAC1 Switch':1:0
- 'EAR PA Gain':0:ZERO
- 'RX1 Digital Volume':1:0
- 'ES325 RX2 Enable':1:0
- EndSequence
-
- ACDBID 71:1
-
-EndSection
-
-SectionDevice
- Name "Voice Earpiece"
- Comment "Handset Rx device for voice call"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:One
- 'RX1 MIX1 INP1':0:RX1
- 'RX1 MIX1 INP2':0:RX6
- 'EAR PA Gain':0:POS_6_DB
- 'DAC1 Switch':1:1
- 'RX1 Digital Volume':2:71%
- 'ES325 RX2 Enable':1:1
- EndSequence
-
- DisableSequence
- 'RX1 MIX1 INP1':0:ZERO
- 'RX1 MIX1 INP2':0:ZERO
- 'DAC1 Switch':1:0
- 'EAR PA Gain':0:ZERO
- 'RX1 Digital Volume':1:0
- 'ES325 RX2 Enable':1:0
- EndSequence
-
- ACDBID 7:1
-
-EndSection
-
-SectionDevice
- Name "VOIP Earpiece"
- Comment "Handset Rx device for VOIP call"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:One
- 'RX1 MIX1 INP1':0:RX1
- 'RX1 MIX1 INP2':0:RX6
- 'EAR PA Gain':0:POS_6_DB
- 'DAC1 Switch':1:1
- 'RX1 Digital Volume':2:71%
- EndSequence
-
- DisableSequence
- 'RX1 MIX1 INP1':0:ZERO
- 'RX1 MIX1 INP2':0:ZERO
- 'DAC1 Switch':1:0
- 'EAR PA Gain':0:ZERO
- 'RX1 Digital Volume':1:0
- EndSequence
-
- ACDBID 7:1
-
-EndSection
-
-SectionDevice
- Name "HAC Earpiece"
- Comment "Handset Rx device for Hearing AID"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:One
- 'RX1 MIX1 INP1':0:RX1
- 'RX1 MIX1 INP2':0:RX6
- 'EAR PA Gain':0:POS_2_DB
- 'DAC1 Switch':1:1
- 'RX1 Digital Volume':1:69
- EndSequence
-
- DisableSequence
- 'RX1 MIX1 INP1':0:ZERO
- 'RX1 MIX1 INP2':0:ZERO
- 'DAC1 Switch':1:0
- 'EAR PA Gain':0:ZERO
- 'RX1 Digital Volume':1:0
- EndSequence
-
- ACDBID 41:1
-
-EndSection
-
-SectionDevice
- Name "TTY Handset Rx"
- Comment "TTY HCO Handset Rx device"
-
- EnableSequence
- 'SLIM RX1 MUX':0:AIF1_PB
- 'SLIM RX6 MUX':0:AIF2_PB
- 'SLIM_0_RX Channels':0:One
- 'RX1 MIX1 INP1':0:RX1
- 'RX1 MIX1 INP2':0:RX6
- 'EAR PA Gain':0:POS_2_DB
- 'DAC1 Switch':1:1
- 'RX1 Digital Volume':1:68
- EndSequence
-
- DisableSequence
- 'SLIM RX1 MUX':0:ZERO
- 'SLIM RX6 MUX':0:ZERO
- 'RX1 MIX1 INP1':0:ZERO
- 'RX1 MIX1 INP2':0:ZERO
- 'DAC1 Switch':1:0
- EndSequence
-
- ACDBID 37:1
- EffectsMixerCTL "SRS TruMedia"
- EC_REF_RXMixerCTL "SLIM_RX"
-
-EndSection
-
-SectionDevice
- Name "Speaker"
- Comment "Speaker Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX5 MIX1 INP1':0:RX1
- 'RX5 MIX1 INP2':0:RX2
- 'RX6 DSM MUX':0:DSM_INV
- 'LINEOUT2 Volume':1:83
- 'LINEOUT4 Volume':1:83
- 'RX5 Digital Volume':2:66.3%
- EndSequence
-
- DisableSequence
- 'RX5 MIX1 INP1':0:ZERO
- 'RX5 MIX1 INP2':0:ZERO
- 'LINEOUT2 Volume':1:0
- 'LINEOUT4 Volume':1:0
- 'RX5 Digital Volume':1:0
- EndSequence
-
- ACDBID 15:1
- EffectsMixerCTL "SRS TruMedia"
- EC_REF_RXMixerCTL "SLIM_RX"
-
-EndSection
-
-SectionDevice
- Name "Speaker Extra Gain"
- Comment "Speaker Extra Gain Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:One
- 'RX5 MIX1 INP1':0:RX1
- 'RX5 MIX1 INP2':0:RX6
- 'RX6 DSM MUX':0:DSM_INV
- 'LINEOUT2 Volume':1:100
- 'LINEOUT4 Volume':1:100
- 'RX5 Digital Volume':2:67.7%
- 'ES325 RX2 Enable':1:1
- EndSequence
-
- DisableSequence
- 'RX5 MIX1 INP1':0:ZERO
- 'RX5 MIX1 INP2':0:ZERO
- 'LINEOUT2 Volume':1:0
- 'LINEOUT4 Volume':1:0
- 'RX5 Digital Volume':1:0
- 'ES325 RX2 Enable':1:0
- EndSequence
-
- ACDBID 72:1
-
-EndSection
-
-SectionDevice
- Name "Voice Speaker"
- Comment "Speaker for voice call"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX5 MIX1 INP1':0:RX1
- 'RX5 MIX1 INP2':0:RX6
- 'RX6 DSM MUX':0:DSM_INV
- 'RX4 MIX1 INP1':0:RX2
- 'RX4 MIX1 INP2':0:RX7
- 'RX4 DSM MUX':0:CIC_OUT
- 'LINEOUT2 Volume':1:100
- 'LINEOUT4 Volume':1:100
- 'RX5 Digital Volume':2:71%
- 'ES325 RX2 Enable':1:1
- 'VEQ Enable':1:0
- EndSequence
-
- DisableSequence
- 'RX5 MIX1 INP1':0:ZERO
- 'RX5 MIX1 INP2':0:ZERO
- 'RX4 MIX1 INP1':0:ZERO
- 'RX4 MIX1 INP2':0:ZERO
- 'LINEOUT2 Volume':1:0
- 'LINEOUT4 Volume':1:0
- 'RX5 Digital Volume':1:0
- 'ES325 RX2 Enable':1:0
- 'VEQ Enable':1:0
- EndSequence
-
- ACDBID 15:1
-
-EndSection
-
-SectionDevice
- Name "Voice Speaker Extra Gain"
- Comment "Voice Speaker Extra Gain Rx device (RX4 is dummy path)"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX5 MIX1 INP1':0:RX1
- 'RX5 MIX1 INP2':0:RX6
- 'RX6 DSM MUX':0:DSM_INV
- 'RX4 MIX1 INP1':0:RX2
- 'RX4 MIX1 INP2':0:RX7
- 'RX4 DSM MUX':0:CIC_OUT
- 'LINEOUT2 Volume':1:100
- 'LINEOUT4 Volume':1:100
- 'RX5 Digital Volume':2:67.7%
- EndSequence
-
- DisableSequence
- 'RX5 MIX1 INP1':0:ZERO
- 'RX5 MIX1 INP2':0:ZERO
- 'RX4 MIX1 INP1':0:ZERO
- 'RX4 MIX1 INP2':0:ZERO
- 'LINEOUT2 Volume':1:0
- 'LINEOUT4 Volume':1:0
- 'RX5 Digital Volume':1:0
- EndSequence
-
- ACDBID 72:1
-
-EndSection
-
-SectionDevice
- Name "VOIP Speaker"
- Comment "VoIP Comm Speaker Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX5 MIX1 INP1':0:RX1
- 'RX5 MIX1 INP2':0:RX2
- 'RX6 DSM MUX':0:DSM_INV
- 'LINEOUT2 Volume':1:100
- 'LINEOUT4 Volume':1:100
- 'RX5 Digital Volume':2:71%
- EndSequence
-
- DisableSequence
- 'RX5 MIX1 INP1':0:ZERO
- 'RX5 MIX1 INP2':0:ZERO
- 'LINEOUT2 Volume':1:0
- 'LINEOUT4 Volume':1:0
- 'RX5 Digital Volume':1:0
- EndSequence
-
- ACDBID 15:1
-
-EndSection
-
-SectionDevice
- Name "Headphones"
- Comment "Headset Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX1 MIX1 INP1':0:RX1
- 'RX2 MIX1 INP1':0:RX2
- 'HPHL DAC Switch':1:1
- 'HPHR DAC Switch':1:1
- 'HPHL Volume':1:100
- 'HPHR Volume':1:100
- 'RX1 Digital Volume':2:64.5%
- 'RX2 Digital Volume':2:64.5%
- 'COMP1 Switch':1:1
- EndSequence
-
- DisableSequence
- 'RX1 MIX1 INP1':0:ZERO
- 'RX2 MIX1 INP1':0:ZERO
- 'HPHL DAC Switch':1:0
- 'HPHR DAC Switch':1:0
- 'HPHL Volume':1:0
- 'HPHR Volume':1:0
- 'RX1 Digital Volume':1:0
- 'RX2 Digital Volume':1:0
- 'COMP1 Switch':1:0
- EndSequence
-
- ACDBID 10:1
- EC_REF_RXMixerCTL "SLIM_RX"
-
-EndSection
-
-SectionDevice
- Name "Voice Headphones"
- Comment "Headset Rx device for voice call"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX1 MIX1 INP1':0:RX1
- 'RX1 MIX1 INP2':0:RX6
- 'RX2 MIX1 INP1':0:RX2
- 'RX2 MIX1 INP2':0:RX7
- 'HPHL DAC Switch':1:1
- 'HPHR DAC Switch':1:1
- 'HPHL Volume':1:100
- 'HPHR Volume':1:100
- 'RX1 Digital Volume':2:67.7%
- 'RX2 Digital Volume':2:67.7%
- 'ES325 RX2 Enable':1:1
- EndSequence
-
- DisableSequence
- 'RX1 MIX1 INP1':0:ZERO
- 'RX1 MIX1 INP2':0:ZERO
- 'RX2 MIX1 INP1':0:ZERO
- 'RX2 MIX1 INP2':0:ZERO
- 'HPHL DAC Switch':1:0
- 'HPHR DAC Switch':1:0
- 'HPHL Volume':1:0
- 'HPHR Volume':1:0
- 'RX1 Digital Volume':1:0
- 'RX2 Digital Volume':1:0
- 'ES325 RX2 Enable':1:0
- EndSequence
-
- ACDBID 10:1
- EffectsMixerCTL "SRS TruMedia"
-
-EndSection
-
-SectionDevice
- Name "VOIP Headphones"
- Comment "VoIP Comm Headset Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX1 MIX1 INP1':0:RX1
- 'RX2 MIX1 INP1':0:RX2
- 'HPHL DAC Switch':1:1
- 'HPHR DAC Switch':1:1
- 'RX1 Digital Volume':2:67.7%
- 'RX2 Digital Volume':2:67.7%
- 'HPHL Volume':1:100
- 'HPHR Volume':1:100
- EndSequence
-
- DisableSequence
- 'RX1 MIX1 INP1':0:ZERO
- 'RX2 MIX1 INP1':0:ZERO
- 'HPHL DAC Switch':1:0
- 'HPHR DAC Switch':1:0
- 'RX1 Digital Volume':1:0
- 'RX2 Digital Volume':1:0
- 'HPHL Volume':1:100
- 'HPHR Volume':1:100
- EndSequence
-
- ACDBID 10:1
-
-EndSection
-
-SectionDevice
- Name "Speaker Headset"
- Comment "Speaker Headset Rx combo device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX5 MIX1 INP1':0:RX1
- 'RX5 MIX1 INP2':0:RX2
- 'RX6 DSM MUX':0:DSM_INV
- 'LINEOUT2 Volume':1:83
- 'LINEOUT4 Volume':1:83
- 'RX5 Digital Volume':2:66.3%
- 'RX1 MIX1 INP1':0:RX1
- 'RX2 MIX1 INP1':0:RX2
- 'HPHL DAC Switch':1:1
- 'HPHR DAC Switch':1:1
- 'HPHL Volume':1:0
- 'HPHR Volume':1:0
- 'RX1 Digital Volume':2:56.4%
- 'RX2 Digital Volume':2:56.4%
- 'COMP1 Switch':1:1
- EndSequence
-
- DisableSequence
- 'RX5 MIX1 INP1':0:ZERO
- 'RX5 MIX1 INP2':0:ZERO
- 'LINEOUT2 Volume':1:0
- 'LINEOUT4 Volume':1:0
- 'RX5 Digital Volume':1:0
- 'RX1 MIX1 INP1':0:ZERO
- 'RX2 MIX1 INP1':0:ZERO
- 'HPHL DAC Switch':1:0
- 'HPHR DAC Switch':1:0
- 'HPHL Volume':1:0
- 'HPHR Volume':1:0
- 'RX1 Digital Volume':1:0
- 'RX2 Digital Volume':1:0
- 'COMP1 Switch':1:0
- EndSequence
-
- ACDBID 15:1
- EffectsMixerCTL "SRS TruMedia"
- EC_REF_RXMixerCTL "SLIM_RX"
-EndSection
-
-SectionDevice
- Name "Speaker FM Tx"
- Comment "Speaker FM Tx combo device"
-
- EnableSequence
- 'SLIM RX1 MUX':0:AIF1_PB
- 'SLIM RX6 MUX':0:AIF2_PB
- 'SLIM RX2 MUX':0:AIF1_PB
- 'SLIM RX7 MUX':0:AIF2_PB
- 'SLIM_0_RX Channels':0:Two
- 'RX3 MIX1 INP1':0:RX1
- 'RX3 MIX1 INP2':0:RX6
- 'RX5 MIX1 INP1':0:RX2
- 'RX5 MIX1 INP2':0:RX7
- 'RX4 DSM MUX':0:DSM_INV
- 'RX6 DSM MUX':0:DSM_INV
- 'LINEOUT1 Volume':1:66
- 'LINEOUT2 Volume':1:66
- 'LINEOUT3 Volume':1:66
- 'LINEOUT4 Volume':1:66
- 'AIF3_CAP Mixer SLIM TX3':1:1
- 'AIF3_CAP Mixer SLIM TX5':1:1
- 'SLIM TX3 MUX':0:RMIX3
- 'SLIM TX5 MUX':0:RMIX5
- 'RX3 Digital Volume':1:68
- 'RX4 Digital Volume':1:68
- 'RX5 Digital Volume':1:68
- 'RX6 Digital Volume':1:68
- EndSequence
-
- DisableSequence
- 'SLIM RX1 MUX':0:ZERO
- 'SLIM RX6 MUX':0:ZERO
- 'SLIM RX2 MUX':0:ZERO
- 'SLIM RX7 MUX':0:ZERO
- 'RX3 MIX1 INP1':0:ZERO
- 'RX3 MIX1 INP2':0:ZERO
- 'RX5 MIX1 INP1':0:ZERO
- 'RX5 MIX1 INP2':0:ZERO
- 'RX4 DSM MUX':0:CIC_OUT
- 'RX6 DSM MUX':0:CIC_OUT
- 'LINEOUT1 Volume':1:0
- 'LINEOUT2 Volume':1:0
- 'LINEOUT3 Volume':1:0
- 'LINEOUT4 Volume':1:0
- 'AIF3_CAP Mixer SLIM TX3':1:0
- 'AIF3_CAP Mixer SLIM TX5':1:0
- 'SLIM TX3 MUX':0:ZERO
- 'SLIM TX5 MUX':0:ZERO
- EndSequence
-
- ACDBID 15:1
- EffectsMixerCTL "SRS TruMedia"
-
-EndSection
-
-SectionDevice
- Name "Headset"
- Comment "Headset Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'SLIM TX7 MUX':0:DEC5
- 'DEC5 MUX':0:ADC2
- 'ADC2 Volume':1:100
- 'DEC5 Volume':2:67.7%
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC5 MUX':0:ZERO
- 'ADC2 Volume':1:0
- EndSequence
-
- ACDBID 8:2
-
-EndSection
-
-SectionDevice
- Name "Voice Headset"
- Comment "Call Headset Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'ES325-AP Tx Channels':0:One
- 'SLIM TX7 MUX':0:DEC5
- 'DEC5 MUX':0:ADC2
- 'ADC2 Volume':1:100
- 'DEC5 Volume':2:67.7%
- 'Internal Route Config':1:0
- 'ES325 TX1 Enable':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC5 MUX':0:ZERO
- 'ADC2 Volume':1:0
- 'Internal Route Config':1:6
- 'ES325 TX1 Enable':1:0
- EndSequence
-
- ACDBID 8:2
-
-EndSection
-
-SectionDevice
- Name "VOIP Headset"
- Comment "VoIP Comm Headset Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'SLIM TX7 MUX':0:DEC5
- 'DEC5 MUX':0:ADC2
- 'ADC2 Volume':1:100
- 'DEC5 Volume':2:67.7%
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC5 MUX':0:ZERO
- 'ADC2 Volume':1:0
- EndSequence
-
- ACDBID 59:2
-
-EndSection
-
-SectionDevice
- Name "Handset"
- Comment "Handset Tx device"
-
- EnableSequence
- 'Main Mic Delay':1:4
- 'SLIM_0_TX Channels':0:One
- 'SLIM TX7 MUX':0:DEC4
- 'DEC4 MUX':0:ADC3
- 'ADC3 Volume':2:91.7%
- 'DEC4 Volume':2:67.7%
- 'MICBIAS1 CAPLESS Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC4 MUX':0:ZERO
- 'ADC3 Volume':1:0
- 'DEC4 Volume':1:67
- 'MICBIAS1 CAPLESS Switch':1:0
- EndSequence
-
- ACDBID 54:2
-
-EndSection
-
-SectionDevice
- Name "VOIP Handset"
- Comment "VoIP Comm Main Mic Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'SLIM TX7 MUX':0:DEC4
- 'DEC4 MUX':0:ADC3
- 'DEC4 Volume':2:67.7%
- 'ADC3 Volume':1:100
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC4 MUX':0:ZERO
- 'DEC4 Volume':1:0
- 'ADC3 Volume':1:0
- EndSequence
-
- ACDBID 57:2
-
-EndSection
-
-SectionDevice
- Name "Camcorder Tx"
- Comment "Camcorder Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:Two
- 'SLIM TX7 MUX':0:DEC3
- 'DEC3 MUX':0:ADC4
- 'ADC4 Volume':2:91.7%
- 'DEC3 Volume':2:84%
- 'SLIM TX8 MUX':0:DEC4
- 'DEC4 MUX':0:ADC3
- 'ADC3 Volume':2:91.7%
- 'DEC4 Volume':2:84%
- 'MICBIAS3 CAPLESS Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC3 MUX':0:ZERO
- 'ADC4 Volume':1:0
- 'DEC3 Volume':1:67%
- 'SLIM TX8 MUX':0:ZERO
- 'DEC4 MUX':0:ZERO
- 'ADC3 Volume':1:0
- 'DEC4 Volume':1:67%
- 'MICBIAS3 CAPLESS Switch':1:0
- EndSequence
-
- ACDBID 56:2
-
-EndSection
-
-SectionDevice
- Name "Voice Recognition"
- Comment "VR Sec Sub Mic Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'SLIM TX7 MUX':0:DEC3
- 'DEC3 MUX':0:ADC4
- 'ADC4 Volume':1:100
- 'DEC3 Volume':2:67.7%
- 'MICBIAS3 CAPLESS Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC3 MUX':0:ZERO
- 'ADC4 Volume':1:0
- 'MICBIAS3 CAPLESS Switch':1:0
- EndSequence
-
- ACDBID 108:2
-
-EndSection
-
-SectionDevice
- Name "Voice Recognition Headset"
- Comment "VR Sec Headset Mic Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'SLIM TX7 MUX':0:DEC5
- 'DEC5 MUX':0:ADC2
- 'DEC5 Volume':2:67.7%
- 'ADC2 Volume':1:100
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC5 MUX':0:ZERO
- 'ADC2 Volume':1:0
- EndSequence
-
- ACDBID 132:2
-
-EndSection
-
-SectionDevice
- Name "Line"
- Comment "Speaker Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'SLIM TX7 MUX':0:DEC3
- 'DEC3 MUX':0:ADC4
- 'ADC4 Volume':1:100
- 'DEC3 Volume':2:67.7%
- 'MICBIAS3 CAPLESS Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC3 MUX':0:ZERO
- 'ADC4 Volume':1:0
- 'MICBIAS3 CAPLESS Switch':1:0
- EndSequence
-
- ACDBID 11:2
-
-EndSection
-
-SectionDevice
- Name "Voice Line"
- Comment "Speaker Tx device for voice call"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'SLIM TX7 MUX':0:DEC3
- 'DEC3 MUX':0:ADC4
- 'ADC4 Volume':1:100
- 'DEC3 Volume':2:67.7%
- 'MICBIAS3 CAPLESS Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC3 MUX':0:ZERO
- 'ADC4 Volume':1:0
- 'MICBIAS3 CAPLESS Switch':1:0
- EndSequence
-
- ACDBID 11:2
-
-EndSection
-
-SectionDevice
- Name "VOIP Line"
- Comment "Speaker Tx device for VOIP call"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'SLIM TX7 MUX':0:DEC3
- 'DEC3 MUX':0:ADC4
- 'ADC4 Volume':1:100
- 'DEC3 Volume':2:67.7%
- 'MICBIAS3 CAPLESS Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC3 MUX':0:ZERO
- 'ADC4 Volume':1:0
- 'MICBIAS3 CAPLESS Switch':1:0
- EndSequence
-
- ACDBID 58:2
-
-EndSection
-
-SectionDevice
- Name "TTY Handset Tx"
- Comment "TTY VCO Handset Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'SLIM TX7 MUX':0:DEC4
- 'DEC4 MUX':0:ADC3
- 'ADC3 Volume':1:100
- 'DEC4 Volume':2:67.7%
- 'MICBIAS3 CAPLESS Switch':1:1
- 'TX3 HPF cut off':0:MIN_3DB_150Hz
- 'TX4 HPF cut off':0:MIN_3DB_150Hz
- 'TX5 HPF cut off':0:MIN_3DB_150Hz
- 'ES325-AP Tx Channels':0:One
- 'Internal Route Config':1:11
- 'ES325 TX1 Enable':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC4 MUX':0:ZERO
- 'ADC3 Volume':1:0
- 'DEC4 Volume':1:0
- 'MICBIAS3 CAPLESS Switch':1:0
- 'TX3 HPF cut off':0:MIN_3DB_4Hz
- 'TX4 HPF cut off':0:MIN_3DB_4Hz
- 'TX5 HPF cut off':0:MIN_3DB_4Hz
- 'Internal Route Config':1:6
- 'ES325 TX1 Enable':1:0
- EndSequence
-
- ACDBID 4:2
-
-EndSection
-
-SectionDevice
- Name "DMIC Endfire"
- Comment "Dual MIC Endfire Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:Two
- 'SLIM TX7 MUX':0:DEC4
- 'DEC4 MUX':0:ADC3
- 'ADC3 Volume':1:100
- 'DEC4 Volume':2:67.7%
- 'SLIM TX8 MUX':0:DEC3
- 'DEC3 MUX':0:ADC4
- 'ADC4 Volume':1:100
- 'DEC3 Volume':2:67.7%
- 'MICBIAS3 CAPLESS Switch':1:1
- 'TX3 HPF cut off':0:MIN_3DB_150Hz
- 'TX4 HPF cut off':0:MIN_3DB_150Hz
- 'TX5 HPF cut off':0:MIN_3DB_150Hz
- 'ES325-AP Tx Channels':0:One
- 'Internal Route Config':1:4
- 'ES325 TX1 Enable':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC4 MUX':0:ZERO
- 'ADC3 Volume':1:0
- 'DEC4 Volume':1:0
- 'SLIM TX8 MUX':0:ZERO
- 'DEC3 MUX':0:ZERO
- 'DEC3 Volume':1:0
- 'ADC4 Volume':1:0
- 'MICBIAS3 CAPLESS Switch':1:0
- 'TX3 HPF cut off':0:MIN_3DB_4Hz
- 'TX4 HPF cut off':0:MIN_3DB_4Hz
- 'TX5 HPF cut off':0:MIN_3DB_4Hz
- 'Internal Route Config':1:6
- 'ES325 TX1 Enable':1:0
- EndSequence
-
- ACDBID 4:2
-
-EndSection
-
-SectionDevice
- Name "Speaker DMIC Endfire"
- Comment "Dual MIC Endfire Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:Two
- 'SLIM TX7 MUX':0:DEC2
- 'DEC3 MUX':0:ADC4
- 'ADC4 Volume':1:100
- 'DEC3 Volume':2:67.7%
- 'SLIM TX8 MUX':0:DEC3
- 'DEC2 MUX':0:ADC5
- 'ADC5 Volume':1:100
- 'DEC2 Volume':2:67.7%
- 'MICBIAS3 CAPLESS Switch':1:1
- 'MICBIAS4 CAPLESS Switch':1:1
- 'TX3 HPF cut off':0:MIN_3DB_150Hz
- 'TX4 HPF cut off':0:MIN_3DB_150Hz
- 'TX5 HPF cut off':0:MIN_3DB_150Hz
- 'ES325-AP Tx Channels':0:One
- 'Internal Route Config':1:3
- 'ES325 TX1 Enable':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC3 MUX':0:ZERO
- 'DEC3 Volume':1:0
- 'ADC4 Volume':1:0
- 'SLIM TX8 MUX':0:ZERO
- 'DEC2 MUX':0:ZERO
- 'DEC2 Volume':1:0
- 'ADC5 Volume':1:0
- 'MICBIAS3 CAPLESS Switch':1:0
- 'MICBIAS4 CAPLESS Switch':1:0
- 'TX3 HPF cut off':0:MIN_3DB_4Hz
- 'TX4 HPF cut off':0:MIN_3DB_4Hz
- 'TX5 HPF cut off':0:MIN_3DB_4Hz
- 'Internal Route Config':1:6
- 'ES325 TX1 Enable':1:0
- EndSequence
-
- ACDBID 11:2
-
-EndSection
-
-SectionDevice
- Name "Speaker DMIC Stereo"
- Comment "Stereo Mic Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:Two
- 'SLIM TX8 MUX':0:DEC3
- 'DEC3 MUX':0:ADC4
- 'ADC4 Volume':2:91.7%
- 'DEC3 Volume':2:66.9%
- 'SLIM TX7 MUX':0:DEC4
- 'DEC4 MUX':0:ADC3
- 'ADC3 Volume':2:91.7%
- 'DEC4 Volume':2:67.7%
- 'MICBIAS1 CAPLESS Switch':1:1
- 'MICBIAS3 CAPLESS Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC3 MUX':0:ZERO
- 'ADC4 Volume':1:0
- 'SLIM TX8 MUX':0:ZERO
- 'DEC4 MUX':0:ZERO
- 'ADC3 Volume':1:0
- 'MICBIAS1 CAPLESS Switch':1:0
- 'MICBIAS3 CAPLESS Switch':1:0
- EndSequence
-
- ACDBID 56:2
-
-EndSection
-
-SectionDevice
- Name "Handset DMIC Stereo"
- Comment "Stereo Mic Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:Two
- 'SLIM TX8 MUX':0:DEC3
- 'DEC3 MUX':0:ADC4
- 'ADC4 Volume':2:91.7%
- 'DEC3 Volume':2:66.9%
- 'SLIM TX7 MUX':0:DEC4
- 'DEC4 MUX':0:ADC3
- 'ADC3 Volume':2:91.7%
- 'DEC4 Volume':2:67.7%
- 'MICBIAS1 CAPLESS Switch':1:1
- 'MICBIAS3 CAPLESS Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC3 MUX':0:ZERO
- 'ADC4 Volume':1:0
- 'SLIM TX8 MUX':0:ZERO
- 'DEC4 MUX':0:ZERO
- 'ADC3 Volume':1:0
- 'MICBIAS1 CAPLESS Switch':1:0
- 'MICBIAS3 CAPLESS Switch':1:0
- EndSequence
-
- ACDBID 56:2
-
-EndSection
-
-SectionDevice
- Name "TTY Headset Rx"
- Comment "TTY Headset Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX1 MIX1 INP1':0:RX1
- 'RX1 MIX1 INP2':0:RX6
- 'RX2 MIX1 INP1':0:RX2
- 'RX2 MIX1 INP2':0:RX7
- 'HPHL DAC Switch':1:1
- 'HPHR DAC Switch':1:1
- 'HPHL Volume':1:100
- 'HPHR Volume':1:100
- 'RX1 Digital Volume':2:67.7%
- 'RX2 Digital Volume':2:67.7%
- 'Internal Route Config':1:6
- 'ES325 RX2 Enable':1:1
- EndSequence
-
- DisableSequence
- 'RX1 MIX1 INP1':0:ZERO
- 'RX1 MIX1 INP2':0:ZERO
- 'RX2 MIX1 INP1':0:ZERO
- 'RX2 MIX1 INP2':0:ZERO
- 'HPHL DAC Switch':1:0
- 'HPHR DAC Switch':1:0
- 'HPHL Volume':1:0
- 'HPHR Volume':1:0
- 'RX1 Digital Volume':1:0
- 'RX2 Digital Volume':1:0
- 'Internal Route Config':1:6
- 'ES325 RX2 Enable':1:0
- EndSequence
-
- ACDBID 102:1
-
-EndSection
-
-SectionDevice
- Name "TTY Headset Tx"
- Comment "TTY Headset Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'ES325-AP Tx Channels':0:One
- 'SLIM TX7 MUX':0:DEC5
- 'DEC5 MUX':0:ADC2
- 'ADC2 Volume':1:100
- 'DEC5 Volume':2:67.7%
- 'Internal Route Config':1:12
- 'ES325 TX1 Enable':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC5 MUX':0:ZERO
- 'ADC2 Volume':1:0
- 'Internal Route Config':1:6
- 'ES325 TX1 Enable':1:0
- EndSequence
-
- ACDBID 101:2
-
-EndSection
-
-SectionDevice
- Name "TTY Full Rx"
- Comment "TTY Full Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX1 MIX1 INP1':0:RX1
- 'RX1 MIX1 INP2':0:RX6
- 'RX2 MIX1 INP1':0:RX2
- 'RX2 MIX1 INP2':0:RX7
- 'HPHL DAC Switch':1:1
- 'HPHR DAC Switch':1:1
- 'HPHL Volume':1:100
- 'HPHR Volume':1:100
- 'RX1 Digital Volume':2:67.7%
- 'RX2 Digital Volume':2:67.7%
- 'Internal Route Config':1:6
- 'ES325 RX2 Enable':1:1
- EndSequence
-
- DisableSequence
- 'RX1 MIX1 INP1':0:ZERO
- 'RX1 MIX1 INP2':0:ZERO
- 'RX2 MIX1 INP1':0:ZERO
- 'RX2 MIX1 INP2':0:ZERO
- 'HPHL DAC Switch':1:0
- 'HPHR DAC Switch':1:0
- 'HPHL Volume':1:0
- 'HPHR Volume':1:0
- 'RX1 Digital Volume':1:0
- 'RX2 Digital Volume':1:0
- 'Internal Route Config':1:6
- 'ES325 RX2 Enable':1:0
- EndSequence
-
- ACDBID 102:1
-
-EndSection
-
-SectionDevice
- Name "TTY Full Tx"
- Comment "TTY Full Tx device"
-
- EnableSequence
- 'SLIM_0_TX Channels':0:One
- 'ES325-AP Tx Channels':0:One
- 'SLIM TX7 MUX':0:DEC5
- 'DEC5 MUX':0:ADC2
- 'ADC2 Volume':1:100
- 'DEC5 Volume':2:67.7%
- 'Internal Route Config':1:0
- 'ES325 TX1 Enable':1:1
- EndSequence
-
- DisableSequence
- 'SLIM TX7 MUX':0:ZERO
- 'DEC5 MUX':0:ZERO
- 'ADC2 Volume':1:0
- 'Internal Route Config':1:6
- 'ES325 TX1 Enable':1:0
- EndSequence
-
- ACDBID 101:2
-
-EndSection
-
-SectionDevice
- Name "BT SCO Rx"
- Comment "BT SCO Rx device"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 50:1
-
-EndSection
-
-SectionDevice
- Name "BT SCO Tx"
- Comment "BT SCO Tx device"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 51:2
-
-EndSection
-
-SectionDevice
- Name "BT SCO WB Rx"
- Comment "BT SCO Rx device"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 50:1
-
-EndSection
-
-SectionDevice
- Name "BT SCO WB Tx"
- Comment "BT SCO Tx device"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 51:2
- EffectsMixerCTL "SRS TruMedia"
-
-EndSection
-
-SectionDevice
- Name "Dock"
- Comment "Dock Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX7 MIX1 INP1':0:RX1
- 'RX3 MIX1 INP1':0:RX2
- 'LINEOUT1 Volume':1:100
- 'LINEOUT5 Volume':1:100
- EndSequence
-
- DisableSequence
- 'RX7 MIX1 INP1':0:ZERO
- 'RX3 MIX1 INP1':0:ZERO
- 'LINEOUT1 Volume':1:0
- 'LINEOUT5 Volume':1:0
- EndSequence
-
- ACDBID 98:1
-
-EndSection
-
-SectionDevice
- Name "HDMI"
- Comment "HDMI Rx device"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 18:1
- EffectsMixerCTL "SRS TruMedia HDMI"
-
-EndSection
-
-
-SectionDevice
- Name "HDMI Speaker"
- Comment "HDMI Speaker Rx device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:One
- 'RX3 MIX1 INP1':0:RX1
- 'RX3 MIX1 INP2':0:RX6
- 'RX4 DSM MUX':0:DSM_INV
- 'RX3 Digital Volume':1:68
- 'LINEOUT1 Volume':1:100
- 'LINEOUT3 Volume':1:100
- 'SLIM TX3 MUX':0:RMIX3
- EndSequence
-
- DisableSequence
- 'RX3 MIX1 INP1':0:ZERO
- 'RX3 MIX1 INP2':0:ZERO
- 'RX4 DSM MUX':0:CIC_OUT
- 'RX3 Digital Volume':1:68
- 'LINEOUT1 Volume':1:0
- 'LINEOUT3 Volume':1:0
- 'SLIM TX3 MUX':0:ZERO
- EndSequence
-
- ACDBID 18:1
- EffectsMixerCTL "SRS TruMedia"
-
-EndSection
-
-SectionDevice
- Name "FM Tx"
- Comment "FM Tx device"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 0:1
- EffectsMixerCTL "SRS TruMedia"
-
-EndSection
-
-SectionDevice
- Name "PROXY Rx"
- Comment "PROXY Rx device"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 20:1
- EffectsMixerCTL "SRS TruMedia"
-
-EndSection
-
-SectionDevice
- Name "PROXY Tx"
- Comment "PROXY Tx device"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 0:2
- EffectsMixerCTL "SRS TruMedia"
-
-EndSection
-
-SectionDevice
- Name "USB PROXY Rx"
- Comment "USB PROXY Rx device"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 45:1
- EffectsMixerCTL "SRS TruMedia"
-
-EndSection
-
-SectionDevice
- Name "USB PROXY Tx"
- Comment "PROXY Tx device"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 44:2
- EffectsMixerCTL "SRS TruMedia"
-
-EndSection
-
-SectionDevice
- Name "Dummy Tx"
- Comment "Dummy Tx device, not a physical device just for routing"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- ACDBID 0:2
- EffectsMixerCTL "SRS TruMedia"
-
-EndSection
-
-SectionDevice
- Name "PROXY Rx Speaker"
- Comment "PROXY Rx + Speaker Rx device combo device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX5 MIX1 INP1':0:RX1
- 'RX5 MIX1 INP2':0:RX2
- 'RX6 DSM MUX':0:DSM_INV
- 'LINEOUT2 Volume':1:83
- 'LINEOUT4 Volume':1:83
- 'RX5 Digital Volume':2:63.0%
- EndSequence
-
- DisableSequence
- 'RX5 MIX1 INP1':0:ZERO
- 'RX5 MIX1 INP2':0:ZERO
- 'LINEOUT2 Volume':1:0
- 'LINEOUT4 Volume':1:0
- 'RX5 Digital Volume':1:0
- EndSequence
-
- ACDBID 20:1
- EffectsMixerCTL "SRS TruMedia"
- EC_REF_RXMixerCTL "SLIM_RX"
-EndSection
-
-SectionDevice
- Name "USB PROXY Rx Speaker"
- Comment "Speaker Lineout Rx combo device"
-
- EnableSequence
- 'SLIM_0_RX Channels':0:Two
- 'RX5 MIX1 INP1':0:RX1
- 'RX5 MIX1 INP2':0:RX2
- 'RX7 MIX1 INP1':0:RX1
- 'RX3 MIX1 INP1':0:RX2
- 'RX6 DSM MUX':0:DSM_INV
- 'LINEOUT1 Volume':1:91
- 'LINEOUT5 Volume':1:91
- 'LINEOUT2 Volume':1:100
- 'LINEOUT4 Volume':1:100
- 'RX5 Digital Volume':1:65
- EndSequence
-
- DisableSequence
- 'RX5 MIX1 INP1':0:ZERO
- 'RX5 MIX1 INP2':0:ZERO
- 'RX7 MIX1 INP1':0:ZERO
- 'RX3 MIX1 INP1':0:ZERO
- 'LINEOUT1 Volume':1:0
- 'LINEOUT5 Volume':1:0
- 'LINEOUT2 Volume':1:0
- 'LINEOUT4 Volume':1:0
- 'RX5 Digital Volume':1:0
- EndSequence
-
- ACDBID 98:1
-
-EndSection
-
-SectionModifier
- Name "Play Music"
- Comment "Modifier for music playback"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicSpeaker FM Tx"
- Comment "Modifier for music playback"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicFM Tx"
- Comment "Modifier for music playback on FM Tx"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicHDMI"
- Comment "Modifier for music playback on HDMI"
-
- EnableSequence
- 'HDMI Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicHDMI Speaker"
- Comment "Modifier for music playback on HDMI Speaker"
-
- EnableSequence
- 'HDMI Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicBT SCO Rx"
- Comment "Modifier for music playback"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicBT SCO WB Rx"
- Comment "Modifier for music playback"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicPROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicUSB PROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play FM"
-
- EnableSequence
- 'Internal FM RX Volume':1:0
- 'SLIMBUS_0_RX Port Mixer INTERNAL_FM_TX':1:1
- 'SLIMBUS_DL_HL Switch':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Port Mixer INTERNAL_FM_TX':1:0
- 'SLIMBUS_DL_HL Switch':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 5
- CapturePCM 6
-
-EndSection
-
-SectionModifier
- Name "Play FMPROXY Rx"
-
- EnableSequence
- 'Internal FM RX Volume':1:0
- 'AFE_PCM_RX Port Mixer INTERNAL_FM_TX':1:1
- 'PCM_RX_DL_HL Switch':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Port Mixer INTERNAL_FM_TX':1:0
- 'PCM_RX_DL_HL Switch':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 5
- CapturePCM 6
-
-EndSection
-
-SectionModifier
- Name "Play FMUSB PROXY Rx"
-
- EnableSequence
- 'Internal FM RX Volume':1:0
- 'AFE_PCM_RX Port Mixer INTERNAL_FM_TX':1:1
- 'PCM_RX_DL_HL Switch':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Port Mixer INTERNAL_FM_TX':1:0
- 'PCM_RX_DL_HL Switch':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 5
- CapturePCM 6
-
-EndSection
-
-SectionModifier
- Name "Capture FM"
-
- EnableSequence
- 'MultiMedia1 Mixer INTERNAL_FM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer INTERNAL_FM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 0
- CapturePCM 0
-
-EndSection
-
-SectionModifier
- Name "Play LPA"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPASpeaker FM Tx"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- 'INTERNAL_FM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- 'INTERNAL_FM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPAFM Tx"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPAHDMI"
-
- EnableSequence
- 'HDMI Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPAHDMI Speaker"
-
- EnableSequence
- 'HDMI Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPABT SCO Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPABT SCO WB Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPAPROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPAUSB PROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Capture Music"
-
- EnableSequence
- 'MultiMedia1 Mixer SLIM_0_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer SLIM_0_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Capture MusicBT SCO Tx"
-
- EnableSequence
- 'MultiMedia1 Mixer AUX_PCM_UL_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer AUX_PCM_UL_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Capture MusicBT SCO WB Tx"
-
- EnableSequence
- 'MultiMedia1 Mixer AUX_PCM_UL_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer AUX_PCM_UL_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Capture Music Compressed"
-
- EnableSequence
- 'MultiMedia4 Mixer SLIM_0_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia4 Mixer SLIM_0_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 9
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Capture Music CompressedMI2S"
-
- EnableSequence
- 'MultiMedia4 Mixer MI2S_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia4 Mixer MI2S_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 9
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play Voice"
-
- EnableSequence
- 'STUB_RX Mixer Voice Stub':1:1
- 'Voice Stub Tx Mixer STUB_TX_HL':1:1
- EndSequence
-
- DisableSequence
- 'STUB_RX Mixer Voice Stub':1:0
- 'Voice Stub Tx Mixer STUB_TX_HL':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Play VoiceHDMI"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'Voice Stub Tx Mixer SLIM_3_TX':1:0
- 'HDMI_RX_Voice Mixer Voice Stub':1:0
- 'HDMI_RX Port Mixer SLIM_3_TX':1:0
- 'Voice Stub Tx Mixer STUB_TX_HL':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Play VoiceHDMI Tx"
-
- EnableSequence
- 'Voice Stub Tx Mixer SLIM_3_TX':1:1
- 'HDMI_RX_Voice Mixer Voice Stub':1:1
- 'HDMI_RX Port Mixer SLIM_3_TX':1:1
- 'Voice Stub Tx Mixer STUB_TX_HL':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Play VoiceHDMI"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'Voice Stub Tx Mixer SLIM_3_TX':1:0
- 'HDMI_RX_Voice Mixer Voice Stub':1:0
- 'HDMI_RX Port Mixer SLIM_3_TX':1:0
- 'Voice Stub Tx Mixer STUB_TX_HL':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Play VoiceHDMI Tx"
-
- EnableSequence
- 'Voice Stub Tx Mixer SLIM_3_TX':1:1
- 'HDMI_RX_Voice Mixer Voice Stub':1:1
- 'HDMI_RX Port Mixer SLIM_3_TX':1:1
- 'Voice Stub Tx Mixer STUB_TX_HL':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Play VoiceBT SCO Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'Voice Stub Tx Mixer AUX_PCM_UL_TX':1:0
- 'SLIMBUS_1_RX Mixer Voice Stub':1:0
- 'Voice Stub Tx Mixer SLIM_1_TX':1:0
- 'AUX_PCM_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_1_RX Port Mixer AUX_PCM_UL_TX':1:0
- 'AUXPCM_RX Port Mixer SLIM_1_TX':1:0
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_3_RX Port Mixer AUX_PCM_DL_RX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Play VoiceBT SCO Tx"
-
- EnableSequence
- 'Voice Stub Tx Mixer AUX_PCM_UL_TX':1:1
- 'SLIMBUS_1_RX Mixer Voice Stub':1:1
- 'Voice Stub Tx Mixer SLIM_1_TX':1:1
- 'AUX_PCM_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_1_RX Port Mixer AUX_PCM_UL_TX':1:1
- 'AUXPCM_RX Port Mixer SLIM_1_TX':1:1
- 'SLIM_3_RX Channels':0:One
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_3_RX Port Mixer AUX_PCM_DL_RX':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Play VoiceBT SCO WB Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'Voice Stub Tx Mixer AUX_PCM_UL_TX':1:0
- 'SLIMBUS_1_RX Mixer Voice Stub':1:0
- 'Voice Stub Tx Mixer SLIM_1_TX':1:0
- 'AUX_PCM_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_1_RX Port Mixer AUX_PCM_UL_TX':1:0
- 'AUXPCM_RX Port Mixer SLIM_1_TX':1:0
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_3_RX Port Mixer AUX_PCM_DL_RX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Play VoiceBT SCO WB Tx"
-
- EnableSequence
- 'Voice Stub Tx Mixer AUX_PCM_UL_TX':1:1
- 'SLIMBUS_1_RX Mixer Voice Stub':1:1
- 'Voice Stub Tx Mixer SLIM_1_TX':1:1
- 'AUX_PCM_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_1_RX Port Mixer AUX_PCM_UL_TX':1:1
- 'AUXPCM_RX Port Mixer SLIM_1_TX':1:1
- 'SLIM_3_RX Channels':0:One
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_3_RX Port Mixer AUX_PCM_DL_RX':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Play VoiceUSB PROXY Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'SLIM_1 SampleRate':1:8000
- 'SLIM_1_TX Channels':0:One
- 'Voice Stub Tx Mixer AFE_PCM_TX':1:0
- 'SLIMBUS_1_RX Mixer Voice Stub':1:0
- 'Voice Stub Tx Mixer SLIM_1_TX':1:0
- 'AFE_PCM_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_1_RX Port Mixer AFE_PCM_TX':1:0
- 'AFE_PCM_RX Port Mixer SLIM_1_TX':1:0
- 'SLIM_3_RX Channels':0:One
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:0
- 'SLIMBUS_3_RX Port Mixer AFE_PCM_RX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Play VoiceUSB PROXY Tx"
-
- EnableSequence
- 'SLIM_1 SampleRate':1:48000
- 'SLIM_1_TX Channels':0:Two
- 'Voice Stub Tx Mixer AFE_PCM_TX':1:1
- 'SLIMBUS_1_RX Mixer Voice Stub':1:1
- 'Voice Stub Tx Mixer SLIM_1_TX':1:1
- 'AFE_PCM_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_1_RX Port Mixer AFE_PCM_TX':1:1
- 'AFE_PCM_RX Port Mixer SLIM_1_TX':1:1
- 'SLIM_3_RX Channels':0:Two
- 'SLIMBUS_3_RX_Voice Mixer Voice Stub':1:1
- 'SLIMBUS_3_RX Port Mixer AFE_PCM_RX':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 12
- CapturePCM 12
-
-EndSection
-
-SectionModifier
- Name "Capture Voice"
-
- EnableSequence
- 'MultiMedia1 Mixer SLIM_4_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer SLIM_4_TX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 0
- CapturePCM 0
-
-EndSection
-
-SectionModifier
- Name "Capture A2DP FM"
-
- EnableSequence
- 'MultiMedia2 Mixer INTERNAL_FM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia2 Mixer INTERNAL_FM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 1
- CapturePCM 1
-
-EndSection
-
-SectionModifier
- Name "Play VOIP"
-
- EnableSequence
- 'SLIM_0_RX_Voice Mixer Voip':1:1
- 'Voip_Tx Mixer SLIM_0_TX_Voip':1:1
- EndSequence
-
- DisableSequence
- 'SLIM_0_RX_Voice Mixer Voip':1:0
- 'Voip_Tx Mixer SLIM_0_TX_Voip':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionModifier
- Name "Play VOIPBT SCO Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX_Voice Mixer Voip':1:0
- 'Voip_Tx Mixer AUX_PCM_TX_Voip':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionModifier
- Name "Play VOIPBT SCO Tx"
-
- EnableSequence
- 'AUX_PCM_RX_Voice Mixer Voip':1:1
- 'Voip_Tx Mixer AUX_PCM_TX_Voip':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionModifier
- Name "Play VOIPBT SCO WB Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX_Voice Mixer Voip':1:0
- 'Voip_Tx Mixer AUX_PCM_TX_Voip':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionModifier
- Name "Play VOIPBT SCO WB Tx"
-
- EnableSequence
- 'AUX_PCM_RX_Voice Mixer Voip':1:1
- 'Voip_Tx Mixer AUX_PCM_TX_Voip':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionModifier
- Name "Play VOIPHDMI"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- 'HDMI_RX_Voice Mixer Voip':1:0
- 'Voip_Tx Mixer SLIM_0_TX_Voip':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionModifier
- Name "Play VOIPHDMI Tx"
-
- EnableSequence
- 'HDMI_RX_Voice Mixer Voip':1:1
- 'Voip_Tx Mixer SLIM_0_TX_Voip':1:1
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 3
- CapturePCM 3
-
-EndSection
-
-SectionModifier
- Name "Capture MusicPROXY Tx"
-
- EnableSequence
- 'MultiMedia1 Mixer AFE_PCM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer AFE_PCM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Capture MusicUSB PROXY Tx"
-
- EnableSequence
- 'MultiMedia1 Mixer AFE_PCM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia1 Mixer AFE_PCM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicPROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicUSB PROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play LPAPROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play LPAUSB PROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play FMPROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play FMUSB PROXY Tx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Capture MusicPROXY Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Capture MusicUSB PROXY Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play Tunnel"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play TunnelSpeaker FM Tx"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- 'INTERNAL_FM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- 'INTERNAL_FM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play TunnelFM Tx"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play TunnelHDMI"
-
- EnableSequence
- 'HDMI Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play TunnelHDMI Speaker"
-
- EnableSequence
- 'HDMI Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play TunnelBT SCO Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play TunnelBT SCO WB Rx"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play TunnelPROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play TunnelUSB PROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play Lowlatency Music"
- Comment "Modifier for Lowlatency music playback"
-
- EnableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Play Lowlatency MusicSpeaker FM Tx"
- Comment "Modifier for Lowlatency music playback"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Play Lowlatency MusicFM Tx"
- Comment "Modifier for Lowlatency music playback on FM Tx"
-
- EnableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'INTERNAL_FM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Play Lowlatency MusicHDMI"
- Comment "Modifier for music playback on HDMI"
-
- EnableSequence
- 'HDMI Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Play Lowlatency MusicHDMI Speaker"
- Comment "Modifier for music playback on HDMI Speaker"
-
- EnableSequence
- 'HDMI Mixer MultiMedia5':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia5':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-EndSection
-
-SectionModifier
- Name "Play Lowlatency MusicHDMI SPDIF"
- Comment "Modifier for music playback on HDMI SPDIF"
-
- EnableSequence
- 'HDMI Mixer MultiMedia5':1:1
- 'SEC_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'HDMI Mixer MultiMedia5':1:0
- 'SEC_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Play Lowlatency MusicBT SCO Rx"
- Comment "Modifier for music playback"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Play Lowlatency MusicBT SCO WB Rx"
- Comment "Modifier for music playback"
-
- EnableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AUX_PCM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Play Lowlatency MusicPROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Play Lowlatency MusicUSB PROXY Rx"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia5':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Capture Lowlatency Music"
-
- EnableSequence
- 'MultiMedia5 Mixer SLIM_0_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer SLIM_0_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Capture Lowlatency MusicBT SCO Tx"
-
- EnableSequence
- 'MultiMedia5 Mixer AUX_PCM_UL_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer AUX_PCM_UL_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Capture Lowlatency MusicBT SCO WB Tx"
-
- EnableSequence
- 'MultiMedia5 Mixer AUX_PCM_UL_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer AUX_PCM_UL_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Capture Lowlatency Music"
-
- EnableSequence
- 'MultiMedia5 Mixer SLIM_0_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer SLIM_0_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Capture Lowlatency MusicBT SCO WB Tx"
-
- EnableSequence
- 'MultiMedia5 Mixer AUX_PCM_UL_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer AUX_PCM_UL_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Capture Lowlatency MusicPROXY Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Capture Lowlatency MusicUSB PROXY Rx"
-
- EnableSequence
- EndSequence
-
- DisableSequence
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Capture Lowlatency MusicPROXY Tx"
-
- EnableSequence
- 'MultiMedia5 Mixer AFE_PCM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer AFE_PCM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Capture Lowlatency MusicUSB PROXY Tx"
-
- EnableSequence
- 'MultiMedia5 Mixer AFE_PCM_TX':1:1
- EndSequence
-
- DisableSequence
- 'MultiMedia5 Mixer AFE_PCM_TX':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 14
- PlaybackPCM 14
-
-EndSection
-
-SectionModifier
- Name "Play MusicPROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicUSB PROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicPROXY Rx Earpiece"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicPROXY Rx Headphones"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play MusicPROXY Rx Speaker Headset"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia1':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia1':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 0
-
-EndSection
-
-SectionModifier
- Name "Play LPAPROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPAUSB PROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPAPROXY Rx Earpiece"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPAPROXY Rx Headphones"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
- Name "Play LPAPROXY Rx Speaker Headset"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia3':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia3':1:0
- EndSequence
-
- # ALSA PCMs
- CapturePCM 0
- PlaybackPCM 4
-
-EndSection
-
-SectionModifier
-
- Name "Play TunnelPROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
-
- Name "Play TunnelUSB PROXY Rx Speaker"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play TunnelPROXY Rx Earpiece"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play Tunnel TunnelPROXY Rx Headphones"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-SectionModifier
- Name "Play TunnelPROXY Rx Speaker Headset"
-
- EnableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:1
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:1
- EndSequence
-
- DisableSequence
- 'AFE_PCM_RX Audio Mixer MultiMedia4':1:0
- 'SLIMBUS_0_RX Audio Mixer MultiMedia4':1:0
- EndSequence
-
- # ALSA PCMs
- PlaybackPCM 9
-
-EndSection
-
-# End of master file
diff --git a/bluetooth/bcm4335_prepatch.hcd b/bluetooth/bcm4335_prepatch.hcd
deleted file mode 100644
index cd1813b..0000000
--- a/bluetooth/bcm4335_prepatch.hcd
+++ /dev/null
Binary files differ
diff --git a/bluetooth/bdroid_buildcfg.h b/bluetooth/bdroid_buildcfg.h
deleted file mode 100644
index c8feb21..0000000
--- a/bluetooth/bdroid_buildcfg.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- * Copyright (C) 2012 The CyanogenMod Project <http://www.cyanogenmod.org>
- *
- * 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 S IV"
-
-#define BTA_SKIP_BLE_READ_REMOTE_FEAT TRUE
-#define BTA_DISABLE_DELAY 1000 /* in milliseconds */
-
-#endif
diff --git a/bluetooth/vnd_jf.txt b/bluetooth/vnd_jf.txt
deleted file mode 100644
index a3ab73a..0000000
--- a/bluetooth/vnd_jf.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-BLUETOOTH_UART_DEVICE_PORT = "/dev/ttyHS0"
-FW_PATCHFILE_LOCATION = "/vendor/firmware"
-#FW_PRE_PATCH="/vendor/firmware/bcm4335_prepatch.hcd"
-BT_WAKE_VIA_PROC = TRUE
-LPM_IDLE_TIMEOUT_MULTIPLE = 5
-BTVND_DBG = FALSE
-BTHW_DBG = TRUE
-VNDUSERIAL_DBG = FALSE
-UPIO_DBG = FALSE
-UART_TARGET_BAUD_RATE = 3000000
-FW_PATCH_SETTLEMENT_DELAY_MS = 100
-#USE_AXI_BRIDGE_LOCK = TRUE
-#UART_FORCE_TWO_STOPBITS = TRUE
-#LPM_COMBINE_SLEEP_MODE_AND_LPM = 0
diff --git a/camera/Android.mk b/camera/Android.mk
deleted file mode 100644
index 5c81ac1..0000000
--- a/camera/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-ifeq ($(TARGET_PROVIDES_CAMERA_HAL),true)
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- CameraWrapper.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libhardware liblog libcamera_client libutils
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
-LOCAL_MODULE := camera.msm8960
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-endif
diff --git a/camera/CameraWrapper.cpp b/camera/CameraWrapper.cpp
deleted file mode 100644
index dd22790..0000000
--- a/camera/CameraWrapper.cpp
+++ /dev/null
@@ -1,638 +0,0 @@
-/*
- * Copyright (C) 2012, 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.
- */
-
-/**
-* @file CameraWrapper.cpp
-*
-* This file wraps a vendor camera module.
-*
-*/
-
-#define LOG_NDEBUG 0
-#define LOG_PARAMETERS
-
-#define LOG_TAG "CameraWrapper"
-#include <cutils/log.h>
-
-#include <utils/threads.h>
-#include <utils/String8.h>
-#include <hardware/hardware.h>
-#include <hardware/camera.h>
-#include <camera/Camera.h>
-#include <camera/CameraParameters.h>
-
-static android::Mutex gCameraWrapperLock;
-static camera_module_t *gVendorModule = 0;
-
-static char **fixed_set_params = NULL;
-
-static int camera_device_open(const hw_module_t* module, const char* name,
- hw_device_t** device);
-static int camera_device_close(hw_device_t* device);
-static int camera_get_number_of_cameras(void);
-static int camera_get_camera_info(int camera_id, struct camera_info *info);
-static int camera_send_command(struct camera_device * device, int32_t cmd,
- int32_t arg1, int32_t arg2);
-
-static struct hw_module_methods_t camera_module_methods = {
- open: camera_device_open
-};
-
-camera_module_t HAL_MODULE_INFO_SYM = {
- common: {
- tag: HARDWARE_MODULE_TAG,
- version_major: 1,
- version_minor: 0,
- id: CAMERA_HARDWARE_MODULE_ID,
- name: "Samsung msm8960 Camera Wrapper",
- author: "The CyanogenMod Project",
- methods: &camera_module_methods,
- dso: NULL, /* remove compilation warnings */
- reserved: {0}, /* remove compilation warnings */
- },
- get_number_of_cameras: camera_get_number_of_cameras,
- get_camera_info: camera_get_camera_info,
-};
-
-typedef struct wrapper_camera_device {
- camera_device_t base;
- int id;
- camera_device_t *vendor;
-} wrapper_camera_device_t;
-
-#define VENDOR_CALL(device, func, ...) ({ \
- wrapper_camera_device_t *__wrapper_dev = (wrapper_camera_device_t*) device; \
- __wrapper_dev->vendor->ops->func(__wrapper_dev->vendor, ##__VA_ARGS__); \
-})
-
-#define CAMERA_ID(device) (((wrapper_camera_device_t *)(device))->id)
-
-static int check_vendor_module()
-{
- int rv = 0;
- ALOGV("%s", __FUNCTION__);
-
- if(gVendorModule)
- return 0;
-
- rv = hw_get_module_by_class("camera", "vendor",
- (const hw_module_t **)&gVendorModule);
-
- if (rv)
- ALOGE("failed to open vendor camera module");
- return rv;
-}
-
-const static char * iso_values[] = {"auto,ISO_HJR,ISO100,ISO200,ISO400,ISO800,ISO1600,auto"};
-
-static char * camera_fixup_getparams(int id, const char * settings)
-{
- android::CameraParameters params;
- params.unflatten(android::String8(settings));
-
- // fix params here
- params.set(android::CameraParameters::KEY_SUPPORTED_ISO_MODES, iso_values[id]);
- params.set(android::CameraParameters::KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO, "1920x1080");
- params.set(android::CameraParameters::KEY_ANTIBANDING, "auto");
-
- /* Enforce video-snapshot-supported to true */
- params.set(android::CameraParameters::KEY_VIDEO_SNAPSHOT_SUPPORTED, "true");
-
- android::String8 strParams = params.flatten();
- char *ret = strdup(strParams.string());
-
- ALOGD("%s: get parameters fixed up", __FUNCTION__);
- return ret;
-}
-
-static bool wasVideo = false;
-
-char * camera_fixup_setparams(struct camera_device * device, const char * settings)
-{
- int id = CAMERA_ID(device);
- android::CameraParameters params;
- params.unflatten(android::String8(settings));
- const char KEY_SAMSUNG_CAMERA_MODE[] = "cam_mode";
- const char* camMode = params.get(KEY_SAMSUNG_CAMERA_MODE);
-
- bool enableZSL = !strcmp(params.get(android::CameraParameters::KEY_ZSL), "on");
-
- // jactive device camera don't seem to have recording hint param, so read it safely
- const char* recordingHint = params.get(android::CameraParameters::KEY_RECORDING_HINT);
- bool isVideo = false;
- if (recordingHint)
- isVideo = !strcmp(recordingHint, "true");
-
- // fix params here
- params.set(android::CameraParameters::KEY_ANTIBANDING, "auto");
- // No need to fix-up ISO_HJR, it is the same for userspace and the camera lib
- if(params.get("iso")) {
- const char* isoMode = params.get(android::CameraParameters::KEY_ISO_MODE);
- if(strcmp(isoMode, "ISO100") == 0)
- params.set(android::CameraParameters::KEY_ISO_MODE, "100");
- else if(strcmp(isoMode, "ISO200") == 0)
- params.set(android::CameraParameters::KEY_ISO_MODE, "200");
- else if(strcmp(isoMode, "ISO400") == 0)
- params.set(android::CameraParameters::KEY_ISO_MODE, "400");
- else if(strcmp(isoMode, "ISO800") == 0)
- params.set(android::CameraParameters::KEY_ISO_MODE, "800");
- else if(strcmp(isoMode, "ISO1600") == 0)
- params.set(android::CameraParameters::KEY_ISO_MODE, "1600");
- else if(strcmp(isoMode, "ISO50") == 0)
- params.set(android::CameraParameters::KEY_ISO_MODE, "50");
- }
-
- if (id != 1) {
- params.set(android::CameraParameters::KEY_ZSL, isVideo ? "off" : "on");
- params.set(android::CameraParameters::KEY_CAMERA_MODE, isVideo ? "0" : "1");
-
- if (!isVideo) {
- // Magic 1508 command needs to be sent for jf
- camera_send_command(device, 1508, 0, 0);
- }
- }
-
- android::String8 strParams = params.flatten();
-
- if (fixed_set_params[id])
- free(fixed_set_params[id]);
- fixed_set_params[id] = strdup(strParams.string());
- char *ret = fixed_set_params[id];
-
- ALOGD("%s: set parameters fixed up", __FUNCTION__);
- return ret;
-}
-
-/*******************************************************************
- * implementation of camera_device_ops functions
- *******************************************************************/
-
-int camera_set_preview_window(struct camera_device * device,
- struct preview_stream_ops *window)
-{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
- return VENDOR_CALL(device, set_preview_window, window);
-}
-
-void camera_set_callbacks(struct camera_device * device,
- camera_notify_callback notify_cb,
- camera_data_callback data_cb,
- camera_data_timestamp_callback data_cb_timestamp,
- camera_request_memory get_memory,
- void *user)
-{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
- ALOGV("%s", __FUNCTION__);
-
- if(!device)
- return;
-
- VENDOR_CALL(device, set_callbacks, notify_cb, data_cb, data_cb_timestamp, get_memory, user);
-}
-
-void camera_enable_msg_type(struct camera_device * device, int32_t msg_type)
-{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
- ALOGV("%s", __FUNCTION__);
-
- if(!device)
- return;
-
- VENDOR_CALL(device, enable_msg_type, msg_type);
-}
-
-void camera_disable_msg_type(struct camera_device * device, int32_t msg_type)
-{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
- ALOGV("%s", __FUNCTION__);
-
- if(!device)
- return;
-
- VENDOR_CALL(device, disable_msg_type, msg_type);
-}
-
-int camera_msg_type_enabled(struct camera_device * device, int32_t msg_type)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return 0;
-
- return VENDOR_CALL(device, msg_type_enabled, msg_type);
-}
-
-int camera_start_preview(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
- return VENDOR_CALL(device, start_preview);
-}
-
-void camera_stop_preview(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return;
-
- VENDOR_CALL(device, stop_preview);
-}
-
-int camera_preview_enabled(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
- return VENDOR_CALL(device, preview_enabled);
-}
-
-int camera_store_meta_data_in_buffers(struct camera_device * device, int enable)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
- return VENDOR_CALL(device, store_meta_data_in_buffers, enable);
-}
-
-int camera_start_recording(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return EINVAL;
-
- return VENDOR_CALL(device, start_recording);
-}
-
-void camera_stop_recording(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return;
-
-
- VENDOR_CALL(device, stop_recording);
-}
-
-int camera_recording_enabled(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
- return VENDOR_CALL(device, recording_enabled);
-}
-
-void camera_release_recording_frame(struct camera_device * device,
- const void *opaque)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return;
-
- VENDOR_CALL(device, release_recording_frame, opaque);
-}
-
-int camera_auto_focus(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
-
- return VENDOR_CALL(device, auto_focus);
-}
-
-int camera_cancel_auto_focus(struct camera_device * device)
-{
- int ret = 0;
-
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
- if (camera_preview_enabled(device))
- ret = VENDOR_CALL(device, cancel_auto_focus);
-
- return ret;
-}
-
-int camera_take_picture(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
- return VENDOR_CALL(device, take_picture);
-}
-
-int camera_cancel_picture(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
- return VENDOR_CALL(device, cancel_picture);
-}
-
-int camera_set_parameters(struct camera_device * device, const char *params)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
- char *tmp = NULL;
- tmp = camera_fixup_setparams(device, params);
-
-#ifdef LOG_PARAMETERS
- __android_log_write(ANDROID_LOG_VERBOSE, LOG_TAG, tmp);
-#endif
-
- int ret = VENDOR_CALL(device, set_parameters, tmp);
- return ret;
-}
-
-char* camera_get_parameters(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return NULL;
-
- char* params = VENDOR_CALL(device, get_parameters);
-
-#ifdef LOG_PARAMETERS
- __android_log_write(ANDROID_LOG_VERBOSE, LOG_TAG, params);
-#endif
-
- char * tmp = camera_fixup_getparams(CAMERA_ID(device), params);
- VENDOR_CALL(device, put_parameters, params);
- params = tmp;
-
-#ifdef LOG_PARAMETERS
- __android_log_write(ANDROID_LOG_VERBOSE, LOG_TAG, params);
-#endif
-
- return params;
-}
-
-static void camera_put_parameters(struct camera_device *device, char *params)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(params)
- free(params);
-}
-
-int camera_send_command(struct camera_device * device,
- int32_t cmd, int32_t arg1, int32_t arg2)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return -EINVAL;
-
- return VENDOR_CALL(device, send_command, cmd, arg1, arg2);
-}
-
-void camera_release(struct camera_device * device)
-{
- ALOGV("%s", __FUNCTION__);
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
-
- if(!device)
- return;
-
- VENDOR_CALL(device, release);
-}
-
-int camera_dump(struct camera_device * device, int fd)
-{
- if(!device)
- return -EINVAL;
-
- return VENDOR_CALL(device, dump, fd);
-}
-
-extern "C" void heaptracker_free_leaked_memory(void);
-
-int camera_device_close(hw_device_t* device)
-{
- int ret = 0;
- wrapper_camera_device_t *wrapper_dev = NULL;
-
- ALOGV("%s", __FUNCTION__);
-
- android::Mutex::Autolock lock(gCameraWrapperLock);
-
- if (!device) {
- ret = -EINVAL;
- goto done;
- }
-
- for (int i = 0; i < camera_get_number_of_cameras(); i++) {
- if (fixed_set_params[i])
- free(fixed_set_params[i]);
- }
-
- wrapper_dev = (wrapper_camera_device_t*) device;
-
- wrapper_dev->vendor->common.close((hw_device_t*)wrapper_dev->vendor);
- if (wrapper_dev->base.ops)
- free(wrapper_dev->base.ops);
- free(wrapper_dev);
-done:
-#ifdef HEAPTRACKER
- heaptracker_free_leaked_memory();
-#endif
- return ret;
-}
-
-/*******************************************************************
- * implementation of camera_module functions
- *******************************************************************/
-
-/* open device handle to one of the cameras
- *
- * assume camera service will keep singleton of each camera
- * so this function will always only be called once per camera instance
- */
-
-int camera_device_open(const hw_module_t* module, const char* name,
- hw_device_t** device)
-{
- int rv = 0;
- int num_cameras = 0;
- int cameraid;
- wrapper_camera_device_t* camera_device = NULL;
- camera_device_ops_t* camera_ops = NULL;
- wasVideo = false;
-
- android::Mutex::Autolock lock(gCameraWrapperLock);
-
- ALOGV("camera_device open");
-
- if (name != NULL) {
- if (check_vendor_module())
- return -EINVAL;
-
- cameraid = atoi(name);
- num_cameras = gVendorModule->get_number_of_cameras();
-
- fixed_set_params = (char **) malloc(sizeof(char *) * num_cameras);
- if (!fixed_set_params) {
- ALOGE("parameter memory allocation fail");
- rv = -ENOMEM;
- goto fail;
- }
- memset(fixed_set_params, 0, sizeof(char *) * num_cameras);
-
- if(cameraid > num_cameras)
- {
- ALOGE("camera service provided cameraid out of bounds, "
- "cameraid = %d, num supported = %d",
- cameraid, num_cameras);
- rv = -EINVAL;
- goto fail;
- }
-
- camera_device = (wrapper_camera_device_t*)malloc(sizeof(*camera_device));
- if(!camera_device)
- {
- ALOGE("camera_device allocation fail");
- rv = -ENOMEM;
- goto fail;
- }
- memset(camera_device, 0, sizeof(*camera_device));
- camera_device->id = cameraid;
-
- if(rv = gVendorModule->common.methods->open((const hw_module_t*)gVendorModule, name, (hw_device_t**)&(camera_device->vendor)))
- {
- ALOGE("vendor camera open fail");
- goto fail;
- }
- ALOGV("%s: got vendor camera device 0x%08X", __FUNCTION__, (uintptr_t)(camera_device->vendor));
-
- camera_ops = (camera_device_ops_t*)malloc(sizeof(*camera_ops));
- if(!camera_ops)
- {
- ALOGE("camera_ops allocation fail");
- rv = -ENOMEM;
- goto fail;
- }
-
- memset(camera_ops, 0, sizeof(*camera_ops));
-
- camera_device->base.common.tag = HARDWARE_DEVICE_TAG;
- camera_device->base.common.version = 0;
- camera_device->base.common.module = (hw_module_t *)(module);
- camera_device->base.common.close = camera_device_close;
- camera_device->base.ops = camera_ops;
-
- camera_ops->set_preview_window = camera_set_preview_window;
- camera_ops->set_callbacks = camera_set_callbacks;
- camera_ops->enable_msg_type = camera_enable_msg_type;
- camera_ops->disable_msg_type = camera_disable_msg_type;
- camera_ops->msg_type_enabled = camera_msg_type_enabled;
- camera_ops->start_preview = camera_start_preview;
- camera_ops->stop_preview = camera_stop_preview;
- camera_ops->preview_enabled = camera_preview_enabled;
- camera_ops->store_meta_data_in_buffers = camera_store_meta_data_in_buffers;
- camera_ops->start_recording = camera_start_recording;
- camera_ops->stop_recording = camera_stop_recording;
- camera_ops->recording_enabled = camera_recording_enabled;
- camera_ops->release_recording_frame = camera_release_recording_frame;
- camera_ops->auto_focus = camera_auto_focus;
- camera_ops->cancel_auto_focus = camera_cancel_auto_focus;
- camera_ops->take_picture = camera_take_picture;
- camera_ops->cancel_picture = camera_cancel_picture;
- camera_ops->set_parameters = camera_set_parameters;
- camera_ops->get_parameters = camera_get_parameters;
- camera_ops->put_parameters = camera_put_parameters;
- camera_ops->send_command = camera_send_command;
- camera_ops->release = camera_release;
- camera_ops->dump = camera_dump;
-
- *device = &camera_device->base.common;
- }
-
- return rv;
-
-fail:
- if(camera_device) {
- free(camera_device);
- camera_device = NULL;
- }
- if(camera_ops) {
- free(camera_ops);
- camera_ops = NULL;
- }
- *device = NULL;
- return rv;
-}
-
-int camera_get_number_of_cameras(void)
-{
- ALOGV("%s", __FUNCTION__);
- if (check_vendor_module())
- return 0;
- return gVendorModule->get_number_of_cameras();
-}
-
-int camera_get_camera_info(int camera_id, struct camera_info *info)
-{
- ALOGV("%s", __FUNCTION__);
- if (check_vendor_module())
- return 0;
- return gVendorModule->get_camera_info(camera_id, info);
-}
diff --git a/cm.dependencies b/cm.dependencies
index 26b9305..b8453ec 100644
--- a/cm.dependencies
+++ b/cm.dependencies
@@ -1,10 +1,6 @@
[
{
- "repository": "android_device_samsung_qcom-common",
- "target_path": "device/samsung/qcom-common"
- },
- {
- "repository": "android_kernel_samsung_jf",
- "target_path": "kernel/samsung/jf"
+ "repository": "android_device_samsung_jf-common",
+ "target_path": "device/samsung/jf-common"
}
]
diff --git a/cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java b/cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java
deleted file mode 100644
index 714045f..0000000
--- a/cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2014 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.
- */
-
-package org.cyanogenmod.hardware;
-
-import org.cyanogenmod.hardware.util.FileUtils;
-
-import java.io.File;
-
-public class DisplayColorCalibration {
- private static final String COLOR_FILE = "/sys/class/misc/gammacontrol/tuner";
-
- public static boolean isSupported() {
- File f = new File(COLOR_FILE);
- return f.exists();
- }
-
- public static int getMaxValue() {
- return 120;
- }
-
- public static int getMinValue() {
- return 0;
- }
-
- public static int getDefValue() {
- return 60;
- }
-
- public static String getCurColors() {
- return FileUtils.readOneLine(COLOR_FILE);
- }
-
- public static boolean setColors(String colors) {
- return FileUtils.writeLine(COLOR_FILE, colors);
- }
-}
-
diff --git a/cmhw/org/cyanogenmod/hardware/KeyDisabler.java b/cmhw/org/cyanogenmod/hardware/KeyDisabler.java
deleted file mode 100644
index 1e18d8f..0000000
--- a/cmhw/org/cyanogenmod/hardware/KeyDisabler.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2014 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.
- */
-
-package org.cyanogenmod.hardware;
-
-import java.io.File;
-
-import org.cyanogenmod.hardware.util.FileUtils;
-
-/*
- * Disable capacitive keys
- *
- * This is intended for use on devices in which the capacitive keys
- * can be fully disabled for replacement with a soft navbar. You
- * really should not be using this on a device with mechanical or
- * otherwise visible-when-inactive keys
- */
-
-public class KeyDisabler {
-
- private static String KEYDISABLER_PATH = "/sys/class/sec/sec_touchkey/keypad_enable";
- /*
- * All HAF classes should export this boolean.
- * Real implementations must, of course, return true
- */
-
- public static boolean isSupported() {
- File f = new File(KEYDISABLER_PATH);
- return f.exists();
- }
-
- /*
- * Are the keys currently blocked?
- */
-
- public static boolean isActive() {
- int i;
- i = Integer.parseInt(FileUtils.readOneLine(KEYDISABLER_PATH));
-
- return i > 0 ? false : true;
- }
-
- /*
- * Disable capacitive keys
- */
-
- public static boolean setActive(boolean state) {
- return FileUtils.writeLine(KEYDISABLER_PATH, String.valueOf(state ? 0 : 1));
- }
-
-}
diff --git a/configs/egl.cfg b/configs/egl.cfg
deleted file mode 100644
index 2a11ba2..0000000
--- a/configs/egl.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-0 0 android
-0 1 adreno
diff --git a/configs/libnfc-brcm.conf b/configs/libnfc-brcm.conf
deleted file mode 100644
index 6d55f22..0000000
--- a/configs/libnfc-brcm.conf
+++ /dev/null
@@ -1,350 +0,0 @@
-###############################################################################
-# Application options
-APPL_TRACE_LEVEL=0x01
-PROTOCOL_TRACE_LEVEL=0x00000000
-
-###############################################################################
-# Logging
-# Set USE_RAW_NCI_TRACE = 1 for protocol logging in a raw format
-# instead of decoded
-# Set LOG_TO_FILE = 1 to log protocol traces to a file on the sdcard
-# instead of to adb logcat
-# Set LOGCAT_FILTER to the filter string which is passed to logcat
-#USE_RAW_NCI_TRACE=0
-#LOG_TO_FILE=0
-#LOGCAT_FILTER="BrcmNciX:V BrcmNciR:V BrcmNote:V *:S"
-
-
-###############################################################################
-# performance measurement
-# Change this setting to control how often USERIAL log the performance (throughput)
-# data on read/write/poll
-# defailt is to log performance dara for every 100 read or write
-#REPORT_PERFORMANCE_MEASURE=100
-
-###############################################################################
-# File used for NFA storage
-NFA_STORAGE="/data/nfc"
-
-###############################################################################
-# Snooze Mode Settings
-#
-# By default snooze mode is enabled. Set SNOOZE_MODE_CFG byte[0] to 0
-# to disable.
-#
-# If SNOOZE_MODE_CFG is not provided, the default settings are used:
-# They are as follows:
-# 8 Sleep Mode (0=Disabled 1=UART 8=SPI/I2C)
-# 0 Idle Threshold Host
-# 0 Idle Threshold HC
-# 0 NFC Wake active mode (0=ActiveLow 1=ActiveHigh)
-# 1 Host Wake active mode (0=ActiveLow 1=ActiveHigh)
-#
-#SNOOZE_MODE_CFG={08:00:00:00:01}
-
-###############################################################################
-# Low Power Mode Settings
-#
-# If NFA_DM_LP_CFG is not provided, stack default settings are
-# used (see nfa_dm_brcm_cfg.c). They are as follows:
-# 1 Power cycle to full power mode from CEx
-# 5 Parameter for low power mode command
-# 0 Primary Threshold for battery monitor
-# 0-7 representing below voltages:
-# {2, 2.2, 2.7, 2.8, 2.9, 3, 3.1, 3.2}
-# 8 Secondary Threshold for battery monitor
-# 0-15 representing below voltages:
-# {5.2, 4.87, 4.54, 4.22, 3.9, 3.73, 3.57, 3.4,
-# 3.2, 3.1, 3.0, 2.9, 2.8, 2.7, 2.2, 2.0}
-#
-#NFA_DM_LP_CFG={01:05:00:08}
-# LPM Disable FW VBAT MON
-NFA_DM_LP_CFG={01:01:00:08}
-
-###############################################################################
-# Insert a delay in milliseconds after NFC_WAKE and before write to NFCC
-NFC_WAKE_DELAY=20
-
-###############################################################################
-# Various Delay settings (in ms) used in USERIAL
-# POWER_ON_DELAY
-# Delay after turning on chip, before writing to transport (default 300)
-# PRE_POWER_OFF_DELAY
-# Delay after deasserting NFC-Wake before turn off chip (default 0)
-# POST_POWER_OFF_DELAY
-# Delay after turning off chip, before USERIAL_close returns (default 0)
-# CE3_PRE_POWER_OFF_DELAY
-# Delay after deasserting NFC-Wake before turn off chip (default 1000)
-# when going to CE3 Switch Off mode
-#
-#POWER_ON_DELAY=300
-PRE_POWER_OFF_DELAY=1500
-#POST_POWER_OFF_DELAY=0
-#CE3_PRE_POWER_OFF_DELAY=1000
-
-
-###############################################################################
-# Device Manager Config
-#
-# If NFA_DM_CFG is not provided, stack default settings are
-# used (see nfa_dm_cfg.c). They are as follows:
-# 0 (FALSE) Automatic NDEF detection when background polling
-# 0 (FALSE) Automatic NDEF read when background polling
-#
-#NFA_DM_CFG={00:00}
-
-###############################################################################
-# LPTD mode configuration
-# byte[0] is the length of the remaining bytes in this value
-# if set to 0, LPTD params will NOT be sent to NFCC (i.e. disabled).
-# byte[1] is the param id it should be set to B9.
-# byte[2] is the length of the LPTD parameters
-# byte[3] indicates if LPTD is enabled
-# if set to 0, LPTD will be disabled (parameters will still be sent).
-# byte[4-n] are the LPTD parameters.
-# By default, LPTD is enabled and default settings are used.
-#
-# These settings are tuned for B4 evaluation boards.
-# LPTD DISABLED ---
-#LPTD_CFG={29:B9:27:00:00:FF:FF:08:A0:0F:40:00:80:12:02:10:00:00:00:31:0B:30:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00}
-
-# Eval Board ---
-#LPTD_CFG={29:B9:27:01:00:FF:FF:08:A0:0F:40:00:80:12:02:10:00:00:00:31:0B:30:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00}
-
-# JF TMO NFC LPTD ENABLED
-LPTD_CFG={29:B9:27:01:00:FF:FF:0A:A0:0F:40:00:80:12:02:10:00:00:00:31:0F:30:00:00:01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00}
-
-###############################################################################
-# Default poll duration (in ms)
-# The defualt is 500ms if not set (see nfc_target.h) same as M0
-NFA_DM_DISC_DURATION_POLL=500
-
-###############################################################################
-# Startup Configuration (100 bytes maximum)
-#
-# For the 0xC2 parameter, set byte[0] to 60 to disable UICC Idle Timeout.
-# set to 61 to enable (The least significant bit of this byte enables
-# the power off when Idle mode).
-# 20 A1 07 00 == > These 4 bytes form a 4 byte value which decides the idle timeout(in us)
-# value to trigger the uicc deactivation.
-# NFC forum conformance
-#NFA_DM_START_UP_CFG={27:B2:04:E8:03:00:00:CF:02:02:08:CB:01:01:A5:01:01:CA:0A:00:00:00:00:06:F0:55:00:00:0F:80:01:01:B5:03:01:03:09:5B:01:02}
-# GCF combined + clfCfgTagPicc
-NFA_DM_START_UP_CFG={4F:CB:01:09:A5:01:01:CA:14:00:00:00:00:06:0C:D4:01:00:15:C0:E1:E4:00:C0:C6:2D:00:14:00:B5:03:01:02:FF:C2:08:61:00:82:04:80:C3:C9:01:80:01:01:C9:03:03:0F:AB:5B:01:02:B2:04:E8:03:00:00:CF:02:02:08:B1:06:00:20:00:00:00:12:B0:05:03:03:03:03:FF}
-
-###############################################################################
-# Startup Vendor Specific Configuration (100 bytes maximum);
-# byte[0] TLV total len = 0x5
-# byte[1] NCI_MTS_CMD|NCI_GID_PROP = 0x2f
-# byte[2] NCI_MSG_FRAME_LOG = 0x9
-# byte[3] 2
-# byte[4] 0=turn off RF frame logging; 1=turn on
-# byte[5] 0=turn off SWP frame logging; 1=turn on
-# NFA_DM_START_UP_VSC_CFG={05:2F:09:02:01:01}
-
-#HW FSM
-#NFA_DM_START_UP_VSC_CFG={04:2F:06:01:00}
-
-###############################################################################
-# Antenna Configuration - This data is used when setting 0xC8 config item
-# at startup (before discovery is started). If not used, no value is sent.
-#
-# The settings for this value are documented here:
-# http://wcgbu.broadcom.com/wpan/PM/Project%20Document%20Library/bcm20791B0/
-# Design/Doc/PHY%20register%20settings/BCM20791-B2-1027-02_PHY_Recommended_Reg_Settings.xlsx
-# This document is maintained by Paul Forshaw.
-#
-# The values marked as ?? should be tweaked per antenna or customer/app:
-# {20:C8:1E:06:??:00:??:??:??:00:??:24:00:1C:00:75:00:77:00:76:00:1C:00:03:00:0A:00:??:01:00:00:40:04}
-# array[0] = 0x20 is length of the payload from array[1] to the end
-# array[1] = 0xC8 is PREINIT_DSP_CFG
-PREINIT_DSP_CFG={20:C8:1E:06:1F:00:0A:03:30:00:04:24:00:1C:00:75:00:77:00:76:00:1C:00:03:00:0A:00:4E:01:00:00:40:04}
-
-###############################################################################
-# Configure crystal frequency when internal LPO can't detect the frequency.
-#XTAL_FREQUENCY=0
-
-###############################################################################
-# Use Nexus S NXP RC work to allow our stack/firmware to work with a retail
-# Nexus S that causes IOP issues. Note, this will not pass conformance and
-# should be removed for production.
-#USE_NXP_P2P_RC_WORKAROUND=1
-
-###############################################################################
-# Configure the default Destination Gate used by HCI (the default is 4, which
-# is the ETSI loopback gate.
-#NFA_HCI_DEFAULT_DEST_GATE=0x04
-
-###############################################################################
-# Configure the single default SE to use. The default is to use the first
-# SE that is detected by the stack. This value might be used when the phone
-# supports multiple SE (e.g. 0xF3 and 0xF4) but you want to force it to use
-# one of them (e.g. 0xF4).
-ACTIVE_SE=0xF4
-
-###############################################################################
-# Configure the NFC Extras to open and use a static pipe. If the value is
-# not set or set to 0, then the default is use a dynamic pipe based on a
-# destination gate (see NFA_HCI_DEFAULT_DEST_GATE). Note there is a value
-# for each UICC (where F3="UICC0" and F4="UICC1")
-NFA_HCI_STATIC_PIPE_ID_F3=0x71
-NFA_HCI_STATIC_PIPE_ID_F4=0x71
-
-###############################################################################
-# When disconnecting from Oberthur secure element, perform a warm-reset of
-# the secure element to deselect the applet.
-# The default hex value of the command is 0x3. If this variable is undefined,
-# then this feature is not used.
-OBERTHUR_WARM_RESET_COMMAND=0x03
-
-###############################################################################
-# Force UICC to only listen to the following technology(s).
-# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
-# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B.
-UICC_LISTEN_TECH_MASK=0x00
-
-###############################################################################
-# AID for Empty Select command
-# If specified, this AID will be substituted when an Empty SELECT command is
-# detected. The first byte is the length of the AID. Maximum length is 16.
-AID_FOR_EMPTY_SELECT={08:A0:00:00:01:51:00:00:00}
-
-###############################################################################
-# Force tag polling for the following technology(s).
-# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
-# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B |
-# NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 |
-# NFA_TECHNOLOGY_MASK_B_PRIME | NFA_TECHNOLOGY_MASK_A_ACTIVE |
-# NFA_TECHNOLOGY_MASK_F_ACTIVE.
-#
-# Notable bits:
-# NFA_TECHNOLOGY_MASK_A 0x01
-# NFA_TECHNOLOGY_MASK_B 0x02
-# NFA_TECHNOLOGY_MASK_F 0x04
-# NFA_TECHNOLOGY_MASK_ISO15693 0x08
-# NFA_TECHNOLOGY_MASK_B_PRIME 0x10
-# NFA_TECHNOLOGY_MASK_KOVIO 0x20
-# NFA_TECHNOLOGY_MASK_A_ACTIVE 0x40
-# NFA_TECHNOLOGY_MASK_F_ACTIVE 0x80
-POLLING_TECH_MASK=0xEF
-
-###############################################################################
-# Force P2P to only listen for the following technology(s).
-# The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
-# Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F |
-# NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE
-P2P_LISTEN_TECH_MASK=0xC4
-
-###############################################################################
-# Maximum Number of Credits to be allowed by the NFCC
-# This value overrides what the NFCC specifices allowing the host to have
-# the control to work-around transport limitations. If this value does
-# not exist or is set to 0, the NFCC will provide the number of credits.
-MAX_RF_DATA_CREDITS=1
-
-###############################################################################
-# This setting allows you to disable registering the T4t Virtual SE that causes
-# the NFCC to send PPSE requests to the DH.
-# The default setting is enabled (i.e. T4t Virtual SE is registered).
-#REGISTER_VIRTUAL_SE=1
-
-###############################################################################
-# When screen is turned off, specify the desired power state of the controller.
-# 0: power-off-sleep state; DEFAULT
-# 1: full-power state
-# 2: screen-off card-emulation (CE4/CE3/CE1 modes are used)
-# 3: FPM CE in snooze mode, Switch Off, Battery Off still available.
-SCREEN_OFF_POWER_STATE=3
-
-###############################################################################
-# Firmware patch file
-# If the value is not set then patch download is disabled.
-FW_PATCH="/vendor/firmware/bcm2079xB4_firmware.ncd"
-
-###############################################################################
-# Firmware pre-patch file (sent before the above patch file)
-# If the value is not set then pre-patch is not used.
-FW_PRE_PATCH="/vendor/firmware/bcm2079xB4_pre_firmware.ncd"
-
-###############################################################################
-# SPD Debug mode
-# If set to 1, any failure of downloading a patch will trigger a hard-stop
-#SPD_DEBUG=0
-
-###############################################################################
-# SPD Max Retry Count
-# The number of attempts to download a patch before giving up (defualt is 3).
-# Note, this resets after a power-cycle.
-#SPD_MAX_RETRY_COUNT=3
-
-###############################################################################
-# Patch RAM Version Checking
-# By default the stack will reject any attempt to download a patch where major
-# version is < the one that is in NVM. If this config item is set to 1 then
-# this version check is skipped.
-#
-#SPD_IGNORE_VERSION=0
-
-###############################################################################
-# transport driver
-#
-# TRANSPORT_DRIVER=<driver>
-#
-# where <driver> can be, for example:
-# "/dev/ttyS" (UART)
-# "/dev/bcmi2cnfc" (I2C)
-# "hwtun" (HW Tunnel)
-# "/dev/bcmspinfc" (SPI)
-# "/dev/btusb0" (BT USB)
-TRANSPORT_DRIVER="/dev/bcm2079x"
-
-###############################################################################
-# power control driver
-# Specify a kernel driver that support ioctl commands to control NFC_EN and
-# NFC_WAKE gpio signals.
-#
-# POWER_CONTRL_DRIVER=<driver>
-# where <driver> can be, for example:
-# "/dev/nfcpower"
-# "/dev/bcmi2cnfc" (I2C)
-# "/dev/bcmspinfc" (SPI)
-# i2c and spi driver may be used to control NFC_EN and NFC_WAKE signal
-POWER_CONTROL_DRIVER="/dev/bcm2079x"
-
-###############################################################################
-# I2C transport driver options
-#
-BCMI2CNFC_ADDRESS=0
-
-###############################################################################
-# I2C transport driver try to read multiple packets in read() if data is available
-# remove the comment below to enable this feature
-#READ_MULTIPLE_PACKETS=1
-
-###############################################################################
-# SPI transport driver options
-#SPI_NEGOTIATION={0A:F0:00:01:00:00:00:FF:FF:00:00}
-
-###############################################################################
-# UART transport driver options
-#
-# PORT=1,2,3,...
-# BAUD=115200, 19200, 9600, 4800,
-# DATABITS=8, 7, 6, 5
-# PARITY="even" | "odd" | "none"
-# STOPBITS="0" | "1" | "1.5" | "2"
-
-#UART_PORT=2
-#UART_BAUD=115200
-#UART_DATABITS=8
-#UART_PARITY="none"
-#UART_STOPBITS="1"
-
-###############################################################################
-# Insert a delay in microseconds per byte after a write to NFCC.
-# after writing a block of data to the NFCC, delay this an amopunt of time before
-# writing next block of data. the delay is calculated as below
-# NFC_WRITE_DELAY * (number of byte written) / 1000 milliseconds
-# e.g. after 259 bytes is written, delay (259 * 20 / 1000) 5 ms before next write
-NFC_WRITE_DELAY=20
-
diff --git a/configs/media_codecs.xml b/configs/media_codecs.xml
deleted file mode 100644
index 74aed30..0000000
--- a/configs/media_codecs.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012-2013, The Linux Foundation. All rights reserved.
- Not a contribution.
-
- 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.
--->
-
-<MediaCodecs>
- <Encoders>
- <MediaCodec name="OMX.google.aac.encoder" type="audio/mp4a-latm" />
- <MediaCodec name="OMX.qcom.audio.encoder.evrc" type="audio/evrc" >
- <Quirk name="requires-allocate-on-input-ports" />
- <Quirk name="requires-allocate-on-output-ports" />
- </MediaCodec>
- <MediaCodec name="OMX.google.flac.encoder" type="audio/flac"/>
- <MediaCodec name="OMX.qcom.audio.encoder.qcelp13" type="audio/qcelp" >
- <Quirk name="requires-allocate-on-input-ports" />
- <Quirk name="requires-allocate-on-output-ports" />
- </MediaCodec>
- <MediaCodec name="AACEncoder" type="audio/mp4a-latm" />
- <MediaCodec name="OMX.google.amrnb.encoder" type="audio/3gpp" />
- <MediaCodec name="OMX.google.amrwb.encoder" type="audio/amr-wb" />
- <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"/>
- </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"/>
- </MediaCodec>
- <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"/>
- </MediaCodec>
-
- <MediaCodec name="OMX.google.vp8.encoder" type="video/x-vnd.on2.vp8" />
- </Encoders>
- <Decoders>
- <!-- Audio Hardware -->
- <MediaCodec name="OMX.qcom.audio.decoder.wma" type="audio/x-ms-wma" >
- <Quirk name="requires-global-flush" />
- <Quirk name="requires-wma-pro-component" />
- </MediaCodec>
- <MediaCodec name="OMX.qcom.audio.decoder.wmaLossLess" type="audio/x-ms-wma" >
- <Quirk name="requires-global-flush" />
- </MediaCodec>
- <MediaCodec name="OMX.qcom.audio.decoder.wma10Pro" type="audio/x-ms-wma" >
- <Quirk name="requires-global-flush" />
- </MediaCodec>
- <MediaCodec name="OMX.qcom.audio.decoder.amrwbplus" type="audio/amr-wb-plus" >
- </MediaCodec>
- <!-- Audio Software -->
- <MediaCodec name="OMX.google.vorbis.decoder" type="audio/vorbis" />
- <MediaCodec name="OMX.google.gsm.decoder" type="audio/gsm" />
- <MediaCodec name="OMX.google.mp3.decoder" type="audio/mpeg" />
- <MediaCodec name="MP3Decoder" type="audio/mpeg" />
- <MediaCodec name="OMX.google.amrnb.decoder" type="audio/3gpp" />
- <MediaCodec name="OMX.google.amrwb.decoder" type="audio/amr-wb" />
- <MediaCodec name="OMX.google.aac.decoder" type="audio/mp4a-latm" />
- <MediaCodec name="OMX.google.g711.alaw.decoder" type="audio/g711-alaw" />
- <MediaCodec name="OMX.google.g711.mlaw.decoder" type="audio/g711-mlaw" />
- <MediaCodec name="OMX.qcom.audio.decoder.Qcelp13" type="audio/qcelp" >
- <Quirk name="requires-global-flush" />
- </MediaCodec>
- <MediaCodec name="OMX.qcom.audio.decoder.evrc" type="audio/evrc" >
- <Quirk name="requires-global-flush" />
- </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" />
- <Quirk name="defers-output-buffer-allocation" />
- </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" />
- <Quirk name="defers-output-buffer-allocation" />
- </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" />
- <Quirk name="defers-output-buffer-allocation" />
- </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" />
- <Quirk name="defers-output-buffer-allocation" />
- </MediaCodec>
- <MediaCodec name="OMX.qcom.video.decoder.avc" type="video/avc" >
- <Quirk name="requires-allocate-on-input-ports" />
- <Quirk name="requires-allocate-on-output-ports"/>
- <Quirk name="defers-output-buffer-allocation"/>
- </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"/>
- <Quirk name="defers-output-buffer-allocation"/>
- </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"/>
- <Quirk name="defers-output-buffer-allocation"/>
- </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"/>
- <Quirk name="defers-output-buffer-allocation"/>
- </MediaCodec>
- <MediaCodec name="OMX.google.vp8.decoder" type="video/x-vnd.on2.vp8" />
- <MediaCodec name="OMX.google.vp9.decoder" type="video/x-vnd.on2.vp9" />
- <MediaCodec name="OMX.google.h264.decoder" type="video/avc" />
- <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" />
- <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" />
-
- <!-- ffmpeg audio codecs -->
- <MediaCodec name="OMX.ffmpeg.ra.decoder" type="audio/vnd.rn-realaudio"/>
- <MediaCodec name="OMX.ffmpeg.flac.decoder" type="audio/flac"/>
- <MediaCodec name="OMX.ffmpeg.mp2.decoder" type="audio/mpeg-L2"/>
- <MediaCodec name="OMX.ffmpeg.ac3.decoder" type="audio/ac3"/>
- <MediaCodec name="OMX.ffmpeg.ape.decoder" type="audio/x-ape"/>
- <MediaCodec name="OMX.ffmpeg.dts.decoder" type="audio/vnd.dts"/>
- <MediaCodec name="OMX.ffmpeg.atrial.decoder" type="audio/ffmpeg"/>
-
- <!-- ffmpeg video codecs -->
- <MediaCodec name="OMX.ffmpeg.mpeg2v.decoder" type="video/mpeg2"/>
- <MediaCodec name="OMX.ffmpeg.wmv.decoder" type="video/x-ms-wmv"/>
- <MediaCodec name="OMX.ffmpeg.rv.decoder" type="video/vnd.rn-realvideo"/>
- <MediaCodec name="OMX.ffmpeg.vc1.decoder" type="video/vc1"/>
- <MediaCodec name="OMX.ffmpeg.flv1.decoder" type="video/x-flv"/>
- <MediaCodec name="OMX.ffmpeg.divx.decoder" type="video/divx"/>
- <MediaCodec name="OMX.ffmpeg.hevc.decoder" type="video/hevc"/>
- <MediaCodec name="OMX.ffmpeg.vtrial.decoder" type="video/ffmpeg"/>
- </Decoders>
-</MediaCodecs>
diff --git a/configs/media_profiles.xml b/configs/media_profiles.xml
deleted file mode 100644
index 499e1fd..0000000
--- a/configs/media_profiles.xml
+++ /dev/null
@@ -1,594 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 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.
--->
-<!--
- Copyright (c) 2012, The Linux Foundation. All rights reserved.
- Not a Contribution, Apache license notifications and license are retained
- for attribution purposes only.
--->
-<!DOCTYPE MediaSettings [
-<!ELEMENT MediaSettings (CamcorderProfiles,
- EncoderOutputFileFormat+,
- VideoEncoderCap+,
- AudioEncoderCap+,
- VideoDecoderCap,
- AudioDecoderCap)>
- <!ELEMENT CamcorderProfiles (EncoderProfile+, ImageEncoding+, ImageDecoding, Camera)>
-<!ELEMENT EncoderProfile (Video, Audio)>
-<!ATTLIST EncoderProfile quality (timelapse1080p|timelapse720p|timelapse480p|timelapsehigh|timelapselow|480p|qvga|high|low) #REQUIRED>
-<!ATTLIST EncoderProfile fileFormat (mp4|3gp) #REQUIRED>
-<!ATTLIST EncoderProfile duration (30|60) #REQUIRED>
-<!ATTLIST EncoderProfile cameraId (0|1) #REQUIRED>
-<!ELEMENT Video EMPTY>
-<!ATTLIST Video codec (h264|h263|m4v) #REQUIRED>
-<!ATTLIST Video bitRate CDATA #REQUIRED>
-<!ATTLIST Video width CDATA #REQUIRED>
-<!ATTLIST Video height CDATA #REQUIRED>
-<!ATTLIST Video frameRate CDATA #REQUIRED>
-<!ELEMENT Audio EMPTY>
-<!ATTLIST Audio codec (amrnb|amrwb|aac|lpcm) #REQUIRED>
-<!ATTLIST Audio bitRate CDATA #REQUIRED>
-<!ATTLIST Audio sampleRate CDATA #REQUIRED>
-<!ATTLIST Audio channels (1|2|6) #REQUIRED>
-<!ELEMENT ImageEncoding EMPTY>
-<!ATTLIST ImageEncoding quality (90|80|70|60|50|40) #REQUIRED>
-<!ELEMENT ImageDecoding EMPTY>
-<!ATTLIST ImageDecoding memCap CDATA #REQUIRED>
-<!ELEMENT Camera EMPTY>
-<!ATTLIST Camera previewFrameRate CDATA #REQUIRED>
-<!ELEMENT EncoderOutputFileFormat EMPTY>
-<!ATTLIST EncoderOutputFileFormat name (mp4|3gp) #REQUIRED>
-<!ELEMENT VideoEncoderCap EMPTY>
-<!ATTLIST VideoEncoderCap name (h264|h263|m4v|wmv) #REQUIRED>
-<!ATTLIST VideoEncoderCap enabled (true|false) #REQUIRED>
-<!ATTLIST VideoEncoderCap minBitRate CDATA #REQUIRED>
-<!ATTLIST VideoEncoderCap maxBitRate CDATA #REQUIRED>
-<!ATTLIST VideoEncoderCap minFrameWidth CDATA #REQUIRED>
-<!ATTLIST VideoEncoderCap maxFrameWidth CDATA #REQUIRED>
-<!ATTLIST VideoEncoderCap minFrameHeight CDATA #REQUIRED>
-<!ATTLIST VideoEncoderCap maxFrameHeight CDATA #REQUIRED>
-<!ATTLIST VideoEncoderCap minFrameRate CDATA #REQUIRED>
-<!ATTLIST VideoEncoderCap maxFrameRate CDATA #REQUIRED>
-<!ELEMENT AudioEncoderCap EMPTY>
-<!ATTLIST AudioEncoderCap name (amrnb|amrwb|aac|wma|lpcm) #REQUIRED>
-<!ATTLIST AudioEncoderCap enabled (true|false) #REQUIRED>
-<!ATTLIST AudioEncoderCap minBitRate CDATA #REQUIRED>
-<!ATTLIST AudioEncoderCap maxBitRate CDATA #REQUIRED>
-<!ATTLIST AudioEncoderCap minSampleRate CDATA #REQUIRED>
-<!ATTLIST AudioEncoderCap maxSampleRate CDATA #REQUIRED>
-<!ATTLIST AudioEncoderCap minChannels (1|2|6) #REQUIRED>
-<!ATTLIST AudioEncoderCap maxChannels (1|2|6) #REQUIRED>
-<!ELEMENT VideoDecoderCap EMPTY>
-<!ATTLIST VideoDecoderCap name (wmv) #REQUIRED>
-<!ATTLIST VideoDecoderCap enabled (true|false) #REQUIRED>
-<!ELEMENT AudioDecoderCap EMPTY>
-<!ATTLIST AudioDecoderCap name (wma) #REQUIRED>
-<!ATTLIST AudioDecoderCap enabled (true|false) #REQUIRED>
-<!ELEMENT VideoEditorCap EMPTY>
-<!ATTLIST VideoEditorCap maxInputFrameWidth CDATA #REQUIRED>
-<!ATTLIST VideoEditorCap maxInputFrameHeight CDATA #REQUIRED>
-<!ATTLIST VideoEditorCap maxOutputFrameWidth CDATA #REQUIRED>
-<!ATTLIST VideoEditorCap maxOutputFrameHeight CDATA #REQUIRED>
-<!ATTLIST VideoEditorCap maxPrefetchYUVFrames CDATA #REQUIRED>
-<!ELEMENT ExportVideoProfile EMPTY>
-<!ATTLIST ExportVideoProfile name (h264|h263|m4v) #REQUIRED>
-<!ATTLIST ExportVideoProfile profile CDATA #REQUIRED>
-<!ATTLIST ExportVideoProfile level CDATA #REQUIRED>
-]>
-<!--
- 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="m4v"
- bitRate="128000"
- width="320"
- height="240"
- frameRate="15" />
-
- <Audio codec="amrnb"
- bitRate="12200"
- sampleRate="8000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="high" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="17000000"
- width="1920"
- height="1080"
- frameRate="30" />
-
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="2" />
- </EncoderProfile>
-
- <EncoderProfile quality="qvga" fileFormat="3gp" duration="30">
- <Video codec="m4v"
- bitRate="128000"
- width="320"
- height="240"
- frameRate="15" />
-
- <Audio codec="amrnb"
- bitRate="12200"
- sampleRate="8000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="3078000"
- width="640"
- height="480"
- frameRate="30" />
-
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="2" />
- </EncoderProfile>
-
- <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="12000000"
- width="1280"
- height="720"
- frameRate="30" />
-
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="2" />
- </EncoderProfile>
-
- <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="17000000"
- width="1920"
- height="1080"
- frameRate="30" />
-
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="2" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapselow" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="384000"
- width="176"
- height="144"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="17000000"
- width="1920"
- height="1080"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="384000"
- width="176"
- height="144"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapseqvga" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="767000"
- width="320"
- height="240"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="3078000"
- width="640"
- height="480"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="12000000"
- width="1280"
- height="720"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="17000000"
- width="1920"
- height="1080"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </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="m4v"
- bitRate="128000"
- width="320"
- height="240"
- frameRate="15" />
-
- <Audio codec="amrnb"
- bitRate="12200"
- sampleRate="8000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="high" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="17000000"
- width="1920"
- height="1080"
- frameRate="30" />
-
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="2" />
- </EncoderProfile>
-
- <EncoderProfile quality="qvga" fileFormat="3gp" duration="30">
- <Video codec="m4v"
- bitRate="128000"
- width="320"
- height="240"
- frameRate="15" />
-
- <Audio codec="amrnb"
- bitRate="12200"
- sampleRate="8000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="480p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="3078000"
- width="640"
- height="480"
- frameRate="30" />
-
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="2" />
- </EncoderProfile>
-
- <EncoderProfile quality="720p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="12000000"
- width="1280"
- height="720"
- frameRate="30" />
-
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="2" />
- </EncoderProfile>
-
- <EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="17000000"
- width="1920"
- height="1080"
- frameRate="30" />
-
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="2" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapselow" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="384000"
- width="176"
- height="144"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="17000000"
- width="1920"
- height="1080"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapseqcif" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="384000"
- width="176"
- height="144"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapseqvga" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="767000"
- width="320"
- height="240"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapse480p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="3078000"
- width="640"
- height="480"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="12000000"
- width="1280"
- height="720"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </EncoderProfile>
-
- <EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
- <Video codec="h264"
- bitRate="17000000"
- width="1920"
- height="1080"
- frameRate="30" />
-
- <!--
- The Audio part of the profile will not be used since time lapse mode
- does not capture audio
- -->
- <Audio codec="aac"
- bitRate="128000"
- sampleRate="48000"
- channels="1" />
- </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="20000000"
- minFrameWidth="176" maxFrameWidth="1920"
- minFrameHeight="144" maxFrameHeight="1080"
- minFrameRate="1" maxFrameRate="30" />
-
- <VideoEncoderCap name="h263" enabled="true"
- minBitRate="64000" maxBitRate="1000000"
- minFrameWidth="176" maxFrameWidth="800"
- minFrameHeight="144" maxFrameHeight="480"
- minFrameRate="1" maxFrameRate="30" />
-
- <VideoEncoderCap name="m4v" enabled="true"
- minBitRate="64000" maxBitRate="20000000"
- minFrameWidth="176" maxFrameWidth="1920"
- minFrameHeight="144" maxFrameHeight="1080"
- minFrameRate="1" maxFrameRate="30" />
-
- <AudioEncoderCap name="aac" enabled="true"
- minBitRate="8192" maxBitRate="196000"
- minSampleRate="8000" maxSampleRate="48000"
- minChannels="1" maxChannels="2" />
-
- <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" />
-
- <!--
- 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="1080" 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>
diff --git a/configs/nfcee_access.xml b/configs/nfcee_access.xml
deleted file mode 100644
index 5f8db9e..0000000
--- a/configs/nfcee_access.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Applications granted NFCEE access on user builds
-
- See packages/apps/Nfc/etc/sample_nfcee_access.xml for full documentation.
- -->
-
- <!-- Google wallet release signature -->
- <signer android:signature="3082044c30820334a003020102020900a8cd17c93da5d990300d06092a864886f70d01010505003077310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f6964311330110603550403130a476f6f676c65204e4643301e170d3131303332343031303635335a170d3338303830393031303635335a3077310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f6964311330110603550403130a476f6f676c65204e464330820120300d06092a864886f70d01010105000382010d00308201080282010100c30f88add9b492096a2c586a5a9a80356bfa026958f8ff0c5dfaf59f49268ad870dee821a53e1f5b170fc96245a3c982a7cb4527053be35e34f396d24b2291ec0c528d6e26927465e06875ea621f7ff98c40e3345b204907cc9354743acdaace65565f48ba74cd4121cdc876df3522badb095c20d934c56a3e5c393ee5f0e02f8fe0621f918d1f35a82489252c6fa6b63392a7686b3e48612d06a9cf6f49bff11d5d96289c9dfe14ac5762439697dd29eafdb9810de3263513a905ac8e8eaf20907e46750a5ab7bf9a77262f47b03f5a3c6e6d7b51343f69c7f725f70bcc1b4ad592250b705a86e6e83ee2ae37fe5701bcbdb26feefdfff60f6a5bdfb5b64793020103a381dc3081d9301d0603551d0e041604141ccece0eea4dc1121fc7515f0d0a0c72e08cc96d3081a90603551d230481a130819e80141ccece0eea4dc1121fc7515f0d0a0c72e08cc96da17ba4793077310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f6964311330110603550403130a476f6f676c65204e4643820900a8cd17c93da5d990300c0603551d13040530030101ff300d06092a864886f70d01010505000382010100a470c728e1d31b06d9af6ae768b565046c57806b9843724931d75d4ca10c321520d33ccfed2aa65462234c9ef9b6f910cc676b99cb7f9895d6c06763574fbb78331275dc5cf38fbaa918d7938c051ffba2ade8f303cde8d9e68a048d1fdb9e7c9f2a49b222c68fff422bf15569b85eeeedb04aa30873dbe64b9c9e74f8f2c2f6c40124aaa8d1780d18512b540add28b3e9581971a4170dd868cf5f31e44712b2c23bb51037d7ef9f87a6e5bdb35e2ceb6bb022636c17a56a96bc7a50258c0bd2ed7b31555a18452e17321a0d52838c82f63f742d74ff79586a5cbb7faf7198a84bcf744310e9e927597f00a23dd00660800c2238d90b2fb372dfdbba75bd852e" />
-</resources>
diff --git a/configs/thermal-engine.conf b/configs/thermal-engine.conf
deleted file mode 100644
index 77e2d72..0000000
--- a/configs/thermal-engine.conf
+++ /dev/null
@@ -1,38 +0,0 @@
-sampling 5000
-
-[CPU0_MONITOR]
-algo_type monitor
-sensor cpu0
-sampling 1000
-thresholds 90000 100000 110000 115000 120000
-thresholds_clr 85000 95000 105000 110000 115000
-actions battery battery battery battery shutdown
-action_info 0 1 2 3 5000
-
-[CPU1_MONITOR]
-algo_type monitor
-sensor cpu1
-sampling 1000
-thresholds 120000
-thresholds_clr 115000
-actions shutdown
-action_info 5000
-
-[CPU2_MONITOR]
-algo_type monitor
-sensor cpu2
-sampling 1000
-thresholds 120000
-thresholds_clr 115000
-actions shutdown
-action_info 5000
-
-[CPU3_MONITOR]
-algo_type monitor
-sensor cpu3
-sampling 1000
-thresholds 120000
-thresholds_clr 115000
-actions shutdown
-action_info 5000
-
diff --git a/configs/thermald.conf b/configs/thermald.conf
deleted file mode 100644
index 01b6a9c..0000000
--- a/configs/thermald.conf
+++ /dev/null
@@ -1,92 +0,0 @@
-sampling 5000
-
-[pa_therm0]
-sampling 5000
-thresholds 70
-thresholds_clr 67
-actions none
-action_info 0
-
-[tsens_tz_sensor0]
-sampling 1000
-thresholds 70
-thresholds_clr 67
-actions none
-action_info 0
-
-[tsens_tz_sensor1]
-sampling 1000
-thresholds 70
-thresholds_clr 67
-actions none
-action_info 0
-
-[tsens_tz_sensor2]
-sampling 1000
-thresholds 70
-thresholds_clr 67
-actions none
-action_info 0
-
-[tsens_tz_sensor3]
-sampling 1000
-thresholds 70
-thresholds_clr 67
-actions none
-action_info 0
-
-[tsens_tz_sensor4]
-sampling 1000
-thresholds 70
-thresholds_clr 67
-actions none
-action_info 0
-
-[tsens_tz_sensor5]
-sampling 1000
-thresholds 70
-thresholds_clr 67
-actions none
-action_info 0
-
-[tsens_tz_sensor6]
-sampling 1000
-thresholds 70
-thresholds_clr 67
-actions none
-action_info 0
-
-[tsens_tz_sensor7]
-sampling 1000
-thresholds 70 90 95 100 105 110 115 120
-thresholds_clr 67 85 90 95 100 105 110 115
-actions cpu+battery cpu+battery cpu+battery cpu+battery cpu+battery cpu+battery cpu+battery shutdown
-action_info 1728000+0 1188000+0 810000+1 648000+1 540000+2 487000+2 384000+3 5000
-
-[tsens_tz_sensor8]
-sampling 1000
-thresholds 70 90 95 100 105 110 115 120
-thresholds_clr 67 85 90 95 100 105 110 115
-actions cpu cpu cpu cpu cpu cpu cpu shutdown
-action_info 1728000 1188000 810000 648000 540000 487000 384000 5000
-
-[tsens_tz_sensor9]
-sampling 1000
-thresholds 70 90 95 100 105 110 115 120
-thresholds_clr 67 85 90 95 100 105 110 115
-actions cpu cpu cpu cpu cpu cpu cpu shutdown
-action_info 1728000 1188000 810000 648000 540000 487000 384000 5000
-
-[tsens_tz_sensor10]
-sampling 1000
-thresholds 70 90 95 100 105 110 115 120
-thresholds_clr 67 85 90 95 100 105 110 115
-actions cpu cpu cpu cpu cpu cpu cpu shutdown
-action_info 1728000 1188000 810000 648000 540000 487000 384000 5000
-
-[pm8821_tz]
-thresholds 107
-thresholds_clr 103
-actions cpu
-action_info 918000
-
diff --git a/consumerir/Android.mk b/consumerir/Android.mk
deleted file mode 100644
index 091d1b7..0000000
--- a/consumerir/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2013 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.
-
-# HAL module implementation stored in
-# hw/<POWERS_HARDWARE_MODULE_ID>.<ro.hardware>.so
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := consumerir.msm8960
-LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
-LOCAL_SRC_FILES := consumerir.c
-LOCAL_SHARED_LIBRARIES := liblog libcutils
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/consumerir/consumerir.c b/consumerir/consumerir.c
deleted file mode 100644
index d935118..0000000
--- a/consumerir/consumerir.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2013 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 "ConsumerIrHal"
-
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <cutils/log.h>
-#include <hardware/hardware.h>
-#include <hardware/consumerir.h>
-
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
-
-static const consumerir_freq_range_t consumerir_freqs[] = {
- {.min = 30000, .max = 30000},
- {.min = 33000, .max = 33000},
- {.min = 36000, .max = 36000},
- {.min = 38000, .max = 38000},
- {.min = 40000, .max = 40000},
- {.min = 56000, .max = 56000},
-};
-
-int fd = 0;
-static int consumerir_transmit(struct consumerir_device *dev,
- int carrier_freq, int pattern[], int pattern_len)
-{
- int strlen;
- int i;
- char buffer[1024];
-
- memset(buffer, 0, 1024);
-
- /* write the header */
- strlen = sprintf(buffer, "%d,", carrier_freq);
-
- /* calculate factor of conversion from microseconds to pulses */
- float factor = 1000000 / carrier_freq;
-
- /* write out the timing pattern */
- for (i = 0; i < pattern_len; i++)
- {
- strlen += sprintf(buffer + strlen, "%d,", (int) (pattern[i]/factor));
- }
-
- buffer[strlen - 1] = 0;
-
- write(fd, buffer, strlen - 1);
-
- return 0;
-}
-
-static int consumerir_get_num_carrier_freqs(struct consumerir_device *dev)
-{
- return ARRAY_SIZE(consumerir_freqs);
-}
-
-static int consumerir_get_carrier_freqs(struct consumerir_device *dev,
- size_t len, consumerir_freq_range_t *ranges)
-{
- size_t to_copy = ARRAY_SIZE(consumerir_freqs);
-
- to_copy = len < to_copy ? len : to_copy;
- memcpy(ranges, consumerir_freqs, to_copy * sizeof(consumerir_freq_range_t));
- return to_copy;
-}
-
-static int consumerir_close(hw_device_t *dev)
-{
- free(dev);
- close(fd);
- return 0;
-}
-
-/*
- * Generic device handling
- */
-static int consumerir_open(const hw_module_t* module, const char* name,
- hw_device_t** device)
-{
- if (strcmp(name, CONSUMERIR_TRANSMITTER) != 0) {
- return -EINVAL;
- }
- if (device == NULL) {
- ALOGE("NULL device on open");
- return -EINVAL;
- }
-
- consumerir_device_t *dev = malloc(sizeof(consumerir_device_t));
- memset(dev, 0, sizeof(consumerir_device_t));
-
- dev->common.tag = HARDWARE_DEVICE_TAG;
- dev->common.version = 0;
- dev->common.module = (struct hw_module_t*) module;
- dev->common.close = consumerir_close;
-
- dev->transmit = consumerir_transmit;
- dev->get_num_carrier_freqs = consumerir_get_num_carrier_freqs;
- dev->get_carrier_freqs = consumerir_get_carrier_freqs;
-
- *device = (hw_device_t*) dev;
- fd = open("/sys/class/sec/sec_ir/ir_send", O_RDWR);
- return 0;
-}
-
-static struct hw_module_methods_t consumerir_module_methods = {
- .open = consumerir_open,
-};
-
-consumerir_module_t HAL_MODULE_INFO_SYM = {
- .common = {
- .tag = HARDWARE_MODULE_TAG,
- .module_api_version = CONSUMERIR_MODULE_API_VERSION_1_0,
- .hal_api_version = HARDWARE_HAL_API_VERSION,
- .id = CONSUMERIR_HARDWARE_MODULE_ID,
- .name = "Consumer IR Module",
- .author = "The CyanogenMod Project",
- .methods = &consumerir_module_methods,
- },
-};
diff --git a/device-proprietary-files.txt b/device-proprietary-files.txt
new file mode 100644
index 0000000..1677e7f
--- /dev/null
+++ b/device-proprietary-files.txt
@@ -0,0 +1,29 @@
+# jflte camera blobs
+
+# Audio firmware (Verizon)
+blobs/vzw/etc/firmware/q6.b00
+blobs/vzw/etc/firmware/q6.b01
+blobs/vzw/etc/firmware/q6.b03
+blobs/vzw/etc/firmware/q6.b04
+blobs/vzw/etc/firmware/q6.b05
+blobs/vzw/etc/firmware/q6.b06
+blobs/vzw/etc/firmware/q6.mdt
+
+# Camera
+lib/libvdis.so
+
+# Camera firmware
+cameradata/M10MO_SFW.bin
+cameradata/RS_M10MO_OL.bin
+cameradata/RS_M10MO_OS.bin
+cameradata/RS_M10MO_SL.bin
+cameradata/RS_M10MO_SS.bin
+
+#Radio
+blobs/cdma/lib/libsec-ril.so
+blobs/cdma/lib/libril.so
+blobs/gsm/lib/libsec-ril.so
+blobs/gsm/lib/libril.so
+
+# Sensors
+lib/libsensirion_j1.so
diff --git a/device.mk b/device.mk
index 978c422..2bf85d3 100644
--- a/device.mk
+++ b/device.mk
@@ -14,197 +14,11 @@
# limitations under the License.
#
-$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
-
# Get non-open-source specific aspects if available
$(call inherit-product-if-exists, vendor/samsung/jflte/jflte-vendor.mk)
# Overlay
DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay
-# Permissions
-PRODUCT_COPY_FILES += \
- frameworks/native/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml \
- frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \
- frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
- frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.flash-autofocus.xml \
- frameworks/native/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \
- frameworks/native/data/etc/android.hardware.consumerir.xml:system/etc/permissions/android.hardware.consumerir.xml \
- frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
- frameworks/native/data/etc/android.hardware.nfc.xml:system/etc/permissions/android.hardware.nfc.xml \
- frameworks/native/data/etc/android.hardware.nfc.hce.xml:system/etc/permissions/android.hardware.nfc.hce.xml \
- frameworks/native/data/etc/android.hardware.sensor.barometer.xml:system/etc/permissions/android.hardware.sensor.barometer.xml \
- frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:system/etc/permissions/android.hardware.sensor.gyroscope.xml \
- frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \
- frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
- frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:system/etc/permissions/android.hardware.sensor.stepcounter.xml \
- frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:system/etc/permissions/android.hardware.sensor.stepdetector.xml \
- frameworks/native/data/etc/android.hardware.telephony.cdma.xml:system/etc/permissions/android.hardware.telephony.cdma.xml \
- frameworks/native/data/etc/android.hardware.telephony.gsm.xml:system/etc/permissions/android.hardware.telephony.gsm.xml \
- frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
- frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \
- frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \
- frameworks/native/data/etc/android.hardware.wifi.direct.xml:system/etc/permissions/android.hardware.wifi.direct.xml \
- frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
- frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
- frameworks/native/data/etc/com.android.nfc_extras.xml:system/etc/permissions/com.android.nfc_extras.xml \
- frameworks/native/data/etc/com.nxp.mifare.xml:system/etc/permissions/com.nxp.mifare.xml \
- frameworks/native/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml
-
-# System Properties
-PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
- persist.sys.usb.config=mtp
-
-# Device uses high-density artwork where available
-PRODUCT_AAPT_CONFIG := normal hdpi xhdpi xxhdpi
-PRODUCT_AAPT_PREF_CONFIG := xxhdpi
-
-# Boot animation
-TARGET_SCREEN_HEIGHT := 1920
-TARGET_SCREEN_WIDTH := 1080
-
-$(call inherit-product, frameworks/native/build/phone-xxhdpi-2048-dalvik-heap.mk)
-
-$(call inherit-product-if-exists, frameworks/native/build/phone-xxhdpi-2048-hwui-memory.mk)
-
-# Audio
-PRODUCT_PACKAGES += \
- audio.a2dp.default \
- audio_policy.msm8960 \
- audio.primary.msm8960 \
- audio.r_submix.default \
- audio.usb.default \
- libaudio-resampler
-
-# Audio configuration
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/audio/audio_policy.conf:system/etc/audio_policy.conf \
- $(LOCAL_PATH)/audio/snd_soc_msm_2x_Fusion3:system/etc/snd_soc_msm/snd_soc_msm_2x_Fusion3
-
-# Bluetooth
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/bluetooth/bcm4335_prepatch.hcd:system/vendor/firmware/bcm4335_prepatch.hcd
-
-# Camera Wrapper
-PRODUCT_PACKAGES += \
- camera.msm8960
-
-# CRDA
-PRODUCT_PACKAGES += \
- crda \
- linville.key.pub.pem \
- regdbdump \
- regulatory.bin
-
-# Display
-PRODUCT_PACKAGES += \
- copybit.msm8960 \
- gralloc.msm8960 \
- hwcomposer.msm8960 \
- libgenlock \
- memtrack.msm8960
-
-# GPS
-PRODUCT_PACKAGES += \
- gps.msm8960
-
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/gps/etc/gps.conf:/system/etc/gps.conf \
- $(LOCAL_PATH)/gps/etc/sap.conf:/system/etc/sap.conf
-
-# IR
-PRODUCT_PACKAGES += \
- consumerir.msm8960
-
-# Keylayouts
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/keylayout/atmel_mxt_ts.kl:system/usr/keylayout/atmel_mxt_ts.kl \
- $(LOCAL_PATH)/keylayout/Button_Jack.kl:system/usr/keylayout/Button_Jack.kl \
- $(LOCAL_PATH)/keylayout/gpio-keys.kl:system/usr/keylayout/gpio-keys.kl \
- $(LOCAL_PATH)/keylayout/philips_remote_ir.kl:system/usr/keylayout/philips_remote_ir.kl \
- $(LOCAL_PATH)/keylayout/samsung_remote_ir.kl:system/usr/keylayout/samsung_remote_ir.kl \
- $(LOCAL_PATH)/keylayout/sec_touchkey.kl:system/usr/keylayout/sec_touchkey.kl \
- $(LOCAL_PATH)/keylayout/ue_rf4ce_remote.kl:system/usr/keylayout/ue_rf4ce_remote.kl
-
-# Lights
-PRODUCT_PACKAGES += \
- lights.msm8960
-
-# Loki
-PRODUCT_PACKAGES += \
- loki_tool \
- loki.sh \
- loki_bootloaders \
- recovery-transform.sh
-
-# Media Profile
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/configs/media_codecs.xml:system/etc/media_codecs.xml \
- $(LOCAL_PATH)/configs/media_profiles.xml:system/etc/media_profiles.xml
-
-# NFC packages
-PRODUCT_PACKAGES += \
- libnfc-nci \
- libnfc_nci_jni \
- nfc_nci.msm8960 \
- NfcNci \
- Tag \
- com.android.nfc_extras
-
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/configs/libnfc-brcm.conf:system/etc/libnfc-brcm.conf \
- $(LOCAL_PATH)/configs/nfcee_access.xml:system/etc/nfcee_access.xml
-
-# OMX
-PRODUCT_PACKAGES += \
- libdashplayer \
- libOmxVdec \
- libOmxVenc \
- libOmxAacEnc \
- libOmxAmrEnc \
- libOmxEvrcEnc \
- libOmxQcelp13Enc \
- libstagefrighthw
-
-# Power
-PRODUCT_PACKAGES += \
- power.msm8960
-
-# QRNGD
-PRODUCT_PACKAGES += \
- qrngd
-
-# Ramdisk
-PRODUCT_PACKAGES += \
- fstab.qcom \
- init.carrier.rc \
- init.crda.sh \
- init.qcom.rc \
- init.qcom.usb.rc \
- init.target.rc \
- ueventd.qcom.rc
-
-# Thermal
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/configs/thermald.conf:system/etc/thermald.conf \
- $(LOCAL_PATH)/configs/thermal-engine.conf:system/etc/thermal-engine.conf
-
-# Torch
-PRODUCT_PACKAGES += \
- Torch
-
-# USB
-PRODUCT_PACKAGES += \
- com.android.future.usb.accessory
-
-# Wifi
-PRODUCT_PACKAGES += \
- libnetcmdiface \
- macloader
-
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/wifi/p2p_supplicant_overlay.conf:system/etc/wifi/p2p_supplicant_overlay.conf \
- $(LOCAL_PATH)/wifi/wpa_supplicant_overlay.conf:system/etc/wifi/wpa_supplicant_overlay.conf
-
-# Common Qualcomm
-$(call inherit-product, device/samsung/qcom-common/qcom-common.mk)
+# Inherit from jf-common
+$(call inherit-product, device/samsung/jf-common/jf-common.mk)
diff --git a/extract-files.sh b/extract-files.sh
index cbbc85c..89d261e 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -1,56 +1,7 @@
#!/bin/bash
#set -e
+
export DEVICE=jflte
export VENDOR=samsung
-
-if [ $# -eq 0 ]; then
- SRC=adb
-else
- if [ $# -eq 1 ]; then
- SRC=$1
- else
- echo "$0: bad number of arguments"
- echo ""
- echo "usage: $0 [PATH_TO_EXPANDED_ROM]"
- echo ""
- echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from"
- echo "the device using adb pull."
- exit 1
- fi
-fi
-
-BASE=../../../vendor/$VENDOR/$DEVICE/proprietary
-rm -rf $BASE/*
-
-for FILE in `egrep -v '(^#|^$)' proprietary-files.txt`; do
- OLDIFS=$IFS IFS=":" PARSING_ARRAY=($FILE) IFS=$OLDIFS
- FILE=`echo ${PARSING_ARRAY[0]} | sed -e "s/^-//g"`
- DEST=${PARSING_ARRAY[1]}
- if [ -z $DEST ]
- then
- DEST=$FILE
- fi
- DIR=`dirname $DEST`
- if [ ! -d $BASE/$DIR ]; then
- mkdir -p $BASE/$DIR
- fi
- # Try CM target first
- if [ "$SRC" = "adb" ]; then
- adb pull /system/$DEST $BASE/$DEST
- # if file does not exist try OEM target
- if [ "$?" != "0" ]; then
- adb pull /system/$FILE $BASE/$DEST
- fi
- else
- if [ -z $SRC/system/$DEST ]; then
- echo ":: $DEST"
- cp $SRC/system/$DEST $BASE/$DEST
- else
- echo ":: $FILE"
- cp $SRC/system/$FILE $BASE/$DEST
- fi
- fi
-done
-
-./setup-makefiles.sh
+./../jf-common/extract-files.sh $@
diff --git a/gps/Android.mk b/gps/Android.mk
deleted file mode 100644
index d1f2343..0000000
--- a/gps/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# 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.
-#
-
-# WARNING: Everything listed here will be built on ALL platforms,
-# including x86, the emulator, and the SDK. Modules must be uniquely
-# named (liblights.tuna), and must build everywhere, or limit themselves
-# to only building on ARM if they include assembly. Individual makefiles
-# are responsible for having their own logic, for fine-grained control.
-
-LOCAL_PATH := $(call my-dir)
-
-ifeq ($(TARGET_DEVICE),jflte)
-include $(call all-subdir-makefiles,$(LOCAL_PATH))
-endif
diff --git a/gps/CleanSpec.mk b/gps/CleanSpec.mk
deleted file mode 100644
index dd1849d..0000000
--- a/gps/CleanSpec.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (C) 2007 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# If you don't need to do a full clean build but would like to touch
-# a file or delete some intermediate files, add a clean step to the end
-# of the list. These steps will only be run once, if they haven't been
-# run before.
-#
-# E.g.:
-# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
-# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
-#
-# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
-# files that are missing or have been moved.
-#
-# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
-# Use $(OUT_DIR) to refer to the "out" directory.
-#
-# If you need to re-do something that's already mentioned, just copy
-# the command and add it to the bottom of the list. E.g., if a change
-# that you made last week required touching a file and a change you
-# made today requires touching the same file, just copy the old
-# touch step and add it to the end of the list.
-#
-# ************************************************
-# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
-# ************************************************
-
-# For example:
-#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
-#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
-#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
-#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
-
-# ************************************************
-# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
-# ************************************************
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc_api*)
diff --git a/gps/core/Android.mk b/gps/core/Android.mk
deleted file mode 100644
index 178e559..0000000
--- a/gps/core/Android.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-ifneq ($(BUILD_TINY_ANDROID),true)
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libloc_core
-LOCAL_MODULE_OWNER := qcom
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SHARED_LIBRARIES := \
- libutils \
- libcutils \
- libgps.utils \
- libdl
-
-LOCAL_SRC_FILES += \
- MsgTask.cpp \
- LocApiBase.cpp \
- LocAdapterBase.cpp \
- ContextBase.cpp \
- LocDualContext.cpp \
- loc_core_log.cpp
-
-LOCAL_CFLAGS += \
- -fno-short-enums \
- -D_ANDROID_
-
-LOCAL_C_INCLUDES:= \
- $(TARGET_OUT_HEADERS)/gps.utils
-
-LOCAL_COPY_HEADERS_TO:= libloc_core/
-LOCAL_COPY_HEADERS:= \
- MsgTask.h \
- LocApiBase.h \
- LocAdapterBase.h \
- ContextBase.h \
- LocDualContext.h \
- LBSProxyBase.h \
- UlpProxyBase.h \
- gps_extended_c.h \
- gps_extended.h \
- loc_core_log.h
-
-LOCAL_PRELINK_MODULE := false
-
-include $(BUILD_SHARED_LIBRARY)
-
-endif # not BUILD_TINY_ANDROID
-
diff --git a/gps/core/ContextBase.cpp b/gps/core/ContextBase.cpp
deleted file mode 100644
index 8c2f8f0..0000000
--- a/gps/core/ContextBase.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Copyright (c) 2011-2013, 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_NDDEBUG 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 <log_util.h>
-#include <loc_log.h>
-
-namespace loc_core {
-
-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)();
- }
- }
- 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;
-
- // first if can not be MPQ
- if (TARGET_MPQ != loc_get_target()) {
- if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) {
- 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);
- }
- }
- // 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);
- }
- }
- }
- }
- }
-
- // locApi could still be NULL at this time
- // we would then create a dummy one
- if (NULL == locApi) {
- locApi = new LocApiBase(mMsgTask, exMask);
- }
-
- 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())
-{
-}
-
-}
diff --git a/gps/core/ContextBase.h b/gps/core/ContextBase.h
deleted file mode 100644
index d713587..0000000
--- a/gps/core/ContextBase.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef __LOC_CONTEXT_BASE__
-#define __LOC_CONTEXT_BASE__
-
-#include <stdbool.h>
-#include <ctype.h>
-#include <MsgTask.h>
-#include <LocApiBase.h>
-#include <LBSProxyBase.h>
-
-namespace loc_core {
-
-class LocAdapterBase;
-
-class ContextBase {
- static LBSProxyBase* getLBSProxy(const char* libName);
- LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask);
-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 void requestUlp(LocAdapterBase* adapter,
- unsigned long capabilities) {
- mLBSProxy->requestUlp(adapter, capabilities);
- }
-};
-
-} // namespace loc_core
-
-#endif //__LOC_CONTEXT_BASE__
diff --git a/gps/core/LBSProxyBase.h b/gps/core/LBSProxyBase.h
deleted file mode 100644
index 99872ee..0000000
--- a/gps/core/LBSProxyBase.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#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 LBSProxyBase {
- friend class ContextBase;
- inline virtual LocApiBase*
- getLocApi(const MsgTask* msgTask,
- LOC_API_ADAPTER_EVENT_MASK_T exMask) const {
- return NULL;
- }
-protected:
- inline LBSProxyBase() {}
-public:
- inline virtual ~LBSProxyBase() {}
- inline virtual void requestUlp(LocAdapterBase* adapter,
- unsigned long capabilities) const {}
- inline virtual bool hasAgpsExtendedCapabilities() const { return false; }
- inline virtual bool hasCPIExtendedCapabilities() const { return false; }
-};
-
-typedef LBSProxyBase* (getLBSProxy_t)();
-
-} // namespace loc_core
-
-#endif // IZAT_PROXY_BASE_H
diff --git a/gps/core/LocAdapterBase.cpp b/gps/core/LocAdapterBase.cpp
deleted file mode 100644
index ec2bb3e..0000000
--- a/gps/core/LocAdapterBase.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#define LOG_NDDEBUG 0
-#define LOG_TAG "LocSvc_LocAdapterBase"
-
-#include <dlfcn.h>
-#include <LocAdapterBase.h>
-#include <loc_target.h>
-#include <log_util.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) :
- mEvtMask(mask), mContext(context),
- mLocApi(context->getLocApi()), mMsgTask(context->getMsgTask())
-{
- mLocApi->addAdapter(this);
-}
-
-void LocAdapterBase::
- handleEngineDownEvent()
-DEFAULT_IMPL()
-
-void LocAdapterBase::
- reportPosition(UlpLocation &location,
- GpsLocationExtended &locationExtended,
- void* locationExt,
- enum loc_sess_status status,
- LocPosTechMask loc_technology_mask)
-DEFAULT_IMPL()
-
-void LocAdapterBase::
- reportSv(GpsSvStatus &svStatus,
- GpsLocationExtended &locationExtended,
- void* svExt)
-DEFAULT_IMPL()
-
-
-void LocAdapterBase::
- reportStatus(GpsStatusValue status)
-DEFAULT_IMPL()
-
-
-void LocAdapterBase::
- reportNmea(const char* nmea, int length)
-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, AGpsType 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::
- requestNiNotify(GpsNiNotification &notify, const void* data)
-DEFAULT_IMPL(false)
-} // namespace loc_core
diff --git a/gps/core/LocAdapterBase.h b/gps/core/LocAdapterBase.h
deleted file mode 100644
index 649a88b..0000000
--- a/gps/core/LocAdapterBase.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef LOC_API_ADAPTER_BASE_H
-#define LOC_API_ADAPTER_BASE_H
-
-#include <gps_extended.h>
-#include <UlpProxyBase.h>
-#include <ContextBase.h>
-
-namespace loc_core {
-
-class LocAdapterBase {
-protected:
- const LOC_API_ADAPTER_EVENT_MASK_T mEvtMask;
- ContextBase* mContext;
- LocApiBase* mLocApi;
- const MsgTask* mMsgTask;
-
- inline LocAdapterBase(const MsgTask* msgTask) :
- mEvtMask(0), mContext(NULL), mLocApi(NULL), mMsgTask(msgTask) {}
-public:
- inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); }
- LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
- ContextBase* context);
- 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);
- }
-
- // This will be overridden by the individual adapters
- // if necessary.
- inline virtual void setUlpProxy(UlpProxyBase* ulp) {}
- inline virtual void handleEngineUpEvent() {}
- virtual void handleEngineDownEvent();
- inline virtual void setPositionModeInt(LocPosMode& posMode) {}
- virtual void startFixInt() {}
- virtual void stopFixInt() {}
- virtual void getZppInt() {}
- virtual void reportPosition(UlpLocation &location,
- GpsLocationExtended &locationExtended,
- void* locationExt,
- enum loc_sess_status status,
- LocPosTechMask loc_technology_mask);
- virtual void reportSv(GpsSvStatus &svStatus,
- GpsLocationExtended &locationExtended,
- void* svExt);
- virtual void reportStatus(GpsStatusValue status);
- virtual void reportNmea(const char* nmea, int length);
- 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, AGpsType agps_type);
- virtual bool releaseATL(int connHandle);
- virtual bool requestSuplES(int connHandle);
- virtual bool reportDataCallOpened();
- virtual bool reportDataCallClosed();
- virtual bool requestNiNotify(GpsNiNotification &notify,
- const void* data);
- inline virtual bool isInSession() { return false; }
- ContextBase* getContext() const { return mContext; }
-};
-
-} // namespace loc_core
-
-#endif //LOC_API_ADAPTER_BASE_H
diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp
deleted file mode 100644
index 8b6713c..0000000
--- a/gps/core/LocApiBase.cpp
+++ /dev/null
@@ -1,476 +0,0 @@
-/* Copyright (c) 2011-2013, 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_NDDEBUG 0
-#define LOG_TAG "LocSvc_LocApiBase"
-
-#include <dlfcn.h>
-#include <LocApiBase.h>
-#include <LocAdapterBase.h>
-#include <log_util.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() {
- LOC_LOGV("LocSsrMsg");
- }
- inline virtual void log() {
- 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() {
- LOC_LOGV("%s:%d]: LocOpen Mask: %x\n",
- __func__, __LINE__, mMask);
- }
- inline virtual void log() {
- locallog();
- }
-};
-
-LocApiBase::LocApiBase(const MsgTask* msgTask,
- LOC_API_ADAPTER_EVENT_MASK_T excludedMask) :
- mExcludedMask(excludedMask), mMsgTask(msgTask), mMask(0)
-{
- memset(mLocAdapters, 0, sizeof(mLocAdapters));
-}
-
-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::handleEngineUpEvent()
-{
- // This will take care of renegotiating the loc handle
- mMsgTask->sendMsg(new LocSsrMsg(this));
-
- // 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,
- void* locationExt,
- enum loc_sess_status status,
- LocPosTechMask loc_technology_mask)
-{
- // loop through adapters, and deliver to all adapters.
- TO_ALL_LOCADAPTERS(
- mLocAdapters[i]->reportPosition(location,
- locationExtended,
- locationExt,
- status,
- loc_technology_mask)
- );
-}
-
-void LocApiBase::reportSv(GpsSvStatus &svStatus,
- GpsLocationExtended &locationExtended,
- void* svExt)
-{
- // loop through adapters, and deliver to all adapters.
- TO_ALL_LOCADAPTERS(
- mLocAdapters[i]->reportSv(svStatus,
- locationExtended,
- svExt)
- );
-}
-
-void LocApiBase::reportStatus(GpsStatusValue 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]->reportNmea(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, AGpsType 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(GpsNiNotification &notify, const void* data)
-{
- // loop through adapters, and deliver to the first handling adapter.
- TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data));
-}
-
-void* LocApiBase :: getSibling()
- DEFAULT_IMPL(NULL)
-
-LocApiProxyBase* LocApiBase :: getLocApiProxy()
- DEFAULT_IMPL(NULL)
-
-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)
-
-enum loc_api_adapter_err LocApiBase::
- deleteAidingData(GpsAidingData f)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_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(GpsUtcTime 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, AGpsType 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)
-
-enum loc_api_adapter_err LocApiBase::
- setServer(const char* url, int len)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-
-enum loc_api_adapter_err LocApiBase::
- setServer(unsigned int ip, int port,
- LocServerType type)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-
-enum loc_api_adapter_err LocApiBase::
- informNiResponse(GpsUserResponseType userResponse,
- const void* passThroughData)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-
-enum loc_api_adapter_err LocApiBase::
- setSUPLVersion(uint32_t version)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-
-enum loc_api_adapter_err LocApiBase::
- setLPPConfig(uint32_t profile)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_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)
-
-enum loc_api_adapter_err LocApiBase::
- setExtPowerConfig(int isBatteryCharging)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-
-enum loc_api_adapter_err LocApiBase::
- setAGLONASSProtocol(unsigned long aGlonassProtocol)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-
-enum loc_api_adapter_err LocApiBase::
- getZppFix(GpsLocation & zppLoc)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-
-enum loc_api_adapter_err LocApiBase::
- getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask)
-DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
-
-int LocApiBase::
- initDataServiceClient()
-DEFAULT_IMPL(-1)
-
-int LocApiBase::
- openAndStartDataCall()
-DEFAULT_IMPL(-1)
-
-void LocApiBase::
- stopDataCall()
-DEFAULT_IMPL()
-
-void LocApiBase::
- closeDataCall()
-DEFAULT_IMPL()
-
-int LocApiBase::
- setGpsLock(unsigned int lock)
-DEFAULT_IMPL(-1)
-
-int LocApiBase::
- getGpsLock()
-DEFAULT_IMPL(-1)
-} // namespace loc_core
diff --git a/gps/core/LocApiBase.h b/gps/core/LocApiBase.h
deleted file mode 100644
index 1603e6b..0000000
--- a/gps/core/LocApiBase.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/* Copyright (c) 2011-2013, 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 <MsgTask.h>
-#include <log_util.h>
-
-namespace loc_core {
-
-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 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++);
-
-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;
- LocAdapterBase* mLocAdapters[MAX_ADAPTERS];
-
-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);
- 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,
- void* locationExt,
- enum loc_sess_status status,
- LocPosTechMask loc_technology_mask =
- LOC_POS_TECH_MASK_DEFAULT);
- void reportSv(GpsSvStatus &svStatus,
- GpsLocationExtended &locationExtended,
- void* svExt);
- void reportStatus(GpsStatusValue 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, AGpsType agps_type);
- void releaseATL(int connHandle);
- void requestSuplES(int connHandle);
- void reportDataCallOpened();
- void reportDataCallClosed();
- void requestNiNotify(GpsNiNotification &notify, const void* data);
-
- // 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 enum loc_api_adapter_err
- deleteAidingData(GpsAidingData f);
- 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(GpsUtcTime 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, AGpsType agpsType);
- virtual enum loc_api_adapter_err
- atlCloseStatus(int handle, int is_succ);
- virtual enum loc_api_adapter_err
- setPositionMode(const LocPosMode& posMode);
- virtual enum loc_api_adapter_err
- setServer(const char* url, int len);
- virtual enum loc_api_adapter_err
- setServer(unsigned int ip, int port,
- LocServerType type);
- virtual enum loc_api_adapter_err
- informNiResponse(GpsUserResponseType userResponse, const void* passThroughData);
- virtual enum loc_api_adapter_err
- setSUPLVersion(uint32_t version);
- virtual enum loc_api_adapter_err
- setLPPConfig(uint32_t 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 enum loc_api_adapter_err
- setExtPowerConfig(int isBatteryCharging);
- virtual enum loc_api_adapter_err
- setAGLONASSProtocol(unsigned long aGlonassProtocol);
- virtual enum loc_api_adapter_err
- getZppFix(GpsLocation & zppLoc);
- virtual enum loc_api_adapter_err
- getZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask);
- virtual int initDataServiceClient();
- virtual int openAndStartDataCall();
- virtual void stopDataCall();
- virtual void closeDataCall();
-
- inline virtual void setInSession(bool inSession) {}
-
- /*Values for lock
- 1 = Do not lock any position sessions
- 2 = Lock MI position sessions
- 3 = Lock MT position sessions
- 4 = Lock all position sessions
- */
- virtual int setGpsLock(unsigned int lock);
- /*
- Returns
- Current value of GPS Lock on success
- -1 on failure
- */
- virtual int getGpsLock(void);
-};
-
-typedef LocApiBase* (getLocApi_t)(const MsgTask* msgTask,
- LOC_API_ADAPTER_EVENT_MASK_T exMask);
-
-} // namespace loc_core
-
-#endif //LOC_API_BASE_H
diff --git a/gps/core/LocDualContext.cpp b/gps/core/LocDualContext.cpp
deleted file mode 100644
index fa4c4d6..0000000
--- a/gps/core/LocDualContext.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Copyright (c) 2011-2013, 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_NDDEBUG 0
-#define LOG_TAG "LocSvc_DualCtx"
-
-#include <cutils/sched_policy.h>
-#include <unistd.h>
-#include <LocDualContext.h>
-#include <msg_q.h>
-#include <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_PARSED_POSITION_REPORT |
- 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);
-
-const MsgTask* LocDualContext::mMsgTask = NULL;
-ContextBase* LocDualContext::mFgContext = NULL;
-ContextBase* LocDualContext::mBgContext = NULL;
-
-// the name must be shorter than 15 chars
-const char* LocDualContext::mLocationHalName = "Loc_hal_worker";
-const char* LocDualContext::mIzatLibName = "liblbs_core.so";
-
-const MsgTask* LocDualContext::getMsgTask(MsgTask::tCreate tCreator,
- const char* name)
-{
- if (NULL == mMsgTask) {
- mMsgTask = new MsgTask(tCreator, name);
- }
- return mMsgTask;
-}
-
-const MsgTask* LocDualContext::getMsgTask(MsgTask::tAssociate tAssociate,
- const char* name)
-{
- if (NULL == mMsgTask) {
- mMsgTask = new MsgTask(tAssociate, name);
- } else if (tAssociate) {
- mMsgTask->associate(tAssociate);
- }
- return mMsgTask;
-}
-
-ContextBase* LocDualContext::getLocFgContext(MsgTask::tCreate tCreator,
- const char* name)
-{
- if (NULL == mFgContext) {
- const MsgTask* msgTask = getMsgTask(tCreator, name);
- mFgContext = new LocDualContext(msgTask,
- mFgExclMask);
- }
- return mFgContext;
-}
-
-ContextBase* LocDualContext::getLocFgContext(MsgTask::tAssociate tAssociate,
- const char* name)
-{
- if (NULL == mFgContext) {
- const MsgTask* msgTask = getMsgTask(tAssociate, name);
- mFgContext = new LocDualContext(msgTask,
- mFgExclMask);
- }
- return mFgContext;
-
-}
-
-ContextBase* LocDualContext::getLocBgContext(MsgTask::tCreate tCreator,
- const char* name)
-{
- if (NULL == mBgContext) {
- const MsgTask* msgTask = getMsgTask(tCreator, name);
- mBgContext = new LocDualContext(msgTask,
- mBgExclMask);
- }
- return mBgContext;
-}
-
-ContextBase* LocDualContext::getLocBgContext(MsgTask::tAssociate tAssociate,
- const char* name)
-{
- if (NULL == mBgContext) {
- const MsgTask* msgTask = getMsgTask(tAssociate, name);
- mBgContext = new LocDualContext(msgTask,
- mBgExclMask);
- }
- return mBgContext;
-}
-
-LocDualContext::LocDualContext(const MsgTask* msgTask,
- LOC_API_ADAPTER_EVENT_MASK_T exMask) :
- ContextBase(msgTask, exMask, mIzatLibName)
-{
-}
-
-}
diff --git a/gps/core/LocDualContext.h b/gps/core/LocDualContext.h
deleted file mode 100644
index e761e76..0000000
--- a/gps/core/LocDualContext.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2011-2013, 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 const MsgTask* getMsgTask(MsgTask::tCreate tCreator,
- const char* name);
- static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate,
- const char* name);
-
-protected:
- LocDualContext(const MsgTask* msgTask,
- LOC_API_ADAPTER_EVENT_MASK_T exMask);
- inline virtual ~LocDualContext() {}
-
-public:
- static const char* mIzatLibName;
- 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(MsgTask::tCreate tCreator,
- const char* name);
- static ContextBase* getLocFgContext(MsgTask::tAssociate tAssociate,
- const char* name);
- static ContextBase* getLocBgContext(MsgTask::tCreate tCreator,
- const char* name);
- static ContextBase* getLocBgContext(MsgTask::tAssociate tAssociate,
- const char* name);
-};
-
-}
-
-#endif //__LOC_ENG_CONTEXT__
diff --git a/gps/core/MsgTask.cpp b/gps/core/MsgTask.cpp
deleted file mode 100644
index 5d375aa..0000000
--- a/gps/core/MsgTask.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Copyright (c) 2011-2013, 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_NDDEBUG 0
-#define LOG_TAG "LocSvc_MsgTask"
-
-#include <cutils/sched_policy.h>
-#include <unistd.h>
-#include <MsgTask.h>
-#include <msg_q.h>
-#include <log_util.h>
-#include <loc_log.h>
-
-namespace loc_core {
-
-#define MAX_TASK_COMM_LEN 15
-
-static void LocMsgDestroy(void* msg) {
- delete (LocMsg*)msg;
-}
-
-MsgTask::MsgTask(tCreate tCreator, const char* threadName) :
- mQ(msg_q_init2()), mAssociator(NULL){
- if (tCreator) {
- tCreator(threadName, loopMain,
- (void*)new MsgTask(mQ, mAssociator));
- } else {
- createPThread(threadName);
- }
-}
-
-MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) :
- mQ(msg_q_init2()), mAssociator(tAssociator){
- createPThread(threadName);
-}
-
-inline
-MsgTask::MsgTask(const void* q, tAssociate associator) :
- mQ(q), mAssociator(associator){
-}
-
-MsgTask::~MsgTask() {
- msg_q_unblock((void*)mQ);
-}
-
-void MsgTask::associate(tAssociate tAssociator) const {
- struct LocAssociateMsg : public LocMsg {
- tAssociate mAssociator;
- inline LocAssociateMsg(tAssociate associator) :
- LocMsg(), mAssociator(associator) {}
- inline virtual void proc() const {
- if (mAssociator) {
- LOC_LOGD("MsgTask::associate");
- mAssociator();
- }
- }
- };
- sendMsg(new LocAssociateMsg(tAssociator));
-}
-
-void MsgTask::createPThread(const char* threadName) {
- pthread_attr_t attr;
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-
- pthread_t tid;
- // create the thread here, then if successful
- // and a name is given, we set the thread name
- if (!pthread_create(&tid, &attr, loopMain,
- (void*)new MsgTask(mQ, mAssociator)) &&
- NULL != threadName) {
- char lname[MAX_TASK_COMM_LEN+1];
- memcpy(lname, threadName, MAX_TASK_COMM_LEN);
- lname[MAX_TASK_COMM_LEN] = 0;
- pthread_setname_np(tid, lname);
- }
-}
-
-void MsgTask::sendMsg(const LocMsg* msg) const {
- msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy);
-}
-
-void* MsgTask::loopMain(void* arg) {
- MsgTask* copy = (MsgTask*)arg;
-
- // make sure we do not run in background scheduling group
- set_sched_policy(gettid(), SP_FOREGROUND);
-
- if (NULL != copy->mAssociator) {
- copy->mAssociator();
- }
-
- LocMsg* msg;
- int cnt = 0;
-
- while (1) {
- LOC_LOGD("MsgTask::loop() %d listening ...\n", cnt++);
-
- msq_q_err_type result = msg_q_rcv((void*)copy->mQ, (void **)&msg);
-
- if (eMSG_Q_SUCCESS != result) {
- LOC_LOGE("%s:%d] fail receiving msg: %s\n", __func__, __LINE__,
- loc_get_msg_q_status(result));
- // destroy the Q and exit
- msg_q_destroy((void**)&(copy->mQ));
- delete copy;
- return NULL;
- }
-
- msg->log();
- // there is where each individual msg handling is invoked
- msg->proc();
-
- delete msg;
- }
-
- delete copy;
-
- return NULL;
-}
-
-}
diff --git a/gps/core/MsgTask.h b/gps/core/MsgTask.h
deleted file mode 100644
index d50bb31..0000000
--- a/gps/core/MsgTask.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright (c) 2011-2013, 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 __MSG_TASK__
-#define __MSG_TASK__
-
-#include <stdbool.h>
-#include <ctype.h>
-#include <string.h>
-#include <pthread.h>
-
-namespace loc_core {
-
-struct LocMsg {
- inline LocMsg() {}
- inline virtual ~LocMsg() {}
- virtual void proc() const = 0;
- inline virtual void log() const {}
-};
-
-class MsgTask {
-public:
- typedef void* (*tStart)(void*);
- typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg);
- typedef int (*tAssociate)();
- MsgTask(tCreate tCreator, const char* threadName);
- MsgTask(tAssociate tAssociator, const char* threadName);
- ~MsgTask();
- void sendMsg(const LocMsg* msg) const;
- void associate(tAssociate tAssociator) const;
-
-private:
- const void* mQ;
- tAssociate mAssociator;
- MsgTask(const void* q, tAssociate associator);
- static void* loopMain(void* copy);
- void createPThread(const char* name);
-};
-
-} // namespace loc_core
-
-#endif //__MSG_TASK__
diff --git a/gps/core/UlpProxyBase.h b/gps/core/UlpProxyBase.h
deleted file mode 100644
index 9009757..0000000
--- a/gps/core/UlpProxyBase.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ULP_PROXY_BASE_H
-#define ULP_PROXY_BASE_H
-
-#include <gps_extended.h>
-
-namespace loc_core {
-
-class LocAdapterBase;
-
-class UlpProxyBase {
-public:
- LocPosMode mPosMode;
- bool mFixSet;
- inline UlpProxyBase() {
- mPosMode.mode = LOC_POSITION_MODE_INVALID;
- mFixSet = false;
- }
- inline virtual ~UlpProxyBase() {}
- inline virtual bool sendStartFix() { mFixSet = true; return false; }
- inline virtual bool sendStopFix() { mFixSet = false; return false; }
- inline virtual bool sendFixMode(LocPosMode &params) {
- mPosMode = params;
- return false;
- }
- inline virtual bool reportPosition(UlpLocation &location,
- GpsLocationExtended &locationExtended,
- void* locationExt,
- enum loc_sess_status status,
- LocPosTechMask loc_technology_mask) {
- return false;
- }
- inline virtual bool reportSv(GpsSvStatus &svStatus,
- GpsLocationExtended &locationExtended,
- void* svExt) {
- return false;
- }
- inline virtual bool reportStatus(GpsStatusValue status) {
- return false;
- }
- inline virtual void setAdapter(LocAdapterBase* adapter) {}
- inline virtual void setCapabilities(unsigned long capabilities) {}
-};
-
-} // namespace loc_core
-
-#endif // ULP_PROXY_BASE_H
diff --git a/gps/core/gps_extended.h b/gps/core/gps_extended.h
deleted file mode 100644
index 88b0415..0000000
--- a/gps/core/gps_extended.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Copyright (c) 2013, 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 GPS_EXTENDED_H
-#define GPS_EXTENDED_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include <gps_extended_c.h>
-
-struct LocPosMode
-{
- LocPositionMode mode;
- GpsPositionRecurrence recurrence;
- uint32_t min_interval;
- uint32_t preferred_accuracy;
- uint32_t preferred_time;
- char credentials[14];
- char provider[8];
- LocPosMode(LocPositionMode m, GpsPositionRecurrence recr,
- uint32_t gap, uint32_t accu, uint32_t time,
- const char* cred, const char* prov) :
- mode(m), recurrence(recr),
- min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap),
- preferred_accuracy(accu), preferred_time(time) {
- memset(credentials, 0, sizeof(credentials));
- memset(provider, 0, sizeof(provider));
- if (NULL != cred) {
- memcpy(credentials, cred, sizeof(credentials)-1);
- }
- if (NULL != prov) {
- memcpy(provider, prov, sizeof(provider)-1);
- }
- }
-
- inline LocPosMode() :
- mode(LOC_POSITION_MODE_MS_BASED),
- recurrence(GPS_POSITION_RECURRENCE_PERIODIC),
- min_interval(MIN_POSSIBLE_FIX_INTERVAL),
- preferred_accuracy(50), preferred_time(120000) {
- memset(credentials, 0, sizeof(credentials));
- memset(provider, 0, sizeof(provider));
- }
-
- inline bool equals(const LocPosMode &anotherMode) const
- {
- return anotherMode.mode == mode &&
- anotherMode.recurrence == recurrence &&
- anotherMode.min_interval == min_interval &&
- anotherMode.preferred_accuracy == preferred_accuracy &&
- anotherMode.preferred_time == preferred_time &&
- !strncmp(anotherMode.credentials, credentials, sizeof(credentials)-1) &&
- !strncmp(anotherMode.provider, provider, sizeof(provider)-1);
- }
-
- void logv() const;
-};
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* GPS_EXTENDED_H */
-
diff --git a/gps/core/gps_extended_c.h b/gps/core/gps_extended_c.h
deleted file mode 100644
index 73dc77d..0000000
--- a/gps/core/gps_extended_c.h
+++ /dev/null
@@ -1,349 +0,0 @@
-/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GPS_EXTENDED_C_H
-#define GPS_EXTENDED_C_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include <ctype.h>
-#include <stdbool.h>
-#include "hardware/gps.h"
-
-/** Location has valid source information. */
-#define LOCATION_HAS_SOURCE_INFO 0x0020
-/** GpsLocation has valid "is indoor?" flag */
-#define GPS_LOCATION_HAS_IS_INDOOR 0x0040
-/** GpsLocation has valid floor number */
-#define GPS_LOCATION_HAS_FLOOR_NUMBER 0x0080
-/** GpsLocation has valid map URL*/
-#define GPS_LOCATION_HAS_MAP_URL 0x0100
-/** GpsLocation has valid map index */
-#define GPS_LOCATION_HAS_MAP_INDEX 0x0200
-
-/** Sizes for indoor fields */
-#define GPS_LOCATION_MAP_URL_SIZE 400
-#define GPS_LOCATION_MAP_INDEX_SIZE 16
-
-/** Position source is ULP */
-#define ULP_LOCATION_IS_FROM_HYBRID 0x0001
-/** Position source is GNSS only */
-#define ULP_LOCATION_IS_FROM_GNSS 0x0002
-/** Position source is ZPP only */
-#define ULP_LOCATION_IS_FROM_ZPP 0x0004
-/** Position is from a Geofence Breach Event */
-#define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008
-
-#define ULP_MIN_INTERVAL_INVALID 0xffffffff
-
-/*Emergency SUPL*/
-#define GPS_NI_TYPE_EMERGENCY_SUPL 4
-
-typedef struct {
- /** set to sizeof(UlpLocation) */
- size_t size;
- GpsLocation gpsLocation;
- /* Provider indicator for HYBRID or GPS */
- uint16_t position_source;
- /*allows HAL to pass additional information related to the location */
- int rawDataSize; /* in # of bytes */
- void * rawData;
- bool is_indoor;
- float floor_number;
- char map_url[GPS_LOCATION_MAP_URL_SIZE];
- unsigned char map_index[GPS_LOCATION_MAP_INDEX_SIZE];
-} UlpLocation;
-
-/** AGPS type */
-typedef int16_t AGpsExtType;
-#define AGPS_TYPE_INVALID -1
-#define AGPS_TYPE_ANY 0
-#define AGPS_TYPE_SUPL 1
-#define AGPS_TYPE_C2K 2
-#define AGPS_TYPE_WWAN_ANY 3
-#define AGPS_TYPE_WIFI 4
-#define AGPS_TYPE_SUPL_ES 5
-
-/** SSID length */
-#define SSID_BUF_SIZE (32+1)
-
-typedef int16_t AGpsBearerType;
-#define AGPS_APN_BEARER_INVALID -1
-#define AGPS_APN_BEARER_IPV4 0
-#define AGPS_APN_BEARER_IPV6 1
-#define AGPS_APN_BEARER_IPV4V6 2
-
-/** GPS extended callback structure. */
-typedef struct {
- /** set to sizeof(GpsCallbacks) */
- size_t size;
- gps_set_capabilities set_capabilities_cb;
- gps_acquire_wakelock acquire_wakelock_cb;
- gps_release_wakelock release_wakelock_cb;
- gps_create_thread create_thread_cb;
- gps_request_utc_time request_utc_time_cb;
-} GpsExtCallbacks;
-
-/** Callback to report the xtra server url to the client.
- * The client should use this url when downloading xtra unless overwritten
- * in the gps.conf file
- */
-typedef void (* report_xtra_server)(const char*, const char*, const char*);
-
-/** Callback structure for the XTRA interface. */
-typedef struct {
- gps_xtra_download_request download_request_cb;
- gps_create_thread create_thread_cb;
- report_xtra_server report_xtra_server_cb;
-} GpsXtraExtCallbacks;
-
-/** Represents the status of AGPS. */
-typedef struct {
- /** set to sizeof(AGpsExtStatus) */
- size_t size;
-
- AGpsExtType type;
- AGpsStatusValue status;
- uint32_t ipv4_addr;
- char ipv6_addr[16];
- char ssid[SSID_BUF_SIZE];
- char password[SSID_BUF_SIZE];
-} AGpsExtStatus;
-
-/** Callback with AGPS status information.
- * Can only be called from a thread created by create_thread_cb.
- */
-typedef void (* agps_status_extended)(AGpsExtStatus* status);
-
-/** Callback structure for the AGPS interface. */
-typedef struct {
- agps_status_extended status_cb;
- gps_create_thread create_thread_cb;
-} AGpsExtCallbacks;
-
-
-/** GPS NI callback structure. */
-typedef struct
-{
- /**
- * Sends the notification request from HAL to GPSLocationProvider.
- */
- gps_ni_notify_callback notify_cb;
- gps_create_thread create_thread_cb;
-} GpsNiExtCallbacks;
-
-typedef enum loc_server_type {
- LOC_AGPS_CDMA_PDE_SERVER,
- LOC_AGPS_CUSTOM_PDE_SERVER,
- LOC_AGPS_MPC_SERVER,
- LOC_AGPS_SUPL_SERVER
-} LocServerType;
-
-typedef enum loc_position_mode_type {
- LOC_POSITION_MODE_INVALID = -1,
- LOC_POSITION_MODE_STANDALONE = 0,
- LOC_POSITION_MODE_MS_BASED,
- LOC_POSITION_MODE_MS_ASSISTED,
- LOC_POSITION_MODE_RESERVED_1,
- LOC_POSITION_MODE_RESERVED_2,
- LOC_POSITION_MODE_RESERVED_3,
- LOC_POSITION_MODE_RESERVED_4,
- LOC_POSITION_MODE_RESERVED_5
-
-} LocPositionMode;
-
-#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */
-
-/** GpsLocationExtended has valid latitude and longitude. */
-#define GPS_LOCATION_EXTENDED_HAS_LAT_LONG (1U<<0)
-/** GpsLocationExtended has valid altitude. */
-#define GPS_LOCATION_EXTENDED_HAS_ALTITUDE (1U<<1)
-/** GpsLocationExtended has valid speed. */
-#define GPS_LOCATION_EXTENDED_HAS_SPEED (1U<<2)
-/** GpsLocationExtended has valid bearing. */
-#define GPS_LOCATION_EXTENDED_HAS_BEARING (1U<<4)
-/** GpsLocationExtended has valid accuracy. */
-#define GPS_LOCATION_EXTENDED_HAS_ACCURACY (1U<<8)
-
-/** GPS extended supports geofencing */
-#define GPS_EXTENDED_CAPABILITY_GEOFENCE 0x0000001
-/** GPS extended supports batching */
-#define GPS_EXTENDED_CAPABILITY_BATCHING 0x0000002
-
-/** Flags to indicate which values are valid in a GpsLocationExtended. */
-typedef uint16_t GpsLocationExtendedFlags;
-/** GpsLocationExtended has valid pdop, hdop, vdop. */
-#define GPS_LOCATION_EXTENDED_HAS_DOP 0x0001
-/** GpsLocationExtended has valid altitude mean sea level. */
-#define GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL 0x0002
-/** UlpLocation has valid magnetic deviation. */
-#define GPS_LOCATION_EXTENDED_HAS_MAG_DEV 0x0004
-/** UlpLocation has valid mode indicator. */
-#define GPS_LOCATION_EXTENDED_HAS_MODE_IND 0x0008
-/** GpsLocationExtended has valid vertical uncertainty */
-#define GPS_LOCATION_EXTENDED_HAS_VERT_UNC 0x0010
-/** GpsLocationExtended has valid speed uncertainty */
-#define GPS_LOCATION_EXTENDED_HAS_SPEED_UNC 0x0020
-
-/** Represents gps location extended. */
-typedef struct {
- /** set to sizeof(GpsLocationExtended) */
- size_t size;
- /** Contains GpsLocationExtendedFlags bits. */
- uint16_t flags;
- /** Contains the Altitude wrt mean sea level */
- float altitudeMeanSeaLevel;
- /** Contains Position Dilusion of Precision. */
- float pdop;
- /** Contains Horizontal Dilusion of Precision. */
- float hdop;
- /** Contains Vertical Dilusion of Precision. */
- float vdop;
- /** Contains Magnetic Deviation. */
- float magneticDeviation;
- /** vertical uncertainty in meters */
- float vert_unc;
- /** speed uncertainty in m/s */
- float speed_unc;
-} GpsLocationExtended;
-
-enum loc_sess_status {
- LOC_SESS_SUCCESS,
- LOC_SESS_INTERMEDIATE,
- LOC_SESS_FAILURE
-};
-
-typedef uint32_t LocPosTechMask;
-#define LOC_POS_TECH_MASK_DEFAULT ((LocPosTechMask)0x00000000)
-#define LOC_POS_TECH_MASK_SATELLITE ((LocPosTechMask)0x00000001)
-#define LOC_POS_TECH_MASK_CELLID ((LocPosTechMask)0x00000002)
-#define LOC_POS_TECH_MASK_WIFI ((LocPosTechMask)0x00000004)
-#define LOC_POS_TECH_MASK_SENSORS ((LocPosTechMask)0x00000008)
-#define LOC_POS_TECH_MASK_REFERENCE_LOCATION ((LocPosTechMask)0x00000010)
-#define LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION ((LocPosTechMask)0x00000020)
-#define LOC_POS_TECH_MASK_AFLT ((LocPosTechMask)0x00000040)
-#define LOC_POS_TECH_MASK_HYBRID ((LocPosTechMask)0x00000080)
-
-typedef enum {
- LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0,
- LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM,
- LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU,
- LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON,
- LOC_ENG_IF_REQUEST_SENDER_ID_MODEM,
- LOC_ENG_IF_REQUEST_SENDER_ID_UNKNOWN
-} loc_if_req_sender_id_e_type;
-
-
-#define smaller_of(a, b) (((a) > (b)) ? (b) : (a))
-#define MAX_APN_LEN 100
-
-// This will be overridden by the individual adapters
-// if necessary.
-#define DEFAULT_IMPL(rtv) \
-{ \
- LOC_LOGD("%s: default implementation invoked", __func__); \
- return rtv; \
-}
-
-enum loc_api_adapter_err {
- LOC_API_ADAPTER_ERR_SUCCESS = 0,
- LOC_API_ADAPTER_ERR_GENERAL_FAILURE = 1,
- LOC_API_ADAPTER_ERR_UNSUPPORTED = 2,
- LOC_API_ADAPTER_ERR_INVALID_HANDLE = 4,
- LOC_API_ADAPTER_ERR_INVALID_PARAMETER = 5,
- LOC_API_ADAPTER_ERR_ENGINE_BUSY = 6,
- LOC_API_ADAPTER_ERR_PHONE_OFFLINE = 7,
- LOC_API_ADAPTER_ERR_TIMEOUT = 8,
- LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT = 9,
-
- LOC_API_ADAPTER_ERR_ENGINE_DOWN = 100,
- LOC_API_ADAPTER_ERR_FAILURE,
- LOC_API_ADAPTER_ERR_UNKNOWN
-};
-
-enum loc_api_adapter_event_index {
- LOC_API_ADAPTER_REPORT_POSITION = 0, // Position report comes in loc_parsed_position_s_type
- LOC_API_ADAPTER_REPORT_SATELLITE, // Satellite in view report
- LOC_API_ADAPTER_REPORT_NMEA_1HZ, // NMEA report at 1HZ rate
- LOC_API_ADAPTER_REPORT_NMEA_POSITION, // NMEA report at position report rate
- LOC_API_ADAPTER_REQUEST_NI_NOTIFY_VERIFY, // NI notification/verification request
- LOC_API_ADAPTER_REQUEST_ASSISTANCE_DATA, // Assistance data, eg: time, predicted orbits request
- LOC_API_ADAPTER_REQUEST_LOCATION_SERVER, // Request for location server
- LOC_API_ADAPTER_REPORT_IOCTL, // Callback report for loc_ioctl
- LOC_API_ADAPTER_REPORT_STATUS, // Misc status report: eg, engine state
- LOC_API_ADAPTER_REQUEST_WIFI, //
- LOC_API_ADAPTER_SENSOR_STATUS, //
- LOC_API_ADAPTER_REQUEST_TIME_SYNC, //
- LOC_API_ADAPTER_REPORT_SPI, //
- LOC_API_ADAPTER_REPORT_NI_GEOFENCE, //
- LOC_API_ADAPTER_GEOFENCE_GEN_ALERT, //
- LOC_API_ADAPTER_REPORT_GENFENCE_BREACH, //
- LOC_API_ADAPTER_PEDOMETER_CTRL, //
- LOC_API_ADAPTER_MOTION_CTRL, //
- LOC_API_ADAPTER_REQUEST_WIFI_AP_DATA, // Wifi ap data
- LOC_API_ADAPTER_BATCH_FULL, // Batching on full
- LOC_API_ADAPTER_BATCHED_POSITION_REPORT, // Batching on fix
- LOC_API_ADAPTER_BATCHED_GENFENCE_BREACH_REPORT, //
-
- LOC_API_ADAPTER_EVENT_MAX
-};
-
-#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1<<LOC_API_ADAPTER_REPORT_POSITION)
-#define LOC_API_ADAPTER_BIT_SATELLITE_REPORT (1<<LOC_API_ADAPTER_REPORT_SATELLITE)
-#define LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT (1<<LOC_API_ADAPTER_REPORT_NMEA_1HZ)
-#define LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT (1<<LOC_API_ADAPTER_REPORT_NMEA_POSITION)
-#define LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST (1<<LOC_API_ADAPTER_REQUEST_NI_NOTIFY_VERIFY)
-#define LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST (1<<LOC_API_ADAPTER_REQUEST_ASSISTANCE_DATA)
-#define LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST (1<<LOC_API_ADAPTER_REQUEST_LOCATION_SERVER)
-#define LOC_API_ADAPTER_BIT_IOCTL_REPORT (1<<LOC_API_ADAPTER_REPORT_IOCTL)
-#define LOC_API_ADAPTER_BIT_STATUS_REPORT (1<<LOC_API_ADAPTER_REPORT_STATUS)
-#define LOC_API_ADAPTER_BIT_REQUEST_WIFI (1<<LOC_API_ADAPTER_REQUEST_WIFI)
-#define LOC_API_ADAPTER_BIT_SENSOR_STATUS (1<<LOC_API_ADAPTER_SENSOR_STATUS)
-#define LOC_API_ADAPTER_BIT_REQUEST_TIME_SYNC (1<<LOC_API_ADAPTER_REQUEST_TIME_SYNC)
-#define LOC_API_ADAPTER_BIT_REPORT_SPI (1<<LOC_API_ADAPTER_REPORT_SPI)
-#define LOC_API_ADAPTER_BIT_REPORT_NI_GEOFENCE (1<<LOC_API_ADAPTER_REPORT_NI_GEOFENCE)
-#define LOC_API_ADAPTER_BIT_GEOFENCE_GEN_ALERT (1<<LOC_API_ADAPTER_GEOFENCE_GEN_ALERT)
-#define LOC_API_ADAPTER_BIT_REPORT_GENFENCE_BREACH (1<<LOC_API_ADAPTER_REPORT_GENFENCE_BREACH)
-#define LOC_API_ADAPTER_BIT_BATCHED_GENFENCE_BREACH_REPORT (1<<LOC_API_ADAPTER_BATCHED_GENFENCE_BREACH_REPORT)
-#define LOC_API_ADAPTER_BIT_PEDOMETER_CTRL (1<<LOC_API_ADAPTER_PEDOMETER_CTRL)
-#define LOC_API_ADAPTER_BIT_MOTION_CTRL (1<<LOC_API_ADAPTER_MOTION_CTRL)
-#define LOC_API_ADAPTER_BIT_REQUEST_WIFI_AP_DATA (1<<LOC_API_ADAPTER_REQUEST_WIFI_AP_DATA)
-#define LOC_API_ADAPTER_BIT_BATCH_FULL (1<<LOC_API_ADAPTER_BATCH_FULL)
-#define LOC_API_ADAPTER_BIT_BATCHED_POSITION_REPORT (1<<LOC_API_ADAPTER_BATCHED_POSITION_REPORT)
-
-typedef unsigned int LOC_API_ADAPTER_EVENT_MASK_T;
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* GPS_EXTENDED_C_H */
-
diff --git a/gps/core/loc_core_log.cpp b/gps/core/loc_core_log.cpp
deleted file mode 100644
index d2eda66..0000000
--- a/gps/core/loc_core_log.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#define LOG_NDDEBUG 0
-#define LOG_TAG "LocSvc_core_log"
-
-#include <loc_log.h>
-#include <log_util.h>
-#include <loc_core_log.h>
-
-void LocPosMode::logv() const
-{
- LOC_LOGV ("Position mode: %s\n Position recurrence: %s\n "
- "min interval: %d\n preferred accuracy: %d\n "
- "preferred time: %d\n credentials: %s provider: %s",
- loc_get_position_mode_name(mode),
- loc_get_position_recurrence_name(recurrence),
- min_interval,
- preferred_accuracy,
- preferred_time,
- credentials,
- provider);
-}
-
-/* GPS status names */
-static loc_name_val_s_type gps_status_name[] =
-{
- NAME_VAL( GPS_STATUS_NONE ),
- NAME_VAL( GPS_STATUS_SESSION_BEGIN ),
- NAME_VAL( GPS_STATUS_SESSION_END ),
- NAME_VAL( GPS_STATUS_ENGINE_ON ),
- NAME_VAL( GPS_STATUS_ENGINE_OFF ),
-};
-static int gps_status_num = sizeof(gps_status_name) / sizeof(loc_name_val_s_type);
-
-/* Find Android GPS status name */
-const char* loc_get_gps_status_name(GpsStatusValue gps_status)
-{
- return loc_get_name_from_val(gps_status_name, gps_status_num,
- (long) gps_status);
-}
-
-
-
-static loc_name_val_s_type loc_eng_position_modes[] =
-{
- NAME_VAL( LOC_POSITION_MODE_STANDALONE ),
- NAME_VAL( LOC_POSITION_MODE_MS_BASED ),
- NAME_VAL( LOC_POSITION_MODE_MS_ASSISTED ),
- NAME_VAL( LOC_POSITION_MODE_RESERVED_1 ),
- NAME_VAL( LOC_POSITION_MODE_RESERVED_2 ),
- NAME_VAL( LOC_POSITION_MODE_RESERVED_3 ),
- NAME_VAL( LOC_POSITION_MODE_RESERVED_4 ),
- NAME_VAL( LOC_POSITION_MODE_RESERVED_5 )
-};
-static int loc_eng_position_mode_num = sizeof(loc_eng_position_modes) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_position_mode_name(GpsPositionMode mode)
-{
- return loc_get_name_from_val(loc_eng_position_modes, loc_eng_position_mode_num, (long) mode);
-}
-
-
-
-static loc_name_val_s_type loc_eng_position_recurrences[] =
-{
- NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ),
- NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE )
-};
-static int loc_eng_position_recurrence_num = sizeof(loc_eng_position_recurrences) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur)
-{
- return loc_get_name_from_val(loc_eng_position_recurrences, loc_eng_position_recurrence_num, (long) recur);
-}
-
-
-
-static loc_name_val_s_type loc_eng_aiding_data_bits[] =
-{
- NAME_VAL( GPS_DELETE_EPHEMERIS ),
- NAME_VAL( GPS_DELETE_ALMANAC ),
- NAME_VAL( GPS_DELETE_POSITION ),
- NAME_VAL( GPS_DELETE_TIME ),
- NAME_VAL( GPS_DELETE_IONO ),
- NAME_VAL( GPS_DELETE_UTC ),
- NAME_VAL( GPS_DELETE_HEALTH ),
- NAME_VAL( GPS_DELETE_SVDIR ),
- NAME_VAL( GPS_DELETE_SVSTEER ),
- NAME_VAL( GPS_DELETE_SADATA ),
- NAME_VAL( GPS_DELETE_RTI ),
- NAME_VAL( GPS_DELETE_CELLDB_INFO ),
- NAME_VAL( GPS_DELETE_ALMANAC_CORR ),
- NAME_VAL( GPS_DELETE_FREQ_BIAS_EST ),
- NAME_VAL( GLO_DELETE_EPHEMERIS ),
- NAME_VAL( GLO_DELETE_ALMANAC ),
- NAME_VAL( GLO_DELETE_SVDIR ),
- NAME_VAL( GLO_DELETE_SVSTEER ),
- NAME_VAL( GLO_DELETE_ALMANAC_CORR ),
- NAME_VAL( GPS_DELETE_TIME_GPS ),
- NAME_VAL( GLO_DELETE_TIME ),
- NAME_VAL( BDS_DELETE_SVDIR ),
- NAME_VAL( BDS_DELETE_SVSTEER ),
- NAME_VAL( BDS_DELETE_TIME ),
- NAME_VAL( BDS_DELETE_ALMANAC_CORR ),
- NAME_VAL( BDS_DELETE_EPHEMERIS ),
- NAME_VAL( BDS_DELETE_ALMANAC ),
- NAME_VAL( GPS_DELETE_ALL)
-};
-static int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_aiding_data_mask_names(GpsAidingData data)
-{
- return NULL;
-}
-
-
-static loc_name_val_s_type loc_eng_agps_types[] =
-{
- NAME_VAL( AGPS_TYPE_INVALID ),
- NAME_VAL( AGPS_TYPE_ANY ),
- NAME_VAL( AGPS_TYPE_SUPL ),
- NAME_VAL( AGPS_TYPE_C2K ),
- NAME_VAL( AGPS_TYPE_WWAN_ANY )
-};
-static int loc_eng_agps_type_num = sizeof(loc_eng_agps_types) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_agps_type_name(AGpsType type)
-{
- return loc_get_name_from_val(loc_eng_agps_types, loc_eng_agps_type_num, (long) type);
-}
-
-
-static loc_name_val_s_type loc_eng_ni_types[] =
-{
- NAME_VAL( GPS_NI_TYPE_VOICE ),
- NAME_VAL( GPS_NI_TYPE_UMTS_SUPL ),
- NAME_VAL( GPS_NI_TYPE_UMTS_CTRL_PLANE ),
- NAME_VAL( GPS_NI_TYPE_EMERGENCY_SUPL )
-};
-static int loc_eng_ni_type_num = sizeof(loc_eng_ni_types) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_ni_type_name(GpsNiType type)
-{
- return loc_get_name_from_val(loc_eng_ni_types, loc_eng_ni_type_num, (long) type);
-}
-
-
-static loc_name_val_s_type loc_eng_ni_responses[] =
-{
- NAME_VAL( GPS_NI_RESPONSE_ACCEPT ),
- NAME_VAL( GPS_NI_RESPONSE_DENY ),
- NAME_VAL( GPS_NI_RESPONSE_DENY )
-};
-static int loc_eng_ni_reponse_num = sizeof(loc_eng_ni_responses) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_ni_response_name(GpsUserResponseType response)
-{
- return loc_get_name_from_val(loc_eng_ni_responses, loc_eng_ni_reponse_num, (long) response);
-}
-
-
-static loc_name_val_s_type loc_eng_ni_encodings[] =
-{
- NAME_VAL( GPS_ENC_NONE ),
- NAME_VAL( GPS_ENC_SUPL_GSM_DEFAULT ),
- NAME_VAL( GPS_ENC_SUPL_UTF8 ),
- NAME_VAL( GPS_ENC_SUPL_UCS2 ),
- NAME_VAL( GPS_ENC_UNKNOWN )
-};
-static int loc_eng_ni_encoding_num = sizeof(loc_eng_ni_encodings) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding)
-{
- return loc_get_name_from_val(loc_eng_ni_encodings, loc_eng_ni_encoding_num, (long) encoding);
-}
-
-static loc_name_val_s_type loc_eng_agps_bears[] =
-{
- NAME_VAL( AGPS_APN_BEARER_INVALID ),
- NAME_VAL( AGPS_APN_BEARER_IPV4 ),
- NAME_VAL( AGPS_APN_BEARER_IPV6 ),
- NAME_VAL( AGPS_APN_BEARER_IPV4V6 )
-};
-static int loc_eng_agps_bears_num = sizeof(loc_eng_agps_bears) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_agps_bear_name(AGpsBearerType bearer)
-{
- return loc_get_name_from_val(loc_eng_agps_bears, loc_eng_agps_bears_num, (long) bearer);
-}
-
-static loc_name_val_s_type loc_eng_server_types[] =
-{
- NAME_VAL( LOC_AGPS_CDMA_PDE_SERVER ),
- NAME_VAL( LOC_AGPS_CUSTOM_PDE_SERVER ),
- NAME_VAL( LOC_AGPS_MPC_SERVER ),
- NAME_VAL( LOC_AGPS_SUPL_SERVER )
-};
-static int loc_eng_server_types_num = sizeof(loc_eng_server_types) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_server_type_name(LocServerType type)
-{
- return loc_get_name_from_val(loc_eng_server_types, loc_eng_server_types_num, (long) type);
-}
-
-static loc_name_val_s_type loc_eng_position_sess_status_types[] =
-{
- NAME_VAL( LOC_SESS_SUCCESS ),
- NAME_VAL( LOC_SESS_INTERMEDIATE ),
- NAME_VAL( LOC_SESS_FAILURE )
-};
-static int loc_eng_position_sess_status_num = sizeof(loc_eng_position_sess_status_types) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_position_sess_status_name(enum loc_sess_status status)
-{
- return loc_get_name_from_val(loc_eng_position_sess_status_types, loc_eng_position_sess_status_num, (long) status);
-}
-
-static loc_name_val_s_type loc_eng_agps_status_names[] =
-{
- NAME_VAL( GPS_REQUEST_AGPS_DATA_CONN ),
- NAME_VAL( GPS_RELEASE_AGPS_DATA_CONN ),
- NAME_VAL( GPS_AGPS_DATA_CONNECTED ),
- NAME_VAL( GPS_AGPS_DATA_CONN_DONE ),
- NAME_VAL( GPS_AGPS_DATA_CONN_FAILED )
-};
-static int loc_eng_agps_status_num = sizeof(loc_eng_agps_status_names) / sizeof(loc_name_val_s_type);
-
-const char* loc_get_agps_status_name(AGpsStatusValue status)
-{
- return loc_get_name_from_val(loc_eng_agps_status_names, loc_eng_agps_status_num, (long) status);
-}
diff --git a/gps/core/loc_core_log.h b/gps/core/loc_core_log.h
deleted file mode 100644
index 8a1825a..0000000
--- a/gps/core/loc_core_log.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (c) 2011-2013, 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_CORE_LOG_H
-#define LOC_CORE_LOG_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#include <ctype.h>
-#include <gps_extended.h>
-
-const char* loc_get_gps_status_name(GpsStatusValue gps_status);
-const char* loc_get_position_mode_name(GpsPositionMode mode);
-const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur);
-const char* loc_get_aiding_data_mask_names(GpsAidingData data);
-const char* loc_get_agps_type_name(AGpsType type);
-const char* loc_get_ni_type_name(GpsNiType type);
-const char* loc_get_ni_response_name(GpsUserResponseType response);
-const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding);
-const char* loc_get_agps_bear_name(AGpsBearerType bear);
-const char* loc_get_server_type_name(LocServerType type);
-const char* loc_get_position_sess_status_name(enum loc_sess_status status);
-const char* loc_get_agps_status_name(AGpsStatusValue status);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LOC_CORE_LOG_H */
diff --git a/gps/etc/Android.mk b/gps/etc/Android.mk
deleted file mode 100644
index 8c238b4..0000000
--- a/gps/etc/Android.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := gps.conf
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
-LOCAL_SRC_FILES := gps.conf
-
-include $(BUILD_PREBUILT)
-
diff --git a/gps/etc/gps.conf b/gps/etc/gps.conf
deleted file mode 100644
index 2650d5f..0000000
--- a/gps/etc/gps.conf
+++ /dev/null
@@ -1,79 +0,0 @@
-#Uncommenting these urls would only enable
-#the power up auto injection and force injection(test case).
-XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra2.bin
-XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra2.bin
-XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra2.bin
-
-# Error Estimate
-# _SET = 1
-# _CLEAR = 0
-ERR_ESTIMATE=0
-
-#Test
-NTP_SERVER=time.gpsonextra.net
-#Asia
-# NTP_SERVER=asia.pool.ntp.org
-#Europe
-# NTP_SERVER=europe.pool.ntp.org
-#North America
-# NTP_SERVER=north-america.pool.ntp.org
-
-# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
-# 4 - Debug, 5 - Verbose
-# If DEBUG_LEVEL is commented, Android's logging levels will be used
-DEBUG_LEVEL = 2
-
-# Intermediate position report, 1=enable, 0=disable
-INTERMEDIATE_POS=0
-
-# supl version 1.0
-SUPL_VER=0x10000
-
-# GPS Capabilities bit mask
-# SCHEDULING = 0x01
-# MSB = 0x02
-# MSA = 0x04
-# ON_DEMAND_TIME = 0x10
-# GEOFENCE = 0x20
-# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE
-CAPABILITIES=0x37
-
-# Accuracy threshold for intermediate positions
-# less accurate positions are ignored, 0 for passing all positions
-# ACCURACY_THRES=5000
-
-################################
-##### AGPS server settings #####
-################################
-
-# FOR SUPL SUPPORT, set the following
-# SUPL_HOST=supl.host.com or IP
-# SUPL_PORT=1234
-
-# FOR C2K PDE SUPPORT, set the following
-# C2K_HOST=c2k.pde.com or IP
-# C2K_PORT=1234
-
-####################################
-# LTE Positioning Profile Settings
-####################################
-# 0: Enable RRLP on LTE(Default)
-# 1: Enable LPP_User_Plane on LTE
-# 2: Enable LPP_Control_Plane
-# 3: Enable both LPP_User_Plane and LPP_Control_Plane
-# Sensor R&D : This will not be injected to MODEM
-LPP_PROFILE=3
-
-################################
-# EXTRA SETTINGS
-################################
-# NMEA provider (1=Modem Processor, 0=Application Processor)
-NMEA_PROVIDER=1
-
-##################################################
-# Select Positioning Protocol on A-GLONASS system
-##################################################
-# 0x1: RRC CPlane
-# 0x2: RRLP UPlane
-# 0x4: LLP Uplane
-A_GLONASS_POS_PROTOCOL_SELECT = 0x0
diff --git a/gps/etc/sap.conf b/gps/etc/sap.conf
deleted file mode 100644
index 6ef6a09..0000000
--- a/gps/etc/sap.conf
+++ /dev/null
@@ -1,42 +0,0 @@
-################################
-# Sensor Settings
-################################
-
-# Needs to be set explicitly based on sensor
-# There is no default value.
-# used in loc_eng_reinit
-#GYRO_BIAS_RANDOM_WALK=
-#ACCEL_RANDOM_WALK_SPECTRAL_DENSITY=
-#ANGLE_RANDOM_WALK_SPECTRAL_DENSITY=
-#RATE_RANDOM_WALK_SPECTRAL_DENSITY=
-#VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY=
-
-# Sensor Sampling Rate Parameters for Low-Data Rate Filter (should be greater than 0)
-# used in loc_eng_reinit
-SENSOR_ACCEL_BATCHES_PER_SEC=3
-SENSOR_ACCEL_SAMPLES_PER_BATCH=5
-SENSOR_GYRO_BATCHES_PER_SEC=3
-SENSOR_GYRO_SAMPLES_PER_BATCH=5
-# Sensor Sampling Rate Parameters for High-Data Rate Filter (should be greater than 0)
-SENSOR_ACCEL_BATCHES_PER_SEC_HIGH=4
-SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH=25
-SENSOR_GYRO_BATCHES_PER_SEC_HIGH=4
-SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH=25
-
-# Sensor Control Mode (0=AUTO, 1=FORCE_ON)
-# used in loc_eng_reinit
-SENSOR_CONTROL_MODE=0
-
-# Enable or Disable Sensors for GPS use (0=Enable, 1=Disable)
-# used in loc_eng_reinit
-SENSOR_USAGE=0
-
-# Choose GSIFF sensor provider (1=Snapdragon Sensors Core, 2=Android NDK)
-SENSOR_PROVIDER=2
-
-# Bit mask used to define which sensor algorithms are used.
-# Setting each bit has the following definition:
-# 0x1 - DISABLE_INS_POSITIONING_FILTER
-# 0x0 - ENABLE_INS_POSITIONING_FILTER
-SENSOR_ALGORITHM_CONFIG_MASK=0x1
-
diff --git a/gps/loc_api/Android.mk b/gps/loc_api/Android.mk
deleted file mode 100644
index 8bfdd1b..0000000
--- a/gps/loc_api/Android.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-# add RPC dirs if RPC is available
-ifneq ($(TARGET_NO_RPC),true)
-
-GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api-rpc-50001/
-
-endif #TARGET_NO_RPC
-
-GPS_DIR_LIST += $(LOCAL_PATH)/libloc_api_50001/
-
-#call the subfolders
-include $(addsuffix Android.mk, $(GPS_DIR_LIST))
diff --git a/gps/loc_api/NOTICE b/gps/loc_api/NOTICE
deleted file mode 100644
index 85b5740..0000000
--- a/gps/loc_api/NOTICE
+++ /dev/null
@@ -1,13 +0,0 @@
-Copyright (c) 2009, QUALCOMM USA, INC.
-
-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 QUALCOMM USA, INC. 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
diff --git a/gps/loc_api/libloc_api_50001/Android.mk b/gps/loc_api/libloc_api_50001/Android.mk
deleted file mode 100644
index 065456d..0000000
--- a/gps/loc_api/libloc_api_50001/Android.mk
+++ /dev/null
@@ -1,101 +0,0 @@
-ifneq ($(BUILD_TINY_ANDROID),true)
-#Compile this library only for builds with the latest modem image
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libloc_eng
-LOCAL_MODULE_OWNER := qcom
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SHARED_LIBRARIES := \
- libutils \
- libcutils \
- libdl \
- liblog \
- libloc_core \
- libgps.utils
-
-LOCAL_SRC_FILES += \
- loc_eng.cpp \
- loc_eng_agps.cpp \
- loc_eng_xtra.cpp \
- loc_eng_ni.cpp \
- loc_eng_log.cpp \
- loc_eng_nmea.cpp \
- LocEngAdapter.cpp
-
-LOCAL_SRC_FILES += \
- loc_eng_dmn_conn.cpp \
- loc_eng_dmn_conn_handler.cpp \
- loc_eng_dmn_conn_thread_helper.c \
- loc_eng_dmn_conn_glue_msg.c \
- loc_eng_dmn_conn_glue_pipe.c
-
-LOCAL_CFLAGS += \
- -fno-short-enums \
- -D_ANDROID_
-
-LOCAL_C_INCLUDES:= \
- $(TARGET_OUT_HEADERS)/gps.utils \
- $(TARGET_OUT_HEADERS)/libloc_core \
- device/samsung/jflte/gps/loc_api/libloc_api_50001
-
-LOCAL_COPY_HEADERS_TO:= libloc_eng/
-LOCAL_COPY_HEADERS:= \
- LocEngAdapter.h \
- loc.h \
- loc_eng.h \
- loc_eng_xtra.h \
- loc_eng_ni.h \
- loc_eng_agps.h \
- loc_eng_msg.h \
- loc_eng_log.h
-
-LOCAL_PRELINK_MODULE := false
-
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := gps.msm8960
-LOCAL_MODULE_OWNER := qcom
-
-LOCAL_MODULE_TAGS := optional
-
-## Libs
-
-LOCAL_SHARED_LIBRARIES := \
- libutils \
- libcutils \
- liblog \
- libloc_eng \
- libloc_core \
- libgps.utils \
- libdl
-
-LOCAL_SRC_FILES += \
- loc.cpp \
- gps.c
-
-LOCAL_CFLAGS += \
- -fno-short-enums \
- -D_ANDROID_ \
-
-ifeq ($(TARGET_USES_QCOM_BSP), true)
-LOCAL_CFLAGS += -DTARGET_USES_QCOM_BSP
-endif
-
-## Includes
-LOCAL_C_INCLUDES:= \
- $(TARGET_OUT_HEADERS)/gps.utils \
- $(TARGET_OUT_HEADERS)/libloc_core
-
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
-
-include $(BUILD_SHARED_LIBRARY)
-
-endif # not BUILD_TINY_ANDROID
diff --git a/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp b/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp
deleted file mode 100644
index 52a9402..0000000
--- a/gps/loc_api/libloc_api_50001/LocEngAdapter.cpp
+++ /dev/null
@@ -1,304 +0,0 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#define LOG_NDDEBUG 0
-#define LOG_TAG "LocSvc_EngAdapter"
-
-#include <LocEngAdapter.h>
-#include "loc_eng_msg.h"
-#include "loc_log.h"
-
-using namespace loc_core;
-
-LocInternalAdapter::LocInternalAdapter(LocEngAdapter* adapter) :
- LocAdapterBase(adapter->getMsgTask()),
- mLocEngAdapter(adapter)
-{
-}
-void LocInternalAdapter::setPositionModeInt(LocPosMode& posMode) {
- sendMsg(new LocEngPositionMode(mLocEngAdapter, posMode));
-}
-void LocInternalAdapter::startFixInt() {
- sendMsg(new LocEngStartFix(mLocEngAdapter));
-}
-void LocInternalAdapter::stopFixInt() {
- sendMsg(new LocEngStopFix(mLocEngAdapter));
-}
-void LocInternalAdapter::getZppInt() {
- sendMsg(new LocEngGetZpp(mLocEngAdapter));
-}
-
-LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
- void* owner, ContextBase* context,
- MsgTask::tCreate tCreator) :
- LocAdapterBase(mask,
- //Get the AFW context if VzW context has not already been intialized in
- //loc_ext
- context == NULL?
- LocDualContext::getLocFgContext(tCreator,
- LocDualContext::mLocationHalName)
- :context),
- mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)),
- mUlp(new UlpProxyBase()), mNavigating(false),
- mSupportsAgpsRequests(false),
- mSupportsPositionInjection(false)
-{
- memset(&mFixCriteria, 0, sizeof(mFixCriteria));
- mFixCriteria.mode = LOC_POSITION_MODE_INVALID;
- LOC_LOGD("LocEngAdapter created");
-}
-
-inline
-LocEngAdapter::~LocEngAdapter()
-{
- delete mInternalAdapter;
- LOC_LOGV("LocEngAdapter deleted");
-}
-
-void LocInternalAdapter::setUlpProxy(UlpProxyBase* ulp) {
- struct LocSetUlpProxy : public LocMsg {
- LocAdapterBase* mAdapter;
- UlpProxyBase* mUlp;
- inline LocSetUlpProxy(LocAdapterBase* adapter, UlpProxyBase* ulp) :
- LocMsg(), mAdapter(adapter), mUlp(ulp) {
- }
- virtual void proc() const {
- LOC_LOGV("%s] ulp %p adapter %p", __func__,
- mUlp, mAdapter);
- mAdapter->setUlpProxy(mUlp);
- }
- };
-
- sendMsg(new LocSetUlpProxy(mLocEngAdapter, ulp));
-}
-
-void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp)
-{
- if (ulp == mUlp) {
- //This takes care of the case when double initalization happens
- //and we get the same object back for UlpProxyBase . Do nothing
- return;
- }
-
- LOC_LOGV("%s] %p", __func__, ulp);
- if (NULL == ulp) {
- LOC_LOGE("%s:%d]: ulp pointer is NULL", __func__, __LINE__);
- ulp = new UlpProxyBase();
- }
-
- if (LOC_POSITION_MODE_INVALID != mUlp->mPosMode.mode) {
- // need to send this mode and start msg to ULP
- ulp->sendFixMode(mUlp->mPosMode);
- }
-
- if(mUlp->mFixSet) {
- ulp->sendStartFix();
- }
-
- delete mUlp;
- mUlp = ulp;
-}
-
-void LocInternalAdapter::reportPosition(UlpLocation &location,
- GpsLocationExtended &locationExtended,
- void* locationExt,
- enum loc_sess_status status,
- LocPosTechMask loc_technology_mask)
-{
- sendMsg(new LocEngReportPosition(mLocEngAdapter,
- location,
- locationExtended,
- locationExt,
- status,
- loc_technology_mask));
-}
-
-
-void LocEngAdapter::reportPosition(UlpLocation &location,
- GpsLocationExtended &locationExtended,
- void* locationExt,
- enum loc_sess_status status,
- LocPosTechMask loc_technology_mask)
-{
- if (! mUlp->reportPosition(location,
- locationExtended,
- locationExt,
- status,
- loc_technology_mask )) {
- mInternalAdapter->reportPosition(location,
- locationExtended,
- locationExt,
- status,
- loc_technology_mask);
- }
-}
-
-void LocInternalAdapter::reportSv(GpsSvStatus &svStatus,
- GpsLocationExtended &locationExtended,
- void* svExt){
- sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus,
- locationExtended, svExt));
-}
-
-void LocEngAdapter::reportSv(GpsSvStatus &svStatus,
- GpsLocationExtended &locationExtended,
- void* svExt)
-{
-
- // We want to send SV info to ULP to help it in determining GNSS
- // signal strength ULP will forward the SV reports to HAL without
- // any modifications
- if (! mUlp->reportSv(svStatus, locationExtended, svExt)) {
- mInternalAdapter->reportSv(svStatus, locationExtended, svExt);
- }
-}
-
-void LocEngAdapter::setInSession(bool inSession)
-{
- mNavigating = inSession;
- mLocApi->setInSession(inSession);
- if (!mNavigating) {
- mFixCriteria.mode = LOC_POSITION_MODE_INVALID;
- }
-}
-
-void LocInternalAdapter::reportStatus(GpsStatusValue status)
-{
- sendMsg(new LocEngReportStatus(mLocEngAdapter, status));
-}
-
-void LocEngAdapter::reportStatus(GpsStatusValue status)
-{
- if (!mUlp->reportStatus(status)) {
- mInternalAdapter->reportStatus(status);
- }
-}
-
-inline
-void LocEngAdapter::reportNmea(const char* nmea, int length)
-{
- sendMsg(new LocEngReportNmea(mOwner, nmea, length));
-}
-
-inline
-bool LocEngAdapter::reportXtraServer(const char* url1,
- const char* url2,
- const char* url3,
- const int maxlength)
-{
- if (mSupportsAgpsRequests) {
- sendMsg(new LocEngReportXtraServer(mOwner, url1,
- url2, url3, maxlength));
- }
- return mSupportsAgpsRequests;
-}
-
-inline
-bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type)
-{
- if (mSupportsAgpsRequests) {
- sendMsg(new LocEngRequestATL(mOwner,
- connHandle, agps_type));
- }
- return mSupportsAgpsRequests;
-}
-
-inline
-bool LocEngAdapter::releaseATL(int connHandle)
-{
- if (mSupportsAgpsRequests) {
- sendMsg(new LocEngReleaseATL(mOwner, connHandle));
- }
- return mSupportsAgpsRequests;
-}
-
-inline
-bool LocEngAdapter::requestXtraData()
-{
- if (mSupportsAgpsRequests) {
- sendMsg(new LocEngRequestXtra(mOwner));
- }
- return mSupportsAgpsRequests;
-}
-
-inline
-bool LocEngAdapter::requestTime()
-{
- if (mSupportsAgpsRequests) {
- sendMsg(new LocEngRequestTime(mOwner));
- }
- return mSupportsAgpsRequests;
-}
-
-inline
-bool LocEngAdapter::requestNiNotify(GpsNiNotification &notif, const void* data)
-{
- if (mSupportsAgpsRequests) {
- notif.size = sizeof(notif);
- notif.timeout = LOC_NI_NO_RESPONSE_TIME;
-
- sendMsg(new LocEngRequestNi(mOwner, notif, data));
- }
- return mSupportsAgpsRequests;
-}
-
-inline
-bool LocEngAdapter::requestSuplES(int connHandle)
-{
- if (mSupportsAgpsRequests)
- sendMsg(new LocEngRequestSuplEs(mOwner, connHandle));
- return mSupportsAgpsRequests;
-}
-
-inline
-bool LocEngAdapter::reportDataCallOpened()
-{
- if(mSupportsAgpsRequests)
- sendMsg(new LocEngSuplEsOpened(mOwner));
- return mSupportsAgpsRequests;
-}
-
-inline
-bool LocEngAdapter::reportDataCallClosed()
-{
- if(mSupportsAgpsRequests)
- sendMsg(new LocEngSuplEsClosed(mOwner));
- return mSupportsAgpsRequests;
-}
-
-inline
-void LocEngAdapter::handleEngineDownEvent()
-{
- sendMsg(new LocEngDown(mOwner));
-}
-
-inline
-void LocEngAdapter::handleEngineUpEvent()
-{
- sendMsg(new LocEngUp(mOwner));
-}
diff --git a/gps/loc_api/libloc_api_50001/LocEngAdapter.h b/gps/loc_api/libloc_api_50001/LocEngAdapter.h
deleted file mode 100644
index 932fea1..0000000
--- a/gps/loc_api/libloc_api_50001/LocEngAdapter.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef LOC_API_ENG_ADAPTER_H
-#define LOC_API_ENG_ADAPTER_H
-
-#include <ctype.h>
-#include "hardware/gps.h"
-#include <loc.h>
-#include <loc_eng_log.h>
-#include <log_util.h>
-#include <LocAdapterBase.h>
-#include <LocDualContext.h>
-#include <UlpProxyBase.h>
-#include <platform_lib_includes.h>
-
-#define MAX_URL_LEN 256
-
-using namespace loc_core;
-
-class LocEngAdapter;
-
-class LocInternalAdapter : public LocAdapterBase {
- LocEngAdapter* mLocEngAdapter;
-public:
- LocInternalAdapter(LocEngAdapter* adapter);
-
- virtual void reportPosition(UlpLocation &location,
- GpsLocationExtended &locationExtended,
- void* locationExt,
- enum loc_sess_status status,
- LocPosTechMask loc_technology_mask);
- virtual void reportSv(GpsSvStatus &svStatus,
- GpsLocationExtended &locationExtended,
- void* svExt);
- virtual void reportStatus(GpsStatusValue status);
- virtual void setPositionModeInt(LocPosMode& posMode);
- virtual void startFixInt();
- virtual void stopFixInt();
- virtual void getZppInt();
- virtual void setUlpProxy(UlpProxyBase* ulp);
-};
-
-typedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp);
-
-class LocEngAdapter : public LocAdapterBase {
- void* mOwner;
- LocInternalAdapter* mInternalAdapter;
- UlpProxyBase* mUlp;
- LocPosMode mFixCriteria;
- bool mNavigating;
-
-public:
- bool mSupportsAgpsRequests;
- bool mSupportsPositionInjection;
-
- LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
- void* owner,ContextBase* context,
- MsgTask::tCreate tCreator);
- virtual ~LocEngAdapter();
-
- virtual void setUlpProxy(UlpProxyBase* ulp);
- inline void requestUlp(unsigned long capabilities) {
- mContext->requestUlp(mInternalAdapter, capabilities);
- }
- inline LocInternalAdapter* getInternalAdapter() { return mInternalAdapter; }
- inline UlpProxyBase* getUlpProxy() { return mUlp; }
- inline void* getOwner() { return mOwner; }
- inline bool hasAgpsExtendedCapabilities() {
- return mContext->hasAgpsExtendedCapabilities();
- }
- inline bool hasCPIExtendedCapabilities() {
- return mContext->hasCPIExtendedCapabilities();
- }
- inline const MsgTask* getMsgTask() { return mMsgTask; }
-
- inline enum loc_api_adapter_err
- startFix()
- {
- return mLocApi->startFix(mFixCriteria);
- }
- inline enum loc_api_adapter_err
- stopFix()
- {
- return mLocApi->stopFix();
- }
- inline enum loc_api_adapter_err
- deleteAidingData(GpsAidingData f)
- {
- return mLocApi->deleteAidingData(f);
- }
- inline enum loc_api_adapter_err
- enableData(int enable)
- {
- return mLocApi->enableData(enable);
- }
- inline enum loc_api_adapter_err
- setAPN(char* apn, int len)
- {
- return mLocApi->setAPN(apn, len);
- }
- inline enum loc_api_adapter_err
- injectPosition(double latitude, double longitude, float accuracy)
- {
- return mLocApi->injectPosition(latitude, longitude, accuracy);
- }
- inline enum loc_api_adapter_err
- setTime(GpsUtcTime time, int64_t timeReference, int uncertainty)
- {
- return mLocApi->setTime(time, timeReference, uncertainty);
- }
- inline enum loc_api_adapter_err
- setXtraData(char* data, int length)
- {
- return mLocApi->setXtraData(data, length);
- }
- inline enum loc_api_adapter_err
- requestXtraServer()
- {
- return mLocApi->requestXtraServer();
- }
- inline enum loc_api_adapter_err
- atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType)
- {
- return mLocApi->atlOpenStatus(handle, is_succ, apn, bearer, agpsType);
- }
- inline enum loc_api_adapter_err
- atlCloseStatus(int handle, int is_succ)
- {
- return mLocApi->atlCloseStatus(handle, is_succ);
- }
- inline enum loc_api_adapter_err
- setPositionMode(const LocPosMode *posMode)
- {
- if (NULL != posMode) {
- mFixCriteria = *posMode;
- }
- return mLocApi->setPositionMode(mFixCriteria);
- }
- inline enum loc_api_adapter_err
- setServer(const char* url, int len)
- {
- return mLocApi->setServer(url, len);
- }
- inline enum loc_api_adapter_err
- setServer(unsigned int ip, int port,
- LocServerType type)
- {
- return mLocApi->setServer(ip, port, type);
- }
- inline enum loc_api_adapter_err
- informNiResponse(GpsUserResponseType userResponse, const void* passThroughData)
- {
- return mLocApi->informNiResponse(userResponse, passThroughData);
- }
- inline enum loc_api_adapter_err
- setSUPLVersion(uint32_t version)
- {
- return mLocApi->setSUPLVersion(version);
- }
- inline enum loc_api_adapter_err
- setLPPConfig(uint32_t profile)
- {
- return mLocApi->setLPPConfig(profile);
- }
- inline enum loc_api_adapter_err
- setSensorControlConfig(int sensorUsage, int sensorProvider)
- {
- return mLocApi->setSensorControlConfig(sensorUsage, sensorProvider);
- }
- inline 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)
- {
- return mLocApi->setSensorProperties(gyroBiasVarianceRandomWalk_valid, gyroBiasVarianceRandomWalk,
- accelBiasVarianceRandomWalk_valid, accelBiasVarianceRandomWalk,
- angleBiasVarianceRandomWalk_valid, angleBiasVarianceRandomWalk,
- rateBiasVarianceRandomWalk_valid, rateBiasVarianceRandomWalk,
- velocityBiasVarianceRandomWalk_valid, velocityBiasVarianceRandomWalk);
- }
- inline 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)
- {
- return mLocApi->setSensorPerfControlConfig(controlMode, accelSamplesPerBatch, accelBatchesPerSec,
- gyroSamplesPerBatch, gyroBatchesPerSec,
- accelSamplesPerBatchHigh, accelBatchesPerSecHigh,
- gyroSamplesPerBatchHigh, gyroBatchesPerSecHigh,
- algorithmConfig);
- }
- inline virtual enum loc_api_adapter_err
- setExtPowerConfig(int isBatteryCharging)
- {
- return mLocApi->setExtPowerConfig(isBatteryCharging);
- }
- inline virtual enum loc_api_adapter_err
- setAGLONASSProtocol(unsigned long aGlonassProtocol)
- {
- return mLocApi->setAGLONASSProtocol(aGlonassProtocol);
- }
- inline virtual int initDataServiceClient()
- {
- return mLocApi->initDataServiceClient();
- }
- inline virtual int openAndStartDataCall()
- {
- return mLocApi->openAndStartDataCall();
- }
- inline virtual void stopDataCall()
- {
- mLocApi->stopDataCall();
- }
- inline virtual void closeDataCall()
- {
- mLocApi->closeDataCall();
- }
- inline enum loc_api_adapter_err
- getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask)
- {
- return mLocApi->getZppFix(zppLoc, tech_mask);
- }
-
- virtual void handleEngineDownEvent();
- virtual void handleEngineUpEvent();
- virtual void reportPosition(UlpLocation &location,
- GpsLocationExtended &locationExtended,
- void* locationExt,
- enum loc_sess_status status,
- LocPosTechMask loc_technology_mask);
- virtual void reportSv(GpsSvStatus &svStatus,
- GpsLocationExtended &locationExtended,
- void* svExt);
- virtual void reportStatus(GpsStatusValue status);
- virtual void reportNmea(const char* nmea, int length);
- virtual bool reportXtraServer(const char* url1, const char* url2,
- const char* url3, const int maxlength);
- virtual bool requestXtraData();
- virtual bool requestTime();
- virtual bool requestATL(int connHandle, AGpsType agps_type);
- virtual bool releaseATL(int connHandle);
- virtual bool requestNiNotify(GpsNiNotification &notify, const void* data);
- virtual bool requestSuplES(int connHandle);
- virtual bool reportDataCallOpened();
- virtual bool reportDataCallClosed();
-
- inline const LocPosMode& getPositionMode() const
- {return mFixCriteria;}
- inline virtual bool isInSession()
- { return mNavigating; }
- void setInSession(bool inSession);
-
- /*Values for lock
- 1 = Do not lock any position sessions
- 2 = Lock MI position sessions
- 3 = Lock MT position sessions
- 4 = Lock all position sessions
- */
- inline int setGpsLock(unsigned int lock)
- {
- return mLocApi->setGpsLock(lock);
- }
- /*
- Returns
- Current value of GPS lock on success
- -1 on failure
- */
- inline int getGpsLock()
- {
- return mLocApi->getGpsLock();
- }
-};
-
-#endif //LOC_API_ENG_ADAPTER_H
diff --git a/gps/loc_api/libloc_api_50001/Makefile.am b/gps/loc_api/libloc_api_50001/Makefile.am
deleted file mode 100644
index 2374357..0000000
--- a/gps/loc_api/libloc_api_50001/Makefile.am
+++ /dev/null
@@ -1,76 +0,0 @@
-AM_CFLAGS = \
- -I../../utils \
- -I../../platform_lib_abstractions \
- -fno-short-enums \
- -DFEATURE_GNSS_BIT_API
-
-libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp
-
-if USE_GLIB
-libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
-libloc_adapter_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
-libloc_adapter_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
-else
-libloc_adapter_so_la_CFLAGS = $(AM_CFLAGS)
-libloc_adapter_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
-libloc_adapter_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
-endif
-libloc_adapter_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la
-
-
-libloc_eng_so_la_SOURCES = \
- loc_eng.cpp \
- loc_eng_agps.cpp \
- loc_eng_xtra.cpp \
- loc_eng_ni.cpp \
- loc_eng_log.cpp \
- loc_eng_dmn_conn.cpp \
- loc_eng_dmn_conn_handler.cpp \
- loc_eng_dmn_conn_thread_helper.c \
- loc_eng_dmn_conn_glue_msg.c \
- loc_eng_dmn_conn_glue_pipe.c
-
-
-if USE_GLIB
-libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
-libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
-libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
-else
-libloc_eng_so_la_CFLAGS = $(AM_CFLAGS)
-libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
-libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
-endif
-
-libloc_eng_so_la_LIBADD = -lstdc++ -lcutils -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la
-
-
-libgps_default_so_la_SOURCES = \
- loc.cpp \
- gps.c
-
-if USE_GLIB
-libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
-libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
-libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
-else
-libgps_default_so_la_CFLAGS = $(AM_CFLAGS)
-libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
-libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
-endif
-
-libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la
-
-library_include_HEADERS = \
- LocEngAdapter.h \
- loc.h \
- loc_eng.h \
- loc_eng_xtra.h \
- loc_eng_ni.h \
- loc_eng_agps.h \
- loc_eng_msg.h \
- loc_eng_log.h
-
-library_includedir = $(pkgincludedir)/libloc_api_50001
-
-#Create and Install libraries
-lib_LTLIBRARIES = libloc_adapter_so.la libloc_eng_so.la libgps_default_so.la
diff --git a/gps/loc_api/libloc_api_50001/gps.c b/gps/loc_api/libloc_api_50001/gps.c
deleted file mode 100644
index 87aca3d..0000000
--- a/gps/loc_api/libloc_api_50001/gps.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2011 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 "hardware/gps.h"
-
-#include <stdlib.h>
-
-extern const GpsInterface* get_gps_interface();
-
-const GpsInterface* gps__get_gps_interface(struct gps_device_t* dev)
-{
- return get_gps_interface();
-}
-
-static int open_gps(const struct hw_module_t* module, char const* name,
- struct hw_device_t** device)
-{
- struct gps_device_t *dev = (struct gps_device_t *) malloc(sizeof(struct gps_device_t));
-
- if(dev == NULL)
- return -1;
-
- memset(dev, 0, sizeof(*dev));
-
- dev->common.tag = HARDWARE_DEVICE_TAG;
- dev->common.version = 0;
- dev->common.module = (struct hw_module_t*)module;
- dev->get_gps_interface = gps__get_gps_interface;
-
- *device = (struct hw_device_t*)dev;
- return 0;
-}
-
-static struct hw_module_methods_t gps_module_methods = {
- .open = open_gps
-};
-
-struct hw_module_t HAL_MODULE_INFO_SYM = {
- .tag = HARDWARE_MODULE_TAG,
- .module_api_version = 1,
- .hal_api_version = 0,
- .id = GPS_HARDWARE_MODULE_ID,
- .name = "loc_api GPS Module",
- .author = "Qualcomm USA, Inc.",
- .methods = &gps_module_methods,
-};
diff --git a/gps/loc_api/libloc_api_50001/loc.cpp b/gps/loc_api/libloc_api_50001/loc.cpp
deleted file mode 100644
index 9e08677..0000000
--- a/gps/loc_api/libloc_api_50001/loc.cpp
+++ /dev/null
@@ -1,889 +0,0 @@
-/* Copyright (c) 2011-2013, 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_NDDEBUG 0
-#define LOG_TAG "LocSvc_afw"
-
-#include "hardware/gps.h"
-#include <gps_extended.h>
-#include <loc_eng.h>
-#include <loc_target.h>
-#include <loc_log.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <dlfcn.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <LocDualContext.h>
-#include <cutils/properties.h>
-
-using namespace loc_core;
-
-//Globals defns
-static gps_location_callback gps_loc_cb = NULL;
-static gps_sv_status_callback gps_sv_cb = NULL;
-
-static void local_loc_cb(UlpLocation* location, void* locExt);
-static void local_sv_cb(GpsSvStatus* sv_status, void* svExt);
-
-static const GpsGeofencingInterface* get_geofence_interface(void);
-
-// Function declarations for sLocEngInterface
-static int loc_init(GpsCallbacks* callbacks);
-static int loc_start();
-static int loc_stop();
-static void loc_cleanup();
-static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty);
-static int loc_inject_location(double latitude, double longitude, float accuracy);
-static void loc_delete_aiding_data(GpsAidingData f);
-static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence,
- uint32_t min_interval, uint32_t preferred_accuracy,
- uint32_t preferred_time);
-static const void* loc_get_extension(const char* name);
-
-// Defines the GpsInterface in gps.h
-static const GpsInterface sLocEngInterface =
-{
- sizeof(GpsInterface),
- loc_init,
- loc_start,
- loc_stop,
- loc_cleanup,
- loc_inject_time,
- loc_inject_location,
- loc_delete_aiding_data,
- loc_set_position_mode,
- loc_get_extension
-};
-
-// Function declarations for sLocEngAGpsInterface
-static void loc_agps_init(AGpsCallbacks* callbacks);
-static int loc_agps_open(const char* apn);
-static int loc_agps_closed();
-static int loc_agps_open_failed();
-static int loc_agps_set_server(AGpsType type, const char *hostname, int port);
-
-static const AGpsInterface sLocEngAGpsInterface =
-{
- sizeof(AGpsInterface),
- loc_agps_init,
- loc_agps_open,
- loc_agps_closed,
- loc_agps_open_failed,
- loc_agps_set_server
-};
-
-static int loc_xtra_init(GpsXtraCallbacks* callbacks);
-static int loc_xtra_inject_data(char* data, int length);
-
-static const GpsXtraInterface sLocEngXTRAInterface =
-{
- sizeof(GpsXtraInterface),
- loc_xtra_init,
- loc_xtra_inject_data
-};
-
-static void loc_ni_init(GpsNiCallbacks *callbacks);
-static void loc_ni_respond(int notif_id, GpsUserResponseType user_response);
-
-const GpsNiInterface sLocEngNiInterface =
-{
- sizeof(GpsNiInterface),
- loc_ni_init,
- loc_ni_respond,
-};
-
-static void loc_agps_ril_init( AGpsRilCallbacks* callbacks );
-static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct);
-static void loc_agps_ril_set_set_id(AGpsSetIDType type, const char* setid);
-static void loc_agps_ril_ni_message(uint8_t *msg, size_t len);
-static void loc_agps_ril_update_network_state(int connected, int type, int roaming, const char* extra_info);
-static void loc_agps_ril_update_network_availability(int avaiable, const char* apn);
-
-static const AGpsRilInterface sLocEngAGpsRilInterface =
-{
- sizeof(AGpsRilInterface),
- loc_agps_ril_init,
- loc_agps_ril_set_ref_location,
- loc_agps_ril_set_set_id,
- loc_agps_ril_ni_message,
- loc_agps_ril_update_network_state,
- loc_agps_ril_update_network_availability
-};
-
-static loc_eng_data_s_type loc_afw_data;
-static int gss_fd = -1;
-
-/*===========================================================================
-FUNCTION gps_get_hardware_interface
-
-DESCRIPTION
- Returns the GPS hardware interaface based on LOC API
- if GPS is enabled.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-const GpsInterface* gps_get_hardware_interface ()
-{
- ENTRY_LOG_CALLFLOW();
- const GpsInterface* ret_val;
-
- char propBuf[PROPERTY_VALUE_MAX];
-
- loc_eng_read_config();
-
- // check to see if GPS should be disabled
- property_get("gps.disable", propBuf, "");
- if (propBuf[0] == '1')
- {
- LOC_LOGD("gps_get_interface returning NULL because gps.disable=1\n");
- ret_val = NULL;
- } else {
- ret_val = &sLocEngInterface;
- }
-
- loc_eng_read_config();
-
- EXIT_LOG(%p, ret_val);
- return ret_val;
-}
-
-// for gps.c
-extern "C" const GpsInterface* get_gps_interface()
-{
- unsigned int target = TARGET_DEFAULT;
- loc_eng_read_config();
-
- target = loc_get_target();
- LOC_LOGD("Target name check returned %s", loc_get_target_name(target));
-
- int gnssType = getTargetGnssType(target);
- switch (gnssType)
- {
- case GNSS_GSS:
- //APQ8064
- gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB);
- gss_fd = open("/dev/gss", O_RDONLY);
- if (gss_fd < 0) {
- LOC_LOGE("GSS open failed: %s\n", strerror(errno));
- }
- else {
- LOC_LOGD("GSS open success! CAPABILITIES %0lx\n",
- gps_conf.CAPABILITIES);
- }
- break;
- case GNSS_NONE:
- //MPQ8064
- LOC_LOGE("No GPS HW on this target. Not returning interface.");
- return NULL;
- case GNSS_QCA1530:
- // qca1530 chip is present
- gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB);
- LOC_LOGD("qca1530 present: CAPABILITIES %0lx\n", gps_conf.CAPABILITIES);
- break;
- }
- return &sLocEngInterface;
-}
-
-/*===========================================================================
-FUNCTION loc_init
-
-DESCRIPTION
- Initialize the location engine, this include setting up global datas
- and registers location engien with loc api service.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/Ax
-
-===========================================================================*/
-static int loc_init(GpsCallbacks* callbacks)
-{
- int retVal = -1;
- ENTRY_LOG();
- LOC_API_ADAPTER_EVENT_MASK_T event;
-
- if (NULL == callbacks) {
- LOC_LOGE("loc_init failed. cb = NULL\n");
- EXIT_LOG(%d, retVal);
- return retVal;
- }
-
- event = LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT |
- LOC_API_ADAPTER_BIT_SATELLITE_REPORT |
- LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST |
- LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST |
- LOC_API_ADAPTER_BIT_IOCTL_REPORT |
- LOC_API_ADAPTER_BIT_STATUS_REPORT |
- LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT |
- LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST;
-
- LocCallbacks clientCallbacks = {local_loc_cb, /* location_cb */
- callbacks->status_cb, /* status_cb */
- local_sv_cb, /* sv_status_cb */
- callbacks->nmea_cb, /* nmea_cb */
- callbacks->set_capabilities_cb, /* set_capabilities_cb */
- callbacks->acquire_wakelock_cb, /* acquire_wakelock_cb */
- callbacks->release_wakelock_cb, /* release_wakelock_cb */
- callbacks->create_thread_cb, /* create_thread_cb */
- NULL, /* location_ext_parser */
- NULL, /* sv_ext_parser */
- callbacks->request_utc_time_cb /* request_utc_time_cb */};
-
- gps_loc_cb = callbacks->location_cb;
- gps_sv_cb = callbacks->sv_status_cb;
-
- retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL);
- loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES);
- loc_afw_data.adapter->mSupportsAgpsRequests = !loc_afw_data.adapter->hasAgpsExtendedCapabilities();
- loc_afw_data.adapter->mSupportsPositionInjection = !loc_afw_data.adapter->hasCPIExtendedCapabilities();
-
- EXIT_LOG(%d, retVal);
- return retVal;
-}
-
-/*===========================================================================
-FUNCTION loc_cleanup
-
-DESCRIPTION
- Cleans location engine. The location client handle will be released.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static void loc_cleanup()
-{
- ENTRY_LOG();
- loc_eng_cleanup(loc_afw_data);
- gps_loc_cb = NULL;
- gps_sv_cb = NULL;
-
-/*
- if (gss_fd >= 0)
- {
- close(gss_fd);
- gss_fd = -1;
- LOC_LOGD("GSS shutdown.\n");
- }
-*/
-
- EXIT_LOG(%s, VOID_RET);
-}
-
-/*===========================================================================
-FUNCTION loc_start
-
-DESCRIPTION
- Starts the tracking session
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int loc_start()
-{
- ENTRY_LOG();
- int ret_val = loc_eng_start(loc_afw_data);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_stop
-
-DESCRIPTION
- Stops the tracking session
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int loc_stop()
-{
- ENTRY_LOG();
- int ret_val = -1;
- ret_val = loc_eng_stop(loc_afw_data);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_set_position_mode
-
-DESCRIPTION
- Sets the mode and fix frequency for the tracking session.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int loc_set_position_mode(GpsPositionMode mode,
- GpsPositionRecurrence recurrence,
- uint32_t min_interval,
- uint32_t preferred_accuracy,
- uint32_t preferred_time)
-{
- ENTRY_LOG();
- int ret_val = -1;
- LocPositionMode locMode;
- switch (mode) {
- case GPS_POSITION_MODE_MS_BASED:
- locMode = LOC_POSITION_MODE_MS_BASED;
- break;
- case GPS_POSITION_MODE_MS_ASSISTED:
- locMode = LOC_POSITION_MODE_MS_ASSISTED;
- break;
- default:
- locMode = LOC_POSITION_MODE_STANDALONE;
- break;
- }
-
- LocPosMode params(locMode, recurrence, min_interval,
- preferred_accuracy, preferred_time, NULL, NULL);
- ret_val = loc_eng_set_position_mode(loc_afw_data, params);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_inject_time
-
-DESCRIPTION
- This is used by Java native function to do time injection.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty)
-{
- ENTRY_LOG();
- int ret_val = 0;
-
- ret_val = loc_eng_inject_time(loc_afw_data, time,
- timeReference, uncertainty);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-
-/*===========================================================================
-FUNCTION loc_inject_location
-
-DESCRIPTION
- This is used by Java native function to do location injection.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0 : Successful
- error code : Failure
-
-SIDE EFFECTS
- N/A
-===========================================================================*/
-static int loc_inject_location(double latitude, double longitude, float accuracy)
-{
- ENTRY_LOG();
-
- int ret_val = 0;
- ret_val = loc_eng_inject_location(loc_afw_data, latitude, longitude, accuracy);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-
-/*===========================================================================
-FUNCTION loc_delete_aiding_data
-
-DESCRIPTION
- This is used by Java native function to delete the aiding data. The function
- updates the global variable for the aiding data to be deleted. If the GPS
- engine is off, the aiding data will be deleted. Otherwise, the actual action
- will happen when gps engine is turned off.
-
-DEPENDENCIES
- Assumes the aiding data type specified in GpsAidingData matches with
- LOC API specification.
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static void loc_delete_aiding_data(GpsAidingData f)
-{
- ENTRY_LOG();
- loc_eng_delete_aiding_data(loc_afw_data, f);
-
- EXIT_LOG(%s, VOID_RET);
-}
-
-const GpsGeofencingInterface* get_geofence_interface(void)
-{
- ENTRY_LOG();
- void *handle;
- const char *error;
- typedef const GpsGeofencingInterface* (*get_gps_geofence_interface_function) (void);
- get_gps_geofence_interface_function get_gps_geofence_interface;
- static const GpsGeofencingInterface* geofence_interface = NULL;
-
- dlerror(); /* Clear any existing error */
-
- handle = dlopen ("libgeofence.so", RTLD_NOW);
-
- if (!handle)
- {
- if ((error = dlerror()) != NULL) {
- LOC_LOGE ("%s, dlopen for libgeofence.so failed, error = %s\n", __func__, error);
- }
- goto exit;
- }
- dlerror(); /* Clear any existing error */
- get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface");
- if ((error = dlerror()) != NULL) {
- LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error);
- goto exit;
- }
-
- geofence_interface = get_gps_geofence_interface();
-
-exit:
- EXIT_LOG(%d, geofence_interface == NULL);
- return geofence_interface;
-}
-/*===========================================================================
-FUNCTION loc_get_extension
-
-DESCRIPTION
- Get the gps extension to support XTRA.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- The GPS extension interface.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-const void* loc_get_extension(const char* name)
-{
- ENTRY_LOG();
- const void* ret_val = NULL;
-
- LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name);
- if (strcmp(name, GPS_XTRA_INTERFACE) == 0)
- {
- ret_val = &sLocEngXTRAInterface;
- }
- else if (strcmp(name, AGPS_INTERFACE) == 0)
- {
- ret_val = &sLocEngAGpsInterface;
- }
- else if (strcmp(name, GPS_NI_INTERFACE) == 0)
- {
- ret_val = &sLocEngNiInterface;
- }
- else if (strcmp(name, AGPS_RIL_INTERFACE) == 0)
- {
- char baseband[PROPERTY_VALUE_MAX];
- property_get("ro.baseband", baseband, "msm");
- if (strcmp(baseband, "csfb") == 0)
- {
- ret_val = &sLocEngAGpsRilInterface;
- }
- }
- else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0)
- {
- if ((gps_conf.CAPABILITIES | GPS_CAPABILITY_GEOFENCING) == gps_conf.CAPABILITIES ){
- ret_val = get_geofence_interface();
- }
- }
- else
- {
- LOC_LOGE ("get_extension: Invalid interface passed in\n");
- }
- EXIT_LOG(%p, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_agps_init
-
-DESCRIPTION
- Initialize the AGps interface.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static void loc_agps_init(AGpsCallbacks* callbacks)
-{
- ENTRY_LOG();
- loc_eng_agps_init(loc_afw_data, (AGpsExtCallbacks*)callbacks);
- EXIT_LOG(%s, VOID_RET);
-}
-
-/*===========================================================================
-FUNCTION loc_agps_open
-
-DESCRIPTION
- This function is called when on-demand data connection opening is successful.
-It should inform ARM 9 about the data open result.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int loc_agps_open(const char* apn)
-{
- ENTRY_LOG();
- AGpsType agpsType = AGPS_TYPE_SUPL;
- AGpsBearerType bearerType = AGPS_APN_BEARER_IPV4;
- int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_agps_closed
-
-DESCRIPTION
- This function is called when on-demand data connection closing is done.
-It should inform ARM 9 about the data close result.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int loc_agps_closed()
-{
- ENTRY_LOG();
- AGpsType agpsType = AGPS_TYPE_SUPL;
- int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_agps_open_failed
-
-DESCRIPTION
- This function is called when on-demand data connection opening has failed.
-It should inform ARM 9 about the data open result.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_agps_open_failed()
-{
- ENTRY_LOG();
- AGpsType agpsType = AGPS_TYPE_SUPL;
- int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_agps_set_server
-
-DESCRIPTION
- If loc_eng_set_server is called before loc_eng_init, it doesn't work. This
- proxy buffers server settings and calls loc_eng_set_server when the client is
- open.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int loc_agps_set_server(AGpsType type, const char* hostname, int port)
-{
- ENTRY_LOG();
- LocServerType serverType;
- switch (type) {
- case AGPS_TYPE_SUPL:
- serverType = LOC_AGPS_SUPL_SERVER;
- break;
- case AGPS_TYPE_C2K:
- serverType = LOC_AGPS_CDMA_PDE_SERVER;
- break;
- default:
- serverType = LOC_AGPS_SUPL_SERVER;
- }
- int ret_val = loc_eng_set_server_proxy(loc_afw_data, serverType, hostname, port);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTIONf571
- loc_xtra_init
-
-DESCRIPTION
- Initialize XTRA module.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int loc_xtra_init(GpsXtraCallbacks* callbacks)
-{
- ENTRY_LOG();
- int ret_val = loc_eng_xtra_init(loc_afw_data, (GpsXtraExtCallbacks*)callbacks);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-
-/*===========================================================================
-FUNCTION loc_xtra_inject_data
-
-DESCRIPTION
- Initialize XTRA module.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int loc_xtra_inject_data(char* data, int length)
-{
- ENTRY_LOG();
- int ret_val = -1;
- if( (data != NULL) && ((unsigned int)length <= XTRA_DATA_MAX_SIZE))
- ret_val = loc_eng_xtra_inject_data(loc_afw_data, data, length);
- else
- LOC_LOGE("%s, Could not inject XTRA data. Buffer address: %p, length: %d",
- __func__, data, length);
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_ni_init
-
-DESCRIPTION
- This function initializes the NI interface
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_ni_init(GpsNiCallbacks *callbacks)
-{
- ENTRY_LOG();
- loc_eng_ni_init(loc_afw_data,(GpsNiExtCallbacks*) callbacks);
- EXIT_LOG(%s, VOID_RET);
-}
-
-/*===========================================================================
-FUNCTION loc_ni_respond
-
-DESCRIPTION
- This function sends an NI respond to the modem processor
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_ni_respond(int notif_id, GpsUserResponseType user_response)
-{
- ENTRY_LOG();
- loc_eng_ni_respond(loc_afw_data, notif_id, user_response);
- EXIT_LOG(%s, VOID_RET);
-}
-
-// Below stub functions are members of sLocEngAGpsRilInterface
-static void loc_agps_ril_init( AGpsRilCallbacks* callbacks ) {}
-static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct) {}
-static void loc_agps_ril_set_set_id(AGpsSetIDType type, const char* setid) {}
-static void loc_agps_ril_ni_message(uint8_t *msg, size_t len) {}
-static void loc_agps_ril_update_network_state(int connected, int type, int roaming, const char* extra_info) {}
-
-/*===========================================================================
-FUNCTION loc_agps_ril_update_network_availability
-
-DESCRIPTION
- Sets data call allow vs disallow flag to modem
- This is the only member of sLocEngAGpsRilInterface implemented.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static void loc_agps_ril_update_network_availability(int available, const char* apn)
-{
- ENTRY_LOG();
- loc_eng_agps_ril_update_network_availability(loc_afw_data, available, apn);
- EXIT_LOG(%s, VOID_RET);
-}
-
-static void local_loc_cb(UlpLocation* location, void* locExt)
-{
- ENTRY_LOG();
- if (NULL != location) {
- CALLBACK_LOG_CALLFLOW("location_cb - from", %d, location->position_source);
-
- if (NULL != gps_loc_cb) {
- gps_loc_cb(&location->gpsLocation);
- }
- }
- EXIT_LOG(%s, VOID_RET);
-}
-
-static void local_sv_cb(GpsSvStatus* sv_status, void* svExt)
-{
- ENTRY_LOG();
- if (NULL != gps_sv_cb) {
- CALLBACK_LOG_CALLFLOW("sv_status_cb -", %d, sv_status->num_svs);
- gps_sv_cb(sv_status);
- }
- EXIT_LOG(%s, VOID_RET);
-}
diff --git a/gps/loc_api/libloc_api_50001/loc.h b/gps/loc_api/libloc_api_50001/loc.h
deleted file mode 100644
index c29d005..0000000
--- a/gps/loc_api/libloc_api_50001/loc.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Copyright (c) 2011-2013, 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_H__
-#define __LOC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include <ctype.h>
-#include <cutils/properties.h>
-#include "hardware/gps.h"
-#include <gps_extended.h>
-
-#define XTRA_DATA_MAX_SIZE 100000 /*bytes*/
-
-typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt);
-typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt);
-typedef void* (*loc_ext_parser)(void* data);
-
-typedef struct {
- loc_location_cb_ext location_cb;
- gps_status_callback status_cb;
- loc_sv_status_cb_ext sv_status_cb;
- gps_nmea_callback nmea_cb;
- gps_set_capabilities set_capabilities_cb;
- gps_acquire_wakelock acquire_wakelock_cb;
- gps_release_wakelock release_wakelock_cb;
- gps_create_thread create_thread_cb;
- loc_ext_parser location_ext_parser;
- loc_ext_parser sv_ext_parser;
- gps_request_utc_time request_utc_time_cb;
-} LocCallbacks;
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif //__LOC_H__
diff --git a/gps/loc_api/libloc_api_50001/loc_eng.cpp b/gps/loc_api/libloc_api_50001/loc_eng.cpp
deleted file mode 100644
index 2c92d46..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng.cpp
+++ /dev/null
@@ -1,2609 +0,0 @@
-/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#define LOG_NDDEBUG 0
-#define LOG_TAG "LocSvc_eng"
-
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <dlfcn.h>
-#include <ctype.h>
-#include <math.h>
-#include <pthread.h>
-#include <arpa/inet.h>
-#include <netinet/in.h> /* struct sockaddr_in */
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netdb.h>
-#include <time.h>
-
-#include <LocEngAdapter.h>
-
-#include <cutils/sched_policy.h>
-#ifndef USE_GLIB
-#include <utils/SystemClock.h>
-#include <utils/Log.h>
-#endif /* USE_GLIB */
-
-#ifdef USE_GLIB
-#include <glib.h>
-#include <sys/syscall.h>
-#endif /* USE_GLIB */
-
-#include <string.h>
-
-#include <loc_eng.h>
-#include <loc_eng_ni.h>
-#include <loc_eng_dmn_conn.h>
-#include <loc_eng_dmn_conn_handler.h>
-#include <loc_eng_msg.h>
-#include <loc_eng_nmea.h>
-#include <msg_q.h>
-#include <loc.h>
-#include "log_util.h"
-#include "platform_lib_includes.h"
-#include "loc_core_log.h"
-#include "loc_eng_log.h"
-
-#define SUCCESS TRUE
-#define FAILURE FALSE
-
-#ifndef GPS_CONF_FILE
-#define GPS_CONF_FILE "/etc/gps.conf" //??? platform independent
-#endif
-
-#ifndef SAP_CONF_FILE
-#define SAP_CONF_FILE "/etc/sap.conf"
-#endif
-
-using namespace loc_core;
-
-boolean configAlreadyRead = false;
-unsigned int agpsStatus = 0;
-loc_gps_cfg_s_type gps_conf;
-loc_sap_cfg_s_type sap_conf;
-
-/* Parameter spec table */
-static loc_param_s_type loc_parameter_table[] =
-{
- {"INTERMEDIATE_POS", &gps_conf.INTERMEDIATE_POS, NULL, 'n'},
- {"ACCURACY_THRES", &gps_conf.ACCURACY_THRES, NULL, 'n'},
- {"NMEA_PROVIDER", &gps_conf.NMEA_PROVIDER, NULL, 'n'},
- {"SUPL_VER", &gps_conf.SUPL_VER, NULL, 'n'},
- {"CAPABILITIES", &gps_conf.CAPABILITIES, NULL, 'n'},
- {"GYRO_BIAS_RANDOM_WALK", &sap_conf.GYRO_BIAS_RANDOM_WALK, &sap_conf.GYRO_BIAS_RANDOM_WALK_VALID, 'f'},
- {"ACCEL_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
- {"ANGLE_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
- {"RATE_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
- {"VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY", &sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY, &sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID, 'f'},
- {"SENSOR_ACCEL_BATCHES_PER_SEC", &sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC, NULL, 'n'},
- {"SENSOR_ACCEL_SAMPLES_PER_BATCH", &sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH, NULL, 'n'},
- {"SENSOR_GYRO_BATCHES_PER_SEC", &sap_conf.SENSOR_GYRO_BATCHES_PER_SEC, NULL, 'n'},
- {"SENSOR_GYRO_SAMPLES_PER_BATCH", &sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH, NULL, 'n'},
- {"SENSOR_ACCEL_BATCHES_PER_SEC_HIGH", &sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH, NULL, 'n'},
- {"SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH", &sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
- {"SENSOR_GYRO_BATCHES_PER_SEC_HIGH", &sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH, NULL, 'n'},
- {"SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH", &sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH, NULL, 'n'},
- {"SENSOR_CONTROL_MODE", &sap_conf.SENSOR_CONTROL_MODE, NULL, 'n'},
- {"SENSOR_USAGE", &sap_conf.SENSOR_USAGE, NULL, 'n'},
- {"SENSOR_ALGORITHM_CONFIG_MASK", &sap_conf.SENSOR_ALGORITHM_CONFIG_MASK, NULL, 'n'},
- {"QUIPC_ENABLED", &gps_conf.QUIPC_ENABLED, NULL, 'n'},
- {"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'},
- {"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
- {"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'},
-};
-
-static void loc_default_parameters(void)
-{
- /* defaults */
- gps_conf.INTERMEDIATE_POS = 0;
- gps_conf.ACCURACY_THRES = 0;
- gps_conf.NMEA_PROVIDER = 0;
- gps_conf.SUPL_VER = 0x10000;
- gps_conf.CAPABILITIES = 0x7;
-
- sap_conf.GYRO_BIAS_RANDOM_WALK = 0;
- sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC = 2;
- sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH = 5;
- sap_conf.SENSOR_GYRO_BATCHES_PER_SEC = 2;
- sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH = 5;
- sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH = 4;
- sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH = 25;
- sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH = 4;
- sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH = 25;
- sap_conf.SENSOR_CONTROL_MODE = 0; /* AUTO */
- sap_conf.SENSOR_USAGE = 0; /* Enabled */
- sap_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 */
- sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY = 0;
- sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
- sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY = 0;
- sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY = 0;
-
- sap_conf.GYRO_BIAS_RANDOM_WALK_VALID = 0;
- sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
- sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
- sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
- sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID = 0;
-
- /* LTE Positioning Profile configuration is disable by default*/
- gps_conf.LPP_PROFILE = 0;
-
- /*By default no positioning protocol is selected on A-GLONASS system*/
- gps_conf.A_GLONASS_POS_PROTOCOL_SELECT = 0;
-
- /* default provider is SSC */
- sap_conf.SENSOR_PROVIDER = 1;
-}
-
-// 2nd half of init(), singled out for
-// modem restart to use.
-static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data);
-static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data);
-
-static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data,
- LocServerType type, const char *hostname, int port);
-// Internal functions
-static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data,
- GpsStatusValue status);
-static void loc_eng_report_status(loc_eng_data_s_type &loc_eng_data,
- GpsStatusValue status);
-static void loc_eng_process_conn_request(loc_eng_data_s_type &loc_eng_data,
- int connHandle, AGpsType agps_type);
-static void loc_eng_agps_close_status(loc_eng_data_s_type &loc_eng_data, int is_succ);
-static void loc_eng_handle_engine_down(loc_eng_data_s_type &loc_eng_data) ;
-static void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) ;
-
-static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data);
-static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data);
-static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data);
-
-static void deleteAidingData(loc_eng_data_s_type &logEng);
-static AgpsStateMachine*
-getAgpsStateMachine(loc_eng_data_s_type& logEng, AGpsExtType agpsType);
-static int dataCallCb(void *cb_data);
-static void update_aiding_data_for_deletion(loc_eng_data_s_type& loc_eng_data) {
- if (loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON &&
- loc_eng_data.aiding_data_for_deletion != 0)
- {
- loc_eng_data.adapter->deleteAidingData(loc_eng_data.aiding_data_for_deletion);
- loc_eng_data.aiding_data_for_deletion = 0;
- }
-}
-
-static void* noProc(void* data)
-{
- return NULL;
-}
-
-
-/*********************************************************************
- * definitions of the static messages used in the file
- *********************************************************************/
-// case LOC_ENG_MSG_REQUEST_NI:
-LocEngRequestNi::LocEngRequestNi(void* locEng,
- GpsNiNotification &notif,
- const void* data) :
- LocMsg(), mLocEng(locEng), mNotify(notif), mPayload(data) {
- locallog();
-}
-void LocEngRequestNi::proc() const {
- loc_eng_ni_request_handler(*((loc_eng_data_s_type*)mLocEng),
- &mNotify, mPayload);
-}
-void LocEngRequestNi::locallog() const
-{
- LOC_LOGV("id: %d\n type: %s\n flags: %d\n time out: %d\n "
- "default response: %s\n requestor id encoding: %s\n"
- " text encoding: %s\n passThroughData: %p",
- mNotify.notification_id,
- loc_get_ni_type_name(mNotify.ni_type),
- mNotify.notify_flags,
- mNotify.timeout,
- loc_get_ni_response_name(mNotify.default_response),
- loc_get_ni_encoding_name(mNotify.requestor_id_encoding),
- loc_get_ni_encoding_name(mNotify.text_encoding),
- mPayload);
-}
-inline void LocEngRequestNi::log() const {
- locallog();
-}
-
-// case LOC_ENG_MSG_INFORM_NI_RESPONSE:
-// in loc_eng_ni.cpp
-
-// case LOC_ENG_MSG_START_FIX:
-LocEngStartFix::LocEngStartFix(LocEngAdapter* adapter) :
- LocMsg(), mAdapter(adapter)
-{
- locallog();
-}
-inline void LocEngStartFix::proc() const
-{
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner();
- loc_eng_start_handler(*locEng);
-}
-inline void LocEngStartFix::locallog() const
-{
- LOC_LOGV("LocEngStartFix");
-}
-inline void LocEngStartFix::log() const
-{
- locallog();
-}
-void LocEngStartFix::send() const {
- mAdapter->sendMsg(this);
-}
-
-// case LOC_ENG_MSG_STOP_FIX:
-LocEngStopFix::LocEngStopFix(LocEngAdapter* adapter) :
- LocMsg(), mAdapter(adapter)
-{
- locallog();
-}
-inline void LocEngStopFix::proc() const
-{
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner();
- loc_eng_stop_handler(*locEng);
-}
-inline void LocEngStopFix::locallog() const
-{
- LOC_LOGV("LocEngStopFix");
-}
-inline void LocEngStopFix::log() const
-{
- locallog();
-}
-void LocEngStopFix::send() const {
- mAdapter->sendMsg(this);
-}
-
-// case LOC_ENG_MSG_SET_POSITION_MODE:
-LocEngPositionMode::LocEngPositionMode(LocEngAdapter* adapter,
- LocPosMode &mode) :
- LocMsg(), mAdapter(adapter), mPosMode(mode)
-{
- mPosMode.logv();
-}
-inline void LocEngPositionMode::proc() const {
- mAdapter->setPositionMode(&mPosMode);
-}
-inline void LocEngPositionMode::log() const {
- mPosMode.logv();
-}
-void LocEngPositionMode::send() const {
- mAdapter->sendMsg(this);
-}
-
-LocEngGetZpp::LocEngGetZpp(LocEngAdapter* adapter) :
- LocMsg(), mAdapter(adapter)
-{
- locallog();
-}
-inline void LocEngGetZpp::proc() const
-{
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mAdapter->getOwner();
- loc_eng_get_zpp_handler(*locEng);
-}
-inline void LocEngGetZpp::locallog() const
-{
- LOC_LOGV("LocEngGetZpp");
-}
-inline void LocEngGetZpp::log() const
-{
- locallog();
-}
-void LocEngGetZpp::send() const {
- mAdapter->sendMsg(this);
-}
-
-// case LOC_ENG_MSG_SET_TIME:
-struct LocEngSetTime : public LocMsg {
- LocEngAdapter* mAdapter;
- const GpsUtcTime mTime;
- const int64_t mTimeReference;
- const int mUncertainty;
- inline LocEngSetTime(LocEngAdapter* adapter,
- GpsUtcTime t, int64_t tf, int unc) :
- LocMsg(), mAdapter(adapter),
- mTime(t), mTimeReference(tf), mUncertainty(unc)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->setTime(mTime, mTimeReference, mUncertainty);
- }
- inline void locallog() const {
- LOC_LOGV("time: %lld\n timeReference: %lld\n uncertainty: %d",
- mTime, mTimeReference, mUncertainty);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
- // case LOC_ENG_MSG_INJECT_LOCATION:
-struct LocEngInjectLocation : public LocMsg {
- LocEngAdapter* mAdapter;
- const double mLatitude;
- const double mLongitude;
- const float mAccuracy;
- inline LocEngInjectLocation(LocEngAdapter* adapter,
- double lat, double lon, float accur) :
- LocMsg(), mAdapter(adapter),
- mLatitude(lat), mLongitude(lon), mAccuracy(accur)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->injectPosition(mLatitude, mLongitude, mAccuracy);
- }
- inline void locallog() const {
- LOC_LOGV("latitude: %f\n longitude: %f\n accuracy: %f",
- mLatitude, mLongitude, mAccuracy);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_SET_SERVER_IPV4:
-struct LocEngSetServerIpv4 : public LocMsg {
- LocEngAdapter* mAdapter;
- const unsigned int mNlAddr;
- const int mPort;
- const LocServerType mServerType;
- inline LocEngSetServerIpv4(LocEngAdapter* adapter,
- unsigned int ip,
- int port,
- LocServerType type) :
- LocMsg(), mAdapter(adapter),
- mNlAddr(ip), mPort(port), mServerType(type)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->setServer(mNlAddr, mPort, mServerType);
- }
- inline void locallog() const {
- LOC_LOGV("LocEngSetServerIpv4 - addr: %x, port: %d, type: %s",
- mNlAddr, mPort, loc_get_server_type_name(mServerType));
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_SET_SERVER_URL:
-struct LocEngSetServerUrl : public LocMsg {
- LocEngAdapter* mAdapter;
- const int mLen;
- char* mUrl;
- inline LocEngSetServerUrl(LocEngAdapter* adapter,
- char* urlString,
- int url_len) :
- LocMsg(), mAdapter(adapter),
- mLen(url_len), mUrl(new char[mLen+1])
- {
- memcpy((void*)mUrl, (void*)urlString, url_len);
- mUrl[mLen] = 0;
- locallog();
- }
- inline ~LocEngSetServerUrl()
- {
- delete[] mUrl;
- }
- inline virtual void proc() const {
- mAdapter->setServer(mUrl, mLen);
- }
- inline void locallog() const {
- LOC_LOGV("LocEngSetServerUrl - url: %s", mUrl);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_A_GLONASS_PROTOCOL:
-struct LocEngAGlonassProtocol : public LocMsg {
- LocEngAdapter* mAdapter;
- const unsigned long mAGlonassProtocl;
- inline LocEngAGlonassProtocol(LocEngAdapter* adapter,
- unsigned long protocol) :
- LocMsg(), mAdapter(adapter), mAGlonassProtocl(protocol)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->setAGLONASSProtocol(mAGlonassProtocl);
- }
- inline void locallog() const {
- LOC_LOGV("A-GLONASS protocol: 0x%lx", mAGlonassProtocl);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_SUPL_VERSION:
-struct LocEngSuplVer : public LocMsg {
- LocEngAdapter* mAdapter;
- const int mSuplVer;
- inline LocEngSuplVer(LocEngAdapter* adapter,
- int suplVer) :
- LocMsg(), mAdapter(adapter), mSuplVer(suplVer)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->setSUPLVersion(mSuplVer);
- }
- inline void locallog() const {
- LOC_LOGV("SUPL Version: %d", mSuplVer);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_LPP_CONFIG:
-struct LocEngLppConfig : public LocMsg {
- LocEngAdapter* mAdapter;
- const int mLppConfig;
- inline LocEngLppConfig(LocEngAdapter* adapter,
- int lppConfig) :
- LocMsg(), mAdapter(adapter), mLppConfig(lppConfig)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->setLPPConfig(mLppConfig);
- }
- inline void locallog() const {
- LOC_LOGV("LocEngLppConfig - profile: %d", mLppConfig);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_SET_SENSOR_CONTROL_CONFIG:
-struct LocEngSensorControlConfig : public LocMsg {
- LocEngAdapter* mAdapter;
- const int mSensorsDisabled;
- const int mSensorProvider;
- inline LocEngSensorControlConfig(LocEngAdapter* adapter,
- int sensorsDisabled, int sensorProvider) :
- LocMsg(), mAdapter(adapter), mSensorsDisabled(sensorsDisabled),
- mSensorProvider(sensorProvider)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->setSensorControlConfig(mSensorsDisabled, mSensorProvider);
- }
- inline void locallog() const {
- LOC_LOGV("LocEngSensorControlConfig - Sensors Disabled: %d, Sensor Provider: %d",
- mSensorsDisabled, mSensorProvider);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_SET_SENSOR_PROPERTIES:
-struct LocEngSensorProperties : public LocMsg {
- LocEngAdapter* mAdapter;
- const bool mGyroBiasVarianceRandomWalkValid;
- const float mGyroBiasVarianceRandomWalk;
- const bool mAccelRandomWalkValid;
- const float mAccelRandomWalk;
- const bool mAngleRandomWalkValid;
- const float mAngleRandomWalk;
- const bool mRateRandomWalkValid;
- const float mRateRandomWalk;
- const bool mVelocityRandomWalkValid;
- const float mVelocityRandomWalk;
- inline LocEngSensorProperties(LocEngAdapter* adapter,
- bool gyroBiasRandomWalk_valid,
- float gyroBiasRandomWalk,
- bool accelRandomWalk_valid,
- float accelRandomWalk,
- bool angleRandomWalk_valid,
- float angleRandomWalk,
- bool rateRandomWalk_valid,
- float rateRandomWalk,
- bool velocityRandomWalk_valid,
- float velocityRandomWalk) :
- LocMsg(), mAdapter(adapter),
- mGyroBiasVarianceRandomWalkValid(gyroBiasRandomWalk_valid),
- mGyroBiasVarianceRandomWalk(gyroBiasRandomWalk),
- mAccelRandomWalkValid(accelRandomWalk_valid),
- mAccelRandomWalk(accelRandomWalk),
- mAngleRandomWalkValid(angleRandomWalk_valid),
- mAngleRandomWalk(angleRandomWalk),
- mRateRandomWalkValid(rateRandomWalk_valid),
- mRateRandomWalk(rateRandomWalk),
- mVelocityRandomWalkValid(velocityRandomWalk_valid),
- mVelocityRandomWalk(velocityRandomWalk)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->setSensorProperties(mGyroBiasVarianceRandomWalkValid,
- mGyroBiasVarianceRandomWalk,
- mAccelRandomWalkValid,
- mAccelRandomWalk,
- mAngleRandomWalkValid,
- mAngleRandomWalk,
- mRateRandomWalkValid,
- mRateRandomWalk,
- mVelocityRandomWalkValid,
- mVelocityRandomWalk);
- }
- inline void locallog() const {
- LOC_LOGV("Sensor properties validity, Gyro Random walk: %d "
- "Accel Random Walk: %d "
- "Angle Random Walk: %d Rate Random Walk: %d "
- "Velocity Random Walk: %d\n"
- "Sensor properties, Gyro Random walk: %f "
- "Accel Random Walk: %f "
- "Angle Random Walk: %f Rate Random Walk: %f "
- "Velocity Random Walk: %f",
- mGyroBiasVarianceRandomWalkValid,
- mAccelRandomWalkValid,
- mAngleRandomWalkValid,
- mRateRandomWalkValid,
- mVelocityRandomWalkValid,
- mGyroBiasVarianceRandomWalk,
- mAccelRandomWalk,
- mAngleRandomWalk,
- mRateRandomWalk,
- mVelocityRandomWalk
- );
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_SET_SENSOR_PERF_CONTROL_CONFIG:
-struct LocEngSensorPerfControlConfig : public LocMsg {
- LocEngAdapter* mAdapter;
- const int mControlMode;
- const int mAccelSamplesPerBatch;
- const int mAccelBatchesPerSec;
- const int mGyroSamplesPerBatch;
- const int mGyroBatchesPerSec;
- const int mAccelSamplesPerBatchHigh;
- const int mAccelBatchesPerSecHigh;
- const int mGyroSamplesPerBatchHigh;
- const int mGyroBatchesPerSecHigh;
- const int mAlgorithmConfig;
- inline LocEngSensorPerfControlConfig(LocEngAdapter* adapter,
- int controlMode,
- int accelSamplesPerBatch,
- int accelBatchesPerSec,
- int gyroSamplesPerBatch,
- int gyroBatchesPerSec,
- int accelSamplesPerBatchHigh,
- int accelBatchesPerSecHigh,
- int gyroSamplesPerBatchHigh,
- int gyroBatchesPerSecHigh,
- int algorithmConfig) :
- LocMsg(), mAdapter(adapter),
- mControlMode(controlMode),
- mAccelSamplesPerBatch(accelSamplesPerBatch),
- mAccelBatchesPerSec(accelBatchesPerSec),
- mGyroSamplesPerBatch(gyroSamplesPerBatch),
- mGyroBatchesPerSec(gyroBatchesPerSec),
- mAccelSamplesPerBatchHigh(accelSamplesPerBatchHigh),
- mAccelBatchesPerSecHigh(accelBatchesPerSecHigh),
- mGyroSamplesPerBatchHigh(gyroSamplesPerBatchHigh),
- mGyroBatchesPerSecHigh(gyroBatchesPerSecHigh),
- mAlgorithmConfig(algorithmConfig)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->setSensorPerfControlConfig(mControlMode,
- mAccelSamplesPerBatch,
- mAccelBatchesPerSec,
- mGyroSamplesPerBatch,
- mGyroBatchesPerSec,
- mAccelSamplesPerBatchHigh,
- mAccelBatchesPerSecHigh,
- mGyroSamplesPerBatchHigh,
- mGyroBatchesPerSecHigh,
- mAlgorithmConfig);
- }
- inline void locallog() const {
- LOC_LOGV("Sensor Perf Control Config (performanceControlMode)(%u) "
- "accel(#smp,#batches) (%u,%u) "
- "gyro(#smp,#batches) (%u,%u), "
- "accel_high(#smp,#batches) (%u,%u) "
- "gyro_high(#smp,#batches) (%u,%u), "
- "algorithmConfig(%u)\n",
- mControlMode,
- mAccelSamplesPerBatch, mAccelBatchesPerSec,
- mGyroSamplesPerBatch, mGyroBatchesPerSec,
- mAccelSamplesPerBatchHigh, mAccelBatchesPerSecHigh,
- mGyroSamplesPerBatchHigh, mGyroBatchesPerSecHigh,
- mAlgorithmConfig);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_EXT_POWER_CONFIG:
-struct LocEngExtPowerConfig : public LocMsg {
- LocEngAdapter* mAdapter;
- const int mIsBatteryCharging;
- inline LocEngExtPowerConfig(LocEngAdapter* adapter,
- int isBatteryCharging) :
- LocMsg(), mAdapter(adapter),
- mIsBatteryCharging(isBatteryCharging)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->setExtPowerConfig(mIsBatteryCharging);
- }
- inline void locallog() const {
- LOC_LOGV("LocEngExtPowerConfig - isBatteryCharging: %d",
- mIsBatteryCharging);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_REPORT_POSITION:
-LocEngReportPosition::LocEngReportPosition(LocAdapterBase* adapter,
- UlpLocation &loc,
- GpsLocationExtended &locExtended,
- void* locExt,
- enum loc_sess_status st,
- LocPosTechMask technology) :
- LocMsg(), mAdapter(adapter), mLocation(loc),
- mLocationExtended(locExtended),
- mLocationExt(((loc_eng_data_s_type*)
- ((LocEngAdapter*)
- (mAdapter))->getOwner())->location_ext_parser(locExt)),
- mStatus(st), mTechMask(technology)
-{
- locallog();
-}
-void LocEngReportPosition::proc() const {
- LocEngAdapter* adapter = (LocEngAdapter*)mAdapter;
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)adapter->getOwner();
-
- if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION) {
- bool reported = false;
- if (locEng->location_cb != NULL) {
- if (LOC_SESS_FAILURE == mStatus) {
- // in case we want to handle the failure case
- locEng->location_cb(NULL, NULL);
- reported = true;
- }
- // what's in the else if is... (line by line)
- // 1. this is a final fix; and
- // 1.1 it is a Satellite fix; or
- // 1.2 it is a sensor fix
- // 2. (must be intermediate fix... implicit)
- // 2.1 we accepte intermediate; and
- // 2.2 it is NOT the case that
- // 2.2.1 there is inaccuracy; and
- // 2.2.2 we care about inaccuracy; and
- // 2.2.3 the inaccuracy exceeds our tolerance
- else if ((LOC_SESS_SUCCESS == mStatus &&
- ((LOC_POS_TECH_MASK_SATELLITE |
- LOC_POS_TECH_MASK_SENSORS |
- LOC_POS_TECH_MASK_HYBRID) &
- mTechMask)) ||
- (LOC_SESS_INTERMEDIATE == locEng->intermediateFix &&
- !((mLocation.gpsLocation.flags &
- GPS_LOCATION_HAS_ACCURACY) &&
- (gps_conf.ACCURACY_THRES != 0) &&
- (mLocation.gpsLocation.accuracy >
- gps_conf.ACCURACY_THRES)))) {
- locEng->location_cb((UlpLocation*)&(mLocation),
- (void*)mLocationExt);
- reported = true;
- }
- }
-
- // if we have reported this fix
- if (reported &&
- // and if this is a singleshot
- GPS_POSITION_RECURRENCE_SINGLE ==
- locEng->adapter->getPositionMode().recurrence) {
- if (LOC_SESS_INTERMEDIATE == mStatus) {
- // modem could be still working for a final fix,
- // although we no longer need it. So stopFix().
- locEng->adapter->stopFix();
- }
- // turn off the session flag.
- locEng->adapter->setInSession(false);
- }
-
- if (locEng->generateNmea &&
- mLocation.position_source == ULP_LOCATION_IS_FROM_GNSS &&
- mTechMask & (LOC_POS_TECH_MASK_SATELLITE |
- LOC_POS_TECH_MASK_SENSORS |
- LOC_POS_TECH_MASK_HYBRID))
- {
- unsigned char generate_nmea = reported &&
- (mStatus != LOC_SESS_FAILURE);
- loc_eng_nmea_generate_pos(locEng, mLocation, mLocationExtended,
- generate_nmea);
- }
-
- // Free the allocated memory for rawData
- UlpLocation* gp = (UlpLocation*)&(mLocation);
- if (gp != NULL && gp->rawData != NULL)
- {
- delete (char*)gp->rawData;
- gp->rawData = NULL;
- gp->rawDataSize = 0;
- }
- }
-}
-void LocEngReportPosition::locallog() const {
- LOC_LOGV("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: %lld\n rawDataSize: %d\n rawData: %p\n Session"
- " status: %d\n Technology mask: %u",
- mLocation.gpsLocation.flags, mLocation.position_source,
- mLocation.gpsLocation.latitude, mLocation.gpsLocation.longitude,
- mLocation.gpsLocation.altitude, mLocation.gpsLocation.speed,
- mLocation.gpsLocation.bearing, mLocation.gpsLocation.accuracy,
- mLocation.gpsLocation.timestamp, mLocation.rawDataSize,
- mLocation.rawData, mStatus, mTechMask);
-}
-void LocEngReportPosition::log() const {
- locallog();
-}
-void LocEngReportPosition::send() const {
- mAdapter->sendMsg(this);
-}
-
-
-// case LOC_ENG_MSG_REPORT_SV:
-LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter,
- GpsSvStatus &sv,
- GpsLocationExtended &locExtended,
- void* svExt) :
- LocMsg(), mAdapter(adapter), mSvStatus(sv),
- mLocationExtended(locExtended),
- mSvExt(((loc_eng_data_s_type*)
- ((LocEngAdapter*)
- (mAdapter))->getOwner())->sv_ext_parser(svExt))
-{
- locallog();
-}
-void LocEngReportSv::proc() const {
- LocEngAdapter* adapter = (LocEngAdapter*)mAdapter;
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)adapter->getOwner();
-
- if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION)
- {
- if (locEng->sv_status_cb != NULL) {
- locEng->sv_status_cb((GpsSvStatus*)&(mSvStatus),
- (void*)mSvExt);
- }
-
- if (locEng->generateNmea)
- {
- loc_eng_nmea_generate_sv(locEng, mSvStatus, mLocationExtended);
- }
- }
-}
-void LocEngReportSv::locallog() const {
- LOC_LOGV("num sv: %d\n ephemeris mask: %dxn almanac mask: %x\n "
- "used in fix mask: %x\n sv: prn snr "
- "elevation azimuth",
- mSvStatus.num_svs, mSvStatus.ephemeris_mask,
- mSvStatus.almanac_mask, mSvStatus.used_in_fix_mask);
- for (int i = 0; i < mSvStatus.num_svs && i < GPS_MAX_SVS; i++) {
- LOC_LOGV(" %d: %d %f %f %f\n ",
- i,
- mSvStatus.sv_list[i].prn,
- mSvStatus.sv_list[i].snr,
- mSvStatus.sv_list[i].elevation,
- mSvStatus.sv_list[i].azimuth);
- }
-}
-inline void LocEngReportSv::log() const {
- locallog();
-}
-void LocEngReportSv::send() const {
- mAdapter->sendMsg(this);
-}
-
-// case LOC_ENG_MSG_REPORT_STATUS:
-LocEngReportStatus::LocEngReportStatus(LocAdapterBase* adapter,
- GpsStatusValue engineStatus) :
- LocMsg(), mAdapter(adapter), mStatus(engineStatus)
-{
- locallog();
-}
-inline void LocEngReportStatus::proc() const
-{
- LocEngAdapter* adapter = (LocEngAdapter*)mAdapter;
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)adapter->getOwner();
-
- loc_eng_report_status(*locEng, mStatus);
- update_aiding_data_for_deletion(*locEng);
-}
-inline void LocEngReportStatus::locallog() const {
- LOC_LOGV("LocEngReportStatus");
-}
-inline void LocEngReportStatus::log() const {
- locallog();
-}
-
-// case LOC_ENG_MSG_REPORT_NMEA:
-LocEngReportNmea::LocEngReportNmea(void* locEng,
- const char* data, int len) :
- LocMsg(), mLocEng(locEng), mNmea(new char[len]), mLen(len)
-{
- memcpy((void*)mNmea, (void*)data, len);
- locallog();
-}
-void LocEngReportNmea::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*) mLocEng;
-
- struct timeval tv;
- gettimeofday(&tv, (struct timezone *) NULL);
- int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000;
- CALLBACK_LOG_CALLFLOW("nmea_cb", %d, mLen);
-
- if (locEng->nmea_cb != NULL)
- locEng->nmea_cb(now, mNmea, mLen);
-}
-inline void LocEngReportNmea::locallog() const {
- LOC_LOGV("LocEngReportNmea");
-}
-inline void LocEngReportNmea::log() const {
- locallog();
-}
-
-// case LOC_ENG_MSG_REPORT_XTRA_SERVER:
-LocEngReportXtraServer::LocEngReportXtraServer(void* locEng,
- const char *url1,
- const char *url2,
- const char *url3,
- const int maxlength) :
- LocMsg(), mLocEng(locEng), mMaxLen(maxlength),
- mServers(new char[3*(mMaxLen+1)])
-{
- memset(mServers, 0, 3*(mMaxLen+1));
- strlcpy(mServers, url1, mMaxLen);
- strlcpy(&(mServers[mMaxLen+1]), url2, mMaxLen);
- strlcpy(&(mServers[(mMaxLen+1)<<1]), url3, mMaxLen);
- locallog();
-}
-void LocEngReportXtraServer::proc() const {
- loc_eng_xtra_data_s_type* locEngXtra =
- &(((loc_eng_data_s_type*)mLocEng)->xtra_module_data);
-
- if (locEngXtra->report_xtra_server_cb != NULL) {
- CALLBACK_LOG_CALLFLOW("report_xtra_server_cb", %s, mServers);
- locEngXtra->report_xtra_server_cb(mServers,
- &(mServers[mMaxLen+1]),
- &(mServers[(mMaxLen+1)<<1]));
- } else {
- LOC_LOGE("Callback function for request xtra is NULL");
- }
-}
-inline void LocEngReportXtraServer::locallog() const {
- LOC_LOGV("LocEngReportXtraServers: server1: %s\n server2: %s\n"
- " server3: %s\n",
- mServers, &mServers[mMaxLen+1], &mServers[(mMaxLen+1)<<1]);
-}
-inline void LocEngReportXtraServer::log() const {
- locallog();
-}
-
-// case LOC_ENG_MSG_REQUEST_BIT:
-// case LOC_ENG_MSG_RELEASE_BIT:
-LocEngReqRelBIT::LocEngReqRelBIT(void* locEng, AGpsExtType type,
- int ipv4, char* ipv6, bool isReq) :
- LocMsg(), mLocEng(locEng), mType(type), mIPv4Addr(ipv4),
- mIPv6Addr(ipv6 ? new char[16] : NULL), mIsReq(isReq) {
- if (NULL != ipv6)
- memcpy(mIPv6Addr, ipv6, 16);
- locallog();
-}
-inline LocEngReqRelBIT::~LocEngReqRelBIT() {
- if (mIPv6Addr) {
- delete[] mIPv6Addr;
- }
-}
-void LocEngReqRelBIT::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- BITSubscriber s(getAgpsStateMachine(*locEng, mType),
- mIPv4Addr, mIPv6Addr);
- AgpsStateMachine* sm = (AgpsStateMachine*)s.mStateMachine;
-
- if (mIsReq) {
- sm->subscribeRsrc((Subscriber*)&s);
- } else {
- sm->unsubscribeRsrc((Subscriber*)&s);
- }
-}
-inline void LocEngReqRelBIT::locallog() const {
- LOC_LOGV("LocEngRequestBIT - ipv4: %d.%d.%d.%d, ipv6: %s",
- (unsigned char)mIPv4Addr,
- (unsigned char)(mIPv4Addr>>8),
- (unsigned char)(mIPv4Addr>>16),
- (unsigned char)(mIPv4Addr>>24),
- NULL != mIPv6Addr ? mIPv6Addr : "");
-}
-inline void LocEngReqRelBIT::log() const {
- locallog();
-}
-void LocEngReqRelBIT::send() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- locEng->adapter->sendMsg(this);
-}
-
-// case LOC_ENG_MSG_RELEASE_BIT:
-struct LocEngReleaseBIT : public LocMsg {
- const BITSubscriber mSubscriber;
- inline LocEngReleaseBIT(const AgpsStateMachine* stateMachine,
- unsigned int ipv4, char* ipv6) :
- LocMsg(),
- mSubscriber(stateMachine, ipv4, ipv6)
- {
- locallog();
- }
- inline virtual void proc() const
- {
- AgpsStateMachine* sm = (AgpsStateMachine*)mSubscriber.mStateMachine;
- sm->unsubscribeRsrc((Subscriber*)&mSubscriber);
- }
- inline void locallog() const {
- LOC_LOGV("LocEngReleaseBIT - ipv4: %d.%d.%d.%d, ipv6: %s",
- (unsigned char)(mSubscriber.ID>>24),
- (unsigned char)(mSubscriber.ID>>16),
- (unsigned char)(mSubscriber.ID>>8),
- (unsigned char)mSubscriber.ID,
- NULL != mSubscriber.mIPv6Addr ? mSubscriber.mIPv6Addr : "");
- }
- virtual void log() const {
- locallog();
- }
-};
-
-// LocEngSuplEsOpened
-LocEngSuplEsOpened::LocEngSuplEsOpened(void* locEng) :
- LocMsg(), mLocEng(locEng) {
- locallog();
-}
-void LocEngSuplEsOpened::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- if (locEng->ds_nif) {
- AgpsStateMachine* sm = locEng->ds_nif;
- sm->onRsrcEvent(RSRC_GRANTED);
- }
-}
-void LocEngSuplEsOpened::locallog() const {
- LOC_LOGV("LocEngSuplEsOpened");
-}
-void LocEngSuplEsOpened::log() const {
- locallog();
-}
-
-// LocEngSuplEsClosed
-LocEngSuplEsClosed::LocEngSuplEsClosed(void* locEng) :
- LocMsg(), mLocEng(locEng) {
- locallog();
-}
-void LocEngSuplEsClosed::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- if (locEng->ds_nif) {
- AgpsStateMachine* sm = locEng->ds_nif;
- sm->onRsrcEvent(RSRC_RELEASED);
- }
-}
-void LocEngSuplEsClosed::locallog() const {
- LOC_LOGV("LocEngSuplEsClosed");
-}
-void LocEngSuplEsClosed::log() const {
- locallog();
-}
-
-
-// case LOC_ENG_MSG_REQUEST_SUPL_ES:
-LocEngRequestSuplEs::LocEngRequestSuplEs(void* locEng, int id) :
- LocMsg(), mLocEng(locEng), mID(id) {
- locallog();
-}
-void LocEngRequestSuplEs::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- if (locEng->ds_nif) {
- AgpsStateMachine* sm = locEng->ds_nif;
- DSSubscriber s(sm, mID);
- sm->subscribeRsrc((Subscriber*)&s);
- } else {
- locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, -1);
- }
-}
-inline void LocEngRequestSuplEs::locallog() const {
- LOC_LOGV("LocEngRequestSuplEs");
-}
-inline void LocEngRequestSuplEs::log() const {
- locallog();
-}
-
-// case LOC_ENG_MSG_REQUEST_ATL:
-LocEngRequestATL::LocEngRequestATL(void* locEng, int id,
- AGpsExtType agps_type) :
- LocMsg(), mLocEng(locEng), mID(id), mType(agps_type) {
- locallog();
-}
-void LocEngRequestATL::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- AgpsStateMachine* sm = (AgpsStateMachine*)
- getAgpsStateMachine(*locEng, mType);
- if (sm) {
- ATLSubscriber s(mID,
- sm,
- locEng->adapter,
- AGPS_TYPE_INVALID == mType);
- sm->subscribeRsrc((Subscriber*)&s);
- } else {
- locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, mType);
- }
-}
-inline void LocEngRequestATL::locallog() const {
- LOC_LOGV("LocEngRequestATL");
-}
-inline void LocEngRequestATL::log() const {
- locallog();
-}
-
-// case LOC_ENG_MSG_RELEASE_ATL:
-LocEngReleaseATL::LocEngReleaseATL(void* locEng, int id) :
- LocMsg(), mLocEng(locEng), mID(id) {
- locallog();
-}
-void LocEngReleaseATL::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
-
- if (locEng->agnss_nif) {
- ATLSubscriber s1(mID, locEng->agnss_nif, locEng->adapter, false);
- if (locEng->agnss_nif->unsubscribeRsrc((Subscriber*)&s1)) {
- LOC_LOGD("%s:%d]: Unsubscribed from agnss_nif",
- __func__, __LINE__);
- return;
- }
- }
-
- if (locEng->internet_nif) {
- ATLSubscriber s2(mID, locEng->internet_nif, locEng->adapter, false);
- if (locEng->internet_nif->unsubscribeRsrc((Subscriber*)&s2)) {
- LOC_LOGD("%s:%d]: Unsubscribed from internet_nif",
- __func__, __LINE__);
- return;
- }
- }
-
- if (locEng->ds_nif) {
- DSSubscriber s3(locEng->ds_nif, mID);
- if (locEng->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) {
- LOC_LOGD("%s:%d]: Unsubscribed from ds_nif",
- __func__, __LINE__);
- return;
- }
- }
-
- LOC_LOGW("%s:%d]: Could not release ATL. "
- "No subscribers found\n",
- __func__, __LINE__);
- locEng->adapter->atlCloseStatus(mID, 0);
-}
-inline void LocEngReleaseATL::locallog() const {
- LOC_LOGV("LocEngReleaseATL");
-}
-inline void LocEngReleaseATL::log() const {
- locallog();
-}
-
-// case LOC_ENG_MSG_REQUEST_WIFI:
-// case LOC_ENG_MSG_RELEASE_WIFI:
-LocEngReqRelWifi::LocEngReqRelWifi(void* locEng, AGpsExtType type,
- loc_if_req_sender_id_e_type sender_id,
- char* s, char* p, bool isReq) :
- LocMsg(), mLocEng(locEng), mType(type), mSenderId(sender_id),
- mSSID(NULL == s ? NULL : new char[SSID_BUF_SIZE]),
- mPassword(NULL == p ? NULL : new char[SSID_BUF_SIZE]),
- mIsReq(isReq) {
- if (NULL != s)
- strlcpy(mSSID, s, SSID_BUF_SIZE);
- if (NULL != p)
- strlcpy(mPassword, p, SSID_BUF_SIZE);
- locallog();
-}
-LocEngReqRelWifi::~LocEngReqRelWifi() {
- if (NULL != mSSID) {
- delete[] mSSID;
- }
- if (NULL != mPassword) {
- delete[] mPassword;
- }
-}
-void LocEngReqRelWifi::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- if (locEng->wifi_nif) {
- WIFISubscriber s(locEng->wifi_nif, mSSID, mPassword, mSenderId);
- if (mIsReq) {
- locEng->wifi_nif->subscribeRsrc((Subscriber*)&s);
- } else {
- locEng->wifi_nif->unsubscribeRsrc((Subscriber*)&s);
- }
- } else {
- locEng->adapter->atlOpenStatus(mSenderId, 0, NULL, -1, mType);
- }
-}
-inline void LocEngReqRelWifi::locallog() const {
- LOC_LOGV("%s - senderId: %d, ssid: %s, password: %s",
- mIsReq ? "LocEngRequestWifi" : "LocEngReleaseWifi",
- mSenderId,
- NULL != mSSID ? mSSID : "",
- NULL != mPassword ? mPassword : "");
-}
-inline void LocEngReqRelWifi::log() const {
- locallog();
-}
-void LocEngReqRelWifi::send() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- locEng->adapter->sendMsg(this);
-}
-
-// case LOC_ENG_MSG_REQUEST_XTRA_DATA:
-LocEngRequestXtra::LocEngRequestXtra(void* locEng) :
- mLocEng(locEng) {
- locallog();
-}
-void LocEngRequestXtra::proc() const
-{
- loc_eng_xtra_data_s_type* locEngXtra =
- &(((loc_eng_data_s_type*)mLocEng)->xtra_module_data);
-
- if (locEngXtra->download_request_cb != NULL) {
- CALLBACK_LOG_CALLFLOW("download_request_cb", %p, mLocEng);
- locEngXtra->download_request_cb();
- } else {
- LOC_LOGE("Callback function for request xtra is NULL");
- }
-}
-inline void LocEngRequestXtra::locallog() const {
- LOC_LOGV("LocEngReqXtra");
-}
-inline void LocEngRequestXtra::log() const {
- locallog();
-}
-
-// case LOC_ENG_MSG_REQUEST_TIME:
-LocEngRequestTime::LocEngRequestTime(void* locEng) :
- LocMsg(), mLocEng(locEng)
-{
- locallog();
-}
-void LocEngRequestTime::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- if (gps_conf.CAPABILITIES & GPS_CAPABILITY_ON_DEMAND_TIME) {
- if (locEng->request_utc_time_cb != NULL) {
- locEng->request_utc_time_cb();
- } else {
- LOC_LOGE("Callback function for request time is NULL");
- }
- }
-}
-inline void LocEngRequestTime::locallog() const {
- LOC_LOGV("LocEngReqTime");
-}
-inline void LocEngRequestTime::log() const {
- locallog();
-}
-
-// case LOC_ENG_MSG_DELETE_AIDING_DATA:
-struct LocEngDelAidData : public LocMsg {
- loc_eng_data_s_type* mLocEng;
- const GpsAidingData mType;
- inline LocEngDelAidData(loc_eng_data_s_type* locEng,
- GpsAidingData f) :
- LocMsg(), mLocEng(locEng), mType(f)
- {
- locallog();
- }
- inline virtual void proc() const {
- mLocEng->aiding_data_for_deletion = mType;
- update_aiding_data_for_deletion(*mLocEng);
- }
- inline void locallog() const {
- LOC_LOGV("aiding data msak %d", mType);
- }
- virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_ENABLE_DATA:
-struct LocEngEnableData : public LocMsg {
- LocEngAdapter* mAdapter;
- const int mEnable;
- char* mAPN;
- const int mLen;
- inline LocEngEnableData(LocEngAdapter* adapter,
- const char* name, int len, int enable) :
- LocMsg(), mAdapter(adapter),
- mEnable(enable), mAPN(NULL), mLen(len)
- {
- if (NULL != name) {
- mAPN = new char[len+1];
- memcpy((void*)mAPN, (void*)name, len);
- mAPN[len] = 0;
- }
- locallog();
- }
- inline ~LocEngEnableData() {
- if (NULL != mAPN) {
- delete[] mAPN;
- }
- }
- inline virtual void proc() const {
- mAdapter->enableData(mEnable);
- if (NULL != mAPN) {
- mAdapter->setAPN(mAPN, mLen);
- }
- }
- inline void locallog() const {
- LOC_LOGV("apn: %s\n enable: %d",
- (NULL == mAPN) ? "NULL" : mAPN, mEnable);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_INJECT_XTRA_DATA:
-// loc_eng_xtra.cpp
-
-// case LOC_ENG_MSG_LOC_INIT:
-struct LocEngInit : public LocMsg {
- loc_eng_data_s_type* mLocEng;
- inline LocEngInit(loc_eng_data_s_type* locEng) :
- LocMsg(), mLocEng(locEng)
- {
- locallog();
- }
- inline virtual void proc() const {
- loc_eng_reinit(*mLocEng);
- }
- inline void locallog() const
- {
- LOC_LOGV("LocEngInit");
- }
- inline virtual void log() const
- {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_REQUEST_XTRA_SERVER:
-// loc_eng_xtra.cpp
-
-// case LOC_ENG_MSG_ATL_OPEN_SUCCESS:
-struct LocEngAtlOpenSuccess : public LocMsg {
- AgpsStateMachine* mStateMachine;
- const int mLen;
- char* mAPN;
- const AGpsBearerType mBearerType;
- inline LocEngAtlOpenSuccess(AgpsStateMachine* statemachine,
- const char* name,
- int len,
- AGpsBearerType btype) :
- LocMsg(),
- mStateMachine(statemachine), mLen(len),
- mAPN(new char[len+1]), mBearerType(btype)
- {
- memcpy((void*)mAPN, (void*)name, len);
- mAPN[len] = 0;
- locallog();
- }
- inline ~LocEngAtlOpenSuccess()
- {
- delete[] mAPN;
- }
- inline virtual void proc() const {
- mStateMachine->setBearer(mBearerType);
- mStateMachine->setAPN(mAPN, mLen);
- mStateMachine->onRsrcEvent(RSRC_GRANTED);
- }
- inline void locallog() const {
- LOC_LOGV("LocEngAtlOpenSuccess agps type: %s\n apn: %s\n"
- " bearer type: %s",
- loc_get_agps_type_name(mStateMachine->getType()),
- mAPN,
- loc_get_agps_bear_name(mBearerType));
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_ATL_CLOSED:
-struct LocEngAtlClosed : public LocMsg {
- AgpsStateMachine* mStateMachine;
- inline LocEngAtlClosed(AgpsStateMachine* statemachine) :
- LocMsg(), mStateMachine(statemachine) {
- locallog();
- }
- inline virtual void proc() const {
- mStateMachine->onRsrcEvent(RSRC_RELEASED);
- }
- inline void locallog() const {
- LOC_LOGV("LocEngAtlClosed");
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_ATL_OPEN_FAILED:
-struct LocEngAtlOpenFailed : public LocMsg {
- AgpsStateMachine* mStateMachine;
- inline LocEngAtlOpenFailed(AgpsStateMachine* statemachine) :
- LocMsg(), mStateMachine(statemachine) {
- locallog();
- }
- inline virtual void proc() const {
- mStateMachine->onRsrcEvent(RSRC_DENIED);
- }
- inline void locallog() const {
- LOC_LOGV("LocEngAtlOpenFailed");
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-// case LOC_ENG_MSG_ENGINE_DOWN:
-LocEngDown::LocEngDown(void* locEng) :
- LocMsg(), mLocEng(locEng) {
- locallog();
-}
-inline void LocEngDown::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- loc_eng_handle_engine_down(*locEng);
-}
-inline void LocEngDown::locallog() const {
- LOC_LOGV("LocEngDown");
-}
-inline void LocEngDown::log() const {
- locallog();
-}
-
-// case LOC_ENG_MSG_ENGINE_UP:
-LocEngUp::LocEngUp(void* locEng) :
- LocMsg(), mLocEng(locEng) {
- locallog();
-}
-inline void LocEngUp::proc() const {
- loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
- loc_eng_handle_engine_up(*locEng);
-}
-inline void LocEngUp::locallog() const {
- LOC_LOGV("LocEngUp");
-}
-inline void LocEngUp::log() const {
- locallog();
-}
-
-struct LocEngDataClientInit : public LocMsg {
- loc_eng_data_s_type* mLocEng;
- inline LocEngDataClientInit(loc_eng_data_s_type* locEng) :
- LocMsg(), mLocEng(locEng) {
- locallog();
- }
- virtual void proc() const {
- loc_eng_data_s_type *locEng = (loc_eng_data_s_type *)mLocEng;
- if(!locEng->adapter->initDataServiceClient()) {
- locEng->ds_nif = new DSStateMachine(servicerTypeExt,
- (void *)dataCallCb,
- locEng->adapter);
- }
- }
- void locallog() const {
- LOC_LOGV("LocEngDataClientInit\n");
- }
- virtual void log() const {
- locallog();
- }
-};
-
-
-/*********************************************************************
- * Initialization checking macros
- *********************************************************************/
-#define STATE_CHECK(ctx, x, ret) \
- if (!(ctx)) \
- { \
- /* Not intialized, abort */\
- LOC_LOGE("%s: log_eng state error: %s", __func__, x); \
- EXIT_LOG(%s, x); \
- ret; \
- }
-#define INIT_CHECK(ctx, ret) STATE_CHECK(ctx, "instance not initialized", ret)
-
-/*===========================================================================
-FUNCTION loc_eng_init
-
-DESCRIPTION
- Initialize the location engine, this include setting up global datas
- and registers location engien with loc api service.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
- LOC_API_ADAPTER_EVENT_MASK_T event, ContextBase* context)
-
-{
- int ret_val = 0;
-
- ENTRY_LOG_CALLFLOW();
- if (NULL == callbacks || 0 == event) {
- LOC_LOGE("loc_eng_init: bad parameters cb %p eMask %d", callbacks, event);
- ret_val = -1;
- EXIT_LOG(%d, ret_val);
- return ret_val;
- }
-
- STATE_CHECK((NULL == loc_eng_data.adapter),
- "instance already initialized", return 0);
-
- memset(&loc_eng_data, 0, sizeof (loc_eng_data));
-
- if (NULL != callbacks->set_capabilities_cb) {
- callbacks->set_capabilities_cb(gps_conf.CAPABILITIES);
- }
-
- // Save callbacks
- loc_eng_data.location_cb = callbacks->location_cb;
- loc_eng_data.sv_status_cb = callbacks->sv_status_cb;
- loc_eng_data.status_cb = callbacks->status_cb;
- loc_eng_data.nmea_cb = callbacks->nmea_cb;
- loc_eng_data.acquire_wakelock_cb = callbacks->acquire_wakelock_cb;
- loc_eng_data.release_wakelock_cb = callbacks->release_wakelock_cb;
- loc_eng_data.request_utc_time_cb = callbacks->request_utc_time_cb;
- loc_eng_data.location_ext_parser = callbacks->location_ext_parser ?
- callbacks->location_ext_parser : noProc;
- loc_eng_data.sv_ext_parser = callbacks->sv_ext_parser ?
- callbacks->sv_ext_parser : noProc;
- loc_eng_data.intermediateFix = gps_conf.INTERMEDIATE_POS;
-
- // initial states taken care of by the memset above
- // loc_eng_data.engine_status -- GPS_STATUS_NONE;
- // loc_eng_data.fix_session_status -- GPS_STATUS_NONE;
- // loc_eng_data.mute_session_state -- LOC_MUTE_SESS_NONE;
-
- if ((event & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) && (gps_conf.NMEA_PROVIDER == NMEA_PROVIDER_AP))
- {
- event = event ^ LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; // unregister for modem NMEA report
- loc_eng_data.generateNmea = true;
- }
- else
- {
- loc_eng_data.generateNmea = false;
- }
-
- loc_eng_data.adapter =
- new LocEngAdapter(event, &loc_eng_data, context,
- (MsgTask::tCreate)callbacks->create_thread_cb);
-
- LOC_LOGD("loc_eng_init created client, id = %p\n",
- loc_eng_data.adapter);
- loc_eng_data.adapter->sendMsg(new LocEngInit(&loc_eng_data));
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG();
- int ret_val = LOC_API_ADAPTER_ERR_SUCCESS;
-
- if (LOC_API_ADAPTER_ERR_SUCCESS == ret_val) {
- LOC_LOGD("loc_eng_reinit reinit() successful");
-
- LocEngAdapter* adapter = loc_eng_data.adapter;
- adapter->sendMsg(new LocEngSuplVer(adapter, gps_conf.SUPL_VER));
- adapter->sendMsg(new LocEngLppConfig(adapter, gps_conf.LPP_PROFILE));
- adapter->sendMsg(new LocEngSensorControlConfig(adapter, sap_conf.SENSOR_USAGE,
- sap_conf.SENSOR_PROVIDER));
- adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT));
-
- /* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */
- if( sap_conf.GYRO_BIAS_RANDOM_WALK_VALID ||
- sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
- sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
- sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||
- sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID )
- {
- adapter->sendMsg(new LocEngSensorProperties(adapter,
- sap_conf.GYRO_BIAS_RANDOM_WALK_VALID,
- sap_conf.GYRO_BIAS_RANDOM_WALK,
- sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
- sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY,
- sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
- sap_conf.ANGLE_RANDOM_WALK_SPECTRAL_DENSITY,
- sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
- sap_conf.RATE_RANDOM_WALK_SPECTRAL_DENSITY,
- sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID,
- sap_conf.VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY));
- }
-
- adapter->sendMsg(new LocEngSensorPerfControlConfig(adapter,
- sap_conf.SENSOR_CONTROL_MODE,
- sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH,
- sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC,
- sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH,
- sap_conf.SENSOR_GYRO_BATCHES_PER_SEC,
- sap_conf.SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH,
- sap_conf.SENSOR_ACCEL_BATCHES_PER_SEC_HIGH,
- sap_conf.SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH,
- sap_conf.SENSOR_GYRO_BATCHES_PER_SEC_HIGH,
- sap_conf.SENSOR_ALGORITHM_CONFIG_MASK));
-
- adapter->sendMsg(new LocEngEnableData(adapter, NULL, 0, (agpsStatus ? 1:0)));
- }
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_cleanup
-
-DESCRIPTION
- Cleans location engine. The location client handle will be released.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter, return);
-
- // XTRA has no state, so we are fine with it.
-
- // we need to check and clear NI
-#if 0
- // we need to check and clear ATL
- if (NULL != loc_eng_data.agnss_nif) {
- delete loc_eng_data.agnss_nif;
- loc_eng_data.agnss_nif = NULL;
- }
- if (NULL != loc_eng_data.internet_nif) {
- delete loc_eng_data.internet_nif;
- loc_eng_data.internet_nif = NULL;
- }
-#endif
- if (loc_eng_data.adapter->isInSession())
- {
- LOC_LOGD("loc_eng_cleanup: fix not stopped. stop it now.");
- loc_eng_stop(loc_eng_data);
- }
-
-#if 0 // can't afford to actually clean up, for many reason.
-
- LOC_LOGD("loc_eng_init: client opened. close it now.");
- delete loc_eng_data.adapter;
- loc_eng_data.adapter = NULL;
-
- loc_eng_dmn_conn_loc_api_server_unblock();
- loc_eng_dmn_conn_loc_api_server_join();
-
-#endif
-
- EXIT_LOG(%s, VOID_RET);
-}
-
-
-/*===========================================================================
-FUNCTION loc_eng_start
-
-DESCRIPTION
- Starts the tracking session
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_start(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter, return -1);
-
- if(! loc_eng_data.adapter->getUlpProxy()->sendStartFix())
- {
- loc_eng_data.adapter->sendMsg(new LocEngStartFix(loc_eng_data.adapter));
- }
-
- EXIT_LOG(%d, 0);
- return 0;
-}
-
-static int loc_eng_start_handler(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG();
- int ret_val = LOC_API_ADAPTER_ERR_SUCCESS;
-
- if (!loc_eng_data.adapter->isInSession()) {
- ret_val = loc_eng_data.adapter->startFix();
-
- if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS ||
- ret_val == LOC_API_ADAPTER_ERR_ENGINE_DOWN)
- {
- loc_eng_data.adapter->setInSession(TRUE);
- loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_BEGIN);
- }
- }
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_stop_wrapper
-
-DESCRIPTION
- Stops the tracking session
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_stop(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter, return -1);
-
- if(! loc_eng_data.adapter->getUlpProxy()->sendStopFix())
- {
- loc_eng_data.adapter->sendMsg(new LocEngStopFix(loc_eng_data.adapter));
- }
-
- EXIT_LOG(%d, 0);
- return 0;
-}
-
-static int loc_eng_stop_handler(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG();
- int ret_val = LOC_API_ADAPTER_ERR_SUCCESS;
-
- if (loc_eng_data.adapter->isInSession()) {
-
- ret_val = loc_eng_data.adapter->stopFix();
- if (ret_val == LOC_API_ADAPTER_ERR_SUCCESS)
- {
- loc_inform_gps_status(loc_eng_data, GPS_STATUS_SESSION_END);
- }
-
- loc_eng_data.adapter->setInSession(FALSE);
- }
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_mute_one_session
-
-DESCRIPTION
- Mutes one session
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: Success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG();
- loc_eng_data.mute_session_state = LOC_MUTE_SESS_WAIT;
- EXIT_LOG(%s, VOID_RET);
-}
-
-/*===========================================================================
-FUNCTION loc_eng_set_position_mode
-
-DESCRIPTION
- Sets the mode and fix frequency for the tracking session.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data,
- LocPosMode &params)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter, return -1);
-
- int gnssType = getTargetGnssType(loc_get_target());
-
- // The position mode for GSS/QCA1530 can only be standalone
- bool is1530 = gnssType == GNSS_QCA1530;
- bool isAPQ = gnssType == GNSS_GSS;
- if ((isAPQ || is1530) && params.mode != LOC_POSITION_MODE_STANDALONE) {
- params.mode = LOC_POSITION_MODE_STANDALONE;
- LOC_LOGD("Position mode changed to standalone for target with GSS/qca1530.");
- }
-
- if(! loc_eng_data.adapter->getUlpProxy()->sendFixMode(params))
- {
- LocEngAdapter* adapter = loc_eng_data.adapter;
- adapter->sendMsg(new LocEngPositionMode(adapter, params));
- }
-
- EXIT_LOG(%d, 0);
- return 0;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_inject_time
-
-DESCRIPTION
- This is used by Java native function to do time injection.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, GpsUtcTime time,
- int64_t timeReference, int uncertainty)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter, return -1);
- LocEngAdapter* adapter = loc_eng_data.adapter;
-
- adapter->sendMsg(new LocEngSetTime(adapter, time, timeReference,
- uncertainty));
-
- EXIT_LOG(%d, 0);
- return 0;
-}
-
-
-/*===========================================================================
-FUNCTION loc_eng_inject_location
-
-DESCRIPTION
- This is used by Java native function to do location injection.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0 : Successful
- error code : Failure
-
-SIDE EFFECTS
- N/A
-===========================================================================*/
-int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude,
- double longitude, float accuracy)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter, return -1);
- LocEngAdapter* adapter = loc_eng_data.adapter;
- if(adapter->mSupportsPositionInjection)
- {
- adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude,
- accuracy));
- }
-
- EXIT_LOG(%d, 0);
- return 0;
-}
-
-
-/*===========================================================================
-FUNCTION loc_eng_delete_aiding_data
-
-DESCRIPTION
- This is used by Java native function to delete the aiding data. The function
- updates the global variable for the aiding data to be deleted. If the GPS
- engine is off, the aiding data will be deleted. Otherwise, the actual action
- will happen when gps engine is turned off.
-
-DEPENDENCIES
- Assumes the aiding data type specified in GpsAidingData matches with
- LOC API specification.
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData f)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter, return);
-
- loc_eng_data.adapter->sendMsg(new LocEngDelAidData(&loc_eng_data, f));
-
- EXIT_LOG(%s, VOID_RET);
-}
-
-/*===========================================================================
-
-FUNCTION loc_inform_gps_state
-
-DESCRIPTION
- Informs the GPS Provider about the GPS status
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusValue status)
-{
- ENTRY_LOG();
-
- if (loc_eng_data.status_cb)
- {
- GpsStatus gs = { sizeof(gs),status };
- CALLBACK_LOG_CALLFLOW("status_cb", %s,
- loc_get_gps_status_name(gs.status));
- loc_eng_data.status_cb(&gs);
- }
-
- EXIT_LOG(%s, VOID_RET);
-}
-
-static int loc_eng_get_zpp_handler(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG();
- int ret_val = LOC_API_ADAPTER_ERR_SUCCESS;
- UlpLocation location;
- LocPosTechMask tech_mask = LOC_POS_TECH_MASK_DEFAULT;
- GpsLocationExtended locationExtended;
- memset(&locationExtended, 0, sizeof (GpsLocationExtended));
- locationExtended.size = sizeof(locationExtended);
- memset(&location, 0, sizeof location);
-
- ret_val = loc_eng_data.adapter->getZpp(location.gpsLocation, tech_mask);
- //Mark the location source as from ZPP
- location.gpsLocation.flags |= LOCATION_HAS_SOURCE_INFO;
- location.position_source = ULP_LOCATION_IS_FROM_ZPP;
-
- loc_eng_data.adapter->getUlpProxy()->reportPosition(location,
- locationExtended,
- NULL,
- LOC_SESS_SUCCESS,
- tech_mask);
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*
- Callback function passed to Data Services State Machine
- This becomes part of the state machine's servicer and
- is used to send requests to the data services client
-*/
-static int dataCallCb(void *cb_data)
-{
- LOC_LOGD("Enter dataCallCb\n");
- int ret=0;
- if(cb_data != NULL) {
- dsCbData *cbData = (dsCbData *)cb_data;
- LocEngAdapter *locAdapter = (LocEngAdapter *)cbData->mAdapter;
- if(cbData->action == GPS_REQUEST_AGPS_DATA_CONN) {
- LOC_LOGD("dataCallCb GPS_REQUEST_AGPS_DATA_CONN\n");
- ret = locAdapter->openAndStartDataCall();
- }
- else if(cbData->action == GPS_RELEASE_AGPS_DATA_CONN) {
- LOC_LOGD("dataCallCb GPS_RELEASE_AGPS_DATA_CONN\n");
- locAdapter->stopDataCall();
- }
- }
- else {
- LOC_LOGE("NULL argument received. Failing.\n");
- ret = -1;
- goto err;
- }
-
-err:
- LOC_LOGD("Exit dataCallCb ret = %d\n", ret);
- return ret;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_agps_reinit
-
-DESCRIPTION
- 2nd half of loc_eng_agps_init(), singled out for modem restart to use.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static void loc_eng_agps_reinit(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG();
-
- // Set server addresses which came before init
- if (loc_eng_data.supl_host_set)
- {
- loc_eng_set_server(loc_eng_data, LOC_AGPS_SUPL_SERVER,
- loc_eng_data.supl_host_buf,
- loc_eng_data.supl_port_buf);
- }
-
- if (loc_eng_data.c2k_host_set)
- {
- loc_eng_set_server(loc_eng_data, LOC_AGPS_CDMA_PDE_SERVER,
- loc_eng_data.c2k_host_buf,
- loc_eng_data.c2k_port_buf);
- }
- EXIT_LOG(%s, VOID_RET);
-}
-/*===========================================================================
-FUNCTION loc_eng_agps_init
-
-DESCRIPTION
- Initialize the AGps interface.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* callbacks)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter, return);
- STATE_CHECK((NULL == loc_eng_data.agps_status_cb),
- "agps instance already initialized",
- return);
- if (callbacks == NULL) {
- LOC_LOGE("loc_eng_agps_init: bad parameters cb %p", callbacks);
- EXIT_LOG(%s, VOID_RET);
- return;
- }
- LocEngAdapter* adapter = loc_eng_data.adapter;
- loc_eng_data.agps_status_cb = callbacks->status_cb;
-
- loc_eng_data.internet_nif = new AgpsStateMachine(servicerTypeAgps,
- (void *)loc_eng_data.agps_status_cb,
- AGPS_TYPE_WWAN_ANY,
- false);
- loc_eng_data.wifi_nif = new AgpsStateMachine(servicerTypeAgps,
- (void *)loc_eng_data.agps_status_cb,
- AGPS_TYPE_WIFI,
- true);
-
- int gnssType = getTargetGnssType(loc_get_target());
- bool isAPQ = (gnssType == GNSS_GSS);
- bool is1530 = (gnssType == GNSS_QCA1530);
- if (!isAPQ && !is1530) {
- loc_eng_data.agnss_nif = new AgpsStateMachine(servicerTypeAgps,
- (void *)loc_eng_data.agps_status_cb,
- AGPS_TYPE_SUPL,
- false);
-
- if (adapter->mSupportsAgpsRequests) {
- loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data));
-
- loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb,
- NULL, NULL, &loc_eng_data);
- }
- loc_eng_agps_reinit(loc_eng_data);
- }
-
- EXIT_LOG(%s, VOID_RET);
-}
-
-static void deleteAidingData(loc_eng_data_s_type &logEng) {
- if (logEng.engine_status != GPS_STATUS_ENGINE_ON &&
- logEng.aiding_data_for_deletion != 0) {
- logEng.adapter->deleteAidingData(logEng.aiding_data_for_deletion);
- logEng.aiding_data_for_deletion = 0;
- }
-}
-
-static AgpsStateMachine*
-getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) {
- AgpsStateMachine* stateMachine;
- switch (agpsType) {
- case AGPS_TYPE_WIFI: {
- stateMachine = locEng.wifi_nif;
- break;
- }
- case AGPS_TYPE_INVALID:
- case AGPS_TYPE_SUPL: {
- stateMachine = locEng.agnss_nif;
- break;
- }
- case AGPS_TYPE_SUPL_ES: {
- stateMachine = locEng.ds_nif;
- break;
- }
- default:
- stateMachine = locEng.internet_nif;
- }
- return stateMachine;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_agps_open
-
-DESCRIPTION
- This function is called when on-demand data connection opening is successful.
-It should inform engine about the data open result.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType,
- const char* apn, AGpsBearerType bearerType)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb,
- return -1);
-
- if (apn == NULL)
- {
- LOC_LOGE("APN Name NULL\n");
- return 0;
- }
-
- LOC_LOGD("loc_eng_agps_open APN name = [%s]", apn);
-
- int apn_len = smaller_of(strlen (apn), MAX_APN_LEN);
- AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType);
-
- loc_eng_data.adapter->sendMsg(
- new LocEngAtlOpenSuccess(sm, apn, apn_len, bearerType));
-
- EXIT_LOG(%d, 0);
- return 0;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_agps_closed
-
-DESCRIPTION
- This function is called when on-demand data connection closing is done.
-It should inform engine about the data close result.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb,
- return -1);
-
- AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType);
- loc_eng_data.adapter->sendMsg(new LocEngAtlClosed(sm));
-
- EXIT_LOG(%d, 0);
- return 0;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_agps_open_failed
-
-DESCRIPTION
- This function is called when on-demand data connection opening has failed.
-It should inform engine about the data open result.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType)
-{
- ENTRY_LOG_CALLFLOW();
- INIT_CHECK(loc_eng_data.adapter && loc_eng_data.agps_status_cb,
- return -1);
-
- AgpsStateMachine* sm = getAgpsStateMachine(loc_eng_data, agpsType);
- loc_eng_data.adapter->sendMsg(new LocEngAtlOpenFailed(sm));
-
- EXIT_LOG(%d, 0);
- return 0;
-}
-
-/*===========================================================================
-
-FUNCTION resolve_in_addr
-
-DESCRIPTION
- Translates a hostname to in_addr struct
-
-DEPENDENCIES
- n/a
-
-RETURN VALUE
- TRUE if successful
-
-SIDE EFFECTS
- n/a
-
-===========================================================================*/
-static boolean resolve_in_addr(const char *host_addr, struct in_addr *in_addr_ptr)
-{
- ENTRY_LOG();
- boolean ret_val = TRUE;
-
- struct hostent *hp;
- hp = gethostbyname(host_addr);
- if (hp != NULL) /* DNS OK */
- {
- memcpy(in_addr_ptr, hp->h_addr_list[0], hp->h_length);
- }
- else
- {
- /* Try IP representation */
- if (inet_aton(host_addr, in_addr_ptr) == 0)
- {
- /* IP not valid */
- LOC_LOGE("DNS query on '%s' failed\n", host_addr);
- ret_val = FALSE;
- }
- }
-
- EXIT_LOG(%s, loc_logger_boolStr[ret_val!=0]);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_set_server
-
-DESCRIPTION
- This is used to set the default AGPS server. Server address is obtained
- from gps.conf.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data,
- LocServerType type, const char* hostname, int port)
-{
- ENTRY_LOG();
- int ret = 0;
- LocEngAdapter* adapter = loc_eng_data.adapter;
-
- if (LOC_AGPS_SUPL_SERVER == type) {
- char url[MAX_URL_LEN];
- unsigned int len = snprintf(url, sizeof(url), "%s:%u", hostname, (unsigned) port);
-
- if (sizeof(url) > len) {
- adapter->sendMsg(new LocEngSetServerUrl(adapter, url, len));
- }
- } else if (LOC_AGPS_CDMA_PDE_SERVER == type ||
- LOC_AGPS_CUSTOM_PDE_SERVER == type ||
- LOC_AGPS_MPC_SERVER == type) {
- struct in_addr addr;
- if (!resolve_in_addr(hostname, &addr))
- {
- LOC_LOGE("loc_eng_set_server, hostname %s cannot be resolved.\n", hostname);
- ret = -2;
- } else {
- unsigned int ip = htonl(addr.s_addr);
- adapter->sendMsg(new LocEngSetServerIpv4(adapter, ip, port, type));
- }
- } else {
- LOC_LOGE("loc_eng_set_server, type %d cannot be resolved.\n", type);
- }
-
- EXIT_LOG(%d, ret);
- return ret;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_set_server_proxy
-
-DESCRIPTION
- If loc_eng_set_server is called before loc_eng_init, it doesn't work. This
- proxy buffers server settings and calls loc_eng_set_server when the client is
- open.
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data,
- LocServerType type,
- const char* hostname, int port)
-{
- ENTRY_LOG_CALLFLOW();
- int ret_val = 0;
-
- if (NULL != loc_eng_data.adapter)
- {
- ret_val = loc_eng_set_server(loc_eng_data, type, hostname, port);
- } else {
- LOC_LOGW("set_server called before init. save the address, type: %d, hostname: %s, port: %d",
- (int) type, hostname, port);
- switch (type)
- {
- case LOC_AGPS_SUPL_SERVER:
- strlcpy(loc_eng_data.supl_host_buf, hostname,
- sizeof(loc_eng_data.supl_host_buf));
- loc_eng_data.supl_port_buf = port;
- loc_eng_data.supl_host_set = 1;
- break;
- case LOC_AGPS_CDMA_PDE_SERVER:
- strlcpy(loc_eng_data.c2k_host_buf, hostname,
- sizeof(loc_eng_data.c2k_host_buf));
- loc_eng_data.c2k_port_buf = port;
- loc_eng_data.c2k_host_set = 1;
- break;
- default:
- LOC_LOGE("loc_eng_set_server_proxy, unknown server type = %d", (int) type);
- }
- }
-
- EXIT_LOG(%d, ret_val);
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_agps_ril_update_network_availability
-
-DESCRIPTION
- Sets data call allow vs disallow flag to modem
- This is the only member of sLocEngAGpsRilInterface implemented.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data,
- int available, const char* apn)
-{
- ENTRY_LOG_CALLFLOW();
-
- //This is to store the status of data availability over the network.
- //If GPS is not enabled, the INIT_CHECK will fail and the modem will
- //not be updated with the network's availability. Since the data status
- //can change before GPS is enabled the, storing the status will enable
- //us to inform the modem after GPS is enabled
- agpsStatus = available;
-
- INIT_CHECK(loc_eng_data.adapter, return);
- if (apn != NULL)
- {
- LOC_LOGD("loc_eng_agps_ril_update_network_availability: APN Name = [%s]\n", apn);
- int apn_len = smaller_of(strlen (apn), MAX_APN_LEN);
- LocEngAdapter* adapter = loc_eng_data.adapter;
- adapter->sendMsg(new LocEngEnableData(adapter, apn, apn_len, available));
- }
- EXIT_LOG(%s, VOID_RET);
-}
-
-/*===========================================================================
-FUNCTION loc_eng_report_status
-
-DESCRIPTION
- Reports GPS engine state to Java layer.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- N/A
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusValue status)
-{
- ENTRY_LOG();
- // Switch from WAIT to MUTE, for "engine on" or "session begin" event
- if (status == GPS_STATUS_SESSION_BEGIN || status == GPS_STATUS_ENGINE_ON)
- {
- if (loc_eng_data.mute_session_state == LOC_MUTE_SESS_WAIT)
- {
- LOC_LOGD("loc_eng_report_status: mute_session_state changed from WAIT to IN SESSION");
- loc_eng_data.mute_session_state = LOC_MUTE_SESS_IN_SESSION;
- }
- }
-
- // Switch off MUTE session
- if (loc_eng_data.mute_session_state == LOC_MUTE_SESS_IN_SESSION &&
- (status == GPS_STATUS_SESSION_END || status == GPS_STATUS_ENGINE_OFF))
- {
- LOC_LOGD("loc_eng_report_status: mute_session_state changed from IN SESSION to NONE");
- loc_eng_data.mute_session_state = LOC_MUTE_SESS_NONE;
- }
-
- // Session End is not reported during Android navigating state
- boolean navigating = loc_eng_data.adapter->isInSession();
- if (status != GPS_STATUS_NONE &&
- !(status == GPS_STATUS_SESSION_END && navigating) &&
- !(status == GPS_STATUS_SESSION_BEGIN && !navigating))
- {
- if (loc_eng_data.mute_session_state != LOC_MUTE_SESS_IN_SESSION)
- {
- // Inform GpsLocationProvider about mNavigating status
- loc_inform_gps_status(loc_eng_data, status);
- }
- else {
- LOC_LOGD("loc_eng_report_status: muting the status report.");
- }
- }
-
- // Only keeps ENGINE ON/OFF in engine_status
- if (status == GPS_STATUS_ENGINE_ON || status == GPS_STATUS_ENGINE_OFF)
- {
- loc_eng_data.engine_status = status;
- }
-
- // Only keeps SESSION BEGIN/END in fix_session_status
- if (status == GPS_STATUS_SESSION_BEGIN || status == GPS_STATUS_SESSION_END)
- {
- loc_eng_data.fix_session_status = status;
- }
- EXIT_LOG(%s, VOID_RET);
-}
-
-/*===========================================================================
-FUNCTION loc_eng_handle_engine_down
- loc_eng_handle_engine_up
-
-DESCRIPTION
- Calls this function when it is detected that modem restart is happening.
- Either we detected the modem is down or received modem up event.
- This must be called from the deferred thread to avoid race condition.
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_handle_engine_down(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG();
- loc_eng_ni_reset_on_engine_restart(loc_eng_data);
- loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_OFF);
- EXIT_LOG(%s, VOID_RET);
-}
-
-void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG();
- loc_eng_reinit(loc_eng_data);
-
- if (loc_eng_data.agps_status_cb != NULL) {
- if (loc_eng_data.agnss_nif)
- loc_eng_data.agnss_nif->dropAllSubscribers();
- if (loc_eng_data.internet_nif)
- loc_eng_data.internet_nif->dropAllSubscribers();
-
- loc_eng_agps_reinit(loc_eng_data);
- }
-
- loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_ON);
-
- // modem is back up. If we crashed in the middle of navigating, we restart.
- if (loc_eng_data.adapter->isInSession()) {
- // This sets the copy in adapter to modem
- loc_eng_data.adapter->setPositionMode(NULL);
- loc_eng_data.adapter->setInSession(false);
- loc_eng_start_handler(loc_eng_data);
- }
- EXIT_LOG(%s, VOID_RET);
-}
-
-#ifdef USE_GLIB
-/*===========================================================================
-FUNCTION set_sched_policy
-
-DESCRIPTION
- Local copy of this function which bypasses android set_sched_policy
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static int set_sched_policy(int tid, SchedPolicy policy)
-{
- return 0;
-}
-#endif /* USE_GLIB */
-
-/*===========================================================================
-FUNCTION loc_eng_read_config
-
-DESCRIPTION
- Initiates the reading of the gps config file stored in /etc dir
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_read_config(void)
-{
- ENTRY_LOG_CALLFLOW();
- if(configAlreadyRead == false)
- {
- // Initialize our defaults before reading of configuration file overwrites them.
- loc_default_parameters();
- // We only want to parse the conf file once. This is a good place to ensure that.
- // In fact one day the conf file should go into context.
- UTIL_READ_CONF(GPS_CONF_FILE, loc_parameter_table);
- UTIL_READ_CONF(SAP_CONF_FILE, loc_parameter_table);
- configAlreadyRead = true;
- } else {
- LOC_LOGV("GPS Config file has already been read\n");
- }
-
- EXIT_LOG(%d, 0);
- return 0;
-}
diff --git a/gps/loc_api/libloc_api_50001/loc_eng.h b/gps/loc_api/libloc_api_50001/loc_eng.h
deleted file mode 100644
index e50e4a5..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/* Copyright (c) 2009-2013, 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_H
-#define LOC_ENG_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-// Uncomment to keep all LOG messages (LOGD, LOGI, LOGV, etc.)
-#define MAX_NUM_ATL_CONNECTIONS 2
-
-// Define boolean type to be used by libgps on loc api module
-typedef unsigned char boolean;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#include <loc.h>
-#include <loc_eng_xtra.h>
-#include <loc_eng_ni.h>
-#include <loc_eng_agps.h>
-#include <loc_cfg.h>
-#include <loc_log.h>
-#include <log_util.h>
-#include <loc_eng_agps.h>
-#include <LocEngAdapter.h>
-
-// The data connection minimal open time
-#define DATA_OPEN_MIN_TIME 1 /* sec */
-
-// The system sees GPS engine turns off after inactive for this period of time
-#define GPS_AUTO_OFF_TIME 2 /* secs */
-#define SUCCESS TRUE
-#define FAILURE FALSE
-#define INVALID_ATL_CONNECTION_HANDLE -1
-
-enum loc_nmea_provider_e_type {
- NMEA_PROVIDER_AP = 0, // Application Processor Provider of NMEA
- NMEA_PROVIDER_MP // Modem Processor Provider of NMEA
-};
-
-enum loc_mute_session_e_type {
- LOC_MUTE_SESS_NONE = 0,
- LOC_MUTE_SESS_WAIT,
- LOC_MUTE_SESS_IN_SESSION
-};
-
-// Module data
-typedef struct loc_eng_data_s
-{
- LocEngAdapter *adapter;
- loc_location_cb_ext location_cb;
- gps_status_callback status_cb;
- loc_sv_status_cb_ext sv_status_cb;
- agps_status_extended agps_status_cb;
- gps_nmea_callback nmea_cb;
- gps_ni_notify_callback ni_notify_cb;
- gps_acquire_wakelock acquire_wakelock_cb;
- gps_release_wakelock release_wakelock_cb;
- gps_request_utc_time request_utc_time_cb;
- boolean intermediateFix;
- AGpsStatusValue agps_status;
- loc_eng_xtra_data_s_type xtra_module_data;
- loc_eng_ni_data_s_type loc_eng_ni_data;
-
- // AGPS state machines
- AgpsStateMachine* agnss_nif;
- AgpsStateMachine* internet_nif;
- AgpsStateMachine* wifi_nif;
- //State machine for Data Services
- AgpsStateMachine* ds_nif;
-
- // GPS engine status
- GpsStatusValue engine_status;
- GpsStatusValue fix_session_status;
-
- // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off
- GpsAidingData aiding_data_for_deletion;
-
- // For muting session broadcast
- loc_mute_session_e_type mute_session_state;
-
- // For nmea generation
- boolean generateNmea;
- uint32_t sv_used_mask;
- float hdop;
- float pdop;
- float vdop;
-
- // Address buffers, for addressing setting before init
- int supl_host_set;
- char supl_host_buf[101];
- int supl_port_buf;
- int c2k_host_set;
- char c2k_host_buf[101];
- int c2k_port_buf;
- int mpc_host_set;
- char mpc_host_buf[101];
- int mpc_port_buf;
-
- loc_ext_parser location_ext_parser;
- loc_ext_parser sv_ext_parser;
-} loc_eng_data_s_type;
-
-/* GPS.conf support */
-typedef struct loc_gps_cfg_s
-{
- unsigned long INTERMEDIATE_POS;
- unsigned long ACCURACY_THRES;
- unsigned long SUPL_VER;
- unsigned long CAPABILITIES;
- unsigned long QUIPC_ENABLED;
- unsigned long LPP_PROFILE;
- uint8_t NMEA_PROVIDER;
- unsigned long A_GLONASS_POS_PROTOCOL_SELECT;
-} loc_gps_cfg_s_type;
-
-typedef struct
-{
- uint8_t GYRO_BIAS_RANDOM_WALK_VALID;
- double GYRO_BIAS_RANDOM_WALK;
- unsigned long SENSOR_ACCEL_BATCHES_PER_SEC;
- unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH;
- unsigned long SENSOR_GYRO_BATCHES_PER_SEC;
- unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH;
- unsigned long SENSOR_ACCEL_BATCHES_PER_SEC_HIGH;
- unsigned long SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH;
- unsigned long SENSOR_GYRO_BATCHES_PER_SEC_HIGH;
- unsigned long SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH;
- unsigned long SENSOR_CONTROL_MODE;
- unsigned long SENSOR_USAGE;
- unsigned long 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;
- unsigned long SENSOR_PROVIDER;
-} loc_sap_cfg_s_type;
-
-extern loc_gps_cfg_s_type gps_conf;
-extern loc_sap_cfg_s_type sap_conf;
-
-int loc_eng_init(loc_eng_data_s_type &loc_eng_data,
- LocCallbacks* callbacks,
- LOC_API_ADAPTER_EVENT_MASK_T event,
- ContextBase* context);
-int loc_eng_start(loc_eng_data_s_type &loc_eng_data);
-int loc_eng_stop(loc_eng_data_s_type &loc_eng_data);
-void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data);
-int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data,
- GpsUtcTime time, int64_t timeReference,
- int uncertainty);
-int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data,
- double latitude, double longitude,
- float accuracy);
-void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data,
- GpsAidingData f);
-int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data,
- LocPosMode &params);
-const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data,
- const char* name);
-void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data,
- AGpsExtCallbacks* callbacks);
-int loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType,
- const char* apn, AGpsBearerType bearerType);
-int loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType);
-int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType);
-
-int loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data,
- LocServerType type, const char *hostname, int port);
-
-
-void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data,
- int avaiable, const char* apn);
-
-
-bool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data,
- char* command, int length);
-
-
-void loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data);
-
-int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data,
- GpsXtraExtCallbacks* callbacks);
-
-int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data,
- char* data, int length);
-
-int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data);
-
-extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data,
- GpsNiExtCallbacks *callbacks);
-extern void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data,
- int notif_id, GpsUserResponseType user_response);
-extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
- const GpsNiNotification *notif,
- const void* passThrough);
-extern void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data);
-int loc_eng_read_config(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif // LOC_ENG_H
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_agps.cpp b/gps/loc_api/libloc_api_50001/loc_eng_agps.cpp
deleted file mode 100644
index d6cc136..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_agps.cpp
+++ /dev/null
@@ -1,970 +0,0 @@
-/* Copyright (c) 2011-2013, 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_NDDEBUG 0
-#define LOG_TAG "LocSvc_eng"
-
-#include <loc_eng_agps.h>
-#include <loc_eng_log.h>
-#include <log_util.h>
-#include <platform_lib_includes.h>
-#include <loc_eng_dmn_conn_handler.h>
-#include <loc_eng_dmn_conn.h>
-#include <sys/time.h>
-
-//======================================================================
-// C callbacks
-//======================================================================
-
-// This is given to linked_list_add as the dealloc callback
-// data -- an instance of Subscriber
-static void deleteObj(void* data)
-{
- delete (Subscriber*)data;
-}
-
-// This is given to linked_list_search() as the comparison callback
-// when the state manchine needs to process for particular subscriber
-// fromCaller -- caller provides this obj
-// fromList -- linked_list_search() function take this one from list
-static bool hasSubscriber(void* fromCaller, void* fromList)
-{
- Notification* notification = (Notification*)fromCaller;
- Subscriber* s1 = (Subscriber*)fromList;
-
- return s1->forMe(*notification);
-}
-
-// This is gvien to linked_list_search() to notify subscriber objs
-// when the state machine needs to inform all subscribers of resource
-// status changes, e.g. when resource is GRANTED.
-// fromCaller -- caller provides this ptr to a Notification obj.
-// fromList -- linked_list_search() function take this one from list
-static bool notifySubscriber(void* fromCaller, void* fromList)
-{
- Notification* notification = (Notification*)fromCaller;
- Subscriber* s1 = (Subscriber*)fromList;
-
- // we notify every subscriber indiscriminatively
- // each subscriber decides if this notification is interesting.
- return s1->notifyRsrcStatus(*notification) &&
- // if we do not want to delete the subscriber from the
- // the list, we must set this to false so this function
- // returns false
- notification->postNotifyDelete;
-}
-
-//======================================================================
-// Notification
-//======================================================================
-const int Notification::BROADCAST_ALL = 0x80000000;
-const int Notification::BROADCAST_ACTIVE = 0x80000001;
-const int Notification::BROADCAST_INACTIVE = 0x80000002;
-const unsigned char DSStateMachine::MAX_START_DATA_CALL_RETRIES = 4;
-const unsigned int DSStateMachine::DATA_CALL_RETRY_DELAY_MSEC = 500;
-//======================================================================
-// Subscriber: BITSubscriber / ATLSubscriber / WIFISubscriber
-//======================================================================
-bool Subscriber::forMe(Notification &notification)
-{
- if (NULL != notification.rcver) {
- return equals(notification.rcver);
- } else {
- return Notification::BROADCAST_ALL == notification.groupID ||
- (Notification::BROADCAST_ACTIVE == notification.groupID &&
- !isInactive()) ||
- (Notification::BROADCAST_INACTIVE == notification.groupID &&
- isInactive());
- }
-}
-bool BITSubscriber::equals(const Subscriber *s) const
-{
- BITSubscriber* bitS = (BITSubscriber*)s;
-
- return (ID == bitS->ID &&
- (INADDR_NONE != (unsigned int)ID ||
- 0 == strncmp(mIPv6Addr, bitS->mIPv6Addr, sizeof(mIPv6Addr))));
-}
-
-bool BITSubscriber::notifyRsrcStatus(Notification &notification)
-{
- bool notify = forMe(notification);
-
- if (notify) {
- switch(notification.rsrcStatus)
- {
- case RSRC_UNSUBSCRIBE:
- case RSRC_RELEASED:
- loc_eng_dmn_conn_loc_api_server_data_conn(
- LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON,
- GPSONE_LOC_API_IF_RELEASE_SUCCESS);
- break;
- case RSRC_DENIED:
- loc_eng_dmn_conn_loc_api_server_data_conn(
- LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON,
- GPSONE_LOC_API_IF_FAILURE);
- break;
- case RSRC_GRANTED:
- loc_eng_dmn_conn_loc_api_server_data_conn(
- LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON,
- GPSONE_LOC_API_IF_REQUEST_SUCCESS);
- break;
- default:
- notify = false;
- }
- }
-
- return notify;
-}
-
-bool ATLSubscriber::notifyRsrcStatus(Notification &notification)
-{
- bool notify = forMe(notification);
-
- if (notify) {
- switch(notification.rsrcStatus)
- {
- case RSRC_UNSUBSCRIBE:
- case RSRC_RELEASED:
- ((LocEngAdapter*)mLocAdapter)->atlCloseStatus(ID, 1);
- break;
- case RSRC_DENIED:
- {
- AGpsExtType type = mBackwardCompatibleMode ?
- AGPS_TYPE_INVALID : mStateMachine->getType();
- ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 0,
- (char*)mStateMachine->getAPN(),
- mStateMachine->getBearer(),
- type);
- }
- break;
- case RSRC_GRANTED:
- {
- AGpsExtType type = mBackwardCompatibleMode ?
- AGPS_TYPE_INVALID : mStateMachine->getType();
- ((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 1,
- (char*)mStateMachine->getAPN(),
- mStateMachine->getBearer(),
- type);
- }
- break;
- default:
- notify = false;
- }
- }
-
- return notify;
-}
-
-bool WIFISubscriber::notifyRsrcStatus(Notification &notification)
-{
- bool notify = forMe(notification);
-
- if (notify) {
- switch(notification.rsrcStatus)
- {
- case RSRC_UNSUBSCRIBE:
- break;
- case RSRC_RELEASED:
- loc_eng_dmn_conn_loc_api_server_data_conn(
- senderId,
- GPSONE_LOC_API_IF_RELEASE_SUCCESS);
- break;
- case RSRC_DENIED:
- loc_eng_dmn_conn_loc_api_server_data_conn(
- senderId,
- GPSONE_LOC_API_IF_FAILURE);
- break;
- case RSRC_GRANTED:
- loc_eng_dmn_conn_loc_api_server_data_conn(
- senderId,
- GPSONE_LOC_API_IF_REQUEST_SUCCESS);
- break;
- default:
- notify = false;
- }
- }
-
- return notify;
-}
-bool DSSubscriber::notifyRsrcStatus(Notification &notification)
-{
- bool notify = forMe(notification);
- LOC_LOGD("DSSubscriber::notifyRsrcStatus. notify:%d \n",(int)(notify));
- if(notify) {
- switch(notification.rsrcStatus) {
- case RSRC_UNSUBSCRIBE:
- case RSRC_RELEASED:
- case RSRC_DENIED:
- case RSRC_GRANTED:
- ((DSStateMachine *)mStateMachine)->informStatus(notification.rsrcStatus, ID);
- break;
- default:
- notify = false;
- }
- }
- return notify;
-}
-void DSSubscriber :: setInactive()
-{
- mIsInactive = true;
- ((DSStateMachine *)mStateMachine)->informStatus(RSRC_UNSUBSCRIBE, ID);
-}
-//======================================================================
-// AgpsState: AgpsReleasedState / AgpsPendingState / AgpsAcquiredState
-//======================================================================
-
-// AgpsReleasedState
-class AgpsReleasedState : public AgpsState
-{
- friend class AgpsStateMachine;
-
- inline AgpsReleasedState(AgpsStateMachine* stateMachine) :
- AgpsState(stateMachine)
- { mReleasedState = this; }
-
- inline ~AgpsReleasedState() {}
-public:
- virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data);
- inline virtual char* whoami() {return (char*)"AgpsReleasedState";}
-};
-
-AgpsState* AgpsReleasedState::onRsrcEvent(AgpsRsrcStatus event, void* data)
-{
- LOC_LOGD("AgpsReleasedState::onRsrcEvent; event:%d\n", (int)event);
- if (mStateMachine->hasSubscribers()) {
- LOC_LOGE("Error: %s subscriber list not empty!!!", whoami());
- // I don't know how to recover from it. I am adding this rather
- // for debugging purpose.
- }
-
- AgpsState* nextState = this;
- switch (event)
- {
- case RSRC_SUBSCRIBE:
- {
- // no notification until we get RSRC_GRANTED
- // but we need to add subscriber to the list
- mStateMachine->addSubscriber((Subscriber*)data);
- // request from connecivity service for NIF
- //The if condition is added so that if the data call setup fails
- //for DS State Machine, we want to retry in released state.
- //for AGps State Machine, sendRsrcRequest() will always return success
- if(!mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN)) {
- // move the state to PENDING
- nextState = mPendingState;
- }
- }
- break;
-
- case RSRC_UNSUBSCRIBE:
- {
- // the list should really be empty, nothing to remove.
- // but we might as well just tell the client it is
- // unsubscribed. False tolerance, right?
- Subscriber* subscriber = (Subscriber*) data;
- Notification notification(subscriber, event, false);
- subscriber->notifyRsrcStatus(notification);
- }
- // break;
- case RSRC_GRANTED:
- case RSRC_RELEASED:
- case RSRC_DENIED:
- default:
- LOC_LOGW("%s: unrecognized event %d", whoami(), event);
- // no state change.
- break;
- }
-
- LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d",
- whoami(), nextState->whoami(), event);
- return nextState;
-}
-
-// AgpsPendingState
-class AgpsPendingState : public AgpsState
-{
- friend class AgpsStateMachine;
-
- inline AgpsPendingState(AgpsStateMachine* stateMachine) :
- AgpsState(stateMachine)
- { mPendingState = this; }
-
- inline ~AgpsPendingState() {}
-public:
- virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data);
- inline virtual char* whoami() {return (char*)"AgpsPendingState";}
-};
-
-AgpsState* AgpsPendingState::onRsrcEvent(AgpsRsrcStatus event, void* data)
-{
- AgpsState* nextState = this;;
- LOC_LOGD("AgpsPendingState::onRsrcEvent; event:%d\n", (int)event);
- switch (event)
- {
- case RSRC_SUBSCRIBE:
- {
- // already requested for NIF resource,
- // do nothing until we get RSRC_GRANTED indication
- // but we need to add subscriber to the list
- mStateMachine->addSubscriber((Subscriber*)data);
- // no state change.
- }
- break;
-
- case RSRC_UNSUBSCRIBE:
- {
- Subscriber* subscriber = (Subscriber*) data;
- if (subscriber->waitForCloseComplete()) {
- subscriber->setInactive();
- } else {
- // auto notify this subscriber of the unsubscribe
- Notification notification(subscriber, event, true);
- mStateMachine->notifySubscribers(notification);
- }
-
- // now check if there is any subscribers left
- if (!mStateMachine->hasSubscribers()) {
- // no more subscribers, move to RELEASED state
- nextState = mReleasedState;
-
- // tell connecivity service we can release NIF
- mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN);
- } else if (!mStateMachine->hasActiveSubscribers()) {
- // only inactive subscribers, move to RELEASING state
- nextState = mReleasingState;
-
- // tell connecivity service we can release NIF
- mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN);
- }
- }
- break;
-
- case RSRC_GRANTED:
- {
- nextState = mAcquiredState;
- Notification notification(Notification::BROADCAST_ACTIVE, event, false);
- // notify all subscribers NIF resource GRANTED
- // by setting false, we keep subscribers on the linked list
- mStateMachine->notifySubscribers(notification);
- }
- break;
-
- case RSRC_RELEASED:
- // no state change.
- // we are expecting either GRANTED or DENIED. Handling RELEASED
- // may like break our state machine in race conditions.
- break;
-
- case RSRC_DENIED:
- {
- nextState = mReleasedState;
- Notification notification(Notification::BROADCAST_ALL, event, true);
- // notify all subscribers NIF resource RELEASED or DENIED
- // by setting true, we remove subscribers from the linked list
- mStateMachine->notifySubscribers(notification);
- }
- break;
-
- default:
- LOC_LOGE("%s: unrecognized event %d", whoami(), event);
- // no state change.
- }
-
- LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d",
- whoami(), nextState->whoami(), event);
- return nextState;
-}
-
-
-class AgpsAcquiredState : public AgpsState
-{
- friend class AgpsStateMachine;
-
- inline AgpsAcquiredState(AgpsStateMachine* stateMachine) :
- AgpsState(stateMachine)
- { mAcquiredState = this; }
-
- inline ~AgpsAcquiredState() {}
-public:
- virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data);
- inline virtual char* whoami() { return (char*)"AgpsAcquiredState"; }
-};
-
-
-AgpsState* AgpsAcquiredState::onRsrcEvent(AgpsRsrcStatus event, void* data)
-{
- AgpsState* nextState = this;
- LOC_LOGD("AgpsAcquiredState::onRsrcEvent; event:%d\n", (int)event);
- switch (event)
- {
- case RSRC_SUBSCRIBE:
- {
- // we already have the NIF resource, simply notify subscriber
- Subscriber* subscriber = (Subscriber*) data;
- // we have rsrc in hand, so grant it right away
- Notification notification(subscriber, RSRC_GRANTED, false);
- subscriber->notifyRsrcStatus(notification);
- // add subscriber to the list
- mStateMachine->addSubscriber(subscriber);
- // no state change.
- }
- break;
-
- case RSRC_UNSUBSCRIBE:
- {
- Subscriber* subscriber = (Subscriber*) data;
- if (subscriber->waitForCloseComplete()) {
- subscriber->setInactive();
- } else {
- // auto notify this subscriber of the unsubscribe
- Notification notification(subscriber, event, true);
- mStateMachine->notifySubscribers(notification);
- }
-
- // now check if there is any subscribers left
- if (!mStateMachine->hasSubscribers()) {
- // no more subscribers, move to RELEASED state
- nextState = mReleasedState;
-
- // tell connecivity service we can release NIF
- mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN);
- } else if (!mStateMachine->hasActiveSubscribers()) {
- // only inactive subscribers, move to RELEASING state
- nextState = mReleasingState;
-
- // tell connecivity service we can release NIF
- mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN);
- }
- }
- break;
-
- case RSRC_GRANTED:
- LOC_LOGW("%s: %d, RSRC_GRANTED already received", whoami(), event);
- // no state change.
- break;
-
- case RSRC_RELEASED:
- {
- LOC_LOGW("%s: %d, a force rsrc release", whoami(), event);
- nextState = mReleasedState;
- Notification notification(Notification::BROADCAST_ALL, event, true);
- // by setting true, we remove subscribers from the linked list
- mStateMachine->notifySubscribers(notification);
- }
- break;
-
- case RSRC_DENIED:
- // no state change.
- // we are expecting RELEASED. Handling DENIED
- // may like break our state machine in race conditions.
- break;
-
- default:
- LOC_LOGE("%s: unrecognized event %d", whoami(), event);
- // no state change.
- }
-
- LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d",
- whoami(), nextState->whoami(), event);
- return nextState;
-}
-
-// AgpsPendingState
-class AgpsReleasingState : public AgpsState
-{
- friend class AgpsStateMachine;
-
- inline AgpsReleasingState(AgpsStateMachine* stateMachine) :
- AgpsState(stateMachine)
- { mReleasingState = this; }
-
- inline ~AgpsReleasingState() {}
-public:
- virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data);
- inline virtual char* whoami() {return (char*)"AgpsReleasingState";}
-};
-
-AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data)
-{
- AgpsState* nextState = this;;
- LOC_LOGD("AgpsReleasingState::onRsrcEvent; event:%d\n", (int)event);
-
- switch (event)
- {
- case RSRC_SUBSCRIBE:
- {
- // already requested for NIF resource,
- // do nothing until we get RSRC_GRANTED indication
- // but we need to add subscriber to the list
- mStateMachine->addSubscriber((Subscriber*)data);
- // no state change.
- }
- break;
-
- case RSRC_UNSUBSCRIBE:
- {
- Subscriber* subscriber = (Subscriber*) data;
- if (subscriber->waitForCloseComplete()) {
- subscriber->setInactive();
- } else {
- // auto notify this subscriber of the unsubscribe
- Notification notification(subscriber, event, true);
- mStateMachine->notifySubscribers(notification);
- }
-
- // now check if there is any subscribers left
- if (!mStateMachine->hasSubscribers()) {
- // no more subscribers, move to RELEASED state
- nextState = mReleasedState;
- }
- }
- break;
-
- case RSRC_DENIED:
- // A race condition subscriber unsubscribes before AFW denies resource.
- case RSRC_RELEASED:
- {
- nextState = mAcquiredState;
- Notification notification(Notification::BROADCAST_INACTIVE, event, true);
- // notify all subscribers that are active NIF resource RELEASE
- // by setting false, we keep subscribers on the linked list
- mStateMachine->notifySubscribers(notification);
-
- if (mStateMachine->hasActiveSubscribers()) {
- nextState = mPendingState;
- // request from connecivity service for NIF
- mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN);
- } else {
- nextState = mReleasedState;
- }
- }
- break;
-
- case RSRC_GRANTED:
- default:
- LOC_LOGE("%s: unrecognized event %d", whoami(), event);
- // no state change.
- }
-
- LOC_LOGD("onRsrcEvent, old state %s, new state %s, event %d",
- whoami(), nextState->whoami(), event);
- return nextState;
-}
-//======================================================================
-//Servicer
-//======================================================================
-Servicer* Servicer :: getServicer(servicerType type, void *cb_func)
-{
- LOC_LOGD(" Enter getServicer type:%d\n", (int)type);
- switch(type) {
- case servicerTypeNoCbParam:
- return (new Servicer(cb_func));
- case servicerTypeExt:
- return (new ExtServicer(cb_func));
- case servicerTypeAgps:
- return (new AGpsServicer(cb_func));
- default:
- return NULL;
- }
-}
-
-int Servicer :: requestRsrc(void *cb_data)
-{
- callback();
- return 0;
-}
-
-int ExtServicer :: requestRsrc(void *cb_data)
-{
- int ret=-1;
- LOC_LOGD("Enter ExtServicer :: requestRsrc\n");
- ret = callbackExt(cb_data);
- LOC_LOGD("Exit ExtServicer :: requestRsrc\n");
- return(ret);
-}
-
-int AGpsServicer :: requestRsrc(void *cb_data)
-{
- callbackAGps((AGpsStatus *)cb_data);
- return 0;
-}
-
-//======================================================================
-// AgpsStateMachine
-//======================================================================
-
-AgpsStateMachine::AgpsStateMachine(servicerType servType,
- void *cb_func,
- AGpsExtType type,
- bool enforceSingleSubscriber) :
- mStatePtr(new AgpsReleasedState(this)),mType(type),
- mAPN(NULL),
- mAPNLen(0),
- mBearer(AGPS_APN_BEARER_INVALID),
- mEnforceSingleSubscriber(enforceSingleSubscriber),
- mServicer(Servicer :: getServicer(servType, (void *)cb_func))
-{
- linked_list_init(&mSubscribers);
-
- // setting up mReleasedState
- mStatePtr->mPendingState = new AgpsPendingState(this);
- mStatePtr->mAcquiredState = new AgpsAcquiredState(this);
- mStatePtr->mReleasingState = new AgpsReleasingState(this);
-
- // setting up mAcquiredState
- mStatePtr->mAcquiredState->mReleasedState = mStatePtr;
- mStatePtr->mAcquiredState->mPendingState = mStatePtr->mPendingState;
- mStatePtr->mAcquiredState->mReleasingState = mStatePtr->mReleasingState;
-
- // setting up mPendingState
- mStatePtr->mPendingState->mAcquiredState = mStatePtr->mAcquiredState;
- mStatePtr->mPendingState->mReleasedState = mStatePtr;
- mStatePtr->mPendingState->mReleasingState = mStatePtr->mReleasingState;
-
- // setting up mReleasingState
- mStatePtr->mReleasingState->mReleasedState = mStatePtr;
- mStatePtr->mReleasingState->mPendingState = mStatePtr->mPendingState;
- mStatePtr->mReleasingState->mAcquiredState = mStatePtr->mAcquiredState;
-}
-
-AgpsStateMachine::~AgpsStateMachine()
-{
- dropAllSubscribers();
-
- // free the 3 states. We must read out all 3 pointers first.
- // Otherwise we run the risk of getting pointers from already
- // freed memory.
- AgpsState* acquiredState = mStatePtr->mAcquiredState;
- AgpsState* releasedState = mStatePtr->mReleasedState;
- AgpsState* pendindState = mStatePtr->mPendingState;
- AgpsState* releasingState = mStatePtr->mReleasingState;
-
- delete acquiredState;
- delete releasedState;
- delete pendindState;
- delete releasingState;
- delete mServicer;
- linked_list_destroy(&mSubscribers);
-
- if (NULL != mAPN) {
- delete[] mAPN;
- mAPN = NULL;
- }
-}
-
-void AgpsStateMachine::setAPN(const char* apn, unsigned int len)
-{
- if (NULL != mAPN) {
- delete mAPN;
- }
-
- if (NULL != apn) {
- mAPN = new char[len+1];
- memcpy(mAPN, apn, len);
- mAPN[len] = NULL;
-
- mAPNLen = len;
- } else {
- mAPN = NULL;
- mAPNLen = 0;
- }
-}
-
-void AgpsStateMachine::onRsrcEvent(AgpsRsrcStatus event)
-{
- switch (event)
- {
- case RSRC_GRANTED:
- case RSRC_RELEASED:
- case RSRC_DENIED:
- mStatePtr = mStatePtr->onRsrcEvent(event, NULL);
- break;
- default:
- LOC_LOGW("AgpsStateMachine: unrecognized event %d", event);
- break;
- }
-}
-
-void AgpsStateMachine::notifySubscribers(Notification& notification) const
-{
- if (notification.postNotifyDelete) {
- // just any non NULL value to get started
- Subscriber* s = (Subscriber*)~0;
- while (NULL != s) {
- s = NULL;
- // if the last param sets to true, _search will delete
- // the node from the list for us. But the problem is
- // once that is done, _search returns, leaving the
- // rest of the list unprocessed. So we need a loop.
- linked_list_search(mSubscribers, (void**)&s, notifySubscriber,
- (void*)&notification, true);
- delete s;
- }
- } else {
- // no loop needed if it the last param sets to false, which
- // mean nothing gets deleted from the list.
- linked_list_search(mSubscribers, NULL, notifySubscriber,
- (void*)&notification, false);
- }
-}
-
-void AgpsStateMachine::addSubscriber(Subscriber* subscriber) const
-{
- Subscriber* s = NULL;
- Notification notification((const Subscriber*)subscriber);
- linked_list_search(mSubscribers, (void**)&s,
- hasSubscriber, (void*)&notification, false);
-
- if (NULL == s) {
- linked_list_add(mSubscribers, subscriber->clone(), deleteObj);
- }
-}
-
-int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const
-{
- Subscriber* s = NULL;
- Notification notification(Notification::BROADCAST_ACTIVE);
- linked_list_search(mSubscribers, (void**)&s, hasSubscriber,
- (void*)&notification, false);
-
- if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) {
- AGpsExtStatus nifRequest;
- nifRequest.size = sizeof(nifRequest);
- nifRequest.type = mType;
- nifRequest.status = action;
-
- if (s == NULL) {
- nifRequest.ipv4_addr = INADDR_NONE;
- nifRequest.ipv6_addr[0] = 0;
- nifRequest.ssid[0] = '\0';
- nifRequest.password[0] = '\0';
- } else {
- s->setIPAddresses(nifRequest.ipv4_addr, (char*)nifRequest.ipv6_addr);
- s->setWifiInfo(nifRequest.ssid, nifRequest.password);
- }
-
- CALLBACK_LOG_CALLFLOW("agps_cb", %s, loc_get_agps_status_name(action));
- mServicer->requestRsrc((void *)&nifRequest);
- }
- return 0;
-}
-
-void AgpsStateMachine::subscribeRsrc(Subscriber *subscriber)
-{
- if (mEnforceSingleSubscriber && hasSubscribers()) {
- Notification notification(Notification::BROADCAST_ALL, RSRC_DENIED, true);
- notifySubscriber(&notification, subscriber);
- } else {
- mStatePtr = mStatePtr->onRsrcEvent(RSRC_SUBSCRIBE, (void*)subscriber);
- }
-}
-
-bool AgpsStateMachine::unsubscribeRsrc(Subscriber *subscriber)
-{
- Subscriber* s = NULL;
- Notification notification((const Subscriber*)subscriber);
- linked_list_search(mSubscribers, (void**)&s,
- hasSubscriber, (void*)&notification, false);
-
- if (NULL != s) {
- mStatePtr = mStatePtr->onRsrcEvent(RSRC_UNSUBSCRIBE, (void*)s);
- return true;
- }
- return false;
-}
-
-bool AgpsStateMachine::hasActiveSubscribers() const
-{
- Subscriber* s = NULL;
- Notification notification(Notification::BROADCAST_ACTIVE);
- linked_list_search(mSubscribers, (void**)&s,
- hasSubscriber, (void*)&notification, false);
- return NULL != s;
-}
-
-//======================================================================
-// DSStateMachine
-//======================================================================
-void delay_callback(void *callbackData, int result)
-{
- if(callbackData) {
- DSStateMachine *DSSMInstance = (DSStateMachine *)callbackData;
- DSSMInstance->retryCallback();
- }
- else {
- LOC_LOGE(" NULL argument received. Failing.\n");
- goto err;
- }
-err:
- return;
-}
-
-DSStateMachine :: DSStateMachine(servicerType type, void *cb_func,
- LocEngAdapter* adapterHandle):
- AgpsStateMachine(type, cb_func, AGPS_TYPE_INVALID,false),
- mLocAdapter(adapterHandle)
-{
- LOC_LOGD("%s:%d]: New DSStateMachine\n", __func__, __LINE__);
- mRetries = 0;
-}
-
-void DSStateMachine :: retryCallback(void)
-{
- DSSubscriber *subscriber = NULL;
- Notification notification(Notification::BROADCAST_ACTIVE);
- linked_list_search(mSubscribers, (void**)&subscriber, hasSubscriber,
- (void*)&notification, false);
- if(subscriber)
- mLocAdapter->requestSuplES(subscriber->ID);
- else
- LOC_LOGE("DSStateMachine :: retryCallback: No subscriber found." \
- "Cannot retry data call\n");
- return;
-}
-
-int DSStateMachine :: sendRsrcRequest(AGpsStatusValue action) const
-{
- DSSubscriber* s = NULL;
- dsCbData cbData;
- int ret=-1;
- int connHandle=-1;
- LOC_LOGD("Enter DSStateMachine :: sendRsrcRequest\n");
- Notification notification(Notification::BROADCAST_ACTIVE);
- linked_list_search(mSubscribers, (void**)&s, hasSubscriber,
- (void*)&notification, false);
- if(s) {
- connHandle = s->ID;
- LOC_LOGD("DSStateMachine :: sendRsrcRequest - subscriber found\n");
- }
- else
- LOC_LOGD("DSStateMachine :: sendRsrcRequest - No subscriber found\n");
-
- cbData.action = action;
- cbData.mAdapter = mLocAdapter;
- ret = mServicer->requestRsrc((void *)&cbData);
- //Only the request to start data call returns a success/failure
- //The request to stop data call will always succeed
- //Hence, the below block will only be executed when the
- //request to start the data call fails
- switch(ret) {
- case LOC_API_ADAPTER_ERR_ENGINE_BUSY:
- LOC_LOGD("DSStateMachine :: sendRsrcRequest - Failure returned: %d\n",ret);
- ((DSStateMachine *)this)->incRetries();
- if(mRetries > MAX_START_DATA_CALL_RETRIES) {
- LOC_LOGE(" Failed to start Data call. Fallback to normal ATL SUPL\n");
- informStatus(RSRC_DENIED, connHandle);
- }
- else {
- if(loc_timer_start(DATA_CALL_RETRY_DELAY_MSEC, delay_callback, (void *)this)) {
- LOC_LOGE("Error: Could not start delay thread\n");
- ret = -1;
- goto err;
- }
- }
- break;
- case LOC_API_ADAPTER_ERR_UNSUPPORTED:
- LOC_LOGE("No profile found for emergency call. Fallback to normal SUPL ATL\n");
- informStatus(RSRC_DENIED, connHandle);
- break;
- case LOC_API_ADAPTER_ERR_SUCCESS:
- LOC_LOGD("%s:%d]: Request to start data call sent\n", __func__, __LINE__);
- break;
- case -1:
- //One of the ways this case can be encountered is if the callback function
- //receives a null argument, it just exits with -1 error
- LOC_LOGE("Error: Something went wrong somewhere. Falling back to normal SUPL ATL\n");
- informStatus(RSRC_DENIED, connHandle);
- break;
- default:
- LOC_LOGE("%s:%d]: Unrecognized return value\n", __func__, __LINE__);
- }
-err:
- LOC_LOGD("EXIT DSStateMachine :: sendRsrcRequest; ret = %d\n", ret);
- return ret;
-}
-
-void DSStateMachine :: onRsrcEvent(AgpsRsrcStatus event)
-{
- void* currState = (void *)mStatePtr;
- LOC_LOGD("Enter DSStateMachine :: onRsrcEvent. event = %d\n", (int)event);
- switch (event)
- {
- case RSRC_GRANTED:
- LOC_LOGD("DSStateMachine :: onRsrcEvent RSRC_GRANTED\n");
- mStatePtr = mStatePtr->onRsrcEvent(event, NULL);
- break;
- case RSRC_RELEASED:
- LOC_LOGD("DSStateMachine :: onRsrcEvent RSRC_RELEASED\n");
- mStatePtr = mStatePtr->onRsrcEvent(event, NULL);
- //To handle the case where we get a RSRC_RELEASED in
- //pending state, we translate that to a RSRC_DENIED state
- //since the callback from DSI is either RSRC_GRANTED or RSRC_RELEASED
- //for when the call is connected or disconnected respectively.
- if((void *)mStatePtr != currState)
- break;
- else {
- event = RSRC_DENIED;
- LOC_LOGE(" Switching event to RSRC_DENIED\n");
- }
- case RSRC_DENIED:
- mStatePtr = mStatePtr->onRsrcEvent(event, NULL);
- break;
- default:
- LOC_LOGW("AgpsStateMachine: unrecognized event %d", event);
- break;
- }
- LOC_LOGD("Exit DSStateMachine :: onRsrcEvent. event = %d\n", (int)event);
-}
-
-void DSStateMachine :: informStatus(AgpsRsrcStatus status, int ID) const
-{
- LOC_LOGD("DSStateMachine :: informStatus. Status=%d\n",(int)status);
- switch(status) {
- case RSRC_UNSUBSCRIBE:
- mLocAdapter->atlCloseStatus(ID, 1);
- break;
- case RSRC_RELEASED:
- mLocAdapter->closeDataCall();
- break;
- case RSRC_DENIED:
- ((DSStateMachine *)this)->mRetries = 0;
- mLocAdapter->requestATL(ID, AGPS_TYPE_SUPL);
- break;
- case RSRC_GRANTED:
- mLocAdapter->atlOpenStatus(ID, 1,
- NULL,
- AGPS_APN_BEARER_INVALID,
- AGPS_TYPE_INVALID);
- break;
- default:
- LOC_LOGW("DSStateMachine :: informStatus - unknown status");
- }
- return;
-}
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_agps.h b/gps/loc_api/libloc_api_50001/loc_eng_agps.h
deleted file mode 100644
index 9915a70..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_agps.h
+++ /dev/null
@@ -1,419 +0,0 @@
-/* Copyright (c) 2011-2013, 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_AGPS_H__
-#define __LOC_ENG_AGPS_H__
-
-#include <stdbool.h>
-#include <ctype.h>
-#include <string.h>
-#include <arpa/inet.h>
-#include "hardware/gps.h"
-#include <gps_extended.h>
-#include <loc_core_log.h>
-#include <linked_list.h>
-#include <loc_timer.h>
-#include <LocEngAdapter.h>
-
-// forward declaration
-class AgpsStateMachine;
-class Subscriber;
-
-// NIF resource events
-typedef enum {
- RSRC_SUBSCRIBE,
- RSRC_UNSUBSCRIBE,
- RSRC_GRANTED,
- RSRC_RELEASED,
- RSRC_DENIED,
- RSRC_STATUS_MAX
-} AgpsRsrcStatus;
-
-typedef enum {
- servicerTypeNoCbParam,
- servicerTypeAgps,
- servicerTypeExt
-}servicerType;
-
-//DS Callback struct
-typedef struct {
- LocEngAdapter *mAdapter;
- AGpsStatusValue action;
-}dsCbData;
-
-// information bundle for subscribers
-struct Notification {
- // goes to every subscriber
- static const int BROADCAST_ALL;
- // goes to every ACTIVE subscriber
- static const int BROADCAST_ACTIVE;
- // goes to every INACTIVE subscriber
- static const int BROADCAST_INACTIVE;
-
- // go to a specific subscriber
- const Subscriber* rcver;
- // broadcast
- const int groupID;
- // the new resource status event
- const AgpsRsrcStatus rsrcStatus;
- // should the subscriber be deleted after the notification
- const bool postNotifyDelete;
-
- // convenient constructor
- inline Notification(const int broadcast,
- const AgpsRsrcStatus status,
- const bool deleteAfterwards) :
- rcver(NULL), groupID(broadcast), rsrcStatus(status),
- postNotifyDelete(deleteAfterwards) {}
-
- // convenient constructor
- inline Notification(const Subscriber* subscriber,
- const AgpsRsrcStatus status,
- const bool deleteAfterwards) :
- rcver(subscriber), groupID(-1), rsrcStatus(status),
- postNotifyDelete(deleteAfterwards) {}
-
- // convenient constructor
- inline Notification(const int broadcast) :
- rcver(NULL), groupID(broadcast), rsrcStatus(RSRC_STATUS_MAX),
- postNotifyDelete(false) {}
-
- // convenient constructor
- inline Notification(const Subscriber* subscriber) :
- rcver(subscriber), groupID(-1), rsrcStatus(RSRC_STATUS_MAX),
- postNotifyDelete(false) {}
-};
-
-class AgpsState {
- // allows AgpsStateMachine to access private data
- // no class members are public. We don't want
- // anyone but state machine to use state.
- friend class AgpsStateMachine;
- friend class DSStateMachine;
- // state transitions are done here.
- // Each state implements its own transitions (of course).
- inline virtual AgpsState* onRsrcEvent(AgpsRsrcStatus event, void* data) = 0;
-
-protected:
- // handle back to state machine
- const AgpsStateMachine* mStateMachine;
- // each state has pointers to all 3 states
- // one of which is to itself.
- AgpsState* mReleasedState;
- AgpsState* mAcquiredState;
- AgpsState* mPendingState;
- AgpsState* mReleasingState;
-
- inline AgpsState(const AgpsStateMachine *stateMachine) :
- mStateMachine(stateMachine),
- mReleasedState(NULL),
- mAcquiredState(NULL),
- mPendingState(NULL),
- mReleasingState(NULL) {}
- virtual ~AgpsState() {}
-
-public:
- // for logging purpose
- inline virtual char* whoami() = 0;
-};
-
-class Servicer {
- void (*callback)(void);
-public:
- static Servicer* getServicer(servicerType type, void *cb_func);
- virtual int requestRsrc(void *cb_data);
- Servicer() {}
- Servicer(void *cb_func)
- { callback = (void(*)(void))(cb_func); }
- virtual ~Servicer(){}
- inline virtual char *whoami() {return (char*)"Servicer";}
-};
-
-class ExtServicer : public Servicer {
- int (*callbackExt)(void *cb_data);
-public:
- int requestRsrc(void *cb_data);
- ExtServicer() {}
- ExtServicer(void *cb_func)
- { callbackExt = (int(*)(void *))(cb_func); }
- virtual ~ExtServicer(){}
- inline virtual char *whoami() {return (char*)"ExtServicer";}
-};
-
-class AGpsServicer : public Servicer {
- void (*callbackAGps)(AGpsStatus* status);
-public:
- int requestRsrc(void *cb_data);
- AGpsServicer() {}
- AGpsServicer(void *cb_func)
- { callbackAGps = (void(*)(AGpsStatus *))(cb_func); }
- virtual ~AGpsServicer(){}
- inline virtual char *whoami() {return (char*)"AGpsServicer";}
-};
-
-class AgpsStateMachine {
-protected:
- // a linked list of subscribers.
- void* mSubscribers;
- //handle to whoever provides the service
- Servicer *mServicer;
- // allows AgpsState to access private data
- // each state is really internal data to the
- // state machine, so it should be able to
- // access anything within the state machine.
- friend class AgpsState;
- // pointer to the current state.
- AgpsState* mStatePtr;
-private:
- // NIF type: AGNSS or INTERNET.
- const AGpsExtType mType;
- // apn to the NIF. Each state machine tracks
- // resource state of a particular NIF. For each
- // NIF, there is also an active APN.
- char* mAPN;
- // for convenience, we don't do strlen each time.
- unsigned int mAPNLen;
- // bear
- AGpsBearerType mBearer;
- // ipv4 address for routing
- bool mEnforceSingleSubscriber;
-
-public:
- AgpsStateMachine(servicerType servType, void *cb_func,
- AGpsExtType type, bool enforceSingleSubscriber);
- virtual ~AgpsStateMachine();
-
- // self explanatory methods below
- void setAPN(const char* apn, unsigned int len);
- inline const char* getAPN() const { return (const char*)mAPN; }
- inline void setBearer(AGpsBearerType bearer) { mBearer = bearer; }
- inline AGpsBearerType getBearer() const { return mBearer; }
- inline AGpsExtType getType() const { return (AGpsExtType)mType; }
-
- // someone, a ATL client or BIT, is asking for NIF
- void subscribeRsrc(Subscriber *subscriber);
-
- // someone, a ATL client or BIT, is done with NIF
- bool unsubscribeRsrc(Subscriber *subscriber);
-
- // add a subscriber in the linked list, if not already there.
- void addSubscriber(Subscriber* subscriber) const;
-
- virtual void onRsrcEvent(AgpsRsrcStatus event);
-
- // put the data together and send the FW
- virtual int sendRsrcRequest(AGpsStatusValue action) const;
-
- //if list is empty, linked_list_empty returns 1
- //else if list is not empty, returns 0
- //so hasSubscribers() returns 1 if list is not empty
- //and returns 0 if list is empty
- inline bool hasSubscribers() const
- { return !linked_list_empty(mSubscribers); }
-
- bool hasActiveSubscribers() const;
-
- inline void dropAllSubscribers() const
- { linked_list_flush(mSubscribers); }
-
- // private. Only a state gets to call this.
- void notifySubscribers(Notification& notification) const;
-
-};
-
-class DSStateMachine : public AgpsStateMachine {
- static const unsigned char MAX_START_DATA_CALL_RETRIES;
- static const unsigned int DATA_CALL_RETRY_DELAY_MSEC;
- LocEngAdapter* mLocAdapter;
- unsigned char mRetries;
-public:
- DSStateMachine(servicerType type,
- void *cb_func,
- LocEngAdapter* adapterHandle);
- int sendRsrcRequest(AGpsStatusValue action) const;
- void onRsrcEvent(AgpsRsrcStatus event);
- void retryCallback();
- void informStatus(AgpsRsrcStatus status, int ID) const;
- inline void incRetries() {mRetries++;}
- inline virtual char *whoami() {return (char*)"DSStateMachine";}
-};
-
-// each subscriber is a AGPS client. In the case of ATL, there could be
-// multiple clients from modem. In the case of BIT, there is only one
-// cilent from BIT daemon.
-struct Subscriber {
- const uint32_t ID;
- const AgpsStateMachine* mStateMachine;
- inline Subscriber(const int id,
- const AgpsStateMachine* stateMachine) :
- ID(id), mStateMachine(stateMachine) {}
- inline virtual ~Subscriber() {}
-
- virtual void setIPAddresses(uint32_t &v4, char* v6) = 0;
- inline virtual void setWifiInfo(char* ssid, char* password)
- { ssid[0] = 0; password[0] = 0; }
-
- inline virtual bool equals(const Subscriber *s) const
- { return ID == s->ID; }
-
- // notifies a subscriber a new NIF resource status, usually
- // either GRANTE, DENIED, or RELEASED
- virtual bool notifyRsrcStatus(Notification &notification) = 0;
-
- virtual bool waitForCloseComplete() { return false; }
- virtual void setInactive() {}
- virtual bool isInactive() { return false; }
-
- virtual Subscriber* clone() = 0;
- // checks if this notification is for me, i.e.
- // either has my id, or has a broadcast id.
- bool forMe(Notification &notification);
-};
-
-// BITSubscriber, created with requests from BIT daemon
-struct BITSubscriber : public Subscriber {
- char mIPv6Addr[16];
-
- inline BITSubscriber(const AgpsStateMachine* stateMachine,
- unsigned int ipv4, char* ipv6) :
- Subscriber(ipv4, stateMachine)
- {
- if (NULL == ipv6) {
- mIPv6Addr[0] = 0;
- } else {
- memcpy(mIPv6Addr, ipv6, sizeof(mIPv6Addr));
- }
- }
-
- virtual bool notifyRsrcStatus(Notification &notification);
-
- inline virtual void setIPAddresses(uint32_t &v4, char* v6)
- { v4 = ID; memcpy(v6, mIPv6Addr, sizeof(mIPv6Addr)); }
-
- virtual Subscriber* clone()
- {
- return new BITSubscriber(mStateMachine, ID, mIPv6Addr);
- }
-
- virtual bool equals(const Subscriber *s) const;
- inline virtual ~BITSubscriber(){}
-};
-
-// ATLSubscriber, created with requests from ATL
-struct ATLSubscriber : public Subscriber {
- const LocEngAdapter* mLocAdapter;
- const bool mBackwardCompatibleMode;
- inline ATLSubscriber(const int id,
- const AgpsStateMachine* stateMachine,
- const LocEngAdapter* adapter,
- const bool compatibleMode) :
- Subscriber(id, stateMachine), mLocAdapter(adapter),
- mBackwardCompatibleMode(compatibleMode){}
- virtual bool notifyRsrcStatus(Notification &notification);
-
- inline virtual void setIPAddresses(uint32_t &v4, char* v6)
- { v4 = INADDR_NONE; v6[0] = 0; }
-
- inline virtual Subscriber* clone()
- {
- return new ATLSubscriber(ID, mStateMachine, mLocAdapter,
- mBackwardCompatibleMode);
- }
- inline virtual ~ATLSubscriber(){}
-};
-
-// WIFISubscriber, created with requests from MSAPM or QuIPC
-struct WIFISubscriber : public Subscriber {
- char * mSSID;
- char * mPassword;
- loc_if_req_sender_id_e_type senderId;
- bool mIsInactive;
- inline WIFISubscriber(const AgpsStateMachine* stateMachine,
- char * ssid, char * password, loc_if_req_sender_id_e_type sender_id) :
- Subscriber(sender_id, stateMachine),
- mSSID(NULL == ssid ? NULL : new char[SSID_BUF_SIZE]),
- mPassword(NULL == password ? NULL : new char[SSID_BUF_SIZE]),
- senderId(sender_id)
- {
- if (NULL != mSSID)
- strlcpy(mSSID, ssid, SSID_BUF_SIZE);
- if (NULL != mPassword)
- strlcpy(mPassword, password, SSID_BUF_SIZE);
- mIsInactive = false;
- }
-
- virtual bool notifyRsrcStatus(Notification &notification);
-
- inline virtual void setIPAddresses(uint32_t &v4, char* v6) {}
-
- inline virtual void setWifiInfo(char* ssid, char* password)
- {
- if (NULL != mSSID)
- strlcpy(ssid, mSSID, SSID_BUF_SIZE);
- else
- ssid[0] = '\0';
- if (NULL != mPassword)
- strlcpy(password, mPassword, SSID_BUF_SIZE);
- else
- password[0] = '\0';
- }
-
- inline virtual bool waitForCloseComplete() { return true; }
-
- inline virtual void setInactive() { mIsInactive = true; }
- inline virtual bool isInactive() { return mIsInactive; }
-
- virtual Subscriber* clone()
- {
- return new WIFISubscriber(mStateMachine, mSSID, mPassword, senderId);
- }
- inline virtual ~WIFISubscriber(){}
-};
-
-struct DSSubscriber : public Subscriber {
- bool mIsInactive;
- inline DSSubscriber(const AgpsStateMachine *stateMachine,
- const int id) :
- Subscriber(id, stateMachine)
- {
- mIsInactive = false;
- }
- inline virtual void setIPAddresses(uint32_t &v4, char* v6) {}
- virtual Subscriber* clone()
- {return new DSSubscriber(mStateMachine, ID);}
- virtual bool notifyRsrcStatus(Notification &notification);
- inline virtual bool waitForCloseComplete() { return true; }
- virtual void setInactive();
- inline virtual bool isInactive()
- { return mIsInactive; }
- inline virtual ~DSSubscriber(){}
- inline virtual char *whoami() {return (char*)"DSSubscriber";}
-};
-
-#endif //__LOC_ENG_AGPS_H__
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp
deleted file mode 100644
index c257dff..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.cpp
+++ /dev/null
@@ -1,270 +0,0 @@
-/* Copyright (c) 2011-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
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <linux/stat.h>
-#include <fcntl.h>
-#include <linux/types.h>
-#include <unistd.h>
-#include <errno.h>
-#include <grp.h>
-#include <sys/stat.h>
-
-#include "log_util.h"
-#include "platform_lib_includes.h"
-#include "loc_eng_dmn_conn_glue_msg.h"
-#include "loc_eng_dmn_conn_handler.h"
-#include "loc_eng_dmn_conn.h"
-#include "loc_eng_msg.h"
-
-static int loc_api_server_msgqid;
-static int loc_api_resp_msgqid;
-static int quipc_msgqid;
-static int msapm_msgqid;
-static int msapu_msgqid;
-
-static const char * global_loc_api_q_path = GPSONE_LOC_API_Q_PATH;
-static const char * global_loc_api_resp_q_path = GPSONE_LOC_API_RESP_Q_PATH;
-static const char * global_quipc_ctrl_q_path = QUIPC_CTRL_Q_PATH;
-static const char * global_msapm_ctrl_q_path = MSAPM_CTRL_Q_PATH;
-static const char * global_msapu_ctrl_q_path = MSAPU_CTRL_Q_PATH;
-
-static int loc_api_server_proc_init(void *context)
-{
- loc_api_server_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_q_path, O_RDWR);
- //change mode/group for the global_loc_api_q_path pipe
- int result = chmod (global_loc_api_q_path, 0660);
- if (result != 0)
- {
- LOC_LOGE("failed to change mode for %s, error = %s\n", global_loc_api_q_path, strerror(errno));
- }
-
- struct group * gps_group = getgrnam("gps");
- if (gps_group != NULL)
- {
- result = chown (global_loc_api_q_path, -1, gps_group->gr_gid);
- if (result != 0)
- {
- LOC_LOGE("chown for pipe failed, pipe %s, gid = %d, result = %d, error = %s\n",
- global_loc_api_q_path, gps_group->gr_gid, result, strerror(errno));
- }
- }
- else
- {
- LOC_LOGE("getgrnam for gps failed, error code = %d\n", errno);
- }
-
- loc_api_resp_msgqid = loc_eng_dmn_conn_glue_msgget(global_loc_api_resp_q_path, O_RDWR);
-
- //change mode/group for the global_loc_api_resp_q_path pipe
- result = chmod (global_loc_api_resp_q_path, 0660);
- if (result != 0)
- {
- LOC_LOGE("failed to change mode for %s, error = %s\n", global_loc_api_resp_q_path, strerror(errno));
- }
-
- if (gps_group != NULL)
- {
- result = chown (global_loc_api_resp_q_path, -1, gps_group->gr_gid);
- if (result != 0)
- {
- LOC_LOGE("chown for pipe failed, pipe %s, gid = %d, result = %d, error = %s\n",
- global_loc_api_resp_q_path,
- gps_group->gr_gid, result, strerror(errno));
- }
- }
-
- quipc_msgqid = loc_eng_dmn_conn_glue_msgget(global_quipc_ctrl_q_path, O_RDWR);
- msapm_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapm_ctrl_q_path , O_RDWR);
- msapu_msgqid = loc_eng_dmn_conn_glue_msgget(global_msapu_ctrl_q_path , O_RDWR);
-
- LOC_LOGD("%s:%d] loc_api_server_msgqid = %d\n", __func__, __LINE__, loc_api_server_msgqid);
- return 0;
-}
-
-static int loc_api_server_proc_pre(void *context)
-{
- return 0;
-}
-
-static int loc_api_server_proc(void *context)
-{
- int length, sz;
- int result = 0;
- static int cnt = 0;
- struct ctrl_msgbuf * p_cmsgbuf;
- struct ctrl_msgbuf cmsg_resp;
-
- sz = sizeof(struct ctrl_msgbuf) + 256;
- p_cmsgbuf = (struct ctrl_msgbuf *) malloc(sz);
-
- if (!p_cmsgbuf) {
- LOC_LOGE("%s:%d] Out of memory\n", __func__, __LINE__);
- return -1;
- }
-
- cnt ++;
- LOC_LOGD("%s:%d] %d listening on %s...\n", __func__, __LINE__, cnt, (char *) context);
- length = loc_eng_dmn_conn_glue_msgrcv(loc_api_server_msgqid, p_cmsgbuf, sz);
- if (length <= 0) {
- free(p_cmsgbuf);
- LOC_LOGE("%s:%d] fail receiving msg from gpsone_daemon, retry later\n", __func__, __LINE__);
- usleep(1000);
- return -1;
- }
-
- LOC_LOGD("%s:%d] received ctrl_type = %d\n", __func__, __LINE__, p_cmsgbuf->ctrl_type);
- switch(p_cmsgbuf->ctrl_type) {
- case GPSONE_LOC_API_IF_REQUEST:
- result = loc_eng_dmn_conn_loc_api_server_if_request_handler(p_cmsgbuf, length);
- break;
-
- case GPSONE_LOC_API_IF_RELEASE:
- result = loc_eng_dmn_conn_loc_api_server_if_release_handler(p_cmsgbuf, length);
- break;
-
- case GPSONE_UNBLOCK:
- LOC_LOGD("%s:%d] GPSONE_UNBLOCK\n", __func__, __LINE__);
- break;
-
- default:
- LOC_LOGE("%s:%d] unsupported ctrl_type = %d\n",
- __func__, __LINE__, p_cmsgbuf->ctrl_type);
- break;
- }
-
- free(p_cmsgbuf);
- return 0;
-}
-
-static int loc_api_server_proc_post(void *context)
-{
- LOC_LOGD("%s:%d]\n", __func__, __LINE__);
- loc_eng_dmn_conn_glue_msgremove( global_loc_api_q_path, loc_api_server_msgqid);
- loc_eng_dmn_conn_glue_msgremove( global_loc_api_resp_q_path, loc_api_resp_msgqid);
- loc_eng_dmn_conn_glue_msgremove( global_quipc_ctrl_q_path, quipc_msgqid);
- loc_eng_dmn_conn_glue_msgremove( global_msapm_ctrl_q_path, msapm_msgqid);
- loc_eng_dmn_conn_glue_msgremove( global_msapu_ctrl_q_path, msapu_msgqid);
- return 0;
-}
-
-static int loc_eng_dmn_conn_unblock_proc(void)
-{
- struct ctrl_msgbuf cmsgbuf;
- cmsgbuf.ctrl_type = GPSONE_UNBLOCK;
- LOC_LOGD("%s:%d]\n", __func__, __LINE__);
- loc_eng_dmn_conn_glue_msgsnd(loc_api_server_msgqid, & cmsgbuf, sizeof(cmsgbuf));
- return 0;
-}
-
-static struct loc_eng_dmn_conn_thelper thelper;
-
-int loc_eng_dmn_conn_loc_api_server_launch(thelper_create_thread create_thread_cb,
- const char * loc_api_q_path, const char * resp_q_path, void *agps_handle)
-{
- int result;
-
- loc_api_handle = agps_handle;
-
- if (loc_api_q_path) global_loc_api_q_path = loc_api_q_path;
- if (resp_q_path) global_loc_api_resp_q_path = resp_q_path;
-
- result = loc_eng_dmn_conn_launch_thelper( &thelper,
- loc_api_server_proc_init,
- loc_api_server_proc_pre,
- loc_api_server_proc,
- loc_api_server_proc_post,
- create_thread_cb,
- (char *) global_loc_api_q_path);
- if (result != 0) {
- LOC_LOGE("%s:%d]\n", __func__, __LINE__);
- return -1;
- }
- return 0;
-}
-
-int loc_eng_dmn_conn_loc_api_server_unblock(void)
-{
- loc_eng_dmn_conn_unblock_thelper(&thelper);
- loc_eng_dmn_conn_unblock_proc();
- return 0;
-}
-
-int loc_eng_dmn_conn_loc_api_server_join(void)
-{
- loc_eng_dmn_conn_join_thelper(&thelper);
- return 0;
-}
-
-int loc_eng_dmn_conn_loc_api_server_data_conn(int sender_id, int status) {
- struct ctrl_msgbuf cmsgbuf;
- LOC_LOGD("%s:%d] quipc_msgqid = %d\n", __func__, __LINE__, quipc_msgqid);
- cmsgbuf.ctrl_type = GPSONE_LOC_API_RESPONSE;
- cmsgbuf.cmsg.cmsg_response.result = status;
- switch (sender_id) {
- case LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC: {
- LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC", __func__, __LINE__);
- if (loc_eng_dmn_conn_glue_msgsnd(quipc_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) {
- LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__);
- return -1;
- }
- break;
- }
- case LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM: {
- LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM", __func__, __LINE__);
- if (loc_eng_dmn_conn_glue_msgsnd(msapm_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) {
- LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__);
- return -1;
- }
- break;
- }
- case LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU: {
- LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU", __func__, __LINE__);
- if (loc_eng_dmn_conn_glue_msgsnd(msapu_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) {
- LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__);
- return -1;
- }
- break;
- }
- case LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON: {
- LOC_LOGD("%s:%d] sender_id = LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON", __func__, __LINE__);
- if (loc_eng_dmn_conn_glue_msgsnd(loc_api_resp_msgqid, & cmsgbuf, sizeof(struct ctrl_msgbuf)) < 0) {
- LOC_LOGD("%s:%d] error! conn_glue_msgsnd failed\n", __func__, __LINE__);
- return -1;
- }
- break;
- }
- default: {
- LOC_LOGD("%s:%d] invalid sender ID!", __func__, __LINE__);
- }
- }
- return 0;
-}
-
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h
deleted file mode 100644
index 1d8c142..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef LOC_ENG_DATA_SERVER_H
-#define LOC_ENG_DATA_SERVER_H
-
-#include "loc_eng_dmn_conn_thread_helper.h"
-
-#ifdef _ANDROID_
-
-#define GPSONE_LOC_API_Q_PATH "/data/misc/location/gpsone_d/gpsone_loc_api_q"
-#define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/location/gpsone_d/gpsone_loc_api_resp_q"
-#define QUIPC_CTRL_Q_PATH "/data/misc/location/gpsone_d/quipc_ctrl_q"
-#define MSAPM_CTRL_Q_PATH "/data/misc/location/gpsone_d/msapm_ctrl_q"
-#define MSAPU_CTRL_Q_PATH "/data/misc/location/gpsone_d/msapu_ctrl_q"
-
-#else
-
-#define GPSONE_LOC_API_Q_PATH "/tmp/gpsone_loc_api_q"
-#define GPSONE_LOC_API_RESP_Q_PATH "/tmp/gpsone_loc_api_resp_q"
-#define QUIPC_CTRL_Q_PATH "/tmp/quipc_ctrl_q"
-#define MSAPM_CTRL_Q_PATH "/tmp/msapm_ctrl_q"
-#define MSAPU_CTRL_Q_PATH "/tmp/msapu_ctrl_q"
-
-#endif
-
-int loc_eng_dmn_conn_loc_api_server_launch(thelper_create_thread create_thread_cb,
- const char * loc_api_q_path, const char * ctrl_q_path, void *agps_handle);
-int loc_eng_dmn_conn_loc_api_server_unblock(void);
-int loc_eng_dmn_conn_loc_api_server_join(void);
-int loc_eng_dmn_conn_loc_api_server_data_conn(int, int);
-
-#endif /* LOC_ENG_DATA_SERVER_H */
-
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c
deleted file mode 100644
index a1076ff..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/* Copyright (c) 2011, 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 <linux/stat.h>
-#include <fcntl.h>
-
-#include <linux/types.h>
-
-#include "log_util.h"
-#include "platform_lib_includes.h"
-#include "loc_eng_dmn_conn_glue_msg.h"
-#include "loc_eng_dmn_conn_handler.h"
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_msgget
-
-DESCRIPTION
- This function get a message queue
-
- q_path - name path of the message queue
- mode -
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- message queue id
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_msgget(const char * q_path, int mode)
-{
- int msgqid;
- msgqid = loc_eng_dmn_conn_glue_pipeget(q_path, mode);
- return msgqid;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_msgremove
-
-DESCRIPTION
- remove a message queue
-
- q_path - name path of the message queue
- msgqid - message queue id
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_msgremove(const char * q_path, int msgqid)
-{
- int result;
- result = loc_eng_dmn_conn_glue_piperemove(q_path, msgqid);
- return result;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_msgsnd
-
-DESCRIPTION
- Send a message
-
- msgqid - message queue id
- msgp - pointer to the message to be sent
- msgsz - size of the message
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- number of bytes sent out or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_msgsnd(int msgqid, const void * msgp, size_t msgsz)
-{
- int result;
- struct ctrl_msgbuf *pmsg = (struct ctrl_msgbuf *) msgp;
- pmsg->msgsz = msgsz;
-
- result = loc_eng_dmn_conn_glue_pipewrite(msgqid, msgp, msgsz);
- if (result != (int) msgsz) {
- LOC_LOGE("%s:%d] pipe broken %d, msgsz = %d\n", __func__, __LINE__, result, (int) msgsz);
- return -1;
- }
-
- return result;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_msgrcv
-
-DESCRIPTION
- receive a message
-
- msgqid - message queue id
- msgp - pointer to the buffer to hold the message
- msgsz - size of the buffer
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- number of bytes received or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_msgrcv(int msgqid, void *msgp, size_t msgbufsz)
-{
- int result;
- struct ctrl_msgbuf *pmsg = (struct ctrl_msgbuf *) msgp;
-
- result = loc_eng_dmn_conn_glue_piperead(msgqid, &(pmsg->msgsz), sizeof(pmsg->msgsz));
- if (result != sizeof(pmsg->msgsz)) {
- LOC_LOGE("%s:%d] pipe broken %d\n", __func__, __LINE__, result);
- return -1;
- }
-
- if (msgbufsz < pmsg->msgsz) {
- LOC_LOGE("%s:%d] msgbuf is too small %d < %d\n", __func__, __LINE__, (int) msgbufsz, (int) pmsg->msgsz);
- return -1;
- }
-
- result = loc_eng_dmn_conn_glue_piperead(msgqid, (uint8_t *) msgp + sizeof(pmsg->msgsz), pmsg->msgsz - sizeof(pmsg->msgsz));
- if (result != (int) (pmsg->msgsz - sizeof(pmsg->msgsz))) {
- LOC_LOGE("%s:%d] pipe broken %d, msgsz = %d\n", __func__, __LINE__, result, (int) pmsg->msgsz);
- return -1;
- }
-
- return pmsg->msgsz;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_msgunblock
-
-DESCRIPTION
- unblock a message queue
-
- msgqid - message queue id
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_msgunblock(int msgqid)
-{
- return loc_eng_dmn_conn_glue_pipeunblock(msgqid);
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_msgflush
-
-DESCRIPTION
- flush out the message in a queue
-
- msgqid - message queue id
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- number of bytes that are flushed out.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_msgflush(int msgqid)
-{
- int length;
- char buf[128];
-
- do {
- length = loc_eng_dmn_conn_glue_piperead(msgqid, buf, 128);
- LOC_LOGD("%s:%d] %s\n", __func__, __LINE__, buf);
- } while(length);
- return length;
-}
-
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h
deleted file mode 100644
index d685c87..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (c) 2011, 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_DMN_CONN_GLUE_MSG_H
-#define LOC_ENG_DMN_CONN_GLUE_MSG_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-#include <linux/types.h>
-#include "loc_eng_dmn_conn_glue_pipe.h"
-
-int loc_eng_dmn_conn_glue_msgget(const char * q_path, int mode);
-int loc_eng_dmn_conn_glue_msgremove(const char * q_path, int msgqid);
-int loc_eng_dmn_conn_glue_msgsnd(int msgqid, const void * msgp, size_t msgsz);
-int loc_eng_dmn_conn_glue_msgrcv(int msgqid, void *msgp, size_t msgsz);
-int loc_eng_dmn_conn_glue_msgflush(int msgqid);
-int loc_eng_dmn_conn_glue_msgunblock(int msgqid);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* LOC_ENG_DMN_CONN_GLUE_MSG_H */
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c
deleted file mode 100644
index dffcad0..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* Copyright (c) 2011-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
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-// #include <linux/stat.h>
-#include <fcntl.h>
-// #include <linux/types.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "loc_eng_dmn_conn_glue_pipe.h"
-#include "log_util.h"
-#include "platform_lib_includes.h"
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_pipeget
-
-DESCRIPTION
- create a named pipe.
-
- pipe_name - pipe name path
- mode - mode
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode)
-{
- int fd;
- int result;
-
- LOC_LOGD("%s, mode = %d\n", pipe_name, mode);
- result = mkfifo(pipe_name, 0660);
-
- if ((result == -1) && (errno != EEXIST)) {
- LOC_LOGE("failed: %s\n", strerror(errno));
- return result;
- }
-
- // The mode in mkfifo is not honoured and does not provide the
- // group permissions. Doing chmod to add group permissions.
- result = chmod (pipe_name, 0660);
- if (result != 0){
- LOC_LOGE ("%s failed to change mode for %s, error = %s\n", __func__,
- pipe_name, strerror(errno));
- }
-
- fd = open(pipe_name, mode);
- if (fd <= 0)
- {
- LOC_LOGE("failed: %s\n", strerror(errno));
- }
- LOC_LOGD("fd = %d, %s\n", fd, pipe_name);
- return fd;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_piperemove
-
-DESCRIPTION
- remove a pipe
-
- pipe_name - pipe name path
- fd - fd for the pipe
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_piperemove(const char * pipe_name, int fd)
-{
- close(fd);
- if (pipe_name) unlink(pipe_name);
- LOC_LOGD("fd = %d, %s\n", fd, pipe_name);
- return 0;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_pipewrite
-
-DESCRIPTION
- write to a pipe
-
- fd - fd of a pipe
- buf - buffer for the data to write
- sz - size of the data in buffer
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- number of bytes written or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_pipewrite(int fd, const void * buf, size_t sz)
-{
- int result;
-
- result = write(fd, buf, sz);
-
- /* @todo check for non EINTR & EAGAIN, shall not do select again, select_tut Law 7) */
-
- /* LOC_LOGD("fd = %d, buf = 0x%lx, size = %d, result = %d\n", fd, (long) buf, (int) sz, (int) result); */
- return result;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_piperead
-
-DESCRIPTION
- read from a pipe
-
- fd - fd for the pipe
- buf - buffer to hold the data read from pipe
- sz - size of the buffer
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- number of bytes read from pipe or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_piperead(int fd, void * buf, size_t sz)
-{
- int len;
-
- len = read(fd, buf, sz);
-
- /* @todo check for non EINTR & EAGAIN, shall not do select again, select_tut Law 7) */
-
- /* LOC_LOGD("fd = %d, buf = 0x%lx, size = %d, len = %d\n", fd, (long) buf, (int) sz, len); */
- return len;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_glue_pipeunblock
-
-DESCRIPTION
- unblock a pipe
-
- fd - fd for the pipe
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0 for success or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_glue_pipeunblock(int fd)
-{
- int result;
- struct flock flock_v;
- LOC_LOGD("\n");
-// result = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NDELAY);
- flock_v.l_type = F_UNLCK;
- flock_v.l_len = 32;
- result = fcntl(fd, F_SETLK, &flock_v);
- if (result < 0) {
- LOC_LOGE("fcntl failure, %s\n", strerror(errno));
- }
-
- return result;
-}
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h
deleted file mode 100644
index b2fa3a0..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright (c) 2011, 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_DMN_CONN_GLUE_PIPE_H
-#define LOC_ENG_DMN_CONN_GLUE_PIPE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include <linux/types.h>
-
-int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode);
-int loc_eng_dmn_conn_glue_piperemove(const char * pipe_name, int fd);
-int loc_eng_dmn_conn_glue_pipewrite(int fd, const void * buf, size_t sz);
-int loc_eng_dmn_conn_glue_piperead(int fd, void * buf, size_t sz);
-
-int loc_eng_dmn_conn_glue_pipeflush(int fd);
-int loc_eng_dmn_conn_glue_pipeunblock(int fd);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* LOC_ENG_DMN_CONN_GLUE_PIPE_H */
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp
deleted file mode 100644
index edd53f2..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/* Copyright (c) 2011-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
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "log_util.h"
-#include "platform_lib_includes.h"
-#include "loc_eng_msg.h"
-#include "loc_eng_dmn_conn.h"
-#include "loc_eng_dmn_conn_handler.h"
-
-void* loc_api_handle = NULL;
-
-int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, int len)
-{
- LOC_LOGD("%s:%d]\n", __func__, __LINE__);
-#ifndef DEBUG_DMN_LOC_API
- if (NULL == loc_api_handle) {
- LOC_LOGE("%s:%d] NO agps data handle\n", __func__, __LINE__);
- return 1;
- }
-
- if (NULL != loc_api_handle) {
- AGpsExtType type;
- switch (pmsg->cmsg.cmsg_if_request.type) {
- case IF_REQUEST_TYPE_SUPL:
- {
- LOC_LOGD("IF_REQUEST_TYPE_SUPL");
- type = AGPS_TYPE_SUPL;
- break;
- }
- case IF_REQUEST_TYPE_WIFI:
- {
- LOC_LOGD("IF_REQUEST_TYPE_WIFI");
- type = AGPS_TYPE_WIFI;
- break;
- }
- case IF_REQUEST_TYPE_ANY:
- {
- LOC_LOGD("IF_REQUEST_TYPE_ANY");
- type = AGPS_TYPE_ANY;
- break;
- }
- default:
- {
- LOC_LOGD("invalid IF_REQUEST_TYPE!");
- return -1;
- }
- }
- switch (pmsg->cmsg.cmsg_if_request.sender_id) {
- case IF_REQUEST_SENDER_ID_QUIPC:
- {
- LOC_LOGD("IF_REQUEST_SENDER_ID_QUIPC");
- LocEngReqRelWifi* msg =
- new LocEngReqRelWifi(loc_api_handle,
- type,
- LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC,
- (char*)pmsg->cmsg.cmsg_if_request.ssid,
- (char*)pmsg->cmsg.cmsg_if_request.password,
- true);
- msg->send();
- break;
- }
- case IF_REQUEST_SENDER_ID_MSAPM:
- {
- LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPM");
- LocEngReqRelWifi* msg =
- new LocEngReqRelWifi(loc_api_handle,
- type,
- LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM,
- (char*)pmsg->cmsg.cmsg_if_request.ssid,
- (char*)pmsg->cmsg.cmsg_if_request.password,
- true);
- msg->send();
- break;
- }
- case IF_REQUEST_SENDER_ID_MSAPU:
- {
- LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU");
- LocEngReqRelWifi* msg =
- new LocEngReqRelWifi(loc_api_handle,
- type,
- LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU,
- (char*)pmsg->cmsg.cmsg_if_request.ssid,
- (char*)pmsg->cmsg.cmsg_if_request.password,
- true);
- msg->send();
- break;
- }
- case IF_REQUEST_SENDER_ID_GPSONE_DAEMON:
- {
- LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON");
- LocEngReqRelBIT* msg =
- new LocEngReqRelBIT(loc_api_handle,
- type,
- pmsg->cmsg.cmsg_if_request.ipv4_addr,
- (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr,
- true);
- msg->send();
- break;
- }
- default:
- {
- LOC_LOGD("invalid IF_REQUEST_SENDER_ID!");
- return -1;
- }
- }
- }
-
-#else
- loc_eng_dmn_conn_loc_api_server_data_conn(LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, GPSONE_LOC_API_IF_REQUEST_SUCCESS);
-#endif
- return 0;
-}
-
-int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, int len)
-{
- LOC_LOGD("%s:%d]\n", __func__, __LINE__);
-#ifndef DEBUG_DMN_LOC_API
- AGpsExtType type;
- switch (pmsg->cmsg.cmsg_if_request.type) {
- case IF_REQUEST_TYPE_SUPL:
- {
- LOC_LOGD("IF_REQUEST_TYPE_SUPL");
- type = AGPS_TYPE_SUPL;
- break;
- }
- case IF_REQUEST_TYPE_WIFI:
- {
- LOC_LOGD("IF_REQUEST_TYPE_WIFI");
- type = AGPS_TYPE_WIFI;
- break;
- }
- case IF_REQUEST_TYPE_ANY:
- {
- LOC_LOGD("IF_REQUEST_TYPE_ANY");
- type = AGPS_TYPE_ANY;
- break;
- }
- default:
- {
- LOC_LOGD("invalid IF_REQUEST_TYPE!");
- return -1;
- }
- }
- switch (pmsg->cmsg.cmsg_if_request.sender_id) {
- case IF_REQUEST_SENDER_ID_QUIPC:
- {
- LOC_LOGD("IF_REQUEST_SENDER_ID_QUIPC");
- LocEngReqRelWifi* msg =
- new LocEngReqRelWifi(loc_api_handle,
- type,
- LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC,
- (char*)pmsg->cmsg.cmsg_if_request.ssid,
- (char*)pmsg->cmsg.cmsg_if_request.password,
- false);
- msg->send();
- break;
- }
- case IF_REQUEST_SENDER_ID_MSAPM:
- {
- LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPM");
- LocEngReqRelWifi* msg =
- new LocEngReqRelWifi(loc_api_handle,
- type,
- LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM,
- (char*)pmsg->cmsg.cmsg_if_request.ssid,
- (char*)pmsg->cmsg.cmsg_if_request.password,
- false);
- msg->send();
- break;
- }
- case IF_REQUEST_SENDER_ID_MSAPU:
- {
- LOC_LOGD("IF_REQUEST_SENDER_ID_MSAPU");
- LocEngReqRelWifi* msg =
- new LocEngReqRelWifi(loc_api_handle,
- type,
- LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU,
- (char*)pmsg->cmsg.cmsg_if_request.ssid,
- (char*)pmsg->cmsg.cmsg_if_request.password,
- false);
- msg->send();
- break;
- }
- case IF_REQUEST_SENDER_ID_GPSONE_DAEMON:
- {
- LOC_LOGD("IF_REQUEST_SENDER_ID_GPSONE_DAEMON");
- LocEngReqRelBIT* msg =
- new LocEngReqRelBIT(loc_api_handle,
- type,
- pmsg->cmsg.cmsg_if_request.ipv4_addr,
- (char*)pmsg->cmsg.cmsg_if_request.ipv6_addr,
- false);
- msg->send();
- break;
- }
- default:
- {
- LOC_LOGD("invalid IF_REQUEST_SENDER_ID!");
- return -1;
- }
- }
-#else
- loc_eng_dmn_conn_loc_api_server_data_conn(LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON, GPSONE_LOC_API_IF_RELEASE_SUCCESS);
-#endif
- return 0;
-}
-
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h
deleted file mode 100644
index 8cbb353..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Copyright (c) 2011-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
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef LOC_ENG_DATA_SERVER_HANDLER
-#define LOC_ENG_DATA_SERVER_HANDLER
-
-#include <linux/types.h>
-#include <arpa/inet.h>
-
-//for SSID_BUF_SIZE
-#include "hardware/gps.h"
-
-#ifndef SSID_BUF_SIZE
- #define SSID_BUF_SIZE (32+1)
-#endif
-
-enum {
- /* 0x0 - 0xEF is reserved for daemon internal */
- GPSONE_LOC_API_IF_REQUEST = 0xF0,
- GPSONE_LOC_API_IF_RELEASE,
- GPSONE_LOC_API_RESPONSE,
- GPSONE_UNBLOCK,
-};
-
-enum {
- GPSONE_LOC_API_IF_REQUEST_SUCCESS = 0xF0,
- GPSONE_LOC_API_IF_RELEASE_SUCCESS,
- GPSONE_LOC_API_IF_FAILURE,
-};
-
-
-struct ctrl_msg_response {
- int result;
-};
-
-struct ctrl_msg_unblock {
- int reserved;
-};
-
-typedef enum {
- IF_REQUEST_TYPE_SUPL = 0,
- IF_REQUEST_TYPE_WIFI,
- IF_REQUEST_TYPE_ANY
-} ctrl_if_req_type_e_type;
-
-typedef enum {
- IF_REQUEST_SENDER_ID_QUIPC = 0,
- IF_REQUEST_SENDER_ID_MSAPM,
- IF_REQUEST_SENDER_ID_MSAPU,
- IF_REQUEST_SENDER_ID_GPSONE_DAEMON,
- IF_REQUEST_SENDER_ID_MODEM
-} ctrl_if_req_sender_id_e_type;
-
-struct ctrl_msg_if_request {
- ctrl_if_req_type_e_type type;
- ctrl_if_req_sender_id_e_type sender_id;
- unsigned long ipv4_addr;
- unsigned char ipv6_addr[16];
- char ssid[SSID_BUF_SIZE];
- char password[SSID_BUF_SIZE];
-};
-
-/* do not change this structure */
-struct ctrl_msgbuf {
- size_t msgsz;
- uint16_t reserved1;
- uint32_t reserved2;
- uint8_t ctrl_type;
- union {
- struct ctrl_msg_response cmsg_response;
- struct ctrl_msg_unblock cmsg_unblock;
- struct ctrl_msg_if_request cmsg_if_request;
- } cmsg;
-};
-
-extern void* loc_api_handle;
-
-int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, int len);
-int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, int len);
-
-#endif /* LOC_ENG_DATA_SERVER_HANDLER */
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c
deleted file mode 100644
index 9fed9d4..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/* Copyright (c) 2011, 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 <stdio.h>
-
-#include "log_util.h"
-#include "platform_lib_includes.h"
-#include "loc_eng_dmn_conn_thread_helper.h"
-
-/*===========================================================================
-FUNCTION thelper_signal_init
-
-DESCRIPTION
- This function will initialize the conditional variable resources.
-
- thelper - thelper instance
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int thelper_signal_init(struct loc_eng_dmn_conn_thelper * thelper)
-{
- int result;
- thelper->thread_exit = 0;
- thelper->thread_ready = 0;
- result = pthread_cond_init( &thelper->thread_cond, NULL);
- if (result) {
- return result;
- }
-
- result = pthread_mutex_init(&thelper->thread_mutex, NULL);
- if (result) {
- pthread_cond_destroy(&thelper->thread_cond);
- }
- return result;
-}
-
-/*===========================================================================
-FUNCTION
-
-DESCRIPTION
- This function will destroy the conditional variable resources
-
- thelper - pointer to thelper instance
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int thelper_signal_destroy(struct loc_eng_dmn_conn_thelper * thelper)
-{
- int result, ret_result = 0;
- result = pthread_cond_destroy( &thelper->thread_cond);
- if (result) {
- ret_result = result;
- }
-
- result = pthread_mutex_destroy(&thelper->thread_mutex);
- if (result) {
- ret_result = result;
- }
-
- return ret_result;
-}
-
-/*===========================================================================
-FUNCTION thelper_signal_wait
-
-DESCRIPTION
- This function will be blocked on the conditional variable until thelper_signal_ready
- is called
-
- thelper - pointer to thelper instance
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int thelper_signal_wait(struct loc_eng_dmn_conn_thelper * thelper)
-{
- int result = 0;
-
- pthread_mutex_lock(&thelper->thread_mutex);
- if (!thelper->thread_ready && !thelper->thread_exit) {
- result = pthread_cond_wait(&thelper->thread_cond, &thelper->thread_mutex);
- }
-
- if (thelper->thread_exit) {
- result = -1;
- }
- pthread_mutex_unlock(&thelper->thread_mutex);
-
- return result;
-}
-
-/*===========================================================================
-FUNCTION thelper_signal_ready
-
-DESCRIPTION
- This function will wake up the conditional variable
-
- thelper - pointer to thelper instance
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int thelper_signal_ready(struct loc_eng_dmn_conn_thelper * thelper)
-{
- int result;
-
- LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
-
- pthread_mutex_lock(&thelper->thread_mutex);
- thelper->thread_ready = 1;
- result = pthread_cond_signal(&thelper->thread_cond);
- pthread_mutex_unlock(&thelper->thread_mutex);
-
- return result;
-}
-
-/*===========================================================================
-FUNCTION thelper_signal_block
-
-DESCRIPTION
- This function will set the thread ready to 0 to block the thelper_signal_wait
-
- thelper - pointer to thelper instance
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- if thread_ready is set
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int thelper_signal_block(struct loc_eng_dmn_conn_thelper * thelper)
-{
- int result = thelper->thread_ready;
-
- LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
-
- pthread_mutex_lock(&thelper->thread_mutex);
- thelper->thread_ready = 0;
- pthread_mutex_unlock(&thelper->thread_mutex);
-
- return result;
-}
-
-/*===========================================================================
-FUNCTION thelper_main
-
-DESCRIPTION
- This function is the main thread. It will be launched as a child thread
-
- data - pointer to the instance
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- NULL
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static void * thelper_main(void *data)
-{
- int result = 0;
- struct loc_eng_dmn_conn_thelper * thelper = (struct loc_eng_dmn_conn_thelper *) data;
-
- if (thelper->thread_proc_init) {
- result = thelper->thread_proc_init(thelper->thread_context);
- if (result < 0) {
- thelper->thread_exit = 1;
- thelper_signal_ready(thelper);
- LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper);
- return NULL;
- }
- }
-
- thelper_signal_ready(thelper);
-
- if (thelper->thread_proc_pre) {
- result = thelper->thread_proc_pre(thelper->thread_context);
- if (result < 0) {
- thelper->thread_exit = 1;
- LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper);
- return NULL;
- }
- }
-
- do {
- if (thelper->thread_proc) {
- result = thelper->thread_proc(thelper->thread_context);
- if (result < 0) {
- thelper->thread_exit = 1;
- LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper);
- }
- }
- } while (thelper->thread_exit == 0);
-
- if (thelper->thread_proc_post) {
- result = thelper->thread_proc_post(thelper->thread_context);
- }
-
- if (result != 0) {
- LOC_LOGE("%s:%d] error: 0x%lx\n", __func__, __LINE__, (long) thelper);
- }
- return NULL;
-}
-
-static void thelper_main_2(void *data)
-{
- thelper_main(data);
- return;
-}
-
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_launch_thelper
-
-DESCRIPTION
- This function will initialize the thread context and launch the thelper_main
-
- thelper - pointer to thelper instance
- thread_proc_init - The initialization function pointer
- thread_proc_pre - The function to call before task loop and after initialization
- thread_proc - The task loop
- thread_proc_post - The function to call after the task loop
- context - the context for the above four functions
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_launch_thelper(struct loc_eng_dmn_conn_thelper * thelper,
- int (*thread_proc_init) (void * context),
- int (*thread_proc_pre) (void * context),
- int (*thread_proc) (void * context),
- int (*thread_proc_post) (void * context),
- thelper_create_thread create_thread_cb,
- void * context)
-{
- int result;
-
- thelper_signal_init(thelper);
-
- if (context) {
- thelper->thread_context = context;
- }
-
- thelper->thread_proc_init = thread_proc_init;
- thelper->thread_proc_pre = thread_proc_pre;
- thelper->thread_proc = thread_proc;
- thelper->thread_proc_post = thread_proc_post;
-
- LOC_LOGD("%s:%d] 0x%lx call pthread_create\n", __func__, __LINE__, (long) thelper);
- if (create_thread_cb) {
- result = 0;
- thelper->thread_id = create_thread_cb("loc_eng_dmn_conn",
- thelper_main_2, (void *)thelper);
- } else {
- result = pthread_create(&thelper->thread_id, NULL,
- thelper_main, (void *)thelper);
- }
-
- if (result != 0) {
- LOC_LOGE("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
- return -1;
- }
-
- LOC_LOGD("%s:%d] 0x%lx pthread_create done\n", __func__, __LINE__, (long) thelper);
-
- thelper_signal_wait(thelper);
-
- LOC_LOGD("%s:%d] 0x%lx pthread ready\n", __func__, __LINE__, (long) thelper);
- return thelper->thread_exit;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_unblock_thelper
-
-DESCRIPTION
- This function unblocks thelper_main to release the thread
-
- thelper - pointer to thelper instance
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_unblock_thelper(struct loc_eng_dmn_conn_thelper * thelper)
-{
- LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
- thelper->thread_exit = 1;
- return 0;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_dmn_conn_join_thelper
-
- thelper - pointer to thelper instance
-
-DESCRIPTION
- This function will wait for the thread of thelper_main to finish
-
-DEPENDENCIES
- None
-
-RETURN VALUE
- 0: success or negative value for failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_dmn_conn_join_thelper(struct loc_eng_dmn_conn_thelper * thelper)
-{
- int result;
-
- LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
- result = pthread_join(thelper->thread_id, NULL);
- if (result != 0) {
- LOC_LOGE("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
- }
- LOC_LOGD("%s:%d] 0x%lx\n", __func__, __LINE__, (long) thelper);
-
- thelper_signal_destroy(thelper);
-
- return result;
-}
-
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h b/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h
deleted file mode 100644
index 89e598b..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Copyright (c) 2011, 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_DMN_CONN_THREAD_HELPER_H__
-#define __LOC_ENG_DMN_CONN_THREAD_HELPER_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include <pthread.h>
-
-struct loc_eng_dmn_conn_thelper {
- unsigned char thread_exit;
- unsigned char thread_ready;
- pthread_cond_t thread_cond;
- pthread_mutex_t thread_mutex;
- pthread_t thread_id;
- void * thread_context;
- int (*thread_proc_init) (void * context);
- int (*thread_proc_pre) (void * context);
- int (*thread_proc) (void * context);
- int (*thread_proc_post) (void * context);
-};
-
-typedef pthread_t (* thelper_create_thread)(const char* name, void (*start)(void *), void* arg);
-int loc_eng_dmn_conn_launch_thelper(struct loc_eng_dmn_conn_thelper * thelper,
- int (*thread_proc_init) (void * context),
- int (*thread_proc_pre) (void * context),
- int (*thread_proc) (void * context),
- int (*thread_proc_post) (void * context),
- thelper_create_thread create_thread_cb,
- void * context);
-
-int loc_eng_dmn_conn_unblock_thelper(struct loc_eng_dmn_conn_thelper * thelper);
-int loc_eng_dmn_conn_join_thelper(struct loc_eng_dmn_conn_thelper * thelper);
-
-/* if only need to use signal */
-int thelper_signal_init(struct loc_eng_dmn_conn_thelper * thelper);
-int thelper_signal_destroy(struct loc_eng_dmn_conn_thelper * thelper);
-int thelper_signal_wait(struct loc_eng_dmn_conn_thelper * thelper);
-int thelper_signal_ready(struct loc_eng_dmn_conn_thelper * thelper);
-int thelper_signal_block(struct loc_eng_dmn_conn_thelper * thelper);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __LOC_ENG_DMN_CONN_THREAD_HELPER_H__ */
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_log.cpp b/gps/loc_api/libloc_api_50001/loc_eng_log.cpp
deleted file mode 100644
index 3a34167..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_log.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (c) 2011-2013, 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_NDDEBUG 0
-#define LOG_TAG "LocSvc_eng"
-
-#include "loc_log.h"
-#include "loc_eng_log.h"
-
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_log.h b/gps/loc_api/libloc_api_50001/loc_eng_log.h
deleted file mode 100644
index a68bd84..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_log.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (c) 2011-2013, 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_LOG_H
-#define LOC_ENG_LOG_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#include <ctype.h>
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LOC_ENG_LOG_H */
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_msg.h b/gps/loc_api/libloc_api_50001/loc_eng_msg.h
deleted file mode 100644
index c2e991a..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_msg.h
+++ /dev/null
@@ -1,296 +0,0 @@
-/* Copyright (c) 2011-2013, 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_MSG_H
-#define LOC_ENG_MSG_H
-
-
-#include "hardware/gps.h"
-#include <gps_extended.h>
-#include <stdlib.h>
-#include <string.h>
-#include <log_util.h>
-#include <loc_eng_log.h>
-#include <loc_eng.h>
-#include <MsgTask.h>
-#include <LocEngAdapter.h>
-
-#ifndef SSID_BUF_SIZE
- #define SSID_BUF_SIZE (32+1)
-#endif
-#ifdef USE_GLIB
-
-#include <glib.h>
-
-#endif /* USE_GLIB */
-#include "platform_lib_includes.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-using namespace loc_core;
-
-struct LocEngPositionMode : public LocMsg {
- LocEngAdapter* mAdapter;
- const LocPosMode mPosMode;
- LocEngPositionMode(LocEngAdapter* adapter, LocPosMode &mode);
- virtual void proc() const;
- virtual void log() const;
- void send() const;
-};
-
-
-struct LocEngStartFix : public LocMsg {
- LocEngAdapter* mAdapter;
- LocEngStartFix(LocEngAdapter* adapter);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
- void send() const;
-};
-
-struct LocEngStopFix : public LocMsg {
- LocEngAdapter* mAdapter;
- LocEngStopFix(LocEngAdapter* adapter);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
- void send() const;
-};
-
-struct LocEngReportPosition : public LocMsg {
- LocAdapterBase* mAdapter;
- const UlpLocation mLocation;
- const GpsLocationExtended mLocationExtended;
- const void* mLocationExt;
- const enum loc_sess_status mStatus;
- const LocPosTechMask mTechMask;
- LocEngReportPosition(LocAdapterBase* adapter,
- UlpLocation &loc,
- GpsLocationExtended &locExtended,
- void* locExt,
- enum loc_sess_status st,
- LocPosTechMask technology);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
- void send() const;
-};
-
-struct LocEngReportSv : public LocMsg {
- LocAdapterBase* mAdapter;
- const GpsSvStatus mSvStatus;
- const GpsLocationExtended mLocationExtended;
- const void* mSvExt;
- LocEngReportSv(LocAdapterBase* adapter,
- GpsSvStatus &sv,
- GpsLocationExtended &locExtended,
- void* svExtended);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
- void send() const;
-};
-
-struct LocEngReportStatus : public LocMsg {
- LocAdapterBase* mAdapter;
- const GpsStatusValue mStatus;
- LocEngReportStatus(LocAdapterBase* adapter,
- GpsStatusValue engineStatus);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngReportNmea : public LocMsg {
- void* mLocEng;
- char* const mNmea;
- const int mLen;
- LocEngReportNmea(void* locEng,
- const char* data, int len);
- inline virtual ~LocEngReportNmea()
- {
- delete[] mNmea;
- }
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngReportXtraServer : public LocMsg {
- void* mLocEng;
- int mMaxLen;
- char *mServers;
- LocEngReportXtraServer(void* locEng,
- const char *url1, const char *url2,
- const char *url3, const int maxlength);
- inline virtual ~LocEngReportXtraServer()
- {
- delete[] mServers;
- }
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngSuplEsOpened : public LocMsg {
- void* mLocEng;
- LocEngSuplEsOpened(void* locEng);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngSuplEsClosed : public LocMsg {
- void* mLocEng;
- LocEngSuplEsClosed(void* locEng);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngRequestSuplEs : public LocMsg {
- void* mLocEng;
- const int mID;
- LocEngRequestSuplEs(void* locEng, int id);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngRequestATL : public LocMsg {
- void* mLocEng;
- const int mID;
- const AGpsExtType mType;
- LocEngRequestATL(void* locEng, int id,
- AGpsExtType agps_type);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngReleaseATL : public LocMsg {
- void* mLocEng;
- const int mID;
- LocEngReleaseATL(void* locEng, int id);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngReqRelBIT : public LocMsg {
- void* mLocEng;
- const AGpsExtType mType;
- const int mIPv4Addr;
- char* const mIPv6Addr;
- const bool mIsReq;
- LocEngReqRelBIT(void* instance, AGpsExtType type,
- int ipv4, char* ipv6, bool isReq);
- virtual ~LocEngReqRelBIT();
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
- void send() const;
-};
-
-struct LocEngReqRelWifi : public LocMsg {
- void* mLocEng;
- const AGpsExtType mType;
- const loc_if_req_sender_id_e_type mSenderId;
- char* const mSSID;
- char* const mPassword;
- const bool mIsReq;
- LocEngReqRelWifi(void* locEng, AGpsExtType type,
- loc_if_req_sender_id_e_type sender_id,
- char* s, char* p, bool isReq);
- virtual ~LocEngReqRelWifi();
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
- void send() const;
-};
-
-struct LocEngRequestXtra : public LocMsg {
- void* mLocEng;
- LocEngRequestXtra(void* locEng);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngRequestTime : public LocMsg {
- void* mLocEng;
- LocEngRequestTime(void* locEng);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngRequestNi : public LocMsg {
- void* mLocEng;
- const GpsNiNotification mNotify;
- const void *mPayload;
- LocEngRequestNi(void* locEng,
- GpsNiNotification &notif,
- const void* data);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngDown : public LocMsg {
- void* mLocEng;
- LocEngDown(void* locEng);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngUp : public LocMsg {
- void* mLocEng;
- LocEngUp(void* locEng);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
-};
-
-struct LocEngGetZpp : public LocMsg {
- LocEngAdapter* mAdapter;
- LocEngGetZpp(LocEngAdapter* adapter);
- virtual void proc() const;
- void locallog() const;
- virtual void log() const;
- void send() const;
-};
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* LOC_ENG_MSG_H */
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_ni.cpp b/gps/loc_api/libloc_api_50001/loc_eng_ni.cpp
deleted file mode 100644
index 4597b98..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_ni.cpp
+++ /dev/null
@@ -1,414 +0,0 @@
-/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#define LOG_NDDEBUG 0
-#define LOG_TAG "LocSvc_eng"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/time.h>
-#include <pthread.h>
-#include <errno.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <time.h>
-#include <MsgTask.h>
-
-#include <loc_eng.h>
-
-#include "log_util.h"
-#include "platform_lib_includes.h"
-
-using namespace loc_core;
-
-/*=============================================================================
- *
- * DATA DECLARATION
- *
- *============================================================================*/
-
-/*=============================================================================
- *
- * FUNCTION DECLARATIONS
- *
- *============================================================================*/
-static void* ni_thread_proc(void *args);
-
-struct LocEngInformNiResponse : public LocMsg {
- LocEngAdapter* mAdapter;
- const GpsUserResponseType mResponse;
- const void *mPayload;
- inline LocEngInformNiResponse(LocEngAdapter* adapter,
- GpsUserResponseType resp,
- const void* data) :
- LocMsg(), mAdapter(adapter),
- mResponse(resp), mPayload(data)
- {
- locallog();
- }
- inline ~LocEngInformNiResponse()
- {
- // this is a bit weird since mPayload is not
- // allocated by this class. But there is no better way.
- // mPayload actually won't be NULL here.
- free((void*)mPayload);
- }
- inline virtual void proc() const
- {
- mAdapter->informNiResponse(mResponse, mPayload);
- }
- inline void locallog() const
- {
- LOC_LOGV("LocEngInformNiResponse - "
- "response: %s\n mPayload: %p",
- loc_get_ni_response_name(mResponse),
- mPayload);
- }
- inline virtual void log() const
- {
- locallog();
- }
-};
-
-/*===========================================================================
-
-FUNCTION loc_eng_ni_request_handler
-
-DESCRIPTION
- Displays the NI request and awaits user input. If a previous request is
- in session, it is ignored.
-
-RETURN VALUE
- none
-
-===========================================================================*/
-void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
- const GpsNiNotification *notif,
- const void* passThrough)
-{
- ENTRY_LOG();
- char lcs_addr[32]; // Decoded LCS address for UMTS CP NI
- loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data;
- loc_eng_ni_session_s_type* pSession = NULL;
-
- if (NULL == loc_eng_data.ni_notify_cb) {
- EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet.");
- return;
- }
-
- if (notif->ni_type == GPS_NI_TYPE_EMERGENCY_SUPL) {
- if (NULL != loc_eng_ni_data_p->sessionEs.rawRequest) {
- LOC_LOGW("loc_eng_ni_request_handler, supl es NI in progress, new supl es NI ignored, type: %d",
- notif->ni_type);
- if (NULL != passThrough) {
- free((void*)passThrough);
- }
- } else {
- pSession = &loc_eng_ni_data_p->sessionEs;
- }
- } else {
- if (NULL != loc_eng_ni_data_p->session.rawRequest ||
- NULL != loc_eng_ni_data_p->sessionEs.rawRequest) {
- LOC_LOGW("loc_eng_ni_request_handler, supl NI in progress, new supl NI ignored, type: %d",
- notif->ni_type);
- if (NULL != passThrough) {
- free((void*)passThrough);
- }
- } else {
- pSession = &loc_eng_ni_data_p->session;
- }
- }
-
-
- if (pSession) {
- /* Save request */
- pSession->rawRequest = (void*)passThrough;
- pSession->reqID = ++loc_eng_ni_data_p->reqIDCounter;
- pSession->adapter = loc_eng_data.adapter;
-
- /* Fill in notification */
- ((GpsNiNotification*)notif)->notification_id = pSession->reqID;
-
- if (notif->notify_flags == GPS_NI_PRIVACY_OVERRIDE)
- {
- loc_eng_mute_one_session(loc_eng_data);
- }
-
- /* Log requestor ID and text for debugging */
- LOC_LOGI("Notification: notif_type: %d, timeout: %d, default_resp: %d", notif->ni_type, notif->timeout, notif->default_response);
- LOC_LOGI(" requestor_id: %s (encoding: %d)", notif->requestor_id, notif->requestor_id_encoding);
- LOC_LOGI(" text: %s text (encoding: %d)", notif->text, notif->text_encoding);
- if (notif->extras[0])
- {
- LOC_LOGI(" extras: %s", notif->extras);
- }
-
- /* For robustness, spawn a thread at this point to timeout to clear up the notification status, even though
- * the OEM layer in java does not do so.
- **/
- pSession->respTimeLeft = 5 + (notif->timeout != 0 ? notif->timeout : LOC_NI_NO_RESPONSE_TIME);
- LOC_LOGI("Automatically sends 'no response' in %d seconds (to clear status)\n", pSession->respTimeLeft);
-
- int rc = 0;
- rc = pthread_create(&pSession->thread, NULL, ni_thread_proc, pSession);
- if (rc)
- {
- LOC_LOGE("Loc NI thread is not created.\n");
- }
- rc = pthread_detach(pSession->thread);
- if (rc)
- {
- LOC_LOGE("Loc NI thread is not detached.\n");
- }
-
- CALLBACK_LOG_CALLFLOW("ni_notify_cb - id", %d, notif->notification_id);
- loc_eng_data.ni_notify_cb((GpsNiNotification*)notif);
- }
- EXIT_LOG(%s, VOID_RET);
-}
-
-/*===========================================================================
-
-FUNCTION ni_thread_proc
-
-===========================================================================*/
-static void* ni_thread_proc(void *args)
-{
- ENTRY_LOG();
-
- loc_eng_ni_session_s_type* pSession = (loc_eng_ni_session_s_type*)args;
- int rc = 0; /* return code from pthread calls */
-
- struct timeval present_time;
- struct timespec expire_time;
-
- LOC_LOGD("Starting Loc NI thread...\n");
- pthread_mutex_lock(&pSession->tLock);
- /* Calculate absolute expire time */
- gettimeofday(&present_time, NULL);
- expire_time.tv_sec = present_time.tv_sec + pSession->respTimeLeft;
- expire_time.tv_nsec = present_time.tv_usec * 1000;
- LOC_LOGD("ni_thread_proc-Time out set for abs time %ld with delay %d sec\n",
- (long) expire_time.tv_sec, pSession->respTimeLeft );
-
- while (!pSession->respRecvd)
- {
- rc = pthread_cond_timedwait(&pSession->tCond,
- &pSession->tLock,
- &expire_time);
- if (rc == ETIMEDOUT)
- {
- pSession->resp = GPS_NI_RESPONSE_NORESP;
- LOC_LOGD("ni_thread_proc-Thread time out after valting for specified time. Ret Val %d\n",rc );
- break;
- }
- }
- LOC_LOGD("ni_thread_proc-Java layer has sent us a user response and return value from "
- "pthread_cond_timedwait = %d\n",rc );
- pSession->respRecvd = FALSE; /* Reset the user response flag for the next session*/
-
- LOC_LOGD("pSession->resp is %d\n",pSession->resp);
-
- // adding this check to support modem restart, in which case, we need the thread
- // to exit without calling sending data. We made sure that rawRequest is NULL in
- // loc_eng_ni_reset_on_engine_restart()
- LocEngAdapter* adapter = pSession->adapter;
- LocEngInformNiResponse *msg = NULL;
-
- if (NULL != pSession->rawRequest) {
- if (pSession->resp != GPS_NI_RESPONSE_IGNORE) {
- LOC_LOGD("pSession->resp != GPS_NI_RESPONSE_IGNORE \n");
- msg = new LocEngInformNiResponse(adapter,
- pSession->resp,
- pSession->rawRequest);
- } else {
- LOC_LOGD("this is the ignore reply for SUPL ES\n");
- free(pSession->rawRequest);
- }
- pSession->rawRequest = NULL;
- }
- pthread_mutex_unlock(&pSession->tLock);
-
- pSession->respTimeLeft = 0;
- pSession->reqID = 0;
-
- if (NULL != msg) {
- LOC_LOGD("ni_thread_proc: adapter->sendMsg(msg)\n");
- adapter->sendMsg(msg);
- }
-
- EXIT_LOG(%s, VOID_RET);
- return NULL;
-}
-
-void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data)
-{
- ENTRY_LOG();
- loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data;
-
- if (NULL == loc_eng_data.ni_notify_cb) {
- EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet.");
- return;
- }
-
- // only if modem has requested but then died.
- if (NULL != loc_eng_ni_data_p->sessionEs.rawRequest) {
- free(loc_eng_ni_data_p->sessionEs.rawRequest);
- loc_eng_ni_data_p->sessionEs.rawRequest = NULL;
-
- pthread_mutex_lock(&loc_eng_ni_data_p->sessionEs.tLock);
- // the goal is to wake up ni_thread_proc
- // and let it exit.
- loc_eng_ni_data_p->sessionEs.respRecvd = TRUE;
- pthread_cond_signal(&loc_eng_ni_data_p->sessionEs.tCond);
- pthread_mutex_unlock(&loc_eng_ni_data_p->sessionEs.tLock);
- }
-
- if (NULL != loc_eng_ni_data_p->session.rawRequest) {
- free(loc_eng_ni_data_p->session.rawRequest);
- loc_eng_ni_data_p->session.rawRequest = NULL;
-
- pthread_mutex_lock(&loc_eng_ni_data_p->session.tLock);
- // the goal is to wake up ni_thread_proc
- // and let it exit.
- loc_eng_ni_data_p->session.respRecvd = TRUE;
- pthread_cond_signal(&loc_eng_ni_data_p->session.tCond);
- pthread_mutex_unlock(&loc_eng_ni_data_p->session.tLock);
- }
-
- EXIT_LOG(%s, VOID_RET);
-}
-
-/*===========================================================================
-FUNCTION loc_eng_ni_init
-
-DESCRIPTION
- This function initializes the NI interface
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data, GpsNiExtCallbacks *callbacks)
-{
- ENTRY_LOG_CALLFLOW();
-
- if(callbacks == NULL)
- EXIT_LOG(%s, "loc_eng_ni_init: failed, cb is NULL");
- else if (NULL == callbacks->notify_cb) {
- EXIT_LOG(%s, "loc_eng_ni_init: failed, no cb.");
- } else if (NULL != loc_eng_data.ni_notify_cb) {
- EXIT_LOG(%s, "loc_eng_ni_init: already inited.");
- } else {
- loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data;
- loc_eng_ni_data_p->sessionEs.respTimeLeft = 0;
- loc_eng_ni_data_p->sessionEs.respRecvd = FALSE;
- loc_eng_ni_data_p->sessionEs.rawRequest = NULL;
- loc_eng_ni_data_p->sessionEs.reqID = 0;
- pthread_cond_init(&loc_eng_ni_data_p->sessionEs.tCond, NULL);
- pthread_mutex_init(&loc_eng_ni_data_p->sessionEs.tLock, NULL);
-
- loc_eng_ni_data_p->session.respTimeLeft = 0;
- loc_eng_ni_data_p->session.respRecvd = FALSE;
- loc_eng_ni_data_p->session.rawRequest = NULL;
- loc_eng_ni_data_p->session.reqID = 0;
- pthread_cond_init(&loc_eng_ni_data_p->session.tCond, NULL);
- pthread_mutex_init(&loc_eng_ni_data_p->session.tLock, NULL);
-
- loc_eng_data.ni_notify_cb = callbacks->notify_cb;
- EXIT_LOG(%s, VOID_RET);
- }
-}
-
-/*===========================================================================
-FUNCTION loc_eng_ni_respond
-
-DESCRIPTION
- This function receives user response from upper layer framework
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data,
- int notif_id, GpsUserResponseType user_response)
-{
- ENTRY_LOG_CALLFLOW();
- loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data;
- loc_eng_ni_session_s_type* pSession = NULL;
-
- if (NULL == loc_eng_data.ni_notify_cb) {
- EXIT_LOG(%s, "loc_eng_ni_init hasn't happened yet.");
- return;
- }
-
- if (notif_id == loc_eng_ni_data_p->sessionEs.reqID &&
- NULL != loc_eng_ni_data_p->sessionEs.rawRequest) {
- pSession = &loc_eng_ni_data_p->sessionEs;
- // ignore any SUPL NI non-Es session if a SUPL NI ES is accepted
- if (user_response == GPS_NI_RESPONSE_ACCEPT &&
- NULL != loc_eng_ni_data_p->session.rawRequest) {
- pthread_mutex_lock(&loc_eng_ni_data_p->session.tLock);
- loc_eng_ni_data_p->session.resp = GPS_NI_RESPONSE_IGNORE;
- loc_eng_ni_data_p->session.respRecvd = TRUE;
- pthread_cond_signal(&loc_eng_ni_data_p->session.tCond);
- pthread_mutex_unlock(&loc_eng_ni_data_p->session.tLock);
- }
- } else if (notif_id == loc_eng_ni_data_p->session.reqID &&
- NULL != loc_eng_ni_data_p->session.rawRequest) {
- pSession = &loc_eng_ni_data_p->session;
- }
-
- if (pSession) {
- LOC_LOGI("loc_eng_ni_respond: send user response %d for notif %d", user_response, notif_id);
- pthread_mutex_lock(&pSession->tLock);
- pSession->resp = user_response;
- pSession->respRecvd = TRUE;
- pthread_cond_signal(&pSession->tCond);
- pthread_mutex_unlock(&pSession->tLock);
- }
- else {
- LOC_LOGE("loc_eng_ni_respond: notif_id %d not an active session", notif_id);
- }
-
- EXIT_LOG(%s, VOID_RET);
-}
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_ni.h b/gps/loc_api/libloc_api_50001/loc_eng_ni.h
deleted file mode 100644
index 068f5cd..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_ni.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright (c) 2009,2011,2014 The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef LOC_ENG_NI_H
-#define LOC_ENG_NI_H
-
-#include <stdbool.h>
-#include <LocEngAdapter.h>
-
-#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */
-#define LOC_NI_NOTIF_KEY_ADDRESS "Address"
-#define GPS_NI_RESPONSE_IGNORE 4
-
-typedef struct {
- pthread_t thread; /* NI thread */
- int respTimeLeft; /* examine time for NI response */
- bool respRecvd; /* NI User reponse received or not from Java layer*/
- void* rawRequest;
- int reqID; /* ID to check against response */
- GpsUserResponseType resp;
- pthread_cond_t tCond;
- pthread_mutex_t tLock;
- LocEngAdapter* adapter;
-} loc_eng_ni_session_s_type;
-
-typedef struct {
- loc_eng_ni_session_s_type session; /* SUPL NI Session */
- loc_eng_ni_session_s_type sessionEs; /* Emergency SUPL NI Session */
- int reqIDCounter;
-} loc_eng_ni_data_s_type;
-
-
-#endif /* LOC_ENG_NI_H */
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp b/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp
deleted file mode 100644
index 842eda1..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_nmea.cpp
+++ /dev/null
@@ -1,833 +0,0 @@
-/* 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
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#define LOG_NDDEBUG 0
-#define LOG_TAG "LocSvc_eng_nmea"
-#define GPS_PRN_START 1
-#define GPS_PRN_END 32
-#define GLONASS_PRN_START 65
-#define GLONASS_PRN_END 96
-#include <loc_eng.h>
-#include <loc_eng_nmea.h>
-#include <math.h>
-#include "log_util.h"
-
-/*===========================================================================
-FUNCTION loc_eng_nmea_send
-
-DESCRIPTION
- send out NMEA sentence
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- Total length of the nmea sentence
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p)
-{
- struct timeval tv;
- gettimeofday(&tv, (struct timezone *) NULL);
- int64_t now = tv.tv_sec * 1000LL + tv.tv_usec / 1000;
- CALLBACK_LOG_CALLFLOW("nmea_cb", %p, pNmea);
- if (loc_eng_data_p->nmea_cb != NULL)
- loc_eng_data_p->nmea_cb(now, pNmea, length);
- LOC_LOGD("NMEA <%s", pNmea);
-}
-
-/*===========================================================================
-FUNCTION loc_eng_nmea_put_checksum
-
-DESCRIPTION
- Generate NMEA sentences generated based on position report
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- Total length of the nmea sentence
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_nmea_put_checksum(char *pNmea, int maxSize)
-{
- uint8_t checksum = 0;
- int length = 0;
-
- pNmea++; //skip the $
- while (*pNmea != '\0')
- {
- checksum ^= *pNmea++;
- length++;
- }
-
- int checksumLength = snprintf(pNmea,(maxSize-length-1),"*%02X\r\n", checksum);
- return (length + checksumLength);
-}
-
-/*===========================================================================
-FUNCTION loc_eng_nmea_generate_pos
-
-DESCRIPTION
- Generate NMEA sentences generated based on position report
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
- const UlpLocation &location,
- const GpsLocationExtended &locationExtended,
- unsigned char generate_nmea)
-{
- ENTRY_LOG();
-
- char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0};
- char* pMarker = sentence;
- int lengthRemaining = sizeof(sentence);
- int length = 0;
-
- time_t utcTime(location.gpsLocation.timestamp/1000);
- tm * pTm = gmtime(&utcTime);
- int utcYear = pTm->tm_year % 100; // 2 digit year
- int utcMonth = pTm->tm_mon + 1; // tm_mon starts at zero
- int utcDay = pTm->tm_mday;
- int utcHours = pTm->tm_hour;
- int utcMinutes = pTm->tm_min;
- int utcSeconds = pTm->tm_sec;
-
- if (generate_nmea) {
- // ------------------
- // ------$GPGSA------
- // ------------------
-
- uint32_t svUsedCount = 0;
- uint32_t svUsedList[32] = {0};
- uint32_t mask = loc_eng_data_p->sv_used_mask;
- for (uint8_t i = 1; mask > 0 && svUsedCount < 32; i++)
- {
- if (mask & 1)
- svUsedList[svUsedCount++] = i;
- mask = mask >> 1;
- }
- // clear the cache so they can't be used again
- loc_eng_data_p->sv_used_mask = 0;
-
- char fixType;
- if (svUsedCount == 0)
- fixType = '1'; // no fix
- else if (svUsedCount <= 3)
- fixType = '2'; // 2D fix
- else
- fixType = '3'; // 3D fix
-
- length = snprintf(pMarker, lengthRemaining, "$GPGSA,A,%c,", fixType);
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- for (uint8_t i = 0; i < 12; i++) // only the first 12 sv go in sentence
- {
- if (i < svUsedCount)
- length = snprintf(pMarker, lengthRemaining, "%02d,", svUsedList[i]);
- else
- length = snprintf(pMarker, lengthRemaining, ",");
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
- }
-
- if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP)
- { // dop is in locationExtended, (QMI)
- length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f",
- locationExtended.pdop,
- locationExtended.hdop,
- locationExtended.vdop);
- }
- else if (loc_eng_data_p->pdop > 0 && loc_eng_data_p->hdop > 0 && loc_eng_data_p->vdop > 0)
- { // dop was cached from sv report (RPC)
- length = snprintf(pMarker, lengthRemaining, "%.1f,%.1f,%.1f",
- loc_eng_data_p->pdop,
- loc_eng_data_p->hdop,
- loc_eng_data_p->vdop);
- }
- else
- { // no dop
- length = snprintf(pMarker, lengthRemaining, ",,");
- }
-
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
-
- // ------------------
- // ------$GPVTG------
- // ------------------
-
- pMarker = sentence;
- lengthRemaining = sizeof(sentence);
-
- if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING)
- {
- float magTrack = location.gpsLocation.bearing;
- if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV)
- {
- float magTrack = location.gpsLocation.bearing - locationExtended.magneticDeviation;
- if (magTrack < 0.0)
- magTrack += 360.0;
- else if (magTrack > 360.0)
- magTrack -= 360.0;
- }
-
- length = snprintf(pMarker, lengthRemaining, "$GPVTG,%.1lf,T,%.1lf,M,", location.gpsLocation.bearing, magTrack);
- }
- else
- {
- length = snprintf(pMarker, lengthRemaining, "$GPVTG,,T,,M,");
- }
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED)
- {
- float speedKnots = location.gpsLocation.speed * (3600.0/1852.0);
- float speedKmPerHour = location.gpsLocation.speed * 3.6;
-
- length = snprintf(pMarker, lengthRemaining, "%.1lf,N,%.1lf,K,", speedKnots, speedKmPerHour);
- }
- else
- {
- length = snprintf(pMarker, lengthRemaining, ",N,,K,");
- }
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG))
- length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix
- else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode)
- length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous
- else
- length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential
-
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
-
- // ------------------
- // ------$GPRMC------
- // ------------------
-
- pMarker = sentence;
- lengthRemaining = sizeof(sentence);
-
- length = snprintf(pMarker, lengthRemaining, "$GPRMC,%02d%02d%02d,A," ,
- utcHours, utcMinutes, utcSeconds);
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)
- {
- double latitude = location.gpsLocation.latitude;
- double longitude = location.gpsLocation.longitude;
- char latHemisphere;
- char lonHemisphere;
- double latMinutes;
- double lonMinutes;
-
- if (latitude > 0)
- {
- latHemisphere = 'N';
- }
- else
- {
- latHemisphere = 'S';
- latitude *= -1.0;
- }
-
- if (longitude < 0)
- {
- lonHemisphere = 'W';
- longitude *= -1.0;
- }
- else
- {
- lonHemisphere = 'E';
- }
-
- latMinutes = fmod(latitude * 60.0 , 60.0);
- lonMinutes = fmod(longitude * 60.0 , 60.0);
-
- length = snprintf(pMarker, lengthRemaining, "%02d%09.6lf,%c,%03d%09.6lf,%c,",
- (uint8_t)floor(latitude), latMinutes, latHemisphere,
- (uint8_t)floor(longitude),lonMinutes, lonHemisphere);
- }
- else
- {
- length = snprintf(pMarker, lengthRemaining,",,,,");
- }
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED)
- {
- float speedKnots = location.gpsLocation.speed * (3600.0/1852.0);
- length = snprintf(pMarker, lengthRemaining, "%.1lf,", speedKnots);
- }
- else
- {
- length = snprintf(pMarker, lengthRemaining, ",");
- }
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING)
- {
- length = snprintf(pMarker, lengthRemaining, "%.1lf,", location.gpsLocation.bearing);
- }
- else
- {
- length = snprintf(pMarker, lengthRemaining, ",");
- }
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- length = snprintf(pMarker, lengthRemaining, "%2.2d%2.2d%2.2d,",
- utcDay, utcMonth, utcYear);
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV)
- {
- float magneticVariation = locationExtended.magneticDeviation;
- char direction;
- if (magneticVariation < 0.0)
- {
- direction = 'W';
- magneticVariation *= -1.0;
- }
- else
- {
- direction = 'E';
- }
-
- length = snprintf(pMarker, lengthRemaining, "%.1lf,%c,",
- magneticVariation, direction);
- }
- else
- {
- length = snprintf(pMarker, lengthRemaining, ",,");
- }
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG))
- length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix
- else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode)
- length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous
- else
- length = snprintf(pMarker, lengthRemaining, "%c", 'D'); // D means differential
-
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
-
- // ------------------
- // ------$GPGGA------
- // ------------------
-
- pMarker = sentence;
- lengthRemaining = sizeof(sentence);
-
- length = snprintf(pMarker, lengthRemaining, "$GPGGA,%02d%02d%02d," ,
- utcHours, utcMinutes, utcSeconds);
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)
- {
- double latitude = location.gpsLocation.latitude;
- double longitude = location.gpsLocation.longitude;
- char latHemisphere;
- char lonHemisphere;
- double latMinutes;
- double lonMinutes;
-
- if (latitude > 0)
- {
- latHemisphere = 'N';
- }
- else
- {
- latHemisphere = 'S';
- latitude *= -1.0;
- }
-
- if (longitude < 0)
- {
- lonHemisphere = 'W';
- longitude *= -1.0;
- }
- else
- {
- lonHemisphere = 'E';
- }
-
- latMinutes = fmod(latitude * 60.0 , 60.0);
- lonMinutes = fmod(longitude * 60.0 , 60.0);
-
- length = snprintf(pMarker, lengthRemaining, "%02d%09.6lf,%c,%03d%09.6lf,%c,",
- (uint8_t)floor(latitude), latMinutes, latHemisphere,
- (uint8_t)floor(longitude),lonMinutes, lonHemisphere);
- }
- else
- {
- length = snprintf(pMarker, lengthRemaining,",,,,");
- }
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- char gpsQuality;
- if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG))
- gpsQuality = '0'; // 0 means no fix
- else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode)
- gpsQuality = '1'; // 1 means GPS fix
- else
- gpsQuality = '2'; // 2 means DGPS fix
-
- if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP)
- { // dop is in locationExtended, (QMI)
- length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,",
- gpsQuality, svUsedCount, locationExtended.hdop);
- }
- else if (loc_eng_data_p->pdop > 0 && loc_eng_data_p->hdop > 0 && loc_eng_data_p->vdop > 0)
- { // dop was cached from sv report (RPC)
- length = snprintf(pMarker, lengthRemaining, "%c,%02d,%.1f,",
- gpsQuality, svUsedCount, loc_eng_data_p->hdop);
- }
- else
- { // no hdop
- length = snprintf(pMarker, lengthRemaining, "%c,%02d,,",
- gpsQuality, svUsedCount);
- }
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL)
- {
- length = snprintf(pMarker, lengthRemaining, "%.1lf,M,",
- locationExtended.altitudeMeanSeaLevel);
- }
- else
- {
- length = snprintf(pMarker, lengthRemaining,",,");
- }
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if ((location.gpsLocation.flags & GPS_LOCATION_HAS_ALTITUDE) &&
- (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL))
- {
- length = snprintf(pMarker, lengthRemaining, "%.1lf,M,,",
- location.gpsLocation.altitude - locationExtended.altitudeMeanSeaLevel);
- }
- else
- {
- length = snprintf(pMarker, lengthRemaining,",,,");
- }
-
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
-
- }
- //Send blank NMEA reports for non-final fixes
- else {
- strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence));
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
-
- strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence));
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
-
- strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence));
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
-
- strlcpy(sentence, "$GPGGA,,,,,,0,,,,,,,,", sizeof(sentence));
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
- }
- // clear the dop cache so they can't be used again
- loc_eng_data_p->pdop = 0;
- loc_eng_data_p->hdop = 0;
- loc_eng_data_p->vdop = 0;
-
- EXIT_LOG(%d, 0);
-}
-
-
-
-/*===========================================================================
-FUNCTION loc_eng_nmea_generate_sv
-
-DESCRIPTION
- Generate NMEA sentences generated based on sv report
-
-DEPENDENCIES
- NONE
-
-RETURN VALUE
- 0
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
- const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended)
-{
- ENTRY_LOG();
-
- char sentence[NMEA_SENTENCE_MAX_LENGTH] = {0};
- char* pMarker = sentence;
- int lengthRemaining = sizeof(sentence);
- int length = 0;
- int svCount = svStatus.num_svs;
- int sentenceCount = 0;
- int sentenceNumber = 1;
- int svNumber = 1;
- int gpsCount = 0;
- int glnCount = 0;
-
- //Count GPS SVs for saparating GPS from GLONASS and throw others
-
- for(svNumber=1; svNumber <= svCount; svNumber++) {
- if( (svStatus.sv_list[svNumber-1].prn >= GPS_PRN_START)&&
- (svStatus.sv_list[svNumber-1].prn <= GPS_PRN_END) )
- {
- gpsCount++;
- }
- else if( (svStatus.sv_list[svNumber-1].prn >= GLONASS_PRN_START) &&
- (svStatus.sv_list[svNumber-1].prn <= GLONASS_PRN_END) )
- {
- glnCount++;
- }
- }
-
- // ------------------
- // ------$GPGSV------
- // ------------------
-
- if (gpsCount <= 0)
- {
- // no svs in view, so just send a blank $GPGSV sentence
- strlcpy(sentence, "$GPGSV,1,1,0,", sizeof(sentence));
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
- }
- else
- {
- svNumber = 1;
- sentenceNumber = 1;
- sentenceCount = gpsCount/4 + (gpsCount % 4 != 0);
-
- while (sentenceNumber <= sentenceCount)
- {
- pMarker = sentence;
- lengthRemaining = sizeof(sentence);
-
- length = snprintf(pMarker, lengthRemaining, "$GPGSV,%d,%d,%02d",
- sentenceCount, sentenceNumber, gpsCount);
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++)
- {
- if( (svStatus.sv_list[svNumber-1].prn >= GPS_PRN_START) &&
- (svStatus.sv_list[svNumber-1].prn <= GPS_PRN_END) )
- {
- length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,",
- svStatus.sv_list[svNumber-1].prn,
- (int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int
- (int)(0.5 + svStatus.sv_list[svNumber-1].azimuth)); //float to int
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (svStatus.sv_list[svNumber-1].snr > 0)
- {
- length = snprintf(pMarker, lengthRemaining,"%02d",
- (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
- }
-
- i++;
- }
-
- }
-
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
- sentenceNumber++;
-
- } //while
-
- } //if
-
- // ------------------
- // ------$GLGSV------
- // ------------------
-
- if (glnCount <= 0)
- {
- // no svs in view, so just send a blank $GLGSV sentence
- strlcpy(sentence, "$GLGSV,1,1,0,", sizeof(sentence));
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
- }
- else
- {
- svNumber = 1;
- sentenceNumber = 1;
- sentenceCount = glnCount/4 + (glnCount % 4 != 0);
-
- while (sentenceNumber <= sentenceCount)
- {
- pMarker = sentence;
- lengthRemaining = sizeof(sentence);
-
- length = snprintf(pMarker, lengthRemaining, "$GLGSV,%d,%d,%02d",
- sentenceCount, sentenceNumber, glnCount);
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- for (int i=0; (svNumber <= svCount) && (i < 4); svNumber++)
- {
- if( (svStatus.sv_list[svNumber-1].prn >= GLONASS_PRN_START) &&
- (svStatus.sv_list[svNumber-1].prn <= GLONASS_PRN_END) ) {
-
- length = snprintf(pMarker, lengthRemaining,",%02d,%02d,%03d,",
- svStatus.sv_list[svNumber-1].prn,
- (int)(0.5 + svStatus.sv_list[svNumber-1].elevation), //float to int
- (int)(0.5 + svStatus.sv_list[svNumber-1].azimuth)); //float to int
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
-
- if (svStatus.sv_list[svNumber-1].snr > 0)
- {
- length = snprintf(pMarker, lengthRemaining,"%02d",
- (int)(0.5 + svStatus.sv_list[svNumber-1].snr)); //float to int
-
- if (length < 0 || length >= lengthRemaining)
- {
- LOC_LOGE("NMEA Error in string formatting");
- return;
- }
- pMarker += length;
- lengthRemaining -= length;
- }
-
- i++;
- }
-
- }
-
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
- sentenceNumber++;
-
- } //while
-
- }//if
-
- if (svStatus.used_in_fix_mask == 0)
- { // No sv used, so there will be no position report, so send
- // blank NMEA sentences
- strlcpy(sentence, "$GPGSA,A,1,,,,,,,,,,,,,,,", sizeof(sentence));
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
-
- strlcpy(sentence, "$GPVTG,,T,,M,,N,,K,N", sizeof(sentence));
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
-
- strlcpy(sentence, "$GPRMC,,V,,,,,,,,,,N", sizeof(sentence));
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
-
- strlcpy(sentence, "$GPGGA,,,,,,0,,,,,,,,", sizeof(sentence));
- length = loc_eng_nmea_put_checksum(sentence, sizeof(sentence));
- loc_eng_nmea_send(sentence, length, loc_eng_data_p);
- }
- else
- { // cache the used in fix mask, as it will be needed to send $GPGSA
- // during the position report
- loc_eng_data_p->sv_used_mask = svStatus.used_in_fix_mask;
-
- // For RPC, the DOP are sent during sv report, so cache them
- // now to be sent during position report.
- // For QMI, the DOP will be in position report.
- if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_DOP)
- {
- loc_eng_data_p->pdop = locationExtended.pdop;
- loc_eng_data_p->hdop = locationExtended.hdop;
- loc_eng_data_p->vdop = locationExtended.vdop;
- }
- else
- {
- loc_eng_data_p->pdop = 0;
- loc_eng_data_p->hdop = 0;
- loc_eng_data_p->vdop = 0;
- }
-
- }
-
- EXIT_LOG(%d, 0);
-}
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_nmea.h b/gps/loc_api/libloc_api_50001/loc_eng_nmea.h
deleted file mode 100644
index c8f3b0e..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_nmea.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* 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
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef LOC_ENG_NMEA_H
-#define LOC_ENG_NMEA_H
-
-#include "hardware/gps.h"
-
-#define NMEA_SENTENCE_MAX_LENGTH 200
-
-void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p);
-int loc_eng_nmea_put_checksum(char *pNmea, int maxSize);
-void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended);
-void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const UlpLocation &location, const GpsLocationExtended &locationExtended, unsigned char generate_nmea);
-
-#endif // LOC_ENG_NMEA_H
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp b/gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp
deleted file mode 100644
index 4582286..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_xtra.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Copyright (c) 2009-2013, 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_NDDEBUG 0
-#define LOG_TAG "LocSvc_eng"
-
-#include <loc_eng.h>
-#include <MsgTask.h>
-#include "log_util.h"
-#include "platform_lib_includes.h"
-
-using namespace loc_core;
-
-struct LocEngRequestXtraServer : public LocMsg {
- LocEngAdapter* mAdapter;
- inline LocEngRequestXtraServer(LocEngAdapter* adapter) :
- LocMsg(), mAdapter(adapter)
- {
- locallog();
- }
- inline virtual void proc() const {
- mAdapter->requestXtraServer();
- }
- inline void locallog() const {
- LOC_LOGV("LocEngRequestXtraServer");
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-struct LocEngInjectXtraData : public LocMsg {
- LocEngAdapter* mAdapter;
- char* mData;
- const int mLen;
- inline LocEngInjectXtraData(LocEngAdapter* adapter,
- char* data, int len):
- LocMsg(), mAdapter(adapter),
- mData(new char[len]), mLen(len)
- {
- memcpy((void*)mData, (void*)data, len);
- locallog();
- }
- inline ~LocEngInjectXtraData()
- {
- delete[] mData;
- }
- inline virtual void proc() const {
- mAdapter->setXtraData(mData, mLen);
- }
- inline void locallog() const {
- LOC_LOGV("length: %d\n data: %p", mLen, mData);
- }
- inline virtual void log() const {
- locallog();
- }
-};
-
-/*===========================================================================
-FUNCTION loc_eng_xtra_init
-
-DESCRIPTION
- Initialize XTRA module.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- 0: success
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data,
- GpsXtraExtCallbacks* callbacks)
-{
- int ret_val = -1;
- loc_eng_xtra_data_s_type *xtra_module_data_ptr;
-
- if(callbacks == NULL) {
- LOC_LOGE("loc_eng_xtra_init: failed, cb is NULL");
- } else {
- xtra_module_data_ptr = &loc_eng_data.xtra_module_data;
- xtra_module_data_ptr->download_request_cb = callbacks->download_request_cb;
- xtra_module_data_ptr->report_xtra_server_cb = callbacks->report_xtra_server_cb;
-
- ret_val = 0;
- }
- return ret_val;
-}
-
-/*===========================================================================
-FUNCTION loc_eng_xtra_inject_data
-
-DESCRIPTION
- Injects XTRA file into the engine but buffers the data if engine is busy.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- 0: success
- >0: failure
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data,
- char* data, int length)
-{
- LocEngAdapter* adapter = loc_eng_data.adapter;
- adapter->sendMsg(new LocEngInjectXtraData(adapter, data, length));
-
- return 0;
-}
-/*===========================================================================
-FUNCTION loc_eng_xtra_request_server
-
-DESCRIPTION
- Request the Xtra server url from the modem
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- length of server string
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data)
-{
- LocEngAdapter* adapter = loc_eng_data.adapter;
- adapter->sendMsg(new LocEngRequestXtraServer(adapter));
-
- return 0;
-
-}
diff --git a/gps/loc_api/libloc_api_50001/loc_eng_xtra.h b/gps/loc_api/libloc_api_50001/loc_eng_xtra.h
deleted file mode 100644
index d8f4641..0000000
--- a/gps/loc_api/libloc_api_50001/loc_eng_xtra.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (c) 2009,2011 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_XTRA_H
-#define LOC_ENG_XTRA_H
-
-#include "hardware/gps.h"
-
-// Module data
-typedef struct
-{
- // loc_eng_ioctl_cb_data_s_type ioctl_cb_data;
- gps_xtra_download_request download_request_cb;
- report_xtra_server report_xtra_server_cb;
-
- // XTRA data buffer
- char *xtra_data_for_injection; // NULL if no pending data
- int xtra_data_len;
-} loc_eng_xtra_data_s_type;
-
-#endif // LOC_ENG_XTRA_H
diff --git a/gps/platform_lib_abstractions/elapsed_millis_since_boot.cpp b/gps/platform_lib_abstractions/elapsed_millis_since_boot.cpp
deleted file mode 100644
index e8cb93a..0000000
--- a/gps/platform_lib_abstractions/elapsed_millis_since_boot.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (c) 2013, 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 <stdlib.h>
-#include <sys/time.h>
-#include "platform_lib_time.h"
-
-int64_t systemTime(int clock)
-{
- struct timeval t;
- t.tv_sec = t.tv_usec = 0;
- gettimeofday(&t, NULL);
- return t.tv_sec*1000000LL + t.tv_usec;
-}
-
-
-int64_t elapsedMillisSinceBoot()
-{
- int64_t t_us = systemTime(0);
- return (int64_t) t_us / 1000LL;
-}
diff --git a/gps/platform_lib_abstractions/platform_lib_includes.h b/gps/platform_lib_abstractions/platform_lib_includes.h
deleted file mode 100644
index 5858674..0000000
--- a/gps/platform_lib_abstractions/platform_lib_includes.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (c) 2013, 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 _PLATFORM_LIB_INCLUDES_H_
-#define _PLATFORM_LIB_INCLUDES_H_
-
-#include "platform_lib_time.h"
-#include "platform_lib_macros.h"
-
-#endif
diff --git a/gps/platform_lib_abstractions/platform_lib_macros.h b/gps/platform_lib_abstractions/platform_lib_macros.h
deleted file mode 100644
index bc48dd9..0000000
--- a/gps/platform_lib_abstractions/platform_lib_macros.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Copyright (c) 2013, 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 __PLATFORM_LIB_MACROS_H__
-#define __PLATFORM_LIB_MACROS_H__
-
-#include <sys/time.h>
-
-#define TS_PRINTF(format, x...) \
-{ \
- struct timeval tv; \
- struct timezone tz; \
- int hh, mm, ss; \
- gettimeofday(&tv, &tz); \
- hh = tv.tv_sec/3600%24; \
- mm = (tv.tv_sec%3600)/60; \
- ss = tv.tv_sec%60; \
- fprintf(stdout,"%02d:%02d:%02d.%06ld]" format "\n", hh, mm, ss, tv.tv_usec,##x); \
-}
-
-
-#ifdef USE_GLIB
-
-#define strlcat g_strlcat
-#define strlcpy g_strlcpy
-
-#define ALOGE(format, x...) TS_PRINTF("E/%s (%d): " format , LOG_TAG, getpid(), ##x)
-#define ALOGW(format, x...) TS_PRINTF("W/%s (%d): " format , LOG_TAG, getpid(), ##x)
-#define ALOGI(format, x...) TS_PRINTF("I/%s (%d): " format , LOG_TAG, getpid(), ##x)
-#define ALOGD(format, x...) TS_PRINTF("D/%s (%d): " format , LOG_TAG, getpid(), ##x)
-#define ALOGV(format, x...) TS_PRINTF("V/%s (%d): " format , LOG_TAG, getpid(), ##x)
-
-#define GETTID_PLATFORM_LIB_ABSTRACTION (syscall(SYS_gettid))
-
-#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION createPthread
-#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (elapsedMillisSinceBoot())
-
-
-#else
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-pid_t gettid(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#define GETTID_PLATFORM_LIB_ABSTRACTION (gettid())
-#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread
-#define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime())
-
-#endif
-
-#endif
diff --git a/gps/platform_lib_abstractions/platform_lib_time.h b/gps/platform_lib_abstractions/platform_lib_time.h
deleted file mode 100644
index ce013af..0000000
--- a/gps/platform_lib_abstractions/platform_lib_time.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (c) 2013, 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 _PLATFORM_LIB_TIME_H_
-#define _PLATFORM_LIB_TIME_H_
-
-int64_t systemTime(int clock);
-int64_t elapsedMillisSinceBoot();
-
-#endif
diff --git a/gps/utils/Android.mk b/gps/utils/Android.mk
deleted file mode 100644
index a91a6ed..0000000
--- a/gps/utils/Android.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-ifneq ($(BUILD_TINY_ANDROID),true)
-#Compile this library only for builds with the latest modem image
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-## Libs
-LOCAL_SHARED_LIBRARIES := \
- libutils \
- libcutils \
- liblog
-
-LOCAL_SRC_FILES += \
- sec_gps.c \
- loc_log.cpp \
- loc_cfg.cpp \
- msg_q.c \
- linked_list.c \
- loc_target.cpp \
- loc_timer.c \
- ../platform_lib_abstractions/elapsed_millis_since_boot.cpp \
- loc_misc_utils.cpp
-
-
-LOCAL_CFLAGS += \
- -fno-short-enums \
- -D_ANDROID_
-
-LOCAL_LDFLAGS += -Wl,--export-dynamic
-
-## Includes
-LOCAL_C_INCLUDES:= \
- $(LOCAL_PATH)/../platform_lib_abstractions
-
-LOCAL_COPY_HEADERS_TO:= gps.utils/
-LOCAL_COPY_HEADERS:= \
- loc_log.h \
- loc_cfg.h \
- log_util.h \
- linked_list.h \
- msg_q.h \
- loc_target.h \
- loc_timer.h \
- ../platform_lib_abstractions/platform_lib_includes.h \
- ../platform_lib_abstractions/platform_lib_time.h \
- ../platform_lib_abstractions/platform_lib_macros.h \
- loc_misc_utils.h
-
-
-LOCAL_MODULE := libgps.utils
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_PRELINK_MODULE := false
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)
-include $(BUILD_SHARED_LIBRARY)
-endif # not BUILD_TINY_ANDROID
-
diff --git a/gps/utils/Makefile.am b/gps/utils/Makefile.am
deleted file mode 100644
index e5935f0..0000000
--- a/gps/utils/Makefile.am
+++ /dev/null
@@ -1,44 +0,0 @@
-AM_CFLAGS = -Wundef \
- -MD \
- -Wno-trigraphs \
- -g -O0 \
- -fno-inline \
- -fno-short-enums \
- -fpic \
- -I../platform_lib_abstractions
-
-libgps_utils_so_la_h_sources = log_util.h \
- msg_q.h \
- linked_list.h \
- loc_cfg.h \
- loc_log.h \
- ../platform_lib_abstractions/platform_lib_includes.h \
- ../platform_lib_abstractions/platform_lib_time.h \
- ../platform_lib_abstractions/platform_lib_macros.h
-
-libgps_utils_so_la_c_sources = linked_list.c \
- msg_q.c \
- loc_cfg.cpp \
- loc_log.cpp \
- ../platform_lib_abstractions/elapsed_millis_since_boot.cpp
-
-library_includedir = $(pkgincludedir)/utils
-
-library_include_HEADERS = $(libgps_utils_so_la_h_sources)
-
-libgps_utils_so_la_SOURCES = $(libgps_utils_so_la_c_sources)
-
-if USE_GLIB
-libgps_utils_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
-libgps_utils_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
-libgps_utils_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
-else
-libgps_utils_so_la_CFLAGS = $(AM_CFLAGS)
-libgps_utils_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
-libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
-endif
-
-libgps_utils_so_la_LIBADD = -lstdc++ -lcutils
-
-#Create and Install libraries
-lib_LTLIBRARIES = libgps_utils_so.la
diff --git a/gps/utils/linked_list.c b/gps/utils/linked_list.c
deleted file mode 100644
index 92617fe..0000000
--- a/gps/utils/linked_list.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/* Copyright (c) 2011, 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 "linked_list.h"
-#include <stdio.h>
-#include <string.h>
-
-#define LOG_TAG "LocSvc_utils_ll"
-#include "log_util.h"
-#include "platform_lib_includes.h"
-#include <stdlib.h>
-#include <stdint.h>
-
-typedef struct list_element {
- struct list_element* next;
- struct list_element* prev;
- void* data_ptr;
- void (*dealloc_func)(void*);
-}list_element;
-
-typedef struct list_state {
- list_element* p_head;
- list_element* p_tail;
-} list_state;
-
-/* ----------------------- END INTERNAL FUNCTIONS ---------------------------------------- */
-
-/*===========================================================================
-
- FUNCTION: linked_list_init
-
- ===========================================================================*/
-linked_list_err_type linked_list_init(void** list_data)
-{
- if( list_data == NULL )
- {
- LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__);
- return eLINKED_LIST_INVALID_PARAMETER;
- }
-
- list_state* tmp_list;
- tmp_list = (list_state*)calloc(1, sizeof(list_state));
- if( tmp_list == NULL )
- {
- LOC_LOGE("%s: Unable to allocate space for list!\n", __FUNCTION__);
- return eLINKED_LIST_FAILURE_GENERAL;
- }
-
- tmp_list->p_head = NULL;
- tmp_list->p_tail = NULL;
-
- *list_data = tmp_list;
-
- return eLINKED_LIST_SUCCESS;
-}
-
-/*===========================================================================
-
- FUNCTION: linked_list_destroy
-
- ===========================================================================*/
-linked_list_err_type linked_list_destroy(void** list_data)
-{
- if( list_data == NULL )
- {
- LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__);
- return eLINKED_LIST_INVALID_HANDLE;
- }
-
- list_state* p_list = (list_state*)*list_data;
-
- linked_list_flush(p_list);
-
- free(*list_data);
- *list_data = NULL;
-
- return eLINKED_LIST_SUCCESS;
-}
-
-/*===========================================================================
-
- FUNCTION: linked_list_add
-
- ===========================================================================*/
-linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dealloc)(void*))
-{
- LOC_LOGD("%s: Adding to list data_obj = 0x%08X\n", __FUNCTION__, data_obj);
- if( list_data == NULL )
- {
- LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__);
- return eLINKED_LIST_INVALID_HANDLE;
- }
-
- if( data_obj == NULL )
- {
- LOC_LOGE("%s: Invalid input parameter!\n", __FUNCTION__);
- return eLINKED_LIST_INVALID_PARAMETER;
- }
-
- list_state* p_list = (list_state*)list_data;
- list_element* elem = (list_element*)malloc(sizeof(list_element));
- if( elem == NULL )
- {
- LOC_LOGE("%s: Memory allocation failed\n", __FUNCTION__);
- return eLINKED_LIST_FAILURE_GENERAL;
- }
-
- /* Copy data to newly created element */
- elem->data_ptr = data_obj;
- elem->next = NULL;
- elem->prev = NULL;
- elem->dealloc_func = dealloc;
-
- /* Replace head element */
- list_element* tmp = p_list->p_head;
- p_list->p_head = elem;
- /* Point next to the previous head element */
- p_list->p_head->next = tmp;
-
- if( tmp != NULL )
- {
- tmp->prev = p_list->p_head;
- }
- else
- {
- p_list->p_tail = p_list->p_head;
- }
-
- return eLINKED_LIST_SUCCESS;
-}
-
-/*===========================================================================
-
- FUNCTION: linked_list_remove
-
- ===========================================================================*/
-linked_list_err_type linked_list_remove(void* list_data, void **data_obj)
-{
- LOC_LOGD("%s: Removing from list\n", __FUNCTION__);
- if( list_data == NULL )
- {
- LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__);
- return eLINKED_LIST_INVALID_HANDLE;
- }
-
- if( data_obj == NULL )
- {
- LOC_LOGE("%s: Invalid input parameter!\n", __FUNCTION__);
- return eLINKED_LIST_INVALID_PARAMETER;
- }
-
- list_state* p_list = (list_state*)list_data;
- if( p_list->p_tail == NULL )
- {
- return eLINKED_LIST_UNAVAILABLE_RESOURCE;
- }
-
- list_element* tmp = p_list->p_tail;
-
- /* Replace tail element */
- p_list->p_tail = tmp->prev;
-
- if( p_list->p_tail != NULL )
- {
- p_list->p_tail->next = NULL;
- }
- else
- {
- p_list->p_head = p_list->p_tail;
- }
-
- /* Copy data to output param */
- *data_obj = tmp->data_ptr;
-
- /* Free allocated list element */
- free(tmp);
-
- return eLINKED_LIST_SUCCESS;
-}
-
-/*===========================================================================
-
- FUNCTION: linked_list_empty
-
- ===========================================================================*/
-int linked_list_empty(void* list_data)
-{
- if( list_data == NULL )
- {
- LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__);
- return (int)eLINKED_LIST_INVALID_HANDLE;
- }
- else
- {
- list_state* p_list = (list_state*)list_data;
- return p_list->p_head == NULL ? 1 : 0;
- }
-}
-
-/*===========================================================================
-
- FUNCTION: linked_list_flush
-
- ===========================================================================*/
-linked_list_err_type linked_list_flush(void* list_data)
-{
- if( list_data == NULL )
- {
- LOC_LOGE("%s: Invalid list parameter!\n", __FUNCTION__);
- return eLINKED_LIST_INVALID_HANDLE;
- }
-
- list_state* p_list = (list_state*)list_data;
-
- /* Remove all dynamically allocated elements */
- while( p_list->p_head != NULL )
- {
- list_element* tmp = p_list->p_head->next;
-
- /* Free data pointer if told to do so. */
- if( p_list->p_head->dealloc_func != NULL )
- {
- p_list->p_head->dealloc_func(p_list->p_head->data_ptr);
- }
-
- /* Free list element */
- free(p_list->p_head);
-
- p_list->p_head = tmp;
- }
-
- p_list->p_tail = NULL;
-
- return eLINKED_LIST_SUCCESS;
-}
-
-/*===========================================================================
-
- FUNCTION: linked_list_search
-
- ===========================================================================*/
-linked_list_err_type linked_list_search(void* list_data, void **data_p,
- bool (*equal)(void* data_0, void* data),
- void* data_0, bool rm_if_found)
-{
- LOC_LOGD("%s: Search the list\n", __FUNCTION__);
- if( list_data == NULL || NULL == equal )
- {
- LOC_LOGE("%s: Invalid list parameter! list_data %p equal %p\n",
- __FUNCTION__, list_data, equal);
- return eLINKED_LIST_INVALID_HANDLE;
- }
-
- list_state* p_list = (list_state*)list_data;
- if( p_list->p_tail == NULL )
- {
- return eLINKED_LIST_UNAVAILABLE_RESOURCE;
- }
-
- list_element* tmp = p_list->p_head;
-
- if (NULL != data_p) {
- *data_p = NULL;
- }
-
- while (NULL != tmp) {
- if ((*equal)(data_0, tmp->data_ptr)) {
- if (NULL != data_p) {
- *data_p = tmp->data_ptr;
- }
-
- if (rm_if_found) {
- if (NULL == tmp->prev) {
- p_list->p_head = tmp->next;
- } else {
- tmp->prev->next = tmp->next;
- }
-
- if (NULL == tmp->next) {
- p_list->p_tail = tmp->prev;
- } else {
- tmp->next->prev = tmp->prev;
- }
-
- tmp->prev = tmp->next = NULL;
-
- // dealloc data if it is not copied out && caller
- // has given us a dealloc function pointer.
- if (NULL == data_p && NULL != tmp->dealloc_func) {
- tmp->dealloc_func(tmp->data_ptr);
- }
- free(tmp);
- }
-
- tmp = NULL;
- } else {
- tmp = tmp->next;
- }
- }
-
- return eLINKED_LIST_SUCCESS;
-}
-
diff --git a/gps/utils/linked_list.h b/gps/utils/linked_list.h
deleted file mode 100644
index a85f09a..0000000
--- a/gps/utils/linked_list.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/* Copyright (c) 2011, 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 __LINKED_LIST_H__
-#define __LINKED_LIST_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include <stdbool.h>
-#include <stdlib.h>
-
-/** Linked List Return Codes */
-typedef enum
-{
- eLINKED_LIST_SUCCESS = 0,
- /**< Request was successful. */
- eLINKED_LIST_FAILURE_GENERAL = -1,
- /**< Failed because of a general failure. */
- eLINKED_LIST_INVALID_PARAMETER = -2,
- /**< Failed because the request contained invalid parameters. */
- eLINKED_LIST_INVALID_HANDLE = -3,
- /**< Failed because an invalid handle was specified. */
- eLINKED_LIST_UNAVAILABLE_RESOURCE = -4,
- /**< Failed because an there were not enough resources. */
- eLINKED_LIST_INSUFFICIENT_BUFFER = -5,
- /**< Failed because an the supplied buffer was too small. */
-}linked_list_err_type;
-
-/*===========================================================================
-FUNCTION linked_list_init
-
-DESCRIPTION
- Initializes internal structures for linked list.
-
- list_data: State of list to be initialized.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-linked_list_err_type linked_list_init(void** list_data);
-
-/*===========================================================================
-FUNCTION linked_list_destroy
-
-DESCRIPTION
- Destroys internal structures for linked list.
-
- p_list_data: State of list to be destroyed.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-linked_list_err_type linked_list_destroy(void** list_data);
-
-/*===========================================================================
-FUNCTION linked_list_add
-
-DESCRIPTION
- Adds an element to the head of the linked list. The passed in data pointer
- is not modified or freed. Passed in data_obj is expected to live throughout
- the use of the linked_list (i.e. data is not allocated internally)
-
- p_list_data: List to add data to the head of.
- data_obj: Pointer to data to add into list
- dealloc: Function used to deallocate memory for this element. Pass NULL
- if you do not want data deallocated during a flush operation
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-linked_list_err_type linked_list_add(void* list_data, void *data_obj, void (*dealloc)(void*));
-
-/*===========================================================================
-FUNCTION linked_list_remove
-
-DESCRIPTION
- Retrieves data from the list tail. data_obj is the tail element from the list
- passed in by linked_list_add.
-
- p_list_data: List to remove the tail from.
- data_obj: Pointer to data removed from list
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-linked_list_err_type linked_list_remove(void* list_data, void **data_obj);
-
-/*===========================================================================
-FUNCTION linked_list_empty
-
-DESCRIPTION
- Tells whether the list currently contains any elements
-
- p_list_data: List to check if empty.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- 0/FALSE : List contains elements
- 1/TRUE : List is Empty
- Otherwise look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-int linked_list_empty(void* list_data);
-
-/*===========================================================================
-FUNCTION linked_list_flush
-
-DESCRIPTION
- Removes all elements from the list and deallocates them using the provided
- dealloc function while adding elements.
-
- p_list_data: List to remove all elements from.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-linked_list_err_type linked_list_flush(void* list_data);
-
-/*===========================================================================
-FUNCTION linked_list_search
-
-DESCRIPTION
- Searches for an element in the linked list.
-
- p_list_data: List handle.
- data_p: to be stored with the data found; NUll if no match.
- if data_p passed in as NULL, then no write to it.
- equal: Function ptr takes in a list element, and returns
- indication if this the one looking for.
- data_0: The data being compared against.
- rm_if_found: Should data be removed if found?
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-linked_list_err_type linked_list_search(void* list_data, void **data_p,
- bool (*equal)(void* data_0, void* data),
- void* data_0, bool rm_if_found);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __LINKED_LIST_H__ */
diff --git a/gps/utils/loc_cfg.cpp b/gps/utils/loc_cfg.cpp
deleted file mode 100644
index abf8086..0000000
--- a/gps/utils/loc_cfg.cpp
+++ /dev/null
@@ -1,300 +0,0 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#define LOG_NDDEBUG 0
-#define LOG_TAG "LocSvc_utils_cfg"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <time.h>
-#include <loc_cfg.h>
-#include <log_util.h>
-#include <loc_misc_utils.h>
-#ifdef USE_GLIB
-#include <glib.h>
-#endif
-#include "platform_lib_includes.h"
-
-/*=============================================================================
- *
- * GLOBAL DATA DECLARATION
- *
- *============================================================================*/
-
-/* Parameter data */
-static uint8_t DEBUG_LEVEL = 0xff;
-static uint8_t TIMESTAMP = 0;
-
-/* Parameter spec table */
-static loc_param_s_type loc_parameter_table[] =
-{
- {"DEBUG_LEVEL", &DEBUG_LEVEL, NULL, 'n'},
- {"TIMESTAMP", &TIMESTAMP, NULL, 'n'},
-};
-int loc_param_num = sizeof(loc_parameter_table) / sizeof(loc_param_s_type);
-
-typedef struct loc_param_v_type
-{
- char* param_name;
- char* param_str_value;
- int param_int_value;
- double param_double_value;
-}loc_param_v_type;
-
-/*===========================================================================
-FUNCTION loc_set_config_entry
-
-DESCRIPTION
- Potentially sets a given configuration table entry based on the passed in
- configuration value. This is done by using a string comparison of the
- parameter names and those found in the configuration file.
-
-PARAMETERS:
- config_entry: configuration entry in the table to possibly set
- config_value: value to store in the entry if the parameter names match
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-===========================================================================*/
-int loc_set_config_entry(loc_param_s_type* config_entry, loc_param_v_type* config_value)
-{
- int ret=-1;
- if(NULL == config_entry || NULL == config_value)
- {
- LOC_LOGE("%s: INVALID config entry or parameter", __FUNCTION__);
- return ret;
- }
-
- if (strcmp(config_entry->param_name, config_value->param_name) == 0 &&
- config_entry->param_ptr)
- {
- switch (config_entry->param_type)
- {
- case 's':
- if (strcmp(config_value->param_str_value, "NULL") == 0)
- {
- *((char*)config_entry->param_ptr) = '\0';
- }
- else {
- strlcpy((char*) config_entry->param_ptr,
- config_value->param_str_value,
- LOC_MAX_PARAM_STRING + 1);
- }
- /* Log INI values */
- LOC_LOGD("%s: PARAM %s = %s", __FUNCTION__, config_entry->param_name, (char*)config_entry->param_ptr);
-
- if(NULL != config_entry->param_set)
- {
- *(config_entry->param_set) = 1;
- }
- ret = 0;
- break;
- case 'n':
- *((int *)config_entry->param_ptr) = config_value->param_int_value;
- /* Log INI values */
- LOC_LOGD("%s: PARAM %s = %d", __FUNCTION__, config_entry->param_name, config_value->param_int_value);
-
- if(NULL != config_entry->param_set)
- {
- *(config_entry->param_set) = 1;
- }
- ret = 0;
- break;
- case 'f':
- *((double *)config_entry->param_ptr) = config_value->param_double_value;
- /* Log INI values */
- LOC_LOGD("%s: PARAM %s = %f", __FUNCTION__, config_entry->param_name, config_value->param_double_value);
-
- if(NULL != config_entry->param_set)
- {
- *(config_entry->param_set) = 1;
- }
- ret = 0;
- break;
- default:
- LOC_LOGE("%s: PARAM %s parameter type must be n, f, or s", __FUNCTION__, config_entry->param_name);
- }
- }
- return ret;
-}
-
-/*===========================================================================
-FUNCTION loc_read_conf_r (repetitive)
-
-DESCRIPTION
- Reads the specified configuration file and sets defined values based on
- the passed in configuration table. This table maps strings to values to
- set along with the type of each of these values.
- The difference between this and loc_read_conf is that this function returns
- the file pointer position at the end of filling a config table. Also, it
- reads a fixed number of parameters at a time which is equal to the length
- of the configuration table. This functionality enables the caller to
- repeatedly call the function to read data from the same file.
-
-PARAMETERS:
- conf_fp : file pointer
- config_table: table definition of strings to places to store information
- table_length: length of the configuration table
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- 0: Table filled successfully
- 1: No more parameters to read
- -1: Error filling table
-
-SIDE EFFECTS
- N/A
-===========================================================================*/
-int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, uint32_t table_length)
-{
- char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */
- char *lasts;
- loc_param_v_type config_value;
- uint32_t i;
- int ret=0;
-
- unsigned int num_params=table_length;
- if(conf_fp == NULL) {
- LOC_LOGE("%s:%d]: ERROR: File pointer is NULL\n", __func__, __LINE__);
- ret = -1;
- goto err;
- }
-
- /* Clear all validity bits */
- for(i = 0; NULL != config_table && i < table_length; i++)
- {
- if(NULL != config_table[i].param_set)
- {
- *(config_table[i].param_set) = 0;
- }
- }
- LOC_LOGD("%s:%d]: num_params: %d\n", __func__, __LINE__, num_params);
- while(num_params)
- {
- if(!fgets(input_buf, LOC_MAX_PARAM_LINE, conf_fp)) {
- LOC_LOGD("%s:%d]: fgets returned NULL\n", __func__, __LINE__);
- break;
- }
-
- memset(&config_value, 0, sizeof(config_value));
-
- /* Separate variable and value */
- config_value.param_name = strtok_r(input_buf, "=", &lasts);
- /* skip lines that do not contain "=" */
- if (config_value.param_name == NULL) continue;
- config_value.param_str_value = strtok_r(NULL, "=", &lasts);
- /* skip lines that do not contain two operands */
- if (config_value.param_str_value == NULL) continue;
-
- /* Trim leading and trailing spaces */
- loc_util_trim_space(config_value.param_name);
- loc_util_trim_space(config_value.param_str_value);
-
- /* Parse numerical value */
- if ((strlen(config_value.param_str_value) >=3) &&
- (config_value.param_str_value[0] == '0') &&
- (tolower(config_value.param_str_value[1]) == 'x'))
- {
- /* hex */
- config_value.param_int_value = (int) strtol(&config_value.param_str_value[2],
- (char**) NULL, 16);
- }
- else {
- config_value.param_double_value = (double) atof(config_value.param_str_value); /* float */
- config_value.param_int_value = atoi(config_value.param_str_value); /* dec */
- }
-
- for(i = 0; NULL != config_table && i < table_length; i++)
- {
- if(!loc_set_config_entry(&config_table[i], &config_value)) {
- num_params--;
- }
- }
- }
-
-err:
- return ret;
-}
-
-/*===========================================================================
-FUNCTION loc_read_conf
-
-DESCRIPTION
- Reads the specified configuration file and sets defined values based on
- the passed in configuration table. This table maps strings to values to
- set along with the type of each of these values.
-
-PARAMETERS:
- conf_file_name: configuration file to read
- config_table: table definition of strings to places to store information
- table_length: length of the configuration table
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-===========================================================================*/
-void loc_read_conf(const char* conf_file_name, loc_param_s_type* config_table,
- uint32_t table_length)
-{
- FILE *gps_conf_fp = NULL;
- char input_buf[LOC_MAX_PARAM_LINE]; /* declare a char array */
- char *lasts;
- loc_param_v_type config_value;
- uint32_t i;
-
- if((gps_conf_fp = fopen(conf_file_name, "r")) != NULL)
- {
- LOC_LOGD("%s: using %s", __FUNCTION__, conf_file_name);
- if(table_length && config_table) {
- loc_read_conf_r(gps_conf_fp, config_table, table_length);
- rewind(gps_conf_fp);
- }
- loc_read_conf_r(gps_conf_fp, loc_parameter_table, loc_param_num);
- fclose(gps_conf_fp);
- }
- /* Initialize logging mechanism with parsed data */
- loc_logger_init(DEBUG_LEVEL, TIMESTAMP);
-}
diff --git a/gps/utils/loc_cfg.h b/gps/utils/loc_cfg.h
deleted file mode 100644
index 268f4c2..0000000
--- a/gps/utils/loc_cfg.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef LOC_CFG_H
-#define LOC_CFG_H
-
-#include <stdio.h>
-#include <stdint.h>
-
-#define LOC_MAX_PARAM_NAME 48
-#define LOC_MAX_PARAM_STRING 80
-#define LOC_MAX_PARAM_LINE 80
-
-#define UTIL_READ_CONF_DEFAULT(filename) \
- loc_read_conf((filename), NULL, 0);
-
-#define UTIL_READ_CONF(filename, config_table) \
- loc_read_conf((filename), (config_table), sizeof(config_table) / sizeof(config_table[0]))
-
-/*=============================================================================
- *
- * MODULE TYPE DECLARATION
- *
- *============================================================================*/
-typedef struct
-{
- char param_name[LOC_MAX_PARAM_NAME];
- void *param_ptr;
- uint8_t *param_set; /* was this value set by config file? */
- char param_type; /* 'n' for number,
- 's' for string,
- 'f' for float */
-} loc_param_s_type;
-
-/*=============================================================================
- *
- * MODULE EXTERNAL DATA
- *
- *============================================================================*/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*=============================================================================
- *
- * MODULE EXPORTED FUNCTIONS
- *
- *============================================================================*/
-extern void loc_read_conf(const char* conf_file_name,
- loc_param_s_type* config_table,
- uint32_t table_length);
-extern int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table, uint32_t table_length);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LOC_CFG_H */
diff --git a/gps/utils/loc_log.cpp b/gps/utils/loc_log.cpp
deleted file mode 100644
index 597b5b6..0000000
--- a/gps/utils/loc_log.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-/* Copyright (c) 2011-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
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#define LOG_NDDEBUG 0
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/time.h>
-#include "loc_log.h"
-#include "msg_q.h"
-#ifdef USE_GLIB
-#include <time.h>
-#endif /* USE_GLIB */
-#include "log_util.h"
-#include "platform_lib_includes.h"
-
-#define BUFFER_SIZE 120
-
-// Logging Improvements
-const char *loc_logger_boolStr[]={"False","True"};
-const char VOID_RET[] = "None";
-const char FROM_AFW[] = "===>";
-const char TO_MODEM[] = "--->";
-const char FROM_MODEM[] = "<---";
-const char TO_AFW[] = "<===";
-const char EXIT_TAG[] = "Exiting";
-const char ENTRY_TAG[] = "Entering";
-
-/* Logging Mechanism */
-loc_logger_s_type loc_logger;
-
-/* Get names from value */
-const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask)
-{
- int i;
- for (i = 0; i < table_size; i++)
- {
- if (table[i].val & (long) mask)
- {
- return table[i].name;
- }
- }
- return UNKNOWN_STR;
-}
-
-/* Get names from value */
-const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value)
-{
- int i;
- for (i = 0; i < table_size; i++)
- {
- if (table[i].val == (long) value)
- {
- return table[i].name;
- }
- }
- return UNKNOWN_STR;
-}
-
-static loc_name_val_s_type loc_msg_q_status[] =
-{
- NAME_VAL( eMSG_Q_SUCCESS ),
- NAME_VAL( eMSG_Q_FAILURE_GENERAL ),
- NAME_VAL( eMSG_Q_INVALID_PARAMETER ),
- NAME_VAL( eMSG_Q_INVALID_HANDLE ),
- NAME_VAL( eMSG_Q_UNAVAILABLE_RESOURCE ),
- NAME_VAL( eMSG_Q_INSUFFICIENT_BUFFER )
-};
-static int loc_msg_q_status_num = sizeof(loc_msg_q_status) / sizeof(loc_name_val_s_type);
-
-/* Find msg_q status name */
-const char* loc_get_msg_q_status(int status)
-{
- return loc_get_name_from_val(loc_msg_q_status, loc_msg_q_status_num, (long) status);
-}
-
-const char* log_succ_fail_string(int is_succ)
-{
- return is_succ? "successful" : "failed";
-}
-
-//Target names
-loc_name_val_s_type target_name[] =
-{
- NAME_VAL(GNSS_NONE),
- NAME_VAL(GNSS_MSM),
- NAME_VAL(GNSS_GSS),
- NAME_VAL(GNSS_MDM),
- NAME_VAL(GNSS_QCA1530),
- NAME_VAL(GNSS_UNKNOWN)
-};
-
-static int target_name_num = sizeof(target_name)/sizeof(loc_name_val_s_type);
-
-/*===========================================================================
-
-FUNCTION loc_get_target_name
-
-DESCRIPTION
- Returns pointer to a string that contains name of the target
-
- XX:XX:XX.000\0
-
-RETURN VALUE
- The target name string
-
-===========================================================================*/
-const char *loc_get_target_name(unsigned int target)
-{
- int index = 0;
- static char ret[BUFFER_SIZE];
-
- index = getTargetGnssType(target);
- if( index >= target_name_num || index < 0)
- index = target_name_num - 1;
-
- if( (target & HAS_SSC) == HAS_SSC ) {
- snprintf(ret, sizeof(ret), " %s with SSC",
- loc_get_name_from_val(target_name, target_name_num, (long)index) );
- }
- else {
- snprintf(ret, sizeof(ret), " %s without SSC",
- loc_get_name_from_val(target_name, target_name_num, (long)index) );
- }
- return ret;
-}
-
-
-/*===========================================================================
-
-FUNCTION loc_get_time
-
-DESCRIPTION
- Logs a callback event header.
- The pointer time_string should point to a buffer of at least 13 bytes:
-
- XX:XX:XX.000\0
-
-RETURN VALUE
- The time string
-
-===========================================================================*/
-char *loc_get_time(char *time_string, unsigned long buf_size)
-{
- struct timeval now; /* sec and usec */
- struct tm now_tm; /* broken-down time */
- char hms_string[80]; /* HH:MM:SS */
-
- gettimeofday(&now, NULL);
- localtime_r(&now.tv_sec, &now_tm);
-
- strftime(hms_string, sizeof hms_string, "%H:%M:%S", &now_tm);
- snprintf(time_string, buf_size, "%s.%03d", hms_string, (int) (now.tv_usec / 1000));
-
- return time_string;
-}
-
-
-/*===========================================================================
-FUNCTION loc_logger_init
-
-DESCRIPTION
- Initializes the state of DEBUG_LEVEL and TIMESTAMP
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-===========================================================================*/
-void loc_logger_init(unsigned long debug, unsigned long timestamp)
-{
- loc_logger.DEBUG_LEVEL = debug;
- loc_logger.TIMESTAMP = timestamp;
-}
-
-
-/*===========================================================================
-FUNCTION get_timestamp
-
-DESCRIPTION
- Generates a timestamp using the current system time
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Char pointer to the parameter str
-
-SIDE EFFECTS
- N/A
-===========================================================================*/
-char * get_timestamp(char *str, unsigned long buf_size)
-{
- struct timeval tv;
- struct timezone tz;
- int hh, mm, ss;
- gettimeofday(&tv, &tz);
- hh = tv.tv_sec/3600%24;
- mm = (tv.tv_sec%3600)/60;
- ss = tv.tv_sec%60;
- snprintf(str, buf_size, "%02d:%02d:%02d.%06ld", hh, mm, ss, tv.tv_usec);
- return str;
-}
-
diff --git a/gps/utils/loc_log.h b/gps/utils/loc_log.h
deleted file mode 100644
index 82dc636..0000000
--- a/gps/utils/loc_log.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Copyright (c) 2011-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
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef LOC_LOG_H
-#define LOC_LOG_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#include <ctype.h>
-#include "loc_target.h"
-
-typedef struct
-{
- char name[128];
- long val;
-} loc_name_val_s_type;
-
-#define NAME_VAL(x) {"" #x "", x }
-
-#define UNKNOWN_STR "UNKNOWN"
-
-#define CHECK_MASK(type, value, mask_var, mask) \
- ((mask_var & mask) ? (type) value : (type) (-1))
-
-/* Get names from value */
-const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask);
-const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value);
-const char* loc_get_msg_q_status(int status);
-const char* loc_get_target_name(unsigned int target);
-
-extern const char* log_succ_fail_string(int is_succ);
-
-extern char *loc_get_time(char *time_string, unsigned long buf_size);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LOC_LOG_H */
diff --git a/gps/utils/loc_misc_utils.cpp b/gps/utils/loc_misc_utils.cpp
deleted file mode 100644
index 7e96313..0000000
--- a/gps/utils/loc_misc_utils.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#include <stdio.h>
-#include <string.h>
-#include <log_util.h>
-#include <loc_misc_utils.h>
-#include <ctype.h>
-
-#define LOG_NDDEBUG 0
-#define LOG_TAG "LocSvc_misc_utils"
-
-int loc_util_split_string(char *raw_string, char **split_strings_ptr,
- int max_num_substrings, char delimiter)
-{
- int raw_string_index=0;
- int num_split_strings=0;
- unsigned char end_string=0;
- int raw_string_length=0;
-
- if(!raw_string || !split_strings_ptr) {
- LOC_LOGE("%s:%d]: NULL parameters", __func__, __LINE__);
- num_split_strings = -1;
- goto err;
- }
- LOC_LOGD("%s:%d]: raw string: %s\n", __func__, __LINE__, raw_string);
- raw_string_length = strlen(raw_string) + 1;
- split_strings_ptr[num_split_strings] = &raw_string[raw_string_index];
- for(raw_string_index=0; raw_string_index < raw_string_length; raw_string_index++) {
- if(raw_string[raw_string_index] == '\0')
- end_string=1;
- if((raw_string[raw_string_index] == delimiter) || end_string) {
- raw_string[raw_string_index] = '\0';
- LOC_LOGD("%s:%d]: split string: %s\n",
- __func__, __LINE__, split_strings_ptr[num_split_strings]);
- num_split_strings++;
- if(((raw_string_index + 1) < raw_string_length) &&
- (num_split_strings < max_num_substrings)) {
- split_strings_ptr[num_split_strings] = &raw_string[raw_string_index+1];
- }
- else {
- break;
- }
- }
- if(end_string)
- break;
- }
-err:
- LOC_LOGD("%s:%d]: num_split_strings: %d\n", __func__, __LINE__, num_split_strings);
- return num_split_strings;
-}
-
-void loc_util_trim_space(char *org_string)
-{
- char *scan_ptr, *write_ptr;
- char *first_nonspace = NULL, *last_nonspace = NULL;
-
- if(org_string == NULL) {
- LOC_LOGE("%s:%d]: NULL parameter", __func__, __LINE__);
- goto err;
- }
-
- scan_ptr = write_ptr = org_string;
-
- while (*scan_ptr) {
- //Find the first non-space character
- if ( !isspace(*scan_ptr) && first_nonspace == NULL) {
- first_nonspace = scan_ptr;
- }
- //Once the first non-space character is found in the
- //above check, keep shifting the characters to the left
- //to replace the spaces
- if (first_nonspace != NULL) {
- *(write_ptr++) = *scan_ptr;
- //Keep track of which was the last non-space character
- //encountered
- //last_nonspace will not be updated in the case where
- //the string ends with spaces
- if ( !isspace(*scan_ptr)) {
- last_nonspace = write_ptr;
- }
- }
- scan_ptr++;
- }
- //Add NULL terminator after the last non-space character
- if (last_nonspace) { *last_nonspace = '\0'; }
-err:
- return;
-}
diff --git a/gps/utils/loc_misc_utils.h b/gps/utils/loc_misc_utils.h
deleted file mode 100644
index 7d66d84..0000000
--- a/gps/utils/loc_misc_utils.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation, nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef _LOC_MISC_UTILS_H_
-#define _LOC_MISC_UTILS_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*===========================================================================
-FUNCTION loc_split_string
-
-DESCRIPTION:
- This function is used to split a delimiter separated string into
- sub-strings. This function does not allocate new memory to store the split
- strings. Instead, it places '\0' in places of delimiters and assings the
- starting address of the substring within the raw string as the string address
- The input raw_string no longer remains to be a collection of sub-strings
- after this function is executed.
- Please make a copy of the input string before calling this function if
- necessary
-
-PARAMETERS:
- char *raw_string: is the original string with delimiter separated substrings
- char **split_strings_ptr: is the arraw of pointers which will hold the addresses
- of individual substrings
- int max_num_substrings: is the maximum number of substrings that are expected
- by the caller. The array of pointers in the above parameter
- is usually this long
- char delimiter: is the delimiter that separates the substrings. Examples: ' ', ';'
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- int Number of split strings
-
-SIDE EFFECTS
- The input raw_string no longer remains a delimiter separated single string.
-
-EXAMPLE
- delimiter = ' ' //space
- raw_string = "hello new user" //delimiter is space ' '
- addresses = 0123456789abcd
- split_strings_ptr[0] = &raw_string[0]; //split_strings_ptr[0] contains "hello"
- split_strings_ptr[1] = &raw_string[6]; //split_strings_ptr[1] contains "new"
- split_strings_ptr[2] = &raw_string[a]; //split_strings_ptr[2] contains "user"
-
-===========================================================================*/
-int loc_util_split_string(char *raw_string, char **split_strings_ptr, int max_num_substrings,
- char delimiter);
-
-/*===========================================================================
-FUNCTION trim_space
-
-DESCRIPTION
- Removes leading and trailing spaces of the string
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- None
-
-SIDE EFFECTS
- N/A
-===========================================================================*/
-void loc_util_trim_space(char *org_string);
-#ifdef __cplusplus
-}
-#endif
-
-#endif //_LOC_MISC_UTILS_H_
diff --git a/gps/utils/loc_target.cpp b/gps/utils/loc_target.cpp
deleted file mode 100644
index 95c30a2..0000000
--- a/gps/utils/loc_target.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include "hardware/gps.h"
-#include <cutils/properties.h>
-#include "loc_target.h"
-#include "loc_log.h"
-#include "log_util.h"
-
-#define APQ8064_ID_1 "109"
-#define APQ8064_ID_2 "153"
-#define MPQ8064_ID_1 "130"
-#define MSM8930_ID_1 "142"
-#define MSM8930_ID_2 "116"
-#define APQ8030_ID_1 "157"
-#define APQ8074_ID_1 "184"
-
-#define LINE_LEN 100
-#define STR_LIQUID "Liquid"
-#define STR_SURF "Surf"
-#define STR_MTP "MTP"
-#define STR_APQ "apq"
-#define IS_STR_END(c) ((c) == '\0' || (c) == '\n' || (c) == '\r')
-#define LENGTH(s) (sizeof(s) - 1)
-#define GPS_CHECK_NO_ERROR 0
-#define GPS_CHECK_NO_GPS_HW 1
-#define QCA1530_DETECT_TIMEOUT 30
-#define QCA1530_DETECT_PRESENT "yes"
-#define QCA1530_DETECT_PROGRESS "detect"
-
-static unsigned int gTarget = (unsigned int)-1;
-
-static int read_a_line(const char * file_path, char * line, int line_size)
-{
- FILE *fp;
- int result = 0;
-
- * line = '\0';
- fp = fopen(file_path, "r" );
- if( fp == NULL ) {
- LOC_LOGE("open failed: %s: %s\n", file_path, strerror(errno));
- result = -1;
- } else {
- int len;
- fgets(line, line_size, fp);
- len = strlen(line);
- len = len < line_size - 1? len : line_size - 1;
- line[len] = '\0';
- LOC_LOGD("cat %s: %s", file_path, line);
- fclose(fp);
- }
- return result;
-}
-
-/*!
- * \brief Checks if QCA1530 is avalable.
- *
- * Function verifies if qca1530 SoC is configured on the device. The test is
- * based on property value. For 1530 scenario, the value shall be one of the
- * following: "yes", "no", "detect". All other values are treated equally to
- * "no". When the value is "detect" the system waits for SoC detection to
- * finish before returning result.
- *
- * \retval true - QCA1530 is available.
- * \retval false - QCA1530 is not available.
- */
-static bool is_qca1530(void)
-{
- static const char qca1530_property_name[] = "persist.qca1530";
- bool res = false;
- int ret, i;
- char buf[PROPERTY_VALUE_MAX];
-
- memset(buf, 0, sizeof(buf));
-
- for (i = 0; i < QCA1530_DETECT_TIMEOUT; ++i)
- {
- ret = property_get(qca1530_property_name, buf, NULL);
- if (ret < 0)
- {
- LOC_LOGV( "qca1530: property %s is not accessible, ret=%d",
- qca1530_property_name,
- ret);
-
- break;
- }
-
- LOC_LOGV( "qca1530: property %s is set to %s",
- qca1530_property_name,
- buf);
-
- if (!memcmp(buf, QCA1530_DETECT_PRESENT,
- sizeof(QCA1530_DETECT_PRESENT)))
- {
- res = true;
- break;
- }
- if (!memcmp(buf, QCA1530_DETECT_PROGRESS,
- sizeof(QCA1530_DETECT_PROGRESS)))
- {
- LOC_LOGV("qca1530: SoC detection is in progress.");
- sleep(1);
- continue;
- }
- break;
- }
-
- LOC_LOGD("qca1530: detected=%s", res ? "true" : "false");
- return res;
-}
-
-/*The character array passed to this function should have length
- of atleast PROPERTY_VALUE_MAX*/
-void loc_get_target_baseband(char *baseband, int array_length)
-{
- if(baseband && (array_length >= PROPERTY_VALUE_MAX)) {
- property_get("ro.baseband", baseband, "");
- LOC_LOGD("%s:%d]: Baseband: %s\n", __func__, __LINE__, baseband);
- }
- else {
- LOC_LOGE("%s:%d]: NULL parameter or array length less than PROPERTY_VALUE_MAX\n",
- __func__, __LINE__);
- }
-}
-
-/*The character array passed to this function should have length
- of atleast PROPERTY_VALUE_MAX*/
-void loc_get_platform_name(char *platform_name, int array_length)
-{
- if(platform_name && (array_length >= PROPERTY_VALUE_MAX)) {
- property_get("ro.board.platform", platform_name, "");
- LOC_LOGD("%s:%d]: Target name: %s\n", __func__, __LINE__, platform_name);
- }
- else {
- LOC_LOGE("%s:%d]: Null parameter or array length less than PROPERTY_VALUE_MAX\n",
- __func__, __LINE__);
- }
-}
-
-unsigned int loc_get_target(void)
-{
- if (gTarget != (unsigned int)-1)
- return gTarget;
-
- static const char hw_platform[] = "/sys/devices/soc0/hw_platform";
- static const char id[] = "/sys/devices/soc0/soc_id";
- static const char hw_platform_dep[] =
- "/sys/devices/system/soc/soc0/hw_platform";
- static const char id_dep[] = "/sys/devices/system/soc/soc0/id";
- static const char mdm[] = "/dev/mdm"; // No such file or directory
-
- char rd_hw_platform[LINE_LEN];
- char rd_id[LINE_LEN];
- char rd_mdm[LINE_LEN];
- char baseband[LINE_LEN];
-
- if (is_qca1530()) {
- gTarget = TARGET_QCA1530;
- goto detected;
- }
-
- loc_get_target_baseband(baseband, sizeof(baseband));
-
- if (!access(hw_platform, F_OK)) {
- read_a_line(hw_platform, rd_hw_platform, LINE_LEN);
- } else {
- read_a_line(hw_platform_dep, rd_hw_platform, LINE_LEN);
- }
- if (!access(id, F_OK)) {
- read_a_line(id, rd_id, LINE_LEN);
- } else {
- read_a_line(id_dep, rd_id, LINE_LEN);
- }
-
- if( !memcmp(baseband, STR_APQ, LENGTH(STR_APQ)) ){
- if( !memcmp(rd_id, MPQ8064_ID_1, LENGTH(MPQ8064_ID_1))
- && IS_STR_END(rd_id[LENGTH(MPQ8064_ID_1)]) )
- gTarget = TARGET_MPQ;
- else
- gTarget = TARGET_APQ_SA;
- }
- else {
- if( (!memcmp(rd_hw_platform, STR_LIQUID, LENGTH(STR_LIQUID))
- && IS_STR_END(rd_hw_platform[LENGTH(STR_LIQUID)])) ||
- (!memcmp(rd_hw_platform, STR_SURF, LENGTH(STR_SURF))
- && IS_STR_END(rd_hw_platform[LENGTH(STR_SURF)])) ||
- (!memcmp(rd_hw_platform, STR_MTP, LENGTH(STR_MTP))
- && IS_STR_END(rd_hw_platform[LENGTH(STR_MTP)]))) {
-
- if (!read_a_line( mdm, rd_mdm, LINE_LEN))
- gTarget = TARGET_MDM;
- }
- else if( (!memcmp(rd_id, MSM8930_ID_1, LENGTH(MSM8930_ID_1))
- && IS_STR_END(rd_id[LENGTH(MSM8930_ID_1)])) ||
- (!memcmp(rd_id, MSM8930_ID_2, LENGTH(MSM8930_ID_2))
- && IS_STR_END(rd_id[LENGTH(MSM8930_ID_2)])) )
- gTarget = TARGET_MSM_NO_SSC;
- else
- gTarget = TARGET_UNKNOWN;
- }
-
-detected:
- LOC_LOGD("HAL: %s returned %d", __FUNCTION__, gTarget);
- return gTarget;
-}
diff --git a/gps/utils/loc_target.h b/gps/utils/loc_target.h
deleted file mode 100644
index 9aa525f..0000000
--- a/gps/utils/loc_target.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef LOC_TARGET_H
-#define LOC_TARGET_H
-#define TARGET_SET(gnss,ssc) ( (gnss<<1)|ssc )
-#define TARGET_DEFAULT TARGET_SET(GNSS_MSM, HAS_SSC)
-#define TARGET_MDM TARGET_SET(GNSS_MDM, HAS_SSC)
-#define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC)
-#define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC)
-#define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC)
-#define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC)
-#define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC)
-#define getTargetGnssType(target) (target>>1)
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-unsigned int loc_get_target(void);
-
-/*The character array passed to this function should have length
- of atleast PROPERTY_VALUE_MAX*/
-void loc_get_target_baseband(char *baseband, int array_length);
-/*The character array passed to this function should have length
- of atleast PROPERTY_VALUE_MAX*/
-void loc_get_platform_name(char *platform_name, int array_length);
-
-/* Please remember to update 'target_name' in loc_log.cpp,
- if do any changes to this enum. */
-typedef enum {
- GNSS_NONE = 0,
- GNSS_MSM,
- GNSS_GSS,
- GNSS_MDM,
- GNSS_QCA1530,
- GNSS_UNKNOWN
-}GNSS_TARGET;
-
-typedef enum {
- NO_SSC = 0,
- HAS_SSC
-}SSC_TYPE;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*LOC_TARGET_H*/
diff --git a/gps/utils/loc_timer.c b/gps/utils/loc_timer.c
deleted file mode 100644
index 1e4008e..0000000
--- a/gps/utils/loc_timer.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/* Copyright (c) 2013, 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<stdio.h>
-#include<stdlib.h>
-#include<sys/time.h>
-#include "loc_timer.h"
-#include<time.h>
-#include<errno.h>
-
-enum timer_state {
- READY = 100,
- WAITING,
- DONE,
- ABORT
-};
-
-typedef struct {
- loc_timer_callback callback_func;
- void *user_data;
- unsigned int time_msec;
- pthread_cond_t timer_cond;
- pthread_mutex_t timer_mutex;
- enum timer_state state;
-}timer_data;
-
-static void *timer_thread(void *thread_data)
-{
- int ret = -ETIMEDOUT;
- struct timespec ts;
- struct timeval tv;
- timer_data* t = (timer_data*)thread_data;
-
- LOC_LOGD("%s:%d]: Enter. Delay = %d\n", __func__, __LINE__, t->time_msec);
-
- gettimeofday(&tv, NULL);
- clock_gettime(CLOCK_REALTIME, &ts);
- if(t->time_msec >= 1000) {
- ts.tv_sec += t->time_msec/1000;
- t->time_msec = t->time_msec % 1000;
- }
- if(t->time_msec)
- ts.tv_nsec += t->time_msec * 1000000;
- if(ts.tv_nsec > 999999999) {
- LOC_LOGD("%s:%d]: Large nanosecs\n", __func__, __LINE__);
- ts.tv_sec += 1;
- ts.tv_nsec -= 1000000000;
- }
- LOC_LOGD("%s:%d]: ts.tv_sec:%d; ts.tv_nsec:%d\n"
- "\t Current time: %d sec; %d nsec",
- __func__, __LINE__, (int)ts.tv_sec, (int)ts.tv_nsec,
- (int)tv.tv_sec, (int)tv.tv_usec*1000);
-
- pthread_mutex_lock(&(t->timer_mutex));
- if (READY == t->state) {
- t->state = WAITING;
- ret = pthread_cond_timedwait(&t->timer_cond, &t->timer_mutex, &ts);
- t->state = DONE;
- }
- pthread_mutex_unlock(&(t->timer_mutex));
-
- switch (ret) {
- case ETIMEDOUT:
- LOC_LOGV("%s:%d]: loc_timer timed out", __func__, __LINE__);
- break;
- case 0:
- LOC_LOGV("%s:%d]: loc_timer stopped", __func__, __LINE__);
- break;
- case -ETIMEDOUT:
- LOC_LOGV("%s:%d]: loc_timer cancelled", __func__, __LINE__);
- break;
- default:
- LOC_LOGE("%s:%d]: Call to pthread timedwait failed; ret=%d\n",
- __func__, __LINE__, ret);
- break;
- }
-
- pthread_mutex_destroy(&t->timer_mutex);
- pthread_cond_destroy(&t->timer_cond);
-
- if(ETIMEDOUT == ret)
- t->callback_func(t->user_data, ret);
-
- free(t);
- LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__);
- return NULL;
-}
-
-void* loc_timer_start(unsigned int msec, loc_timer_callback cb_func,
- void* caller_data)
-{
- timer_data *t=NULL;
- pthread_attr_t tattr;
- pthread_t id;
- LOC_LOGD("%s:%d]: Enter\n", __func__, __LINE__);
- if(cb_func == NULL || msec == 0) {
- LOC_LOGE("%s:%d]: Error: Wrong parameters\n", __func__, __LINE__);
- goto _err;
- }
- t = (timer_data *)calloc(1, sizeof(timer_data));
- if(t == NULL) {
- LOC_LOGE("%s:%d]: Could not allocate memory. Failing.\n",
- __func__, __LINE__);
- goto _err;
- }
-
- if(pthread_cond_init(&(t->timer_cond), NULL)) {
- LOC_LOGE("%s:%d]: Pthread cond init failed\n", __func__, __LINE__);
- goto t_err;
- }
- if(pthread_mutex_init(&(t->timer_mutex), NULL)) {
- LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__);
- goto cond_err;
- }
-
- t->callback_func = cb_func;
- t->user_data = caller_data;
- t->time_msec = msec;
- t->state = READY;
-
- if (pthread_attr_init(&tattr)) {
- LOC_LOGE("%s:%d]: Pthread mutex init failed\n", __func__, __LINE__);
- goto mutex_err;
- }
- pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);
-
- if(pthread_create(&(id), &tattr, timer_thread, (void *)t)) {
- LOC_LOGE("%s:%d]: Could not create thread\n", __func__, __LINE__);
- goto attr_err;
- }
-
- LOC_LOGD("%s:%d]: Created thread with id: %d\n",
- __func__, __LINE__, (int)id);
- goto _err;
-
-attr_err:
- pthread_attr_destroy(&tattr);
-mutex_err:
- pthread_mutex_destroy(&t->timer_mutex);
-cond_err:
- pthread_cond_destroy(&t->timer_cond);
-t_err:
- free(t);
-_err:
- LOC_LOGD("%s:%d]: Exit\n", __func__, __LINE__);
- return t;
-}
-
-void loc_timer_stop(void* handle) {
- timer_data* t = (timer_data*)handle;
-
- if (NULL != t && (READY == t->state || WAITING == t->state)) {
- pthread_mutex_lock(&(t->timer_mutex));
- if (READY == t->state || WAITING == t->state) {
- pthread_cond_signal(&t->timer_cond);
- t->state = ABORT;
- }
- pthread_mutex_unlock(&(t->timer_mutex));
- }
-}
diff --git a/gps/utils/loc_timer.h b/gps/utils/loc_timer.h
deleted file mode 100644
index 0034d27..0000000
--- a/gps/utils/loc_timer.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Copyright (c) 2013, 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_DELAY_H__
-#define __LOC_DELAY_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-#include<pthread.h>
-#include "log_util.h"
-
-/*
- Return values:
- Success = 0
- Failure = Non zero
-*/
-typedef void(*loc_timer_callback)(void *user_data, int result);
-
-
-/*
- Returns the handle, which can be used to stop the timer
-*/
-void* loc_timer_start(unsigned int delay_msec,
- loc_timer_callback,
- void* user_data);
-
-/*
- handle becomes invalid upon the return of the callback
-*/
-void loc_timer_stop(void* handle);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif //__LOC_DELAY_H__
diff --git a/gps/utils/log_util.h b/gps/utils/log_util.h
deleted file mode 100644
index 8ff6b5a..0000000
--- a/gps/utils/log_util.h
+++ /dev/null
@@ -1,181 +0,0 @@
-/* Copyright (c) 2011-2014 The Linux Foundation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of The Linux Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef __LOG_UTIL_H__
-#define __LOG_UTIL_H__
-
-#ifndef USE_GLIB
-#include <utils/Log.h>
-#endif /* USE_GLIB */
-
-#ifdef USE_GLIB
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#ifndef LOG_TAG
-#define LOG_TAG "GPS_UTILS"
-
-#endif // LOG_TAG
-
-#endif /* USE_GLIB */
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/*=============================================================================
- *
- * LOC LOGGER TYPE DECLARATION
- *
- *============================================================================*/
-/* LOC LOGGER */
-typedef struct loc_logger_s
-{
- unsigned long DEBUG_LEVEL;
- unsigned long TIMESTAMP;
-} loc_logger_s_type;
-
-/*=============================================================================
- *
- * EXTERNAL DATA
- *
- *============================================================================*/
-extern loc_logger_s_type loc_logger;
-
-// Logging Improvements
-extern const char *loc_logger_boolStr[];
-
-extern const char *boolStr[];
-extern const char VOID_RET[];
-extern const char FROM_AFW[];
-extern const char TO_MODEM[];
-extern const char FROM_MODEM[];
-extern const char TO_AFW[];
-extern const char EXIT_TAG[];
-extern const char ENTRY_TAG[];
-/*=============================================================================
- *
- * MODULE EXPORTED FUNCTIONS
- *
- *============================================================================*/
-extern void loc_logger_init(unsigned long debug, unsigned long timestamp);
-extern char* get_timestamp(char* str, unsigned long buf_size);
-
-#ifndef DEBUG_DMN_LOC_API
-
-/* LOGGING MACROS */
-/*loc_logger.DEBUG_LEVEL is initialized to 0xff in loc_cfg.cpp
- if that value remains unchanged, it means gps.conf did not
- provide a value and we default to the initial value to use
- Android's logging levels*/
-#define IF_LOC_LOGE if((loc_logger.DEBUG_LEVEL >= 1) && (loc_logger.DEBUG_LEVEL <= 5))
-
-#define IF_LOC_LOGW if((loc_logger.DEBUG_LEVEL >= 2) && (loc_logger.DEBUG_LEVEL <= 5))
-
-#define IF_LOC_LOGI if((loc_logger.DEBUG_LEVEL >= 3) && (loc_logger.DEBUG_LEVEL <= 5))
-
-#define IF_LOC_LOGD if((loc_logger.DEBUG_LEVEL >= 4) && (loc_logger.DEBUG_LEVEL <= 5))
-
-#define IF_LOC_LOGV if((loc_logger.DEBUG_LEVEL >= 5) && (loc_logger.DEBUG_LEVEL <= 5))
-
-#define LOC_LOGE(...) \
-IF_LOC_LOGE { ALOGE("E/" __VA_ARGS__); } \
-else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGE("E/" __VA_ARGS__); }
-
-#define LOC_LOGW(...) \
-IF_LOC_LOGW { ALOGE("W/" __VA_ARGS__); } \
-else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGW("W/" __VA_ARGS__); }
-
-#define LOC_LOGI(...) \
-IF_LOC_LOGI { ALOGE("I/" __VA_ARGS__); } \
-else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGI("I/" __VA_ARGS__); }
-
-#define LOC_LOGD(...) \
-IF_LOC_LOGD { ALOGE("D/" __VA_ARGS__); } \
-else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGD("D/" __VA_ARGS__); }
-
-#define LOC_LOGV(...) \
-IF_LOC_LOGV { ALOGE("V/" __VA_ARGS__); } \
-else if (loc_logger.DEBUG_LEVEL == 0xff) { ALOGV("V/" __VA_ARGS__); }
-
-#else /* DEBUG_DMN_LOC_API */
-
-#define LOC_LOGE(...) ALOGE("E/" __VA_ARGS__)
-
-#define LOC_LOGW(...) ALOGW("W/" __VA_ARGS__)
-
-#define LOC_LOGI(...) ALOGI("I/" __VA_ARGS__)
-
-#define LOC_LOGD(...) ALOGD("D/" __VA_ARGS__)
-
-#define LOC_LOGV(...) ALOGV("V/" __VA_ARGS__)
-
-#endif /* DEBUG_DMN_LOC_API */
-
-/*=============================================================================
- *
- * LOGGING IMPROVEMENT MACROS
- *
- *============================================================================*/
-#define LOG_(LOC_LOG, ID, WHAT, SPEC, VAL) \
- do { \
- if (loc_logger.TIMESTAMP) { \
- char ts[32]; \
- LOC_LOG("[%s] %s %s line %d " #SPEC, \
- get_timestamp(ts, sizeof(ts)), ID, WHAT, __LINE__, VAL); \
- } else { \
- LOC_LOG("%s %s line %d " #SPEC, \
- ID, WHAT, __LINE__, VAL); \
- } \
- } while(0)
-
-
-#define LOG_I(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGI, ID, WHAT, SPEC, VAL)
-#define LOG_V(ID, WHAT, SPEC, VAL) LOG_(LOC_LOGV, ID, WHAT, SPEC, VAL)
-
-#define ENTRY_LOG() LOG_V(ENTRY_TAG, __func__, %s, "")
-#define EXIT_LOG(SPEC, VAL) LOG_V(EXIT_TAG, __func__, SPEC, VAL)
-
-
-// Used for logging callflow from Android Framework
-#define ENTRY_LOG_CALLFLOW() LOG_I(FROM_AFW, __func__, %s, "")
-// Used for logging callflow to Modem
-#define EXIT_LOG_CALLFLOW(SPEC, VAL) LOG_I(TO_MODEM, __func__, SPEC, VAL)
-// Used for logging callflow from Modem(TO_MODEM, __func__, %s, "")
-#define MODEM_LOG_CALLFLOW(SPEC, VAL) LOG_I(FROM_MODEM, __func__, SPEC, VAL)
-// Used for logging callflow to Android Framework
-#define CALLBACK_LOG_CALLFLOW(CB, SPEC, VAL) LOG_I(TO_AFW, CB, SPEC, VAL)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __LOG_UTIL_H__
diff --git a/gps/utils/msg_q.c b/gps/utils/msg_q.c
deleted file mode 100644
index f82d4c0..0000000
--- a/gps/utils/msg_q.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/* Copyright (c) 2011-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
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "msg_q.h"
-
-#define LOG_TAG "LocSvc_utils_q"
-#include "log_util.h"
-#include "platform_lib_includes.h"
-#include "linked_list.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <pthread.h>
-
-typedef struct msg_q {
- void* msg_list; /* Linked list to store information */
- pthread_cond_t list_cond; /* Condition variable for waiting on msg queue */
- pthread_mutex_t list_mutex; /* Mutex for exclusive access to message queue */
- int unblocked; /* Has this message queue been unblocked? */
-} msg_q;
-
-/*===========================================================================
-FUNCTION convert_linked_list_err_type
-
-DESCRIPTION
- Converts from one set of enum values to another.
-
- linked_list_val: Value to convert to msg_q_enum_type
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Corresponding linked_list_enum_type in msg_q_enum_type
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-static msq_q_err_type convert_linked_list_err_type(linked_list_err_type linked_list_val)
-{
- switch( linked_list_val )
- {
- case eLINKED_LIST_SUCCESS:
- return eMSG_Q_SUCCESS;
- case eLINKED_LIST_INVALID_PARAMETER:
- return eMSG_Q_INVALID_PARAMETER;
- case eLINKED_LIST_INVALID_HANDLE:
- return eMSG_Q_INVALID_HANDLE;
- case eLINKED_LIST_UNAVAILABLE_RESOURCE:
- return eMSG_Q_UNAVAILABLE_RESOURCE;
- case eLINKED_LIST_INSUFFICIENT_BUFFER:
- return eMSG_Q_INSUFFICIENT_BUFFER;
-
- case eLINKED_LIST_FAILURE_GENERAL:
- default:
- return eMSG_Q_FAILURE_GENERAL;
- }
-}
-
-/* ----------------------- END INTERNAL FUNCTIONS ---------------------------------------- */
-
-/*===========================================================================
-
- FUNCTION: msg_q_init
-
- ===========================================================================*/
-msq_q_err_type msg_q_init(void** msg_q_data)
-{
- if( msg_q_data == NULL )
- {
- LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__);
- return eMSG_Q_INVALID_PARAMETER;
- }
-
- msg_q* tmp_msg_q;
- tmp_msg_q = (msg_q*)calloc(1, sizeof(msg_q));
- if( tmp_msg_q == NULL )
- {
- LOC_LOGE("%s: Unable to allocate space for message queue!\n", __FUNCTION__);
- return eMSG_Q_FAILURE_GENERAL;
- }
-
- if( linked_list_init(&tmp_msg_q->msg_list) != 0 )
- {
- LOC_LOGE("%s: Unable to initialize storage list!\n", __FUNCTION__);
- free(tmp_msg_q);
- return eMSG_Q_FAILURE_GENERAL;
- }
-
- if( pthread_mutex_init(&tmp_msg_q->list_mutex, NULL) != 0 )
- {
- LOC_LOGE("%s: Unable to initialize list mutex!\n", __FUNCTION__);
- linked_list_destroy(&tmp_msg_q->msg_list);
- free(tmp_msg_q);
- return eMSG_Q_FAILURE_GENERAL;
- }
-
- if( pthread_cond_init(&tmp_msg_q->list_cond, NULL) != 0 )
- {
- LOC_LOGE("%s: Unable to initialize msg q cond var!\n", __FUNCTION__);
- linked_list_destroy(&tmp_msg_q->msg_list);
- pthread_mutex_destroy(&tmp_msg_q->list_mutex);
- free(tmp_msg_q);
- return eMSG_Q_FAILURE_GENERAL;
- }
-
- tmp_msg_q->unblocked = 0;
-
- *msg_q_data = tmp_msg_q;
-
- return eMSG_Q_SUCCESS;
-}
-
-/*===========================================================================
-
- FUNCTION: msg_q_init2
-
- ===========================================================================*/
-const void* msg_q_init2()
-{
- void* q = NULL;
- if (eMSG_Q_SUCCESS != msg_q_init(&q)) {
- q = NULL;
- }
- return q;
-}
-
-/*===========================================================================
-
- FUNCTION: msg_q_destroy
-
- ===========================================================================*/
-msq_q_err_type msg_q_destroy(void** msg_q_data)
-{
- if( msg_q_data == NULL )
- {
- LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__);
- return eMSG_Q_INVALID_HANDLE;
- }
-
- msg_q* p_msg_q = (msg_q*)*msg_q_data;
-
- linked_list_destroy(&p_msg_q->msg_list);
- pthread_mutex_destroy(&p_msg_q->list_mutex);
- pthread_cond_destroy(&p_msg_q->list_cond);
-
- p_msg_q->unblocked = 0;
-
- free(*msg_q_data);
- *msg_q_data = NULL;
-
- return eMSG_Q_SUCCESS;
-}
-
-/*===========================================================================
-
- FUNCTION: msg_q_snd
-
- ===========================================================================*/
-msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*))
-{
- msq_q_err_type rv;
- if( msg_q_data == NULL )
- {
- LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__);
- return eMSG_Q_INVALID_HANDLE;
- }
- if( msg_obj == NULL )
- {
- LOC_LOGE("%s: Invalid msg_obj parameter!\n", __FUNCTION__);
- return eMSG_Q_INVALID_PARAMETER;
- }
-
- msg_q* p_msg_q = (msg_q*)msg_q_data;
-
- pthread_mutex_lock(&p_msg_q->list_mutex);
- LOC_LOGD("%s: Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj);
-
- if( p_msg_q->unblocked )
- {
- LOC_LOGE("%s: Message queue has been unblocked.\n", __FUNCTION__);
- pthread_mutex_unlock(&p_msg_q->list_mutex);
- return eMSG_Q_UNAVAILABLE_RESOURCE;
- }
-
- rv = convert_linked_list_err_type(linked_list_add(p_msg_q->msg_list, msg_obj, dealloc));
-
- /* Show data is in the message queue. */
- pthread_cond_signal(&p_msg_q->list_cond);
-
- pthread_mutex_unlock(&p_msg_q->list_mutex);
-
- LOC_LOGD("%s: Finished Sending message with handle = 0x%08X\n", __FUNCTION__, msg_obj);
-
- return rv;
-}
-
-/*===========================================================================
-
- FUNCTION: msg_q_rcv
-
- ===========================================================================*/
-msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj)
-{
- msq_q_err_type rv;
- if( msg_q_data == NULL )
- {
- LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__);
- return eMSG_Q_INVALID_HANDLE;
- }
-
- if( msg_obj == NULL )
- {
- LOC_LOGE("%s: Invalid msg_obj parameter!\n", __FUNCTION__);
- return eMSG_Q_INVALID_PARAMETER;
- }
-
- msg_q* p_msg_q = (msg_q*)msg_q_data;
-
- LOC_LOGD("%s: Waiting on message\n", __FUNCTION__);
-
- pthread_mutex_lock(&p_msg_q->list_mutex);
-
- if( p_msg_q->unblocked )
- {
- LOC_LOGE("%s: Message queue has been unblocked.\n", __FUNCTION__);
- pthread_mutex_unlock(&p_msg_q->list_mutex);
- return eMSG_Q_UNAVAILABLE_RESOURCE;
- }
-
- /* Wait for data in the message queue */
- while( linked_list_empty(p_msg_q->msg_list) && !p_msg_q->unblocked )
- {
- pthread_cond_wait(&p_msg_q->list_cond, &p_msg_q->list_mutex);
- }
-
- rv = convert_linked_list_err_type(linked_list_remove(p_msg_q->msg_list, msg_obj));
-
- pthread_mutex_unlock(&p_msg_q->list_mutex);
-
- LOC_LOGD("%s: Received message 0x%08X rv = %d\n", __FUNCTION__, *msg_obj, rv);
-
- return rv;
-}
-
-/*===========================================================================
-
- FUNCTION: msg_q_flush
-
- ===========================================================================*/
-msq_q_err_type msg_q_flush(void* msg_q_data)
-{
- msq_q_err_type rv;
- if ( msg_q_data == NULL )
- {
- LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__);
- return eMSG_Q_INVALID_HANDLE;
- }
-
- msg_q* p_msg_q = (msg_q*)msg_q_data;
-
- LOC_LOGD("%s: Flushing Message Queue\n", __FUNCTION__);
-
- pthread_mutex_lock(&p_msg_q->list_mutex);
-
- /* Remove all elements from the list */
- rv = convert_linked_list_err_type(linked_list_flush(p_msg_q->msg_list));
-
- pthread_mutex_unlock(&p_msg_q->list_mutex);
-
- LOC_LOGD("%s: Message Queue flushed\n", __FUNCTION__);
-
- return rv;
-}
-
-/*===========================================================================
-
- FUNCTION: msg_q_unblock
-
- ===========================================================================*/
-msq_q_err_type msg_q_unblock(void* msg_q_data)
-{
- if ( msg_q_data == NULL )
- {
- LOC_LOGE("%s: Invalid msg_q_data parameter!\n", __FUNCTION__);
- return eMSG_Q_INVALID_HANDLE;
- }
-
- msg_q* p_msg_q = (msg_q*)msg_q_data;
- pthread_mutex_lock(&p_msg_q->list_mutex);
-
- if( p_msg_q->unblocked )
- {
- LOC_LOGE("%s: Message queue has been unblocked.\n", __FUNCTION__);
- pthread_mutex_unlock(&p_msg_q->list_mutex);
- return eMSG_Q_UNAVAILABLE_RESOURCE;
- }
-
- LOC_LOGD("%s: Unblocking Message Queue\n", __FUNCTION__);
- /* Unblocking message queue */
- p_msg_q->unblocked = 1;
-
- /* Allow all the waiters to wake up */
- pthread_cond_broadcast(&p_msg_q->list_cond);
-
- pthread_mutex_unlock(&p_msg_q->list_mutex);
-
- LOC_LOGD("%s: Message Queue unblocked\n", __FUNCTION__);
-
- return eMSG_Q_SUCCESS;
-}
diff --git a/gps/utils/msg_q.h b/gps/utils/msg_q.h
deleted file mode 100644
index 453b8ce..0000000
--- a/gps/utils/msg_q.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/* Copyright (c) 2011, 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 __MSG_Q_H__
-#define __MSG_Q_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#include <stdlib.h>
-
-/** Linked List Return Codes */
-typedef enum
-{
- eMSG_Q_SUCCESS = 0,
- /**< Request was successful. */
- eMSG_Q_FAILURE_GENERAL = -1,
- /**< Failed because of a general failure. */
- eMSG_Q_INVALID_PARAMETER = -2,
- /**< Failed because the request contained invalid parameters. */
- eMSG_Q_INVALID_HANDLE = -3,
- /**< Failed because an invalid handle was specified. */
- eMSG_Q_UNAVAILABLE_RESOURCE = -4,
- /**< Failed because an there were not enough resources. */
- eMSG_Q_INSUFFICIENT_BUFFER = -5,
- /**< Failed because an the supplied buffer was too small. */
-}msq_q_err_type;
-
-/*===========================================================================
-FUNCTION msg_q_init
-
-DESCRIPTION
- Initializes internal structures for message queue.
-
- msg_q_data: pointer to an opaque Q handle to be returned; NULL if fails
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-msq_q_err_type msg_q_init(void** msg_q_data);
-
-/*===========================================================================
-FUNCTION msg_q_init2
-
-DESCRIPTION
- Initializes internal structures for message queue.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- opaque handle to the Q created; NULL if create fails
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-const void* msg_q_init2();
-
-/*===========================================================================
-FUNCTION msg_q_destroy
-
-DESCRIPTION
- Releases internal structures for message queue.
-
- msg_q_data: State of message queue to be released.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-msq_q_err_type msg_q_destroy(void** msg_q_data);
-
-/*===========================================================================
-FUNCTION msg_q_snd
-
-DESCRIPTION
- Sends data to the message queue. The passed in data pointer
- is not modified or freed. Passed in msg_obj is expected to live throughout
- the use of the msg_q (i.e. data is not allocated internally)
-
- msg_q_data: Message Queue to add the element to.
- msgp: Pointer to data to add into message queue.
- dealloc: Function used to deallocate memory for this element. Pass NULL
- if you do not want data deallocated during a flush operation
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-msq_q_err_type msg_q_snd(void* msg_q_data, void* msg_obj, void (*dealloc)(void*));
-
-/*===========================================================================
-FUNCTION msg_q_rcv
-
-DESCRIPTION
- Retrieves data from the message queue. msg_obj is the oldest message received
- and pointer is simply removed from message queue.
-
- msg_q_data: Message Queue to copy data from into msgp.
- msg_obj: Pointer to space to copy msg_q contents to.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-msq_q_err_type msg_q_rcv(void* msg_q_data, void** msg_obj);
-
-/*===========================================================================
-FUNCTION msg_q_flush
-
-DESCRIPTION
- Function removes all elements from the message queue.
-
- msg_q_data: Message Queue to remove elements from.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-msq_q_err_type msg_q_flush(void* msg_q_data);
-
-/*===========================================================================
-FUNCTION msg_q_unblock
-
-DESCRIPTION
- This function will stop use of the message queue. All waiters will wake up
- and likely receive nothing from the queue resulting in a negative return
- value. The message queue can no longer be used until it is destroyed
- and initialized again after calling this function.
-
- msg_q_data: Message queue to unblock.
-
-DEPENDENCIES
- N/A
-
-RETURN VALUE
- Look at error codes above.
-
-SIDE EFFECTS
- N/A
-
-===========================================================================*/
-msq_q_err_type msg_q_unblock(void* msg_q_data);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __MSG_Q_H__ */
diff --git a/gps/utils/sec_gps.c b/gps/utils/sec_gps.c
deleted file mode 100644
index d5b1226..0000000
--- a/gps/utils/sec_gps.c
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-int sec_gps_conf(void)
-{
- return 0;
-}
-
-int Sec_Configuration(void)
-{
- return 0;
-}
-
diff --git a/include/device_perms.h b/include/device_perms.h
deleted file mode 100644
index f45b431..0000000
--- a/include/device_perms.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2012 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.
- */
-
-#ifndef DEVICE_PERMS_H
-#define DEVICE_PERMS_H
-
-#define PROPERTY_PERMS_APPEND \
- { "persist.audio.", AID_SYSTEM, 0 }, \
- { "persist.sys.camera.", AID_MEDIA, 0 },
-#endif /* DEVICE_PERMS_H */
diff --git a/include/hardware/gps.h b/include/hardware/gps.h
deleted file mode 100644
index c7ff20f..0000000
--- a/include/hardware/gps.h
+++ /dev/null
@@ -1,966 +0,0 @@
-/*
- * Copyright (C) 2010 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_INCLUDE_HARDWARE_GPS_H
-#define ANDROID_INCLUDE_HARDWARE_GPS_H
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <pthread.h>
-
-#include <hardware/hardware.h>
-
-__BEGIN_DECLS
-
-/**
- * The id of this module
- */
-#define GPS_HARDWARE_MODULE_ID "gps"
-
-
-/** Milliseconds since January 1, 1970 */
-typedef int64_t GpsUtcTime;
-
-/** Maximum number of SVs for gps_sv_status_callback(). */
-#define GPS_MAX_SVS 32
-
-/** Requested operational mode for GPS operation. */
-typedef uint32_t GpsPositionMode;
-// IMPORTANT: Note that the following values must match
-// constants in GpsLocationProvider.java.
-/** Mode for running GPS standalone (no assistance). */
-#define GPS_POSITION_MODE_STANDALONE 0
-/** AGPS MS-Based mode. */
-#define GPS_POSITION_MODE_MS_BASED 1
-/** AGPS MS-Assisted mode. */
-#define GPS_POSITION_MODE_MS_ASSISTED 2
-
-/** Requested recurrence mode for GPS operation. */
-typedef uint32_t GpsPositionRecurrence;
-// IMPORTANT: Note that the following values must match
-// constants in GpsLocationProvider.java.
-/** Receive GPS fixes on a recurring basis at a specified period. */
-#define GPS_POSITION_RECURRENCE_PERIODIC 0
-/** Request a single shot GPS fix. */
-#define GPS_POSITION_RECURRENCE_SINGLE 1
-
-/** GPS status event values. */
-typedef uint16_t GpsStatusValue;
-// IMPORTANT: Note that the following values must match
-// constants in GpsLocationProvider.java.
-/** GPS status unknown. */
-#define GPS_STATUS_NONE 0
-/** GPS has begun navigating. */
-#define GPS_STATUS_SESSION_BEGIN 1
-/** GPS has stopped navigating. */
-#define GPS_STATUS_SESSION_END 2
-/** GPS has powered on but is not navigating. */
-#define GPS_STATUS_ENGINE_ON 3
-/** GPS is powered off. */
-#define GPS_STATUS_ENGINE_OFF 4
-
-/** Flags to indicate which values are valid in a GpsLocation. */
-typedef uint16_t GpsLocationFlags;
-// IMPORTANT: Note that the following values must match
-// constants in GpsLocationProvider.java.
-/** GpsLocation has valid latitude and longitude. */
-#define GPS_LOCATION_HAS_LAT_LONG 0x0001
-/** GpsLocation has valid altitude. */
-#define GPS_LOCATION_HAS_ALTITUDE 0x0002
-/** GpsLocation has valid speed. */
-#define GPS_LOCATION_HAS_SPEED 0x0004
-/** GpsLocation has valid bearing. */
-#define GPS_LOCATION_HAS_BEARING 0x0008
-/** GpsLocation has valid accuracy. */
-#define GPS_LOCATION_HAS_ACCURACY 0x0010
-
-/** Flags for the gps_set_capabilities callback. */
-
-/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode.
- If this is not set, then the framework will use 1000ms for min_interval
- and will start and call start() and stop() to schedule the GPS.
- */
-#define GPS_CAPABILITY_SCHEDULING 0x0000001
-/** GPS supports MS-Based AGPS mode */
-#define GPS_CAPABILITY_MSB 0x0000002
-/** GPS supports MS-Assisted AGPS mode */
-#define GPS_CAPABILITY_MSA 0x0000004
-/** GPS supports single-shot fixes */
-#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008
-/** GPS supports on demand time injection */
-#define GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010
-/** GPS supports Geofencing */
-#define GPS_CAPABILITY_GEOFENCING 0x0000020
-
-/** Flags used to specify which aiding data to delete
- when calling delete_aiding_data(). */
-typedef uint32_t GpsAidingData;
-// IMPORTANT: Note that the following values must match
-// constants in GpsLocationProvider.java.
-#define GPS_DELETE_EPHEMERIS 0x00000001
-#define GPS_DELETE_ALMANAC 0x00000002
-#define GPS_DELETE_POSITION 0x00000004
-#define GPS_DELETE_TIME 0x00000008
-#define GPS_DELETE_IONO 0x00000010
-#define GPS_DELETE_UTC 0x00000020
-#define GPS_DELETE_HEALTH 0x00000040
-#define GPS_DELETE_SVDIR 0x00000080
-#define GPS_DELETE_SVSTEER 0x00000100
-#define GPS_DELETE_SADATA 0x00000200
-#define GPS_DELETE_RTI 0x00000400
-#define GPS_DELETE_CELLDB_INFO 0x00000800
-#define GPS_DELETE_ALMANAC_CORR 0x00001000
-#define GPS_DELETE_FREQ_BIAS_EST 0x00002000
-#define GLO_DELETE_EPHEMERIS 0x00004000
-#define GLO_DELETE_ALMANAC 0x00008000
-#define GLO_DELETE_SVDIR 0x00010000
-#define GLO_DELETE_SVSTEER 0x00020000
-#define GLO_DELETE_ALMANAC_CORR 0x00040000
-#define GPS_DELETE_TIME_GPS 0x00080000
-#define GLO_DELETE_TIME 0x00100000
-#define BDS_DELETE_SVDIR 0X00200000
-#define BDS_DELETE_SVSTEER 0X00400000
-#define BDS_DELETE_TIME 0X00800000
-#define BDS_DELETE_ALMANAC_CORR 0X01000000
-#define BDS_DELETE_EPHEMERIS 0X02000000
-#define BDS_DELETE_ALMANAC 0X04000000
-
-#define GPS_DELETE_ALL 0xFFFFFFFF
-
-/** AGPS type */
-typedef uint16_t AGpsType;
-#define AGPS_TYPE_SUPL 1
-#define AGPS_TYPE_C2K 2
-
-typedef uint16_t AGpsSetIDType;
-#define AGPS_SETID_TYPE_NONE 0
-#define AGPS_SETID_TYPE_IMSI 1
-#define AGPS_SETID_TYPE_MSISDN 2
-
-/**
- * String length constants
- */
-#define GPS_NI_SHORT_STRING_MAXLEN 256
-#define GPS_NI_LONG_STRING_MAXLEN 2048
-
-/**
- * GpsNiType constants
- */
-typedef uint32_t GpsNiType;
-#define GPS_NI_TYPE_VOICE 1
-#define GPS_NI_TYPE_UMTS_SUPL 2
-#define GPS_NI_TYPE_UMTS_CTRL_PLANE 3
-
-/**
- * GpsNiNotifyFlags constants
- */
-typedef uint32_t GpsNiNotifyFlags;
-/** NI requires notification */
-#define GPS_NI_NEED_NOTIFY 0x0001
-/** NI requires verification */
-#define GPS_NI_NEED_VERIFY 0x0002
-/** NI requires privacy override, no notification/minimal trace */
-#define GPS_NI_PRIVACY_OVERRIDE 0x0004
-
-/**
- * GPS NI responses, used to define the response in
- * NI structures
- */
-typedef int GpsUserResponseType;
-#define GPS_NI_RESPONSE_ACCEPT 1
-#define GPS_NI_RESPONSE_DENY 2
-#define GPS_NI_RESPONSE_NORESP 3
-
-/**
- * NI data encoding scheme
- */
-typedef int GpsNiEncodingType;
-#define GPS_ENC_NONE 0
-#define GPS_ENC_SUPL_GSM_DEFAULT 1
-#define GPS_ENC_SUPL_UTF8 2
-#define GPS_ENC_SUPL_UCS2 3
-#define GPS_ENC_UNKNOWN -1
-
-/** AGPS status event values. */
-typedef uint16_t AGpsStatusValue;
-/** GPS requests data connection for AGPS. */
-#define GPS_REQUEST_AGPS_DATA_CONN 1
-/** GPS releases the AGPS data connection. */
-#define GPS_RELEASE_AGPS_DATA_CONN 2
-/** AGPS data connection initiated */
-#define GPS_AGPS_DATA_CONNECTED 3
-/** AGPS data connection completed */
-#define GPS_AGPS_DATA_CONN_DONE 4
-/** AGPS data connection failed */
-#define GPS_AGPS_DATA_CONN_FAILED 5
-
-#define AGPS_REF_LOCATION_TYPE_GSM_CELLID 1
-#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2
-#define AGPS_REG_LOCATION_TYPE_MAC 3
-
-/** Network types for update_network_state "type" parameter */
-#define AGPS_RIL_NETWORK_TYPE_MOBILE 0
-#define AGPS_RIL_NETWORK_TYPE_WIFI 1
-#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2
-#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3
-#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4
-#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5
-#define AGPS_RIL_NETWORK_TTYPE_WIMAX 6
-
-/**
- * Name for the GPS XTRA interface.
- */
-#define GPS_XTRA_INTERFACE "gps-xtra"
-
-/**
- * Name for the GPS DEBUG interface.
- */
-#define GPS_DEBUG_INTERFACE "gps-debug"
-
-/**
- * Name for the AGPS interface.
- */
-#define AGPS_INTERFACE "agps"
-
-/**
- * Name for NI interface
- */
-#define GPS_NI_INTERFACE "gps-ni"
-
-/**
- * Name for the AGPS-RIL interface.
- */
-#define AGPS_RIL_INTERFACE "agps_ril"
-
-/**
- * Name for the GPS_Geofencing interface.
- */
-#define GPS_GEOFENCING_INTERFACE "gps_geofencing"
-
-
-/** Represents a location. */
-typedef struct {
- /** set to sizeof(GpsLocation) */
- size_t size;
- /** Contains GpsLocationFlags bits. */
- uint16_t flags;
- /** Represents latitude in degrees. */
- double latitude;
- /** Represents longitude in degrees. */
- double longitude;
- /** Represents altitude in meters above the WGS 84 reference
- * ellipsoid. */
- double altitude;
- /** Represents speed in meters per second. */
- float speed;
- /** Represents heading in degrees. */
- float bearing;
- /** Represents expected accuracy in meters. */
- float accuracy;
- /** Timestamp for the location fix. */
- GpsUtcTime timestamp;
-} GpsLocation;
-
-/** Represents the status. */
-typedef struct {
- /** set to sizeof(GpsStatus) */
- size_t size;
- GpsStatusValue status;
-} GpsStatus;
-
-/** Represents SV information. */
-typedef struct {
- /** set to sizeof(GpsSvInfo) */
- size_t size;
- /** Pseudo-random number for the SV. */
-
- int prn;
-
- /** Signal to noise ratio. */
- float snr;
-
- /** Elevation of SV in degrees. */
- float elevation;
-
- /** Azimuth of SV in degrees. */
- float azimuth;
-
- int used;
-
-} GpsSvInfo;
-
-/** Represents SV status. */
-typedef struct {
- /** set to sizeof(GpsSvStatus) */
- size_t size;
-
- /** Number of SVs currently visible. */
- int num_svs;
-
- /** Contains an array of SV information. */
- GpsSvInfo sv_list[GPS_MAX_SVS];
-
- /** Represents a bit mask indicating which SVs
- * have ephemeris data.
- */
- uint32_t ephemeris_mask;
-
- /** Represents a bit mask indicating which SVs
- * have almanac data.
- */
- uint32_t almanac_mask;
-
- /**
- * Represents a bit mask indicating which SVs
- * were used for computing the most recent position fix.
- */
- uint32_t used_in_fix_mask;
-
-} GpsSvStatus;
-
-/* 2G and 3G */
-/* In 3G lac is discarded */
-typedef struct {
- uint16_t type;
- uint16_t mcc;
- uint16_t mnc;
- uint16_t lac;
-#ifdef AGPS_USE_PSC
- uint16_t psc;
-#endif
- uint32_t cid;
-} AGpsRefLocationCellID;
-
-typedef struct {
- uint8_t mac[6];
-} AGpsRefLocationMac;
-
-/** Represents ref locations */
-typedef struct {
- uint16_t type;
- union {
- AGpsRefLocationCellID cellID;
- AGpsRefLocationMac mac;
- } u;
-} AGpsRefLocation;
-
-/** Callback with location information.
- * Can only be called from a thread created by create_thread_cb.
- */
-typedef void (* gps_location_callback)(GpsLocation* location);
-
-/** Callback with status information.
- * Can only be called from a thread created by create_thread_cb.
- */
-typedef void (* gps_status_callback)(GpsStatus* status);
-
-/** Callback with SV status information.
- * Can only be called from a thread created by create_thread_cb.
- */
-typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info);
-
-/** Callback for reporting NMEA sentences.
- * Can only be called from a thread created by create_thread_cb.
- */
-typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length);
-
-/** Callback to inform framework of the GPS engine's capabilities.
- * Capability parameter is a bit field of GPS_CAPABILITY_* flags.
- */
-typedef void (* gps_set_capabilities)(uint32_t capabilities);
-
-/** Callback utility for acquiring the GPS wakelock.
- * This can be used to prevent the CPU from suspending while handling GPS events.
- */
-typedef void (* gps_acquire_wakelock)();
-
-/** Callback utility for releasing the GPS wakelock. */
-typedef void (* gps_release_wakelock)();
-
-/** Callback for requesting NTP time */
-typedef void (* gps_request_utc_time)();
-
-/** Callback for creating a thread that can call into the Java framework code.
- * This must be used to create any threads that report events up to the framework.
- */
-typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg);
-
-/** GPS callback structure. */
-typedef struct {
- /** set to sizeof(GpsCallbacks) */
- size_t size;
- gps_location_callback location_cb;
- gps_status_callback status_cb;
- gps_sv_status_callback sv_status_cb;
- gps_nmea_callback nmea_cb;
- gps_set_capabilities set_capabilities_cb;
- gps_acquire_wakelock acquire_wakelock_cb;
- gps_release_wakelock release_wakelock_cb;
- gps_create_thread create_thread_cb;
- gps_request_utc_time request_utc_time_cb;
-} GpsCallbacks;
-
-
-/** Represents the standard GPS interface. */
-typedef struct {
- /** set to sizeof(GpsInterface) */
- size_t size;
- /**
- * Opens the interface and provides the callback routines
- * to the implemenation of this interface.
- */
- int (*init)( GpsCallbacks* callbacks );
-
- /** Starts navigating. */
- int (*start)( void );
-
- /** Stops navigating. */
- int (*stop)( void );
-
- /** Closes the interface. */
- void (*cleanup)( void );
-
- /** Injects the current time. */
- int (*inject_time)(GpsUtcTime time, int64_t timeReference,
- int uncertainty);
-
- /** Injects current location from another location provider
- * (typically cell ID).
- * latitude and longitude are measured in degrees
- * expected accuracy is measured in meters
- */
- int (*inject_location)(double latitude, double longitude, float accuracy);
-
- /**
- * Specifies that the next call to start will not use the
- * information defined in the flags. GPS_DELETE_ALL is passed for
- * a cold start.
- */
- void (*delete_aiding_data)(GpsAidingData flags);
-
- /**
- * min_interval represents the time between fixes in milliseconds.
- * preferred_accuracy represents the requested fix accuracy in meters.
- * preferred_time represents the requested time to first fix in milliseconds.
- */
- int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence,
- uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time);
-
- /** Get a pointer to extension information. */
- const void* (*get_extension)(const char* name);
-} GpsInterface;
-
-/** Callback to request the client to download XTRA data.
- * The client should download XTRA data and inject it by calling inject_xtra_data().
- * Can only be called from a thread created by create_thread_cb.
- */
-typedef void (* gps_xtra_download_request)();
-
-/** Callback structure for the XTRA interface. */
-typedef struct {
- gps_xtra_download_request download_request_cb;
- gps_create_thread create_thread_cb;
-} GpsXtraCallbacks;
-
-/** Extended interface for XTRA support. */
-typedef struct {
- /** set to sizeof(GpsXtraInterface) */
- size_t size;
- /**
- * Opens the XTRA interface and provides the callback routines
- * to the implemenation of this interface.
- */
- int (*init)( GpsXtraCallbacks* callbacks );
- /** Injects XTRA data into the GPS. */
- int (*inject_xtra_data)( char* data, int length );
-} GpsXtraInterface;
-
-/** Extended interface for DEBUG support. */
-typedef struct {
- /** set to sizeof(GpsDebugInterface) */
- size_t size;
-
- /**
- * This function should return any information that the native
- * implementation wishes to include in a bugreport.
- */
- size_t (*get_internal_state)(char* buffer, size_t bufferSize);
-} GpsDebugInterface;
-
-/** Represents the status of AGPS. */
-typedef struct {
- /** set to sizeof(AGpsStatus) */
- size_t size;
-
- AGpsType type;
- AGpsStatusValue status;
- uint32_t ipaddr;
-} AGpsStatus;
-
-/** Callback with AGPS status information.
- * Can only be called from a thread created by create_thread_cb.
- */
-typedef void (* agps_status_callback)(AGpsStatus* status);
-
-/** Callback structure for the AGPS interface. */
-typedef struct {
- agps_status_callback status_cb;
- gps_create_thread create_thread_cb;
-} AGpsCallbacks;
-
-
-/** Extended interface for AGPS support. */
-typedef struct {
- /** set to sizeof(AGpsInterface) */
- size_t size;
-
- /**
- * Opens the AGPS interface and provides the callback routines
- * to the implemenation of this interface.
- */
- void (*init)( AGpsCallbacks* callbacks );
- /**
- * Notifies that a data connection is available and sets
- * the name of the APN to be used for SUPL.
- */
- int (*data_conn_open)( const char* apn );
- /**
- * Notifies that the AGPS data connection has been closed.
- */
- int (*data_conn_closed)();
- /**
- * Notifies that a data connection is not available for AGPS.
- */
- int (*data_conn_failed)();
- /**
- * Sets the hostname and port for the AGPS server.
- */
- int (*set_server)( AGpsType type, const char* hostname, int port );
-} AGpsInterface;
-
-
-/** Represents an NI request */
-typedef struct {
- /** set to sizeof(GpsNiNotification) */
- size_t size;
-
- /**
- * An ID generated by HAL to associate NI notifications and UI
- * responses
- */
- int notification_id;
-
- /**
- * An NI type used to distinguish different categories of NI
- * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ...
- */
- GpsNiType ni_type;
-
- /**
- * Notification/verification options, combinations of GpsNiNotifyFlags constants
- */
- GpsNiNotifyFlags notify_flags;
-
- /**
- * Timeout period to wait for user response.
- * Set to 0 for no time out limit.
- */
- int timeout;
-
- /**
- * Default response when time out.
- */
- GpsUserResponseType default_response;
-
- /**
- * Requestor ID
- */
- char requestor_id[GPS_NI_SHORT_STRING_MAXLEN];
-
- /**
- * Notification message. It can also be used to store client_id in some cases
- */
- char text[GPS_NI_LONG_STRING_MAXLEN];
-
- /**
- * Client name decoding scheme
- */
- GpsNiEncodingType requestor_id_encoding;
-
- /**
- * Client name decoding scheme
- */
- GpsNiEncodingType text_encoding;
-
- /**
- * A pointer to extra data. Format:
- * key_1 = value_1
- * key_2 = value_2
- */
- char extras[GPS_NI_LONG_STRING_MAXLEN];
-
-} GpsNiNotification;
-
-/** Callback with NI notification.
- * Can only be called from a thread created by create_thread_cb.
- */
-typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification);
-
-/** GPS NI callback structure. */
-typedef struct
-{
- /**
- * Sends the notification request from HAL to GPSLocationProvider.
- */
- gps_ni_notify_callback notify_cb;
- gps_create_thread create_thread_cb;
-} GpsNiCallbacks;
-
-/**
- * Extended interface for Network-initiated (NI) support.
- */
-typedef struct
-{
- /** set to sizeof(GpsNiInterface) */
- size_t size;
-
- /** Registers the callbacks for HAL to use. */
- void (*init) (GpsNiCallbacks *callbacks);
-
- /** Sends a response to HAL. */
- void (*respond) (int notif_id, GpsUserResponseType user_response);
-} GpsNiInterface;
-
-struct gps_device_t {
- struct hw_device_t common;
-
- /**
- * Set the provided lights to the provided values.
- *
- * Returns: 0 on succes, error code on failure.
- */
- const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev);
-};
-
-#define AGPS_RIL_REQUEST_SETID_IMSI (1<<0L)
-#define AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L)
-
-#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L)
-#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L)
-
-typedef void (*agps_ril_request_set_id)(uint32_t flags);
-typedef void (*agps_ril_request_ref_loc)(uint32_t flags);
-
-typedef struct {
- agps_ril_request_set_id request_setid;
- agps_ril_request_ref_loc request_refloc;
- gps_create_thread create_thread_cb;
-} AGpsRilCallbacks;
-
-/** Extended interface for AGPS_RIL support. */
-typedef struct {
- /** set to sizeof(AGpsRilInterface) */
- size_t size;
- /**
- * Opens the AGPS interface and provides the callback routines
- * to the implemenation of this interface.
- */
- void (*init)( AGpsRilCallbacks* callbacks );
-
- /**
- * Sets the reference location.
- */
- void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct);
- /**
- * Sets the set ID.
- */
- void (*set_set_id) (AGpsSetIDType type, const char* setid);
-
- /**
- * Send network initiated message.
- */
- void (*ni_message) (uint8_t *msg, size_t len);
-
- /**
- * Notify GPS of network status changes.
- * These parameters match values in the android.net.NetworkInfo class.
- */
- void (*update_network_state) (int connected, int type, int roaming, const char* extra_info);
-
- /**
- * Notify GPS of network status changes.
- * These parameters match values in the android.net.NetworkInfo class.
- */
- void (*update_network_availability) (int avaiable, const char* apn);
-} AGpsRilInterface;
-
-/**
- * GPS Geofence.
- * There are 3 states associated with a Geofence: Inside, Outside, Unknown.
- * There are 3 transitions: ENTERED, EXITED, UNCERTAIN.
- *
- * An example state diagram with confidence level: 95% and Unknown time limit
- * set as 30 secs is shown below. (confidence level and Unknown time limit are
- * explained latter)
- * ____________________________
- * | Unknown (30 secs) |
- * """"""""""""""""""""""""""""
- * ^ | | ^
- * UNCERTAIN| |ENTERED EXITED| |UNCERTAIN
- * | v v |
- * ________ EXITED _________
- * | Inside | -----------> | Outside |
- * | | <----------- | |
- * """""""" ENTERED """""""""
- *
- * Inside state: We are 95% confident that the user is inside the geofence.
- * Outside state: We are 95% confident that the user is outside the geofence
- * Unknown state: Rest of the time.
- *
- * The Unknown state is better explained with an example:
- *
- * __________
- * | c|
- * | ___ | _______
- * | |a| | | b |
- * | """ | """""""
- * | |
- * """"""""""
- * In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy
- * circle reported by the GPS subsystem. Now with regard to "b", the system is
- * confident that the user is outside. But with regard to "a" is not confident
- * whether it is inside or outside the geofence. If the accuracy remains the
- * same for a sufficient period of time, the UNCERTAIN transition would be
- * triggered with the state set to Unknown. If the accuracy improves later, an
- * appropriate transition should be triggered. This "sufficient period of time"
- * is defined by the parameter in the add_geofence_area API.
- * In other words, Unknown state can be interpreted as a state in which the
- * GPS subsystem isn't confident enough that the user is either inside or
- * outside the Geofence. It moves to Unknown state only after the expiry of the
- * timeout.
- *
- * The geofence callback needs to be triggered for the ENTERED and EXITED
- * transitions, when the GPS system is confident that the user has entered
- * (Inside state) or exited (Outside state) the Geofence. An implementation
- * which uses a value of 95% as the confidence is recommended. The callback
- * should be triggered only for the transitions requested by the
- * add_geofence_area call.
- *
- * Even though the diagram and explanation talks about states and transitions,
- * the callee is only interested in the transistions. The states are mentioned
- * here for illustrative purposes.
- *
- * Startup Scenario: When the device boots up, if an application adds geofences,
- * and then we get an accurate GPS location fix, it needs to trigger the
- * appropriate (ENTERED or EXITED) transition for every Geofence it knows about.
- * By default, all the Geofences will be in the Unknown state.
- *
- * When the GPS system is unavailable, gps_geofence_status_callback should be
- * called to inform the upper layers of the same. Similarly, when it becomes
- * available the callback should be called. This is a global state while the
- * UNKNOWN transition described above is per geofence.
- *
- * An important aspect to note is that users of this API (framework), will use
- * other subsystems like wifi, sensors, cell to handle Unknown case and
- * hopefully provide a definitive state transition to the third party
- * application. GPS Geofence will just be a signal indicating what the GPS
- * subsystem knows about the Geofence.
- *
- */
-#define GPS_GEOFENCE_ENTERED (1<<0L)
-#define GPS_GEOFENCE_EXITED (1<<1L)
-#define GPS_GEOFENCE_UNCERTAIN (1<<2L)
-
-#define GPS_GEOFENCE_UNAVAILABLE (1<<0L)
-#define GPS_GEOFENCE_AVAILABLE (1<<1L)
-
-#define GPS_GEOFENCE_OPERATION_SUCCESS 0
-#define GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES -100
-#define GPS_GEOFENCE_ERROR_ID_EXISTS -101
-#define GPS_GEOFENCE_ERROR_ID_UNKNOWN -102
-#define GPS_GEOFENCE_ERROR_INVALID_TRANSITION -103
-#define GPS_GEOFENCE_ERROR_GENERIC -149
-
-/**
- * The callback associated with the geofence.
- * Parameters:
- * geofence_id - The id associated with the add_geofence_area.
- * location - The current GPS location.
- * transition - Can be one of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED,
- * GPS_GEOFENCE_UNCERTAIN.
- * timestamp - Timestamp when the transition was detected.
- *
- * The callback should only be called when the caller is interested in that
- * particular transition. For instance, if the caller is interested only in
- * ENTERED transition, then the callback should NOT be called with the EXITED
- * transition.
- *
- * IMPORTANT: If a transition is triggered resulting in this callback, the GPS
- * subsystem will wake up the application processor, if its in suspend state.
- */
-typedef void (*gps_geofence_transition_callback) (int32_t geofence_id, GpsLocation* location,
- int32_t transition, GpsUtcTime timestamp);
-
-/**
- * The callback associated with the availablity of the GPS system for geofencing
- * monitoring. If the GPS system determines that it cannot monitor geofences
- * because of lack of reliability or unavailability of the GPS signals, it will
- * call this callback with GPS_GEOFENCE_UNAVAILABLE parameter.
- *
- * Parameters:
- * status - GPS_GEOFENCE_UNAVAILABLE or GPS_GEOFENCE_AVAILABLE.
- * last_location - Last known location.
- */
-typedef void (*gps_geofence_status_callback) (int32_t status, GpsLocation* last_location);
-
-/**
- * The callback associated with the add_geofence call.
- *
- * Parameter:
- * geofence_id - Id of the geofence.
- * status - GPS_GEOFENCE_OPERATION_SUCCESS
- * GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached.
- * GPS_GEOFENCE_ERROR_ID_EXISTS - geofence with id already exists
- * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - the monitorTransition contains an
- * invalid transition
- * GPS_GEOFENCE_ERROR_GENERIC - for other errors.
- */
-typedef void (*gps_geofence_add_callback) (int32_t geofence_id, int32_t status);
-
-/**
- * The callback associated with the remove_geofence call.
- *
- * Parameter:
- * geofence_id - Id of the geofence.
- * status - GPS_GEOFENCE_OPERATION_SUCCESS
- * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id
- * GPS_GEOFENCE_ERROR_GENERIC for others.
- */
-typedef void (*gps_geofence_remove_callback) (int32_t geofence_id, int32_t status);
-
-
-/**
- * The callback associated with the pause_geofence call.
- *
- * Parameter:
- * geofence_id - Id of the geofence.
- * status - GPS_GEOFENCE_OPERATION_SUCCESS
- * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id
- * GPS_GEOFENCE_ERROR_INVALID_TRANSITION -
- * when monitor_transitions is invalid
- * GPS_GEOFENCE_ERROR_GENERIC for others.
- */
-typedef void (*gps_geofence_pause_callback) (int32_t geofence_id, int32_t status);
-
-/**
- * The callback associated with the resume_geofence call.
- *
- * Parameter:
- * geofence_id - Id of the geofence.
- * status - GPS_GEOFENCE_OPERATION_SUCCESS
- * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id
- * GPS_GEOFENCE_ERROR_GENERIC for others.
- */
-typedef void (*gps_geofence_resume_callback) (int32_t geofence_id, int32_t status);
-
-typedef struct {
- gps_geofence_transition_callback geofence_transition_callback;
- gps_geofence_status_callback geofence_status_callback;
- gps_geofence_add_callback geofence_add_callback;
- gps_geofence_remove_callback geofence_remove_callback;
- gps_geofence_pause_callback geofence_pause_callback;
- gps_geofence_resume_callback geofence_resume_callback;
- gps_create_thread create_thread_cb;
-} GpsGeofenceCallbacks;
-
-/** Extended interface for GPS_Geofencing support */
-typedef struct {
- /** set to sizeof(GpsGeofencingInterface) */
- size_t size;
-
- /**
- * Opens the geofence interface and provides the callback routines
- * to the implemenation of this interface.
- */
- void (*init)( GpsGeofenceCallbacks* callbacks );
-
- /**
- * Add a geofence area. This api currently supports circular geofences.
- * Parameters:
- * geofence_id - The id for the geofence. If a geofence with this id
- * already exists, an error value (GPS_GEOFENCE_ERROR_ID_EXISTS)
- * should be returned.
- * latitude, longtitude, radius_meters - The lat, long and radius
- * (in meters) for the geofence
- * last_transition - The current state of the geofence. For example, if
- * the system already knows that the user is inside the geofence,
- * this will be set to GPS_GEOFENCE_ENTERED. In most cases, it
- * will be GPS_GEOFENCE_UNCERTAIN.
- * monitor_transition - Which transitions to monitor. Bitwise OR of
- * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and
- * GPS_GEOFENCE_UNCERTAIN.
- * notification_responsiveness_ms - Defines the best-effort description
- * of how soon should the callback be called when the transition
- * associated with the Geofence is triggered. For instance, if set
- * to 1000 millseconds with GPS_GEOFENCE_ENTERED, the callback
- * should be called 1000 milliseconds within entering the geofence.
- * This parameter is defined in milliseconds.
- * NOTE: This is not to be confused with the rate that the GPS is
- * polled at. It is acceptable to dynamically vary the rate of
- * sampling the GPS for power-saving reasons; thus the rate of
- * sampling may be faster or slower than this.
- * unknown_timer_ms - The time limit after which the UNCERTAIN transition
- * should be triggered. This paramter is defined in milliseconds.
- * See above for a detailed explanation.
- */
- void (*add_geofence_area) (int32_t geofence_id, double latitude,
- double longitude, double radius_meters,
- int last_transition, int monitor_transitions,
- int notification_responsiveness_ms,
- int unknown_timer_ms);
-
- /**
- * Pause monitoring a particular geofence.
- * Parameters:
- * geofence_id - The id for the geofence.
- */
- void (*pause_geofence) (int32_t geofence_id);
-
- /**
- * Resume monitoring a particular geofence.
- * Parameters:
- * geofence_id - The id for the geofence.
- * monitor_transitions - Which transitions to monitor. Bitwise OR of
- * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and
- * GPS_GEOFENCE_UNCERTAIN.
- * This supersedes the value associated provided in the
- * add_geofence_area call.
- */
- void (*resume_geofence) (int32_t geofence_id, int monitor_transitions);
-
- /**
- * Remove a geofence area. After the function returns, no notifications
- * should be sent.
- * Parameter:
- * geofence_id - The id for the geofence.
- */
- void (*remove_geofence_area) (int32_t geofence_id);
-} GpsGeofencingInterface;
-__END_DECLS
-
-#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */
-
diff --git a/init/Android.mk b/init/Android.mk
deleted file mode 100644
index a079b73..0000000
--- a/init/Android.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_C_INCLUDES := system/core/init
-LOCAL_CFLAGS := -Wall -DANDROID_TARGET=\"$(TARGET_BOARD_PLATFORM)\"
-LOCAL_SRC_FILES := init_jflte.c
-LOCAL_MODULE := libinit_jflte
-include $(BUILD_STATIC_LIBRARY)
diff --git a/init/init_jflte.c b/init/init_jflte.c
deleted file mode 100644
index 1b2c89d..0000000
--- a/init/init_jflte.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- Copyright (c) 2013, 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 <stdlib.h>
-
-#include "vendor_init.h"
-#include "property_service.h"
-#include "log.h"
-#include "util.h"
-
-void gsm_properties();
-void cdma_properties(char cdma_sub[]);
-
-void vendor_load_properties()
-{
- char platform[PROP_VALUE_MAX];
- char bootloader[PROP_VALUE_MAX];
- char device[PROP_VALUE_MAX];
- int rc;
-
- rc = property_get("ro.board.platform", platform);
- if (!rc || strncmp(platform, ANDROID_TARGET, PROP_VALUE_MAX))
- return;
-
- property_get("ro.bootloader", bootloader);
-
- if (strstr(bootloader, "I337M")) {
- /* jfltecan */
- gsm_properties();
- property_set("ro.build.fingerprint", "samsung/jfltevl/jfltecan:4.2.2/JDQ39/I337MVLUAMDJ:user/release-keys");
- property_set("ro.build.description", "jfltevl-user 4.2.2 JDQ39 I337MVLUAMDJ release-keys");
- property_set("ro.product.model", "SGH-I337M");
- property_set("ro.product.device", "jfltecan");
- } else if (strstr(bootloader, "I337")) {
- /* jflteatt */
- gsm_properties();
- property_set("ro.product.device", "jflteatt");
- property_set("ro.product.model", "SAMSUNG-SGH-I337");
- property_set("ro.build.fingerprint", "samsung/jflteuc/jflteatt:4.4.2/KOT49H/I337UCUFNB1:user/release-keys");
- property_set("ro.build.description", "jflteuc-user 4.4.2 KOT49H I337UCUFNB1 release-keys");
- } else if (strstr(bootloader, "R970C")) {
- /* jfltecri */
- cdma_properties("0");
- property_set("ro.build.fingerprint", "samsung/jfltecri/jfltecri:4.2.2/JDQ39/R970CVVUAME4:user/release-keys");
- property_set("ro.build.description", "jfltecri-user 4.2.2 JDQ39 R970CVVUAME4 release-keys");
- property_set("ro.product.model", "SCH-R970C");
- property_set("ro.product.device", "jfltecri");
- property_set("ro.cdma.home.operator.alpha", "Cricket");
- property_set("ro.cdma.home.operator.numeric", "310090");
- } else if (strstr(bootloader, "R970X")) {
- /* jfltecsp */
- cdma_properties("0");
- property_set("ro.build.fingerprint", "samsung/jfltecsp/jfltecsp:4.2.2/JDQ39/R970XWWUAMFA:user/release-keys");
- property_set("ro.build.description", "jfltecsp-user 4.2.2 JDQ39 R970XWWUAMFA release-keys");
- property_set("ro.product.model", "SCH-R970X");
- property_set("ro.product.device", "jfltecsp");
- property_set("telephony.sms.pseudo_multipart", "1");
- } else if (strstr(bootloader, "L720")) {
- /* jfltespr */
- cdma_properties("1");
- property_set("ro.build.fingerprint", "samsung/jfltespr/jfltespr:4.2.2/JDQ39/L720VPUAMDL:user/release-keys");
- property_set("ro.build.description", "jfltespr-user 4.2.2 JDQ39 L720VPUAMDL release-keys");
- property_set("ro.product.model", "SPH-L720");
- property_set("ro.product.device", "jfltespr");
- property_set("telephony.sms.pseudo_multipart", "1");
- } else if (strstr(bootloader, "M919")) {
- /* jfltetmo */
- gsm_properties();
- property_set("ro.build.fingerprint", "samsung/jfltetmo/jfltetmo:4.3/JSS15J/M919UVUEMK2:user/release-keys");
- property_set("ro.build.description", "jfltetmo-user 4.3 JSS15J M919UVUEMK2 release-keys");
- property_set("ro.product.model", "SGH-M919");
- property_set("ro.product.device", "jfltetmo");
- } else if (strstr(bootloader, "R970")) {
- /* jflteusc */
- cdma_properties("0");
- property_set("ro.build.fingerprint", "samsung/jflteusc/jflteusc:4.2.2/JDQ39/R970VXUAMD9:user/release-keys");
- property_set("ro.build.description", "jflteusc-user 4.2.2 JDQ39 R970VXUAMD9 release-keys");
- property_set("ro.product.model", "SCH-R970");
- property_set("ro.product.device", "jflteusc");
- property_set("ro.cdma.home.operator.alpha", "U.S.Cellular");
- property_set("ro.cdma.home.operator.numeric", "311580");
- property_set("telephony.sms.pseudo_multipart", "1");
- } else if (strstr(bootloader, "I545")) {
- /* jfltevzw */
- cdma_properties("0");
- property_set("ro.build.fingerprint", "Verizon/jfltevzw/jfltevzw:4.3/JSS15J/I545VRUEMK2:user/release-keys");
- property_set("ro.build.description", "jfltevzw-user 4.3 JSS15J I545VRUEMK2 release-keys");
- property_set("ro.product.model", "SCH-I545");
- property_set("ro.product.device", "jfltevzw");
- property_set("ro.cdma.home.operator.alpha", "Verizon");
- property_set("ro.cdma.home.operator.numeric", "311480");
- } else if (strstr(bootloader, "I9505G")) {
- /* jgedlte */
- gsm_properties();
- property_set("ro.build.fingerprint", "samsung/jgedlteue/jgedlte:4.4.3/KTU84L.S003/140503:user/release-keys");
- property_set("ro.build.description", "jgedlteue-user 4.4.3 KTU84L.S003 140503 release-keys");
- property_set("ro.product.model", "GT-I9505G");
- property_set("ro.product.device", "jgedlte");
- } else if (strstr(bootloader, "I9505")) {
- /* jfltexx */
- gsm_properties();
- property_set("ro.build.fingerprint", "samsung/jfltexx/jflte:4.2.2/JDQ39/I9505XXUAMDE:user/release-keys");
- property_set("ro.build.description", "jfltexx-user 4.2.2 JDQ39 I9505XXUAMDE release-keys");
- property_set("ro.product.model", "GT-I9505");
- property_set("ro.product.device", "jfltexx");
- } else if (strstr(bootloader, "I9507")) {
- /* jftddxx */
- gsm_properties();
- property_set("ro.build.fingerprint", "samsung/jftddxx/jftdd:4.3/JSS15J/I9507XXUENB5:user/release-keys");
- property_set("ro.build.description", "jftddxx-user 4.3 JSS15J I9507XXUENB5 release-keys");
- property_set("ro.product.model", "GT-I9507");
- property_set("ro.product.device", "jftddxx");
- } else if (strstr(bootloader, "I9508")) {
- /* jfltezm */
- gsm_properties();
- property_set("ro.build.fingerprint", "samsung/jfltezm/jflte:4.2.2/JDQ39/I9508ZMUAMG1:user/release-keys");
- property_set("ro.build.description", "jfltezm-user 4.2.2 JDQ39 I9508ZMUAMG1 release-keys");
- property_set("ro.product.model", "GT-I9508");
- property_set("ro.product.device", "jfltezm");
- }
-
- property_get("ro.product.device", device);
- ERROR("Found bootloader id %s setting build properties for %s device\n", bootloader, device);
-
-}
-
-void gsm_properties()
-{
- property_set("telephony.lteOnGsmDevice", "1");
- property_set("ro.telephony.default_network", "9");
-}
-
-void cdma_properties(char cdma_sub[])
-{
- property_set("ro.telephony.default_cdma_sub", cdma_sub);
- property_set("ro.gps.set_privacy", "1");
- property_set("telephony.lteOnCdmaDevice", "1");
- property_set("ro.telephony.default_network", "10");
-}
diff --git a/keylayout/Button_Jack.kl b/keylayout/Button_Jack.kl
deleted file mode 100644
index 421b5b8..0000000
--- a/keylayout/Button_Jack.kl
+++ /dev/null
@@ -1 +0,0 @@
-key 256 HEADSETHOOK WAKE
diff --git a/keylayout/atmel_mxt_ts.kl b/keylayout/atmel_mxt_ts.kl
deleted file mode 100644
index 2f364b2..0000000
--- a/keylayout/atmel_mxt_ts.kl
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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
-
-key 139 MENU
-key 102 HOME
-key 158 BACK
-key 217 SEARCH
diff --git a/keylayout/gpio-keys.kl b/keylayout/gpio-keys.kl
deleted file mode 100644
index 6126636..0000000
--- a/keylayout/gpio-keys.kl
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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
-
-key 115 VOLUME_UP WAKE
-key 114 VOLUME_DOWN WAKE
-key 172 HOME WAKE
-key 528 FOCUS WAKE
-key 766 CAMERA WAKE
diff --git a/keylayout/philips_remote_ir.kl b/keylayout/philips_remote_ir.kl
deleted file mode 100644
index c66bef8..0000000
--- a/keylayout/philips_remote_ir.kl
+++ /dev/null
@@ -1,63 +0,0 @@
-# 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
-# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-key 512 0 WAKE
-key 513 1 WAKE
-key 514 2 WAKE
-key 515 3 WAKE
-key 516 4 WAKE
-key 517 5 WAKE
-key 518 6 WAKE
-key 519 7 WAKE
-key 520 8 WAKE
-key 521 9 WAKE
-key 213 AVR_INPUT WAKE #Sound
-key 375 WINDOW WAKE #Picture
-key 115 VOLUME_UP WAKE
-key 114 VOLUME_DOWN WAKE
-key 113 VOLUME_MUTE WAKE
-key 402 CHANNEL_UP WAKE
-key 403 CHANNEL_DOWN WAKE
-key 158 BACK WAKE
-key 358 INFO WAKE
-key 352 ENTER WAKE #OK
-key 103 DPAD_UP WAKE
-key 108 DPAD_DOWN WAKE
-key 105 DPAD_LEFT WAKE
-key 106 DPAD_RIGHT WAKE
-key 119 MEDIA_PAUSE WAKE
-key 366 DVR WAKE #Demo
-key 174 BREAK WAKE #Exit
-key 148 PROG_RED WAKE
-key 373 PROG_GREEN WAKE
-key 142 PROG_YELLOW WAKE
-key 386 PROG_BLUE WAKE
-key 377 TV WAKE
-key 181 TV_INPUT WAKE #USB
-key 127 FUNCTION WAKE #Source
-key 139 MENU WAKE
-key 116 POWER WAKE
diff --git a/keylayout/samsung_remote_ir.kl b/keylayout/samsung_remote_ir.kl
deleted file mode 100644
index ff081a6..0000000
--- a/keylayout/samsung_remote_ir.kl
+++ /dev/null
@@ -1,62 +0,0 @@
-# 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
-# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-key 11 0 WAKE
-key 2 1 WAKE
-key 3 2 WAKE
-key 4 3 WAKE
-key 5 4 WAKE
-key 6 5 WAKE
-key 7 6 WAKE
-key 8 7 WAKE
-key 9 8 WAKE
-key 10 9 WAKE
-key 115 VOLUME_UP WAKE
-key 114 VOLUME_DOWN WAKE
-key 113 VOLUME_MUTE WAKE
-key 402 CHANNEL_UP WAKE
-key 403 CHANNEL_DOWN WAKE
-key 158 BACK WAKE
-key 102 INFO WAKE
-key 28 ENTER WAKE
-key 103 DPAD_UP WAKE
-key 108 DPAD_DOWN WAKE
-key 105 DPAD_LEFT WAKE
-key 106 DPAD_RIGHT WAKE
-key 119 MEDIA_PAUSE WAKE
-key 30 PROG_RED WAKE
-key 48 PROG_GREEN WAKE
-key 46 PROG_YELLOW WAKE
-key 32 PROG_BLUE WAKE
-key 139 MENU WAKE
-key 116 POWER WAKE
-key 168 MEDIA_REWIND WAKE
-key 119 MEDIA_PAUSE WAKE
-key 208 MEDIA_FAST_FORWARD WAKE
-key 167 MEDIA_RECORD WAKE
-key 207 MEDIA_PLAY WAKE
-key 128 MEDIA_STOP WAKE
diff --git a/keylayout/sec_touchkey.kl b/keylayout/sec_touchkey.kl
deleted file mode 100644
index a2e24c1..0000000
--- a/keylayout/sec_touchkey.kl
+++ /dev/null
@@ -1,4 +0,0 @@
-key 139 MENU VIRTUAL
-key 158 BACK VIRTUAL
-key 102 HOME
-key 217 SEARCH
diff --git a/keylayout/ue_rf4ce_remote.kl b/keylayout/ue_rf4ce_remote.kl
deleted file mode 100644
index 36bf39e..0000000
--- a/keylayout/ue_rf4ce_remote.kl
+++ /dev/null
@@ -1,68 +0,0 @@
-# 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
-# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-key 512 0 WAKE
-key 513 1 WAKE
-key 514 2 WAKE
-key 515 3 WAKE
-key 516 4 WAKE
-key 517 5 WAKE
-key 518 6 WAKE
-key 519 7 WAKE
-key 520 8 WAKE
-key 521 9 WAKE
-key 141 SETTINGS WAKE #Sound
-key 116 POWER WAKE #Picture
-key 352 EQUALS WAKE
-key 105 DPAD_LEFT WAKE
-key 106 DPAD_RIGHT WAKE
-key 103 DPAD_UP WAKE
-key 108 DPAD_DOWN WAKE
-key 172 GUIDE WAKE
-key 174 ESCAPE WAKE
-key 377 TV WAKE
-key 393 WINDOW WAKE
-key 127 TV_INPUT WAKE
-key 390 AVR_INPUT WAKE
-key 128 MEDIA_STOP WAKE
-key 395 EXPLORER WAKE
-key 167 MEDIA_RECORD WAKE
-key 168 MEDIA_REWIND WAKE
-key 207 MEDIA_PLAY WAKE
-key 208 MEDIA_FAST_FORWARD WAKE
-key 158 BACK WAKE
-key 119 MEDIA_PAUSE WAKE
-key 407 MEDIA_NEXT WAKE
-key 115 VOLUME_UP WAKE
-key 114 VOLUME_DOWN WAKE
-key 403 INFO WAKE
-key 113 VOLUME_MUTE WAKEU
-key 402 CHANNEL_UP WAKE
-key 403 CHANNEL_DOWN WAKE
-key 110 STB_INPUT WAKE
-key 28 ENTER WAKE #OK
-key 139 MENU WAKE
diff --git a/liblights/Android.mk b/liblights/Android.mk
deleted file mode 100644
index ff82d2e..0000000
--- a/liblights/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2012 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.
-
-LOCAL_PATH:= $(call my-dir)
-# HAL module implemenation stored in
-# hw/<COPYPIX_HARDWARE_MODULE_ID>.<ro.board.platform>.so
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := lights.c
-
-
-LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
-
-LOCAL_SHARED_LIBRARIES := liblog
-
-LOCAL_MODULE := lights.msm8960
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/liblights/NOTICE b/liblights/NOTICE
deleted file mode 100644
index f921593..0000000
--- a/liblights/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
- Copyright (C) 2008 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
diff --git a/liblights/lights.c b/liblights/lights.c
deleted file mode 100644
index d9a424c..0000000
--- a/liblights/lights.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- * Copyright (C) 2012 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.
- */
-
-//#define LOG_NDEBUG 0
-#define LOG_TAG "lights"
-#include <cutils/log.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <hardware/lights.h>
-
-static pthread_once_t g_init = PTHREAD_ONCE_INIT;
-static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
-
-char const*const PANEL_FILE = "/sys/class/leds/lcd-backlight/brightness";
-char const*const BUTTON_FILE = "/sys/class/leds/button-backlight/brightness";
-
-char const*const LED_BLINK = "/sys/class/sec/led/led_blink";
-
-struct led_config {
- unsigned int color;
- int delay_on, delay_off;
-};
-
-static struct led_config g_leds[3]; // For battery, notifications, and attention.
-static int g_cur_led = -1; // Presently showing LED of the above.
-
-void init_g_lock(void)
-{
- pthread_mutex_init(&g_lock, NULL);
-}
-
-static int write_int(char const *path, int value)
-{
- int fd;
- static int already_warned;
-
- already_warned = 0;
-
- ALOGV("write_int: path %s, value %d", path, value);
- fd = open(path, O_RDWR);
-
- if (fd >= 0) {
- char buffer[20];
- int bytes = sprintf(buffer, "%d\n", value);
- int amt = write(fd, buffer, bytes);
- close(fd);
- return amt == -1 ? -errno : 0;
- } else {
- if (already_warned == 0) {
- ALOGE("write_int failed to open %s\n", path);
- already_warned = 1;
- }
- return -errno;
- }
-}
-
-/* Currently unused.
-static int read_int(char const *path)
-{
- int fd;
- char buffer[2];
-
- fd = open(path, O_RDONLY);
-
- if (fd >= 0) {
- read(fd, buffer, 1);
- }
- close(fd);
-
- return atoi(buffer);
-}
-*/
-
-static int write_str(char const *path, const char* value)
-{
- int fd;
- static int already_warned;
-
- already_warned = 0;
-
- ALOGV("write_str: path %s, value %s", path, value);
- fd = open(path, O_RDWR);
-
- if (fd >= 0) {
- int amt = write(fd, value, strlen(value));
- close(fd);
- return amt == -1 ? -errno : 0;
- } else {
- if (already_warned == 0) {
- ALOGE("write_str failed to open %s\n", path);
- already_warned = 1;
- }
- return -errno;
- }
-}
-
-static int rgb_to_brightness(struct light_state_t const *state)
-{
- int color = state->color & 0x00ffffff;
-
- return ((77*((color>>16) & 0x00ff))
- + (150*((color>>8) & 0x00ff)) + (29*(color & 0x00ff))) >> 8;
-}
-
-/* Previously used by set_light_leds.
-static int get_calibrated_color(struct light_state_t const *state, int brightness)
-{
- int red = (state->color >> 16) & 0xFF;
- int green = ((state->color >> 8) & 0xFF) * 0.7;
- int blue = (state->color & 0x00FF) * 0.8;
-
- return (((red * brightness) / 255) << 16) + (((green * brightness) / 255) << 8) + ((blue * brightness) / 255);
-}
-*/
-
-static int is_lit(struct light_state_t const* state)
-{
- return state->color & 0x00ffffff;
-}
-
-static int set_light_backlight(struct light_device_t *dev,
- struct light_state_t const *state)
-{
- int err = 0;
- int brightness = rgb_to_brightness(state);
-
- pthread_mutex_lock(&g_lock);
- err = write_int(PANEL_FILE, brightness);
-
- pthread_mutex_unlock(&g_lock);
- return err;
-}
-
-static int
-set_light_buttons(struct light_device_t* dev,
- struct light_state_t const* state)
-{
- int err = 0;
- int on = is_lit(state);
-
- pthread_mutex_lock(&g_lock);
- err = write_int(BUTTON_FILE, on?255:0);
- pthread_mutex_unlock(&g_lock);
-
- return err;
-
-}
-
-static int close_lights(struct light_device_t *dev)
-{
- ALOGV("close_light is called");
- if (dev)
- free(dev);
-
- return 0;
-}
-
-/* LEDs */
-static int write_leds(const struct led_config *led)
-{
- static const struct led_config led_off = {0, 0, 0};
-
- char blink[32];
- int count, err;
-
- if (led == NULL)
- led = &led_off;
-
- if ((count = snprintf(blink, sizeof(blink)-1, "0x%08x %d %d", led->color,
- led->delay_on, led->delay_off)) < 0) {
- return -errno;
- } else if ((unsigned int)count >= sizeof(blink)-1) {
- ALOGE("%s: Truncated string: blink=\"%s\".", __func__, blink);
- return -EINVAL;
- }
-
- ALOGD("%s: color=0x%08x, delay_on=%d, delay_off=%d, blink=\"%s\".",
- __func__, led->color, led->delay_on, led->delay_off, blink);
-
- /* Add '\n' here to make the above log message clean. */
- blink[count] = '\n';
- blink[count+1] = '\0';
-
- pthread_mutex_lock(&g_lock);
- err = write_str(LED_BLINK, blink);
- pthread_mutex_unlock(&g_lock);
-
- return err;
-}
-
-static int set_light_leds(struct light_state_t const *state, int type)
-{
- struct led_config *led;
- int err = 0;
-
- ALOGD("%s: type=%d, color=0x%010x, fM=%d, fOnMS=%d, fOffMs=%d.", __func__,
- type, state->color,state->flashMode, state->flashOnMS, state->flashOffMS);
-
- if (type < 0 || (unsigned int)type >= sizeof(g_leds)/sizeof(g_leds[0]))
- return -EINVAL;
-
- /* type is one of:
- * 0. battery
- * 1. notifications
- * 2. attention
- * which are multiplexed onto the same physical LED in the above order. */
- led = &g_leds[type];
-
- switch (state->flashMode) {
- case LIGHT_FLASH_NONE:
- /* Set LED to a solid color, spec is unclear on the exact behavior here. */
- led->delay_on = led->delay_off = 0;
- break;
- case LIGHT_FLASH_TIMED:
- case LIGHT_FLASH_HARDWARE:
- led->delay_on = state->flashOnMS;
- led->delay_off = state->flashOffMS;
- break;
- default:
- return -EINVAL;
- }
-
- led->color = state->color & 0x00ffffff;
-
- if (led->color > 0) {
- /* This LED is lit. */
- if (type >= g_cur_led) {
- /* And it has the highest priority, so show it. */
- err = write_leds(led);
- g_cur_led = type;
- }
- } else {
- /* This LED is not (any longer) lit. */
- if (type == g_cur_led) {
- /* But it is currently showing, switch to a lower-priority LED. */
- int i;
-
- for (i = type-1; i >= 0; i--) {
- if (g_leds[i].color > 0) {
- /* Found a lower-priority LED to switch to. */
- err = write_leds(&g_leds[i]);
- goto switched;
- }
- }
-
- /* No LEDs are lit, turn off. */
- err = write_leds(NULL);
-switched:
- g_cur_led = i;
- }
- }
-
- return err;
-}
-
-static int set_light_leds_battery(struct light_device_t *dev,
- struct light_state_t const *state)
-{
- return set_light_leds(state, 0);
-}
-
-static int set_light_leds_notifications(struct light_device_t *dev,
- struct light_state_t const *state)
-{
- return set_light_leds(state, 1);
-}
-
-static int set_light_leds_attention(struct light_device_t *dev,
- struct light_state_t const *state)
-{
- struct light_state_t fixed;
-
- memcpy(&fixed, state, sizeof(fixed));
-
- /* The framework does odd things with the attention lights, fix them up to
- * do something sensible here. */
- switch (fixed.flashMode) {
- case LIGHT_FLASH_NONE:
- /* LightsService.Light::stopFlashing calls with non-zero color. */
- fixed.color = 0;
- break;
- case LIGHT_FLASH_HARDWARE:
- /* PowerManagerService::setAttentionLight calls with onMS=3, offMS=0, which
- * just makes for a slightly-dimmer LED. */
- if (fixed.flashOnMS > 0 && fixed.flashOffMS == 0)
- fixed.flashMode = LIGHT_FLASH_NONE;
- break;
- }
-
- return set_light_leds(&fixed, 2);
-}
-
-static int open_lights(const struct hw_module_t *module, char const *name,
- struct hw_device_t **device)
-{
- int (*set_light)(struct light_device_t *dev,
- struct light_state_t const *state);
-
- if (0 == strcmp(LIGHT_ID_BACKLIGHT, name))
- set_light = set_light_backlight;
- else if (0 == strcmp(LIGHT_ID_BUTTONS, name))
- set_light = set_light_buttons;
- else if (0 == strcmp(LIGHT_ID_BATTERY, name))
- set_light = set_light_leds_battery;
- else if (0 == strcmp(LIGHT_ID_NOTIFICATIONS, name))
- set_light = set_light_leds_notifications;
- else if (0 == strcmp(LIGHT_ID_ATTENTION, name))
- set_light = set_light_leds_attention;
- else
- return -EINVAL;
-
- pthread_once(&g_init, init_g_lock);
-
- struct light_device_t *dev = malloc(sizeof(struct light_device_t));
- memset(dev, 0, sizeof(*dev));
-
- dev->common.tag = HARDWARE_DEVICE_TAG;
- dev->common.version = 0;
- dev->common.module = (struct hw_module_t *)module;
- dev->common.close = (int (*)(struct hw_device_t *))close_lights;
- dev->set_light = set_light;
-
- *device = (struct hw_device_t *)dev;
-
- return 0;
-}
-
-static struct hw_module_methods_t lights_module_methods = {
- .open = open_lights,
-};
-
-struct hw_module_t HAL_MODULE_INFO_SYM = {
- .tag = HARDWARE_MODULE_TAG,
- .version_major = 1,
- .version_minor = 0,
- .id = LIGHTS_HARDWARE_MODULE_ID,
- .name = "JF Lights Module",
- .author = "The CyanogenMod Project",
- .methods = &lights_module_methods,
-};
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
deleted file mode 100644
index 90c09fc..0000000
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ /dev/null
@@ -1,284 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2011, 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.
-*/
--->
-
-<!-- These resources are around just to allow their values to be customized
- for different hardware and product builds. -->
-<resources>
-
- <bool name="config_deskDockEnablesAccelerometer">false</bool>
-
- <!-- Default color for notification LED is white. -->
- <color name="config_defaultNotificationColor">#ffffffff</color>
-
- <!-- Default value for led color when battery is medium charged -->
- <!-- The green LED is brighter than red, bias closer to yellow. -->
- <integer name="config_notificationsBatteryMediumARGB">0xFFFF6000</integer>
-
- <!-- If this is true, the screen will come on when you unplug usb/power/whatever. -->
- <bool name="config_unplugTurnsOnScreen">true</bool>
-
- <!-- Array of light sensor LUX values to define our levels for auto backlight brightness support.
- The N entries of this array define N 1 zones as follows:
-
- Zone 0: 0 <= LUX < array[0]
- Zone 1: array[0] <= LUX < array[1]
- ...
- Zone N: array[N - 1] <= LUX < array[N]
- Zone N + 1 array[N] <= LUX < infinity
-
- Must be overridden in platform specific overlays -->
- <integer-array name="config_autoBrightnessLevels">
- <item>40</item>
- <item>200</item>
- <item>450</item>
- <item>1400</item>
- <item>2000</item>
- </integer-array>
-
- <!-- Array of output values for LCD backlight corresponding to the LUX values
- in the config_autoBrightnessLevels array. This array should have size one greater
- than the size of the config_autoBrightnessLevels array.
- This must be overridden in platform specific overlays -->
- <integer-array name="config_autoBrightnessLcdBacklightValues">
- <item>15</item>
- <item>30</item>
- <item>55</item>
- <item>90</item>
- <item>255</item>
- <item>255</item>
- </integer-array>
-
- <!-- Array of output values for button backlight corresponding to the LUX values
- in the config_autoBrightnessLevels array. This array should have size one greater
- than the size of the config_autoBrightnessLevels array.
- This must be overridden in platform specific overlays -->
- <integer-array name="config_autoBrightnessButtonBacklightValues">
- <item>1</item>
- <item>1</item>
- <item>1</item>
- <item>1</item>
- <item>1</item>
- <item>1</item>
- </integer-array>
-
-
- <!-- Minimum screen brightness allowed by the power manager. -->
- <integer name="config_screenBrightnessDim">10</integer>
-
- <!-- Default screen brightness setting.
- Must be in the range specified by minimum and maximum. -->
- <integer name="config_screenBrightnessSettingDefault">102</integer>
-
- <!-- Minimum screen brightness setting allowed by the power manager.
- The user is forbidden from setting the brightness below this level. -->
- <integer name="config_screenBrightnessSettingMinimum">10</integer>
-
- <!-- XXXXX NOTE THE FOLLOWING RESOURCES USE THE WRONG NAMING CONVENTION.
- Please don't copy them, copy anything else. -->
-
- <!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
- [associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
- <!-- the 5th element "resore-time" indicates the number of milliseconds to delay
- before automatically restore the default connection. Set -1 if the connection
- does not require auto-restore. -->
- <!-- the 6th element indicates boot-time dependency-met value. -->
- <string-array translatable="false" name="networkAttributes">
- <item>"wifi,1,1,1,-1,true"</item>
- <item>"mobile,0,0,0,-1,true"</item>
- <item>"mobile_mms,2,0,2,180000,true"</item>
- <item>"mobile_supl,3,0,2,60000,true"</item>
- <item>"mobile_dun,4,0,2,60000,true"</item>
- <item>"mobile_hipri,5,0,3,60000,true"</item>
- <item>"mobile_bluetooth,7,7,2,-1,true"</item>
- <item>"wifi_p2p,13,1,0,-1,true"</item>
- </string-array>
-
- <!-- An Array of "[ConnectivityManager connectionType],
- [# simultaneous connection types]" -->
- <string-array translatable="false" name="radioAttributes">
- <item>"1,1"</item>
- <item>"0,1"</item>
- <item>"7,1"</item>
- </string-array>
-
- <!-- List of regexpressions describing the interface (if any) that represent tetherable
- USB interfaces. If the device doesn't want to support tething over USB this should
- be empty. An example would be "usb.*" -->
- <string-array translatable="false" name="config_tether_usb_regexs">
- <item>"rndis0"</item>
- <item>"usb0"</item>
- </string-array>
-
- <!-- List of regexpressions describing the interface (if any) that represent tetherable
- Wifi interfaces. If the device doesn't want to support tethering over Wifi this
- should be empty. An example would be "softap.*" -->
- <string-array translatable="false" name="config_tether_wifi_regexs">
- <item>"wlan0"</item>
- </string-array>
-
- <!-- List of regexpressions describing the interface (if any) that represent tetherable
- bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this
- should be empty. -->
- <string-array translatable="false" name="config_tether_bluetooth_regexs">
- <item>"bt-pan"</item>
- </string-array>
-
- <!-- Array of ConnectivityManager.TYPE_xxxx values allowable for tethering -->
- <!-- Common options are [1, 4] for TYPE_WIFI and TYPE_MOBILE_DUN or
- <!== [0,1,5,7] for TYPE_MOBILE, TYPE_WIFI, TYPE_MOBILE_HIPRI and TYPE_BLUETOOTH -->
- <integer-array translatable="false" name="config_tether_upstream_types">
- <item>0</item>
- <item>1</item>
- <item>5</item>
- <item>7</item>
- </integer-array>
-
- <!-- Boolean indicating whether the wifi chipset has dual frequency band support -->
- <bool translatable="false" name="config_wifi_dual_band_support">true</bool>
-
- <!-- Boolean indicating whether the wifi chipset has background scan support -->
- <bool translatable="false" name="config_wifi_background_scan_support">true</bool>
-
- <!-- WiFi batched scanning -->
- <bool translatable="false" name="config_wifi_batched_scan_supported">false</bool>
-
- <!-- Enables or disables fading edges when marquee is enabled in TextView. -->
- <bool name="config_ui_enableFadingMarquee">false</bool>
-
- <!-- The VoiceMail default value is displayed to my own number if it is true -->
- <bool name="config_telephony_use_own_number_for_voicemail">true</bool>
-
- <!-- Boolean indicating if restoring network selection should be skipped -->
- <!-- The restoring is handled by modem if it is true-->
- <bool name="skip_restoring_network_selection">true</bool>
-
- <!-- Is the notification LED intrusive? Used to decide if there should be a disable option -->
- <bool name="config_intrusiveNotificationLed">true</bool>
-
- <!-- Is the battery LED intrusive? Used to decide if there should be a disable option -->
- <bool name="config_intrusiveBatteryLed">true</bool>
-
- <!-- Does the battery LED support multiple colors? Used to decide if the user can change the colors -->
- <bool name="config_multiColorBatteryLed">true</bool>
-
- <!-- Vibrator pattern for feedback about a long screen/key press -->
- <integer-array name="config_longPressVibePattern">
- <item>0</item>
- <item>1</item>
- <item>20</item>
- <item>21</item>
- </integer-array>
-
- <!-- Vibrator pattern for feedback about touching a virtual key -->
- <integer-array name="config_virtualKeyVibePattern">
- <item>0</item>
- <item>1</item>
- <item>20</item>
- <item>21</item>
- </integer-array>
-
- <!-- Vibrator pattern for a very short but reliable vibration for soft keyboard tap -->
- <integer-array name="config_keyboardTapVibePattern">
- <item>20</item>
- </integer-array>
-
- <!-- Vibrator pattern for feedback about booting with safe mode disabled -->
- <integer-array name="config_safeModeDisabledVibePattern">
- <item>0</item>
- <item>1</item>
- <item>20</item>
- <item>21</item>
- </integer-array>
-
- <!-- Vibrator pattern for feedback about booting with safe mode disabled -->
- <integer-array name="config_safeModeEnabledVibePattern">
- <item>0</item>
- <item>1</item>
- <item>20</item>
- <item>21</item>
- <item>500</item>
- <item>600</item>
- </integer-array>
-
- <!-- Vibrator pattern for feedback about hitting a scroll barrier -->
- <integer-array name="config_scrollBarrierVibePattern">
- <item>0</item>
- <item>15</item>
- <item>10</item>
- <item>10</item>
- </integer-array>
-
- <!-- Workaround for devices with broken keyboards -->
- <bool name="config_forceDisableHardwareKeyboard">true</bool>
-
- <!-- Indicate whether the SD card is accessible without removing the battery. -->
- <bool name="config_batterySdCardAccessibility">true</bool>
-
- <!-- Disable the home key unlock setting -->
- <!-- <bool name="config_disableHomeUnlockSetting">false</bool> -->
-
- <!-- Hardware 'face' keys present on the device, stored as a bit field.
- This integer should equal the sum of the corresponding value for each
- of the following keys present:
- 1 - Home
- 2 - Back
- 4 - Menu
- 8 - Assistant (search)
- 16 - App switch
- For example, a device with Home, Back and Menu keys would set this
- config to 7. -->
- <integer name="config_deviceHardwareKeys">7</integer>
-
- <bool name="config_enableWifiDisplay">true</bool>
-
- <!-- Panel auto-brightness configuration value -->
- <integer name="config_panelAutoBrightnessValue">1</integer>
-
- <!-- Device supports LED flashlight -->
- <bool name="config_enableTorch">true</bool>
-
- <!-- Performance profiles -->
- <string name="config_perf_profile_prop">sys.perf.profile</string>
- <string name="config_perf_profile_default_entry">1</string>
-
- <!-- Base "touch slop" value used by ViewConfiguration as a
- movement threshold where scrolling should begin. -->
- <dimen name="config_viewConfigurationTouchSlop">4dp</dimen>
-
- <!-- Indicate whether closing the lid causes the device to go to sleep and opening
- it causes the device to wake up.
- The default is false. -->
- <bool name="config_lidControlsSleep">true</bool>
-
- <!-- Indicate the device's Smart Cover coordinates.
- If none are provided, then the feature will be disabled.
- The array should contain 4 values, in pixels, (sample values provided):
- Top 0
- Left 100
- Bottom Top + 400
- Right Display Width - 100
- -->
- <integer-array name="config_smartCoverWindowCoords">
- <item>30</item>
- <item>44</item>
- <item>450</item>
- <item>1036</item>
- </integer-array>
-
-</resources>
diff --git a/overlay/frameworks/base/core/res/res/xml/power_profile.xml b/overlay/frameworks/base/core/res/res/xml/power_profile.xml
deleted file mode 100644
index b432204..0000000
--- a/overlay/frameworks/base/core/res/res/xml/power_profile.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<device name="Android">
- <item name="none">0</item>
- <item name="screen.on">120</item>
- <item name="bluetooth.active">110</item>
- <item name="bluetooth.on">0.9</item>
- <item name="screen.full">130</item>
- <item name="wifi.on">0.64</item>
- <item name="wifi.active">145</item>
- <item name="wifi.scan">120</item>
- <item name="dsp.audio">35</item>
- <item name="dsp.video">205</item>
- <item name="radio.active">117</item>
- <item name="radio.scanning">76</item>
- <item name="gps.on">0.13</item>
- <array name="radio.on">
- <value>1.23</value>
- <value>1.23</value>
- </array>
- <array name="cpu.speeds">
- <value>1890000</value>
- <value>1782000</value>
- <value>1674000</value>
- <value>1566000</value>
- <value>1458000</value>
- <value>1350000</value>
- <value>1242000</value>
- <value>1134000</value>
- <value>1026000</value>
- <value>918000</value>
- <value>810000</value>
- <value>702000</value>
- <value>594000</value>
- <value>486000</value>
- <value>384000</value>
- </array>
- <item name="cpu.idle">4</item>
- <array name="cpu.active">
- <value>118</value>
- <value>113</value>
- <value>108</value>
- <value>104</value>
- <value>102</value>
- <value>100</value>
- <value>98</value>
- <value>96</value>
- <value>77</value>
- <value>75</value>
- <value>75</value>
- <value>74</value>
- <value>74</value>
- <value>74</value>
- <value>61</value>
- </array>
- <item name="battery.capacity">2600</item>
-</device> \ No newline at end of file
diff --git a/overlay/frameworks/base/core/res/res/xml/storage_list.xml b/overlay/frameworks/base/core/res/res/xml/storage_list.xml
deleted file mode 100644
index be3c809..0000000
--- a/overlay/frameworks/base/core/res/res/xml/storage_list.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 2011, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License")
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- The <device> element should contain one or more <storage> elements.
- Exactly one of these should have the attribute primary="true".
- This storage will be the primary external storage and should have path="/mnt/sdcard".
- Each storage should have both a path and description attribute set.
- The following boolean attributes are optional:
-
- primary: this storage is the primary external storage
- removable: this is removable storage (for example, a real SD card)
- emulated: the storage is emulated via the FUSE sdcard daemon
- mtp-reserve: number of megabytes of storage MTP should reserve for free storage
- (used for emulated storage that is shared with system's data partition)
-
- A storage should not have both emulated and removable set to true
--->
-
-<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
- <storage android:mountPoint="/storage/sdcard0"
- android:storageDescription="@string/storage_internal"
- android:primary="true"
- android:emulated="true"
- android:mtpReserve="100" />
-
- <storage android:mountPoint="/storage/sdcard1"
- android:storageDescription="@string/storage_sd_card"
- android:primary="false"
- android:removable="true"
- android:allowMassStorage="true" />
-
- <storage android:mountPoint="/storage/usbdisk"
- android:storageDescription="@string/storage_usb"
- android:primary="false"
- android:removable="true" />
-
-</StorageList>
diff --git a/overlay/frameworks/base/packages/SettingsProvider/res/values/config.xml b/overlay/frameworks/base/packages/SettingsProvider/res/values/config.xml
deleted file mode 100644
index 13c9dfe..0000000
--- a/overlay/frameworks/base/packages/SettingsProvider/res/values/config.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/**
- * Copyright (c) 2012, 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.
- */
--->
-<resources>
- <bool name="def_accelerometer_rotation">true</bool>
- <bool name="def_screen_brightness_automatic_mode">true</bool>
-</resources>
-
diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
deleted file mode 100644
index 8cad4da..0000000
--- a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2009, 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.
-*/
--->
-
-<!-- These resources are around just to allow their values to be customized
- for different hardware and product builds. -->
-<resources>
-
- <!-- Control whether status bar should distinguish HSPA data icon form UMTS
- data icon on devices -->
- <bool name="config_hspa_data_distinguishable">true</bool>
-
-</resources>
diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml b/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml
deleted file mode 100644
index 8236cf2..0000000
--- a/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (c) 2006, 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.
-*/
--->
-<resources>
- <dimen name="self_expand_velocity">4000dp</dimen>
- <dimen name="self_collapse_velocity">4000dp</dimen>
- <dimen name="fling_gesture_max_x_velocity">1500dp</dimen>
- <dimen name="fling_gesture_max_output_velocity">6000dp</dimen>
-</resources>
diff --git a/overlay/packages/apps/Camera2/res/values/config.xml b/overlay/packages/apps/Camera2/res/values/config.xml
deleted file mode 100644
index 7960cf1..0000000
--- a/overlay/packages/apps/Camera2/res/values/config.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2011, 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.
-*/
--->
-
-<resources>
- <!-- Use ZSL mode for Qualcomm cameras -->
- <bool name="enableZSL">true</bool>
- <!-- Decode YV16 format on Samsung HDR hardware -->
- <bool name="needsSamsungHDRFormat">true</bool>
-</resources>
diff --git a/overlay/packages/apps/Camera2/res/values/qcomstrings.xml b/overlay/packages/apps/Camera2/res/values/qcomstrings.xml
deleted file mode 100644
index 49a0cdd..0000000
--- a/overlay/packages/apps/Camera2/res/values/qcomstrings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
- Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
- Copyright (C) 2013-2014 The CyanogenMod Project
-
- Not a Contribution.
-
- Copyright (C) 2007 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<resources>
- <!-- Default Anti Banding setting. -->
- <string name="pref_camera_antibanding_default" translatable="false">off</string>
-</resources>
diff --git a/overlay/packages/apps/Settings/res/values/bools.xml b/overlay/packages/apps/Settings/res/values/bools.xml
deleted file mode 100644
index bc8d564..0000000
--- a/overlay/packages/apps/Settings/res/values/bools.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<resources>
- <!-- Whether or not the dock settings are to be displayed for this device when docked -->
- <bool name="has_dock_settings">true</bool>
-</resources>
diff --git a/overlay/packages/apps/Settings/res/values/config.xml b/overlay/packages/apps/Settings/res/values/config.xml
deleted file mode 100644
index 8ed5c03..0000000
--- a/overlay/packages/apps/Settings/res/values/config.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Home button Wake Support. Some devices do not support this.
- Setting to false will disable Home button Wake support -->
- <bool name="config_show_homeWake">true</bool>
-
- <!-- Volume Rocker Wake Support. Some devices do not support (PMU) this.
- Setting to false will disable Volume Rocker Wake support -->
- <bool name="config_show_volumeRockerWake">true</bool>
-</resources>
diff --git a/overlay/packages/apps/Torch/res/values/config.xml b/overlay/packages/apps/Torch/res/values/config.xml
deleted file mode 100644
index c889bd9..0000000
--- a/overlay/packages/apps/Torch/res/values/config.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
-/*
-** Copyright 2011, 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.
-*/
--->
-
-<resources>
- <!-- If there is no sysfs-based control mechanism, enable this -->
- <bool name="useCameraInterface">false</bool>
-
- <!-- Full path to the sysfs toggle -->
- <string name="flashDevice">/sys/class/leds/torch-sec1/brightness</string>
-
- <!-- Lowest setting -->
- <integer name="valueOn">5</integer>
- <!-- Middle setting -->
- <integer name="valueHigh">15</integer>
- <!-- Highest setting, leave -1 if it doesn't exist -->
- <integer name="valueDeathRay">-1</integer>
-
-</resources>
diff --git a/overlay/packages/services/Telephony/res/values/config.xml b/overlay/packages/services/Telephony/res/values/config.xml
deleted file mode 100644
index 013659f..0000000
--- a/overlay/packages/services/Telephony/res/values/config.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<!-- shooteru-specific phone app resources. -->
-<resources>
-
- <!-- Determine whether calls to mute the microphone in PhoneUtils
- are routed through the android.media.AudioManager class (true) or through
- the com.android.internal.telephony.Phone interface (false). -->
- <bool name="send_mic_mute_to_AudioManager">true</bool>
-
- <!-- This device implements a noise suppression device for in call audio-->
- <bool name="has_in_call_noise_suppression">true</bool>
-
- <!-- Flag indicating if the tty is enabled -->
- <bool name="tty_enabled">true</bool>
-
- <!-- Show enabled lte option for lte device -->
- <bool name="config_enabled_lte" translatable="false">true</bool>
-</resources>
diff --git a/proprietary-files.txt b/proprietary-files.txt
deleted file mode 100644
index 8e0fc54..0000000
--- a/proprietary-files.txt
+++ /dev/null
@@ -1,220 +0,0 @@
-# Bins
-bin/mpdecision
-bin/thermal-engine
-lib/libqc-opt.so:vendor/lib/libqc-opt.so
-lib/libthermalclient.so:vendor/lib/libthermalclient.so
-
-# Bluetooth firmware
-vendor/firmware/bcm4335.hcd
-vendor/firmware/bcm4335_murata.hcd
-vendor/firmware/bcm4335_semco.hcd
-
-# Audio
-lib/libacdbloader.so:vendor/lib/libacdbloader.so
-lib/libaudcal.so:vendor/lib/libaudcal.so
-vendor/lib/libcsd-client.so:lib/libcsd-client.so
-
-# Audio firmware (Verizon)
-blobs/vzw/etc/firmware/q6.b00
-blobs/vzw/etc/firmware/q6.b01
-blobs/vzw/etc/firmware/q6.b03
-blobs/vzw/etc/firmware/q6.b04
-blobs/vzw/etc/firmware/q6.b05
-blobs/vzw/etc/firmware/q6.b06
-blobs/vzw/etc/firmware/q6.mdt
-
-# Camera
-bin/mm-qcamera-daemon
-lib/hw/camera.msm8960.so:lib/hw/camera.vendor.msm8960.so
-lib/libadsprpc.so
-lib/libchromatix_imx074_default_video.so
-lib/libchromatix_imx074_preview.so
-lib/libchromatix_imx074_video_hd.so
-lib/libchromatix_imx074_zsl.so
-lib/libchromatix_imx091_default_video.so
-lib/libchromatix_imx091_preview.so
-lib/libchromatix_imx091_video_hd.so
-lib/libchromatix_mt9e013_default_video.so
-lib/libchromatix_mt9e013_preview.so
-lib/libchromatix_mt9e013_video_hfr.so
-lib/libchromatix_ov2720_default_video.so
-lib/libchromatix_ov2720_hfr.so
-lib/libchromatix_ov2720_preview.so
-lib/libchromatix_ov2720_zsl.so
-lib/libchromatix_ov5647_default_video.so
-lib/libchromatix_ov5647_preview.so
-lib/libchromatix_ov8825_default_video.so
-lib/libchromatix_ov8825_preview.so
-lib/libchromatix_ov9726_default_video.so
-lib/libchromatix_ov9726_preview.so
-lib/libchromatix_s5k3l1yx_default_video.so
-lib/libchromatix_s5k3l1yx_hfr_120fps.so
-lib/libchromatix_s5k3l1yx_hfr_60fps.so
-lib/libchromatix_s5k3l1yx_hfr_90fps.so
-lib/libchromatix_s5k3l1yx_preview.so
-lib/libchromatix_s5k3l1yx_video_hd.so
-lib/libchromatix_s5k3l1yx_zsl.so
-lib/libchromatix_s5k4e1_default_video.so
-lib/libchromatix_s5k4e1_preview.so
-lib/libchromatix_s5k6b2yx_pip.so
-lib/libchromatix_s5k6b2yx_preview.so
-lib/libchromatix_s5k6b2yx_smartstay.so
-lib/libchromatix_s5k6b2yx_video.so
-lib/libchromatix_s5k6b2yx_vt_hd.so
-lib/libchromatix_s5k6b2yx_vt.so
-lib/libgemini.so
-lib/libimage-jpeg-enc-omx-comp.so
-lib/libimage-omx-common.so
-lib/libmercury.so
-lib/libmmcamera_faceproc.so
-lib/libmmcamera_frameproc.so
-lib/libmmcamera_hdr_lib.so
-lib/libmmcamera_image_stab.so
-lib/libmmcamera_imx091.so
-lib/libmmcamera_interface2.so
-lib/libmmcamera_interface.so
-lib/libmmcamera_plugin.so
-lib/libmmcamera_statsproc31.so
-lib/libmmcamera_wavelet_lib.so
-lib/libmmjpeg_interface.so
-lib/libmmjpeg.so
-lib/libmmmpod.so
-lib/libmmstillomx.so
-lib/liboemcamera.so
-lib/libsecnativefeature.so
-lib/libvdis.so
-
-# Camera firmware
-cameradata/datapattern_420sp.yuv
-cameradata/datapattern_front_420sp.yuv
-cameradata/M10MO_SFW.bin
-cameradata/RS_M10MO_OL.bin
-cameradata/RS_M10MO_OS.bin
-cameradata/RS_M10MO_SL.bin
-cameradata/RS_M10MO_SS.bin
-
-# DRM
-bin/qseecomd
-lib/libdrmdecrypt.so:vendor/lib/libdrmdecrypt.so
-lib/libdrmfs.so:vendor/lib/libdrmfs.so
-lib/libdrmtime.so:vendor/lib/libdrmtime.so
-lib/libQSEEComAPI.so:vendor/lib/libQSEEComAPI.so
-
-# GPU
-vendor/lib/egl/eglsubAndroid.so
-vendor/lib/egl/libEGL_adreno.so
-vendor/lib/egl/libGLES_android.so
-vendor/lib/egl/libGLESv1_CM_adreno.so
-vendor/lib/egl/libGLESv2_adreno.so
-vendor/lib/egl/libGLESv2S3D_adreno.so
-vendor/lib/egl/libq3dtools_adreno.so
-vendor/lib/libadreno_utils.so
-vendor/lib/libC2D2.so
-vendor/lib/libc2d30-a3xx.so
-vendor/lib/libc2d30.so
-vendor/lib/libCB.so
-vendor/lib/libgsl.so
-vendor/lib/libllvm-a3xx.so
-vendor/lib/libOpenCL.so
-vendor/lib/libOpenVG.so
-vendor/lib/librs_adreno_sha1.so
-vendor/lib/librs_adreno.so
-vendor/lib/libRSDriver_adreno.so
-vendor/lib/libsc-a3xx.so
-
-# GPU Firmware
-etc/firmware/a300_pfp.fw:vendor/firmware/a300_pfp.fw
-etc/firmware/a300_pm4.fw:vendor/firmware/a300_pm4.fw
-etc/firmware/vidc_1080p.fw:vendor/firmware/vidc_1080p.fw
-
-# GPS
-lib/libloc_api_v02.so
-vendor/lib/libgeofence.so
-vendor/lib/libizat_core.so
-vendor/lib/liblbs_core.so
-vendor/lib/liblocationservice.so
-
-# HDCP
-bin/insthk
-etc/srm.bin
-lib/libhdcp2.so
-
-# IPC router security
-bin/irsc_util
-etc/sec_config
-
-# Media
-lib/libdivxdrm.so:vendor/lib/libdivxdrm.so
-lib/libExtendedExtractor.so:vendor/lib/libExtendedExtractor.so
-lib/libI420colorconvert.so:vendor/lib/libI420colorconvert.so
-lib/libmm-color-convertor.so:vendor/lib/libmm-color-convertor.so
-lib/libmmosal.so:vendor/lib/libmmosal.so
-lib/libmmparser.so:vendor/lib/libmmparser.so
-
-# NFC firmware
-vendor/firmware/bcm2079xB4_firmware.ncd
-vendor/firmware/bcm2079xB4_pre_firmware.ncd
-
-# Postprocessing
-bin/mm-pp-daemon
-lib/libmm-abl.so:vendor/lib/libmm-abl.so
-lib/libmm-abl-oem.so:vendor/lib/libmm-abl-oem.so
-
-# QMI
-vendor/lib/libidl.so
-vendor/lib/libqcci_legacy.so
-vendor/lib/libqmi_cci.so
-vendor/lib/libqmi_client_qmux.so
-vendor/lib/libqmi_common_so.so
-vendor/lib/libqmi_csi.so
-vendor/lib/libqmi_encdec.so
-vendor/lib/libqmiservices.so
-vendor/lib/libqmi.so
-
-# Radio
-bin/ds_fmc_appd
-bin/efsks
-bin/ks
-bin/qcks
-bin/qmuxd
-bin/rild
-bin/rmt_storage
-lib/libatparser.so
-lib/libfactoryutil.so
-lib/libomission_avoidance.so
-lib/libreference-ril.so
-lib/libsecril-client.so
-blobs/cdma/lib/libsec-ril.so
-blobs/cdma/lib/libril.so
-blobs/gsm/lib/libsec-ril.so
-blobs/gsm/lib/libril.so
-vendor/lib/libdiag.so
-vendor/lib/libdsutils.so
-vendor/lib/libnetmgr.so
-vendor/lib/libril-qcril-hook-oem.so
-
-# Sensors
-lib/libsensirion_j1.so
-lib/libsam.so
-lib/hw/sensors.msm8960.so
-lib/hw/sensorhubs.msm8960.so
-
-# Time services
-bin/time_daemon
--lib/libtime_genoff.so
-
-# Wi-Fi
-etc/wifi/bcmdhd_apsta.bin
-etc/wifi/bcmdhd_ibss.bin
-etc/wifi/bcmdhd_mfg.bin
-etc/wifi/bcmdhd_sta.bin
-etc/wifi/cred.conf
-etc/wifi/nvram_mfg.txt
-etc/wifi/nvram_net.txt
-
-# Widevine
-lib/drm/libdrmwvmplugin.so:vendor/lib/drm/libdrmwvmplugin.so
-lib/libwvdrm_L1.so:vendor/lib/libwvdrm_L1.so
-lib/libwvm.so:vendor/lib/libwvm.so
-lib/libWVStreamControlAPI_L1.so:vendor/lib/libWVStreamControlAPI_L1.so
-vendor/lib/mediadrm/libwvdrmengine.so
diff --git a/releasetools/Android.mk b/releasetools/Android.mk
deleted file mode 100644
index 0d0a714..0000000
--- a/releasetools/Android.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (C) 2013 The CyanogenMod Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := loki_flash.c loki_patch.c loki_find.c loki_unlok.c loki_main.c
-LOCAL_MODULE := loki_tool
-LOCAL_MODULE_TAGS := eng
-LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
-LOCAL_STATIC_LIBRARIES := libc
-LOCAL_FORCE_STATIC_EXECUTABLE := true
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := loki.sh
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(TARGET_OUT)/etc
-LOCAL_SRC_FILES := loki.sh
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := loki_bootloaders
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(TARGET_OUT)/etc
-LOCAL_SRC_FILES := loki_bootloaders
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := recovery-transform.sh
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_PATH := $(TARGET_OUT)/etc
-LOCAL_SRC_FILES := loki-recovery.sh
-include $(BUILD_PREBUILT)
diff --git a/releasetools/LICENSE b/releasetools/LICENSE
deleted file mode 100644
index dcdee17..0000000
--- a/releasetools/LICENSE
+++ /dev/null
@@ -1,25 +0,0 @@
-Copyright (c) 2013 Dan Rosenberg. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. 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.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INFRAE 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.
diff --git a/releasetools/loki-recovery.sh b/releasetools/loki-recovery.sh
deleted file mode 100644
index 0ff3d68..0000000
--- a/releasetools/loki-recovery.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/system/bin/sh
-#
-# This leverages the loki_patch utility created by djrbliss
-# See here for more information on loki: https://github.com/djrbliss/loki
-#
-
-RECSIZE=$1
-RECSHA1=$2
-BOOTSIZE=$3
-BOOTSHA1=$4
-
-egrep -q -f /system/etc/loki_bootloaders /proc/cmdline
-if [ $? -eq 0 ]; then
- need_lok=1
- export C=/data/local/tmp/loki_tmpdir
- rm -rf $C
- mkdir -p $C
- dd if=/dev/block/platform/msm_sdcc.1/by-name/recovery of=$C/recovery.lok
- /system/bin/loki_tool unlok $C/recovery.lok $C/recovery
-else
- export C=/dev/block/platform/msm_sdcc.1/by-name/
-fi
-
-if ! applypatch -c EMMC:$C/recovery:$RECSIZE:$RECSHA1; then
- if [ $need_lok -eq 1 ]; then
- log -t recovery "recovery is outdated. unloki-ing all the things"
- dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=$C/boot.lok
- dd if=/dev/block/platform/msm_sdcc.1/by-name/aboot of=$C/aboot.img
- /system/bin/loki_tool unlok $C/boot.lok $C/boot
- fi
-
- log -t recovery "Installing new recovery image"
- applypatch -b /system/etc/recovery-resource.dat EMMC:$C/boot:$BOOTSIZE:$BOOTSHA1 EMMC:$C/recovery $RECSHA1 $RECSIZE $BOOTSHA1:/system/recovery-from-boot.p || exit 1
-
- if [ $need_lok -eq 1 ]; then
- /system/bin/loki_tool patch recovery $C/aboot.img $C/recovery $C/recovery.lok || exit 1
- /system/bin/loki_tool flash recovery $C/recovery.lok || exit 1
- fi
-
-else
- log -t recovery "Recovery image already installed"
-fi
-
-if [ $need_lok -eq 1 ]; then
- rm -rf $C
-fi
-
-exit 0
diff --git a/releasetools/loki.h b/releasetools/loki.h
deleted file mode 100644
index c1d6b3e..0000000
--- a/releasetools/loki.h
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifndef __LOKI_H_
-#define __LOKI_H_
-
-#define VERSION "2.1"
-
-#define BOOT_MAGIC_SIZE 8
-#define BOOT_NAME_SIZE 16
-#define BOOT_ARGS_SIZE 512
-
-#define BOOT_PARTITION "/dev/block/platform/msm_sdcc.1/by-name/boot"
-#define RECOVERY_PARTITION "/dev/block/platform/msm_sdcc.1/by-name/recovery"
-#define ABOOT_PARTITION "/dev/block/platform/msm_sdcc.1/by-name/aboot"
-
-#define PATTERN1 "\xf0\xb5\x8f\xb0\x06\x46\xf0\xf7"
-#define PATTERN2 "\xf0\xb5\x8f\xb0\x07\x46\xf0\xf7"
-#define PATTERN3 "\x2d\xe9\xf0\x41\x86\xb0\xf1\xf7"
-#define PATTERN4 "\x2d\xe9\xf0\x4f\xad\xf5\xc6\x6d"
-#define PATTERN5 "\x2d\xe9\xf0\x4f\xad\xf5\x21\x7d"
-#define PATTERN6 "\x2d\xe9\xf0\x4f\xf3\xb0\x05\x46"
-
-#define ABOOT_BASE_SAMSUNG 0x88dfffd8
-#define ABOOT_BASE_LG 0x88efffd8
-#define ABOOT_BASE_G2 0xf7fffd8
-#define ABOOT_BASE_VIPER 0x40100000
-
-struct boot_img_hdr {
- unsigned char magic[BOOT_MAGIC_SIZE];
- unsigned kernel_size; /* size in bytes */
- unsigned kernel_addr; /* physical load addr */
- unsigned ramdisk_size; /* size in bytes */
- unsigned ramdisk_addr; /* physical load addr */
- unsigned second_size; /* size in bytes */
- unsigned second_addr; /* physical load addr */
- unsigned tags_addr; /* physical addr for kernel tags */
- unsigned page_size; /* flash page size we assume */
- unsigned dt_size; /* device_tree in bytes */
- unsigned unused; /* future expansion: should be 0 */
- unsigned char name[BOOT_NAME_SIZE]; /* asciiz product name */
- unsigned char cmdline[BOOT_ARGS_SIZE];
- unsigned id[8]; /* timestamp / checksum / sha1 / etc */
-};
-
-struct loki_hdr {
- unsigned char magic[4]; /* 0x494b4f4c */
- unsigned int recovery; /* 0 = boot.img, 1 = recovery.img */
- char build[128]; /* Build number */
-
- unsigned int orig_kernel_size;
- unsigned int orig_ramdisk_size;
- unsigned int ramdisk_addr;
-};
-
-int loki_patch(const char* partition_label, const char* aboot_image, const char* in_image, const char* out_image);
-int loki_flash(const char* partition_label, const char* loki_image);
-int loki_find(const char* aboot_image);
-int loki_unlok(const char* in_image, const char* out_image);
-
-#define PATCH "\xfe\xb5" \
- "\x0d\x4d" \
- "\xd5\xf8" \
- "\x88\x04" \
- "\xab\x68" \
- "\x98\x42" \
- "\x12\xd0" \
- "\xd5\xf8" \
- "\x90\x64" \
- "\x0a\x4c" \
- "\xd5\xf8" \
- "\x8c\x74" \
- "\x07\xf5\x80\x57" \
- "\x0f\xce" \
- "\x0f\xc4" \
- "\x10\x3f" \
- "\xfb\xdc" \
- "\xd5\xf8" \
- "\x88\x04" \
- "\x04\x49" \
- "\xd5\xf8" \
- "\x8c\x24" \
- "\xa8\x60" \
- "\x69\x61" \
- "\x2a\x61" \
- "\x00\x20" \
- "\xfe\xbd" \
- "\xff\xff\xff\xff" \
- "\xee\xee\xee\xee"
-
-#endif //__LOKI_H_
diff --git a/releasetools/loki.sh b/releasetools/loki.sh
deleted file mode 100644
index 4102077..0000000
--- a/releasetools/loki.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/sbin/sh
-#
-# This leverages the loki_patch utility created by djrbliss which allows us
-# to bypass the bootloader checks on jfltevzw and jflteatt
-# See here for more information on loki: https://github.com/djrbliss/loki
-#
-#
-# Run loki patch on boot.img for locked bootloaders, found in loki_bootloaders
-#
-
-egrep -q -f /system/etc/loki_bootloaders /proc/cmdline
-if [ $? -eq 0 ];then
- echo '[*] Locked bootloader version detected.'
- export C=/tmp/loki_tmpdir
- mkdir -p $C
- dd if=/dev/block/platform/msm_sdcc.1/by-name/aboot of=$C/aboot.img
- echo '[*] Patching boot.img to with loki.'
- /system/bin/loki_tool patch boot $C/aboot.img /tmp/boot.img $C/boot.lok || exit 1
- echo '[*] Flashing modified boot.img to device.'
- /system/bin/loki_tool flash boot $C/boot.lok || exit 1
- rm -rf $C
-else
- echo '[*] Unlocked bootloader version detected.'
- echo '[*] Flashing unmodified boot.img to device.'
- dd if=/tmp/boot.img of=/dev/block/platform/msm_sdcc.1/by-name/boot || exit 1
-fi
-
-exit 0
diff --git a/releasetools/loki_bootloaders b/releasetools/loki_bootloaders
deleted file mode 100644
index 0c298da..0000000
--- a/releasetools/loki_bootloaders
+++ /dev/null
@@ -1,8 +0,0 @@
-# AT&T SGS4
-bootloader=I337UCUAMDB
-bootloader=I337UCUAMDL
-# Verizon SGS4
-bootloader=I545VRUAMDK
-# Galaxy Stellar
-bootloader=I200VRALH2
-bootloader=I200VRBMA1
diff --git a/releasetools/loki_find.c b/releasetools/loki_find.c
deleted file mode 100644
index 151a309..0000000
--- a/releasetools/loki_find.c
+++ /dev/null
@@ -1,91 +0,0 @@
-#include <stdio.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <string.h>
-
-#include "loki.h"
-
-#define BOOT_PATTERN1 "\x4f\xf4\x70\x40\xb3\x49\x2d\xe9" /* Samsung GS4 */
-#define BOOT_PATTERN2 "\x2d\xe9\xf0\x4f\xad\xf5\x82\x5d" /* LG */
-#define BOOT_PATTERN3 "\x2d\xe9\xf0\x4f\x4f\xf4\x70\x40" /* LG */
-#define BOOT_PATTERN4 "\x2d\xe9\xf0\x4f\xad\xf5\x80\x5d" /* LG G2 */
-
-int loki_find(const char* aboot_image)
-{
- int aboot_fd;
- struct stat st;
- void *aboot, *ptr;
- unsigned long aboot_base, check_sigs, boot_mmc;
-
- aboot_fd = open(aboot_image, O_RDONLY);
- if (aboot_fd < 0) {
- printf("[-] Failed to open %s for reading.\n", aboot_image);
- return 1;
- }
-
- if (fstat(aboot_fd, &st)) {
- printf("[-] fstat() failed.\n");
- return 1;
- }
-
- aboot = mmap(0, (st.st_size + 0xfff) & ~0xfff, PROT_READ, MAP_PRIVATE, aboot_fd, 0);
- if (aboot == MAP_FAILED) {
- printf("[-] Failed to mmap aboot.\n");
- return 1;
- }
-
- check_sigs = 0;
- aboot_base = *(unsigned int *)(aboot + 12) - 0x28;
-
- /* Do a pass to find signature checking function */
- for (ptr = aboot; ptr < aboot + st.st_size - 0x1000; ptr++) {
- if (!memcmp(ptr, PATTERN1, 8) ||
- !memcmp(ptr, PATTERN2, 8) ||
- !memcmp(ptr, PATTERN3, 8) ||
- !memcmp(ptr, PATTERN4, 8) ||
- !memcmp(ptr, PATTERN5, 8)) {
-
- check_sigs = (unsigned long)ptr - (unsigned long)aboot + aboot_base;
- break;
- }
-
- if (!memcmp(ptr, PATTERN6, 8)) {
-
- check_sigs = (unsigned long)ptr - (unsigned long)aboot + aboot_base;
-
- /* Don't break, because the other LG patterns override this one */
- continue;
- }
- }
-
- if (!check_sigs) {
- printf("[-] Could not find signature checking function.\n");
- return 1;
- }
-
- printf("[+] Signature check function: %.08lx\n", check_sigs);
-
- boot_mmc = 0;
-
- /* Do a second pass for the boot_linux_from_emmc function */
- for (ptr = aboot; ptr < aboot + st.st_size - 0x1000; ptr++) {
- if (!memcmp(ptr, BOOT_PATTERN1, 8) ||
- !memcmp(ptr, BOOT_PATTERN2, 8) ||
- !memcmp(ptr, BOOT_PATTERN3, 8) ||
- !memcmp(ptr, BOOT_PATTERN4, 8)) {
-
- boot_mmc = (unsigned long)ptr - (unsigned long)aboot + aboot_base;
- break;
- }
- }
-
- if (!boot_mmc) {
- printf("[-] Could not find boot_linux_from_mmc.\n");
- return 1;
- }
-
- printf("[+] boot_linux_from_mmc: %.08lx\n", boot_mmc);
-
- return 0;
-}
diff --git a/releasetools/loki_flash.c b/releasetools/loki_flash.c
deleted file mode 100644
index 16bdd4d..0000000
--- a/releasetools/loki_flash.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * loki_flash
- *
- * A sample utility to validate and flash .lok files
- *
- * by Dan Rosenberg (@djrbliss)
- *
- */
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "loki.h"
-
-int loki_flash(const char* partition_label, const char* loki_image)
-{
- int ifd, aboot_fd, ofd, recovery, offs, match;
- void *orig, *aboot, *patch;
- struct stat st;
- struct boot_img_hdr *hdr;
- struct loki_hdr *loki_hdr;
- char outfile[1024];
-
- if (!strcmp(partition_label, "boot")) {
- recovery = 0;
- } else if (!strcmp(partition_label, "recovery")) {
- recovery = 1;
- } else {
- printf("[+] First argument must be \"boot\" or \"recovery\".\n");
- return 1;
- }
-
- /* Verify input file */
- aboot_fd = open(ABOOT_PARTITION, O_RDONLY);
- if (aboot_fd < 0) {
- printf("[-] Failed to open aboot for reading.\n");
- return 1;
- }
-
- ifd = open(loki_image, O_RDONLY);
- if (ifd < 0) {
- printf("[-] Failed to open %s for reading.\n", loki_image);
- return 1;
- }
-
- /* Map the image to be flashed */
- if (fstat(ifd, &st)) {
- printf("[-] fstat() failed.\n");
- return 1;
- }
-
- orig = mmap(0, (st.st_size + 0x2000 + 0xfff) & ~0xfff, PROT_READ, MAP_PRIVATE, ifd, 0);
- if (orig == MAP_FAILED) {
- printf("[-] Failed to mmap Loki image.\n");
- return 1;
- }
-
- hdr = orig;
- loki_hdr = orig + 0x400;
-
- /* Verify this is a Loki image */
- if (memcmp(loki_hdr->magic, "LOKI", 4)) {
- printf("[-] Input file is not a Loki image.\n");
- return 1;
- }
-
- /* Verify this is the right type of image */
- if (loki_hdr->recovery != recovery) {
- printf("[-] Loki image is not a %s image.\n", recovery ? "recovery" : "boot");
- return 1;
- }
-
- /* Verify the to-be-patched address matches the known code pattern */
- aboot = mmap(0, 0x40000, PROT_READ, MAP_PRIVATE, aboot_fd, 0);
- if (aboot == MAP_FAILED) {
- printf("[-] Failed to mmap aboot.\n");
- return 1;
- }
-
- match = 0;
-
- for (offs = 0; offs < 0x10; offs += 0x4) {
-
- patch = NULL;
-
- if (hdr->ramdisk_addr > ABOOT_BASE_LG)
- patch = hdr->ramdisk_addr - ABOOT_BASE_LG + aboot + offs;
- else if (hdr->ramdisk_addr > ABOOT_BASE_SAMSUNG)
- patch = hdr->ramdisk_addr - ABOOT_BASE_SAMSUNG + aboot + offs;
- else if (hdr->ramdisk_addr > ABOOT_BASE_VIPER)
- patch = hdr->ramdisk_addr - ABOOT_BASE_VIPER + aboot + offs;
- else if (hdr->ramdisk_addr > ABOOT_BASE_G2)
- patch = hdr->ramdisk_addr - ABOOT_BASE_G2 + aboot + offs;
-
- if (patch < aboot || patch > aboot + 0x40000 - 8) {
- printf("[-] Invalid .lok file.\n");
- return 1;
- }
-
- if (!memcmp(patch, PATTERN1, 8) ||
- !memcmp(patch, PATTERN2, 8) ||
- !memcmp(patch, PATTERN3, 8) ||
- !memcmp(patch, PATTERN4, 8) ||
- !memcmp(patch, PATTERN5, 8) ||
- !memcmp(patch, PATTERN6, 8)) {
-
- match = 1;
- break;
- }
- }
-
- if (!match) {
- printf("[-] Loki aboot version does not match device.\n");
- return 1;
- }
-
- printf("[+] Loki validation passed, flashing image.\n");
-
- snprintf(outfile, sizeof(outfile),
- "%s",
- recovery ? RECOVERY_PARTITION : BOOT_PARTITION);
-
- ofd = open(outfile, O_WRONLY);
- if (ofd < 0) {
- printf("[-] Failed to open output block device.\n");
- return 1;
- }
-
- if (write(ofd, orig, st.st_size) != st.st_size) {
- printf("[-] Failed to write to block device.\n");
- return 1;
- }
-
- printf("[+] Loki flashing complete!\n");
-
- close(ifd);
- close(aboot_fd);
- close(ofd);
-
- return 0;
-}
diff --git a/releasetools/loki_main.c b/releasetools/loki_main.c
deleted file mode 100644
index 1d3d9d3..0000000
--- a/releasetools/loki_main.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * loki_patch
- *
- * A utility to patch unsigned boot and recovery images to make
- * them suitable for booting on the AT&T/Verizon Samsung
- * Galaxy S4, Galaxy Stellar, and various locked LG devices
- *
- * by Dan Rosenberg (@djrbliss)
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "loki.h"
-
-static int print_help(const char* cmd) {
- printf("Usage\n");
- printf("> Patch partition file image:\n");
- printf("%s [patch] [boot|recovery] [aboot.img] [in.img] [out.lok]\n", cmd);
- printf("\n");
- printf("> Flash loki image to boot|recovery:\n");
- printf("%s [flash] [boot|recovery] [in.lok]\n", cmd);
- printf("\n");
- printf("> Find offset from aboot image:\n");
- printf("%s [find] [aboot.img]\n", cmd);
- printf("\n");
- printf("> Revert Loki patching:\n");
- printf("%s [unlok] [in.lok] [out.img]\n", cmd);
- printf("\n");
- return 1;
-}
-
-int main(int argc, char **argv) {
- printf("Loki tool v%s\n", VERSION);
-
- if (argc == 6 && strcmp(argv[1], "patch") == 0) {
- // argv[2]: partition_label
- // argv[3]: aboot_image
- // argv[4]: in_image
- // argv[5]: out_image
- return loki_patch(argv[2], argv[3], argv[4], argv[5]);
- } else if (argc == 4 && strcmp(argv[1], "flash") == 0) {
- // argv[2]: partition_label
- // argv[3]: loki_image
- return loki_flash(argv[2], argv[3]);
- } else if (argc == 3 && strcmp(argv[1], "find") == 0) {
- // argv[2]: aboot_image
- return loki_find(argv[2]);
- } else if (argc == 4 && strcmp(argv[1], "unlok") == 0) {
- // argv[2]: in_image
- // argv[3]: out_image
- return loki_unlok(argv[2], argv[3]);
- }
-
- return print_help(argv[0]);
-}
diff --git a/releasetools/loki_patch.c b/releasetools/loki_patch.c
deleted file mode 100644
index abb9f8d..0000000
--- a/releasetools/loki_patch.c
+++ /dev/null
@@ -1,670 +0,0 @@
-/*
- * loki_patch
- *
- * A utility to patch unsigned boot and recovery images to make
- * them suitable for booting on the AT&T/Verizon Samsung
- * Galaxy S4, Galaxy Stellar, and various locked LG devices
- *
- * by Dan Rosenberg (@djrbliss)
- *
- */
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "loki.h"
-
-struct target {
- char *vendor;
- char *device;
- char *build;
- unsigned long check_sigs;
- unsigned long hdr;
- int lg;
-};
-
-struct target targets[] = {
- {
- .vendor = "AT&T",
- .device = "Samsung Galaxy S4",
- .build = "JDQ39.I337UCUAMDB or JDQ39.I337UCUAMDL",
- .check_sigs = 0x88e0ff98,
- .hdr = 0x88f3bafc,
- .lg = 0,
- },
- {
- .vendor = "Verizon",
- .device = "Samsung Galaxy S4",
- .build = "JDQ39.I545VRUAMDK",
- .check_sigs = 0x88e0fe98,
- .hdr = 0x88f372fc,
- .lg = 0,
- },
- {
- .vendor = "DoCoMo",
- .device = "Samsung Galaxy S4",
- .build = "JDQ39.SC04EOMUAMDI",
- .check_sigs = 0x88e0fcd8,
- .hdr = 0x88f0b2fc,
- .lg = 0,
- },
- {
- .vendor = "Verizon",
- .device = "Samsung Galaxy Stellar",
- .build = "IMM76D.I200VRALH2",
- .check_sigs = 0x88e0f5c0,
- .hdr = 0x88ed32e0,
- .lg = 0,
- },
- {
- .vendor = "Verizon",
- .device = "Samsung Galaxy Stellar",
- .build = "JZO54K.I200VRBMA1",
- .check_sigs = 0x88e101ac,
- .hdr = 0x88ed72e0,
- .lg = 0,
- },
- {
- .vendor = "DoCoMo",
- .device = "LG Optimus G",
- .build = "L01E20b",
- .check_sigs = 0x88F10E48,
- .hdr = 0x88F54418,
- .lg = 1,
- },
- {
- .vendor = "DoCoMo",
- .device = "LG Optimus G Pro",
- .build = "L04E10f",
- .check_sigs = 0x88f1102c,
- .hdr = 0x88f54418,
- .lg = 1,
- },
- {
- .vendor = "AT&T or HK",
- .device = "LG Optimus G Pro",
- .build = "E98010g or E98810b",
- .check_sigs = 0x88f11084,
- .hdr = 0x88f54418,
- .lg = 1,
- },
- {
- .vendor = "KT, LGU, or SKT",
- .device = "LG Optimus G Pro",
- .build = "F240K10o, F240L10v, or F240S10w",
- .check_sigs = 0x88f110b8,
- .hdr = 0x88f54418,
- .lg = 1,
- },
- {
- .vendor = "KT, LGU, or SKT",
- .device = "LG Optimus LTE 2",
- .build = "F160K20g, F160L20f, F160LV20d, or F160S20f",
- .check_sigs = 0x88f10864,
- .hdr = 0x88f802b8,
- .lg = 1,
- },
- {
- .vendor = "MetroPCS",
- .device = "LG Spirit",
- .build = "MS87010a_05",
- .check_sigs = 0x88f0e634,
- .hdr = 0x88f68194,
- .lg = 1,
- },
- {
- .vendor = "MetroPCS",
- .device = "LG Motion",
- .build = "MS77010f_01",
- .check_sigs = 0x88f1015c,
- .hdr = 0x88f58194,
- .lg = 1,
- },
- {
- .vendor = "Verizon",
- .device = "LG Lucid 2",
- .build = "VS87010B_12",
- .check_sigs = 0x88f10adc,
- .hdr = 0x88f702bc,
- .lg = 1,
- },
- {
- .vendor = "Verizon",
- .device = "LG Spectrum 2",
- .build = "VS93021B_05",
- .check_sigs = 0x88f10c10,
- .hdr = 0x88f84514,
- .lg = 1,
- },
- {
- .vendor = "Boost Mobile",
- .device = "LG Optimus F7",
- .build = "LG870ZV4_06",
- .check_sigs = 0x88f11714,
- .hdr = 0x88f842ac,
- .lg = 1,
- },
- {
- .vendor = "US Cellular",
- .device = "LG Optimus F7",
- .build = "US78011a",
- .check_sigs = 0x88f112c8,
- .hdr = 0x88f84518,
- .lg = 1,
- },
- {
- .vendor = "Sprint",
- .device = "LG Optimus F7",
- .build = "LG870ZV5_02",
- .check_sigs = 0x88f11710,
- .hdr = 0x88f842a8,
- .lg = 1,
- },
- {
- .vendor = "Virgin Mobile",
- .device = "LG Optimus F3",
- .build = "LS720ZV5",
- .check_sigs = 0x88f108f0,
- .hdr = 0x88f854f4,
- .lg = 1,
- },
- {
- .vendor = "T-Mobile and MetroPCS",
- .device = "LG Optimus F3",
- .build = "LS720ZV5",
- .check_sigs = 0x88f10264,
- .hdr = 0x88f64508,
- .lg = 1,
- },
- {
- .vendor = "AT&T",
- .device = "LG G2",
- .build = "D80010d",
- .check_sigs = 0xf8132ac,
- .hdr = 0xf906440,
- .lg = 1,
- },
- {
- .vendor = "Verizon",
- .device = "LG G2",
- .build = "VS98010b",
- .check_sigs = 0xf8131f0,
- .hdr = 0xf906440,
- .lg = 1,
- },
- {
- .vendor = "AT&T",
- .device = "LG G2",
- .build = "D80010o",
- .check_sigs = 0xf813428,
- .hdr = 0xf904400,
- .lg = 1,
- },
- {
- .vendor = "Verizon",
- .device = "LG G2",
- .build = "VS98012b",
- .check_sigs = 0xf813210,
- .hdr = 0xf906440,
- .lg = 1,
- },
- {
- .vendor = "T-Mobile or Canada",
- .device = "LG G2",
- .build = "D80110c or D803",
- .check_sigs = 0xf813294,
- .hdr = 0xf906440,
- .lg = 1,
- },
- {
- .vendor = "International",
- .device = "LG G2",
- .build = "D802b",
- .check_sigs = 0xf813a70,
- .hdr = 0xf9041c0,
- .lg = 1,
- },
- {
- .vendor = "Sprint",
- .device = "LG G2",
- .build = "LS980ZV7",
- .check_sigs = 0xf813460,
- .hdr = 0xf9041c0,
- .lg = 1,
- },
- {
- .vendor = "KT or LGU",
- .device = "LG G2",
- .build = "F320K, F320L",
- .check_sigs = 0xf81346c,
- .hdr = 0xf8de440,
- .lg = 1,
- },
- {
- .vendor = "SKT",
- .device = "LG G2",
- .build = "F320S",
- .check_sigs = 0xf8132e4,
- .hdr = 0xf8ee440,
- .lg = 1,
- },
- {
- .vendor = "SKT",
- .device = "LG G2",
- .build = "F320S11c",
- .check_sigs = 0xf813470,
- .hdr = 0xf8de440,
- .lg = 1,
- },
- {
- .vendor = "DoCoMo",
- .device = "LG G2",
- .build = "L-01F",
- .check_sigs = 0xf813538,
- .hdr = 0xf8d41c0,
- .lg = 1,
- },
- {
- .vendor = "KT",
- .device = "LG G Flex",
- .build = "F340K",
- .check_sigs = 0xf8124a4,
- .hdr = 0xf8b6440,
- .lg = 1,
- },
- {
- .vendor = "KDDI",
- .device = "LG G Flex",
- .build = "LGL2310d",
- .check_sigs = 0xf81261c,
- .hdr = 0xf8b41c0,
- .lg = 1,
- },
- {
- .vendor = "International",
- .device = "LG Optimus F5",
- .build = "P87510e",
- .check_sigs = 0x88f10a9c,
- .hdr = 0x88f702b8,
- .lg = 1,
- },
- {
- .vendor = "SKT",
- .device = "LG Optimus LTE 3",
- .build = "F260S10l",
- .check_sigs = 0x88f11398,
- .hdr = 0x88f8451c,
- .lg = 1,
- },
- {
- .vendor = "International",
- .device = "LG G Pad 8.3",
- .build = "V50010a",
- .check_sigs = 0x88f10814,
- .hdr = 0x88f801b8,
- .lg = 1,
- },
- {
- .vendor = "International",
- .device = "LG G Pad 8.3",
- .build = "V50010c or V50010e",
- .check_sigs = 0x88f108bc,
- .hdr = 0x88f801b8,
- .lg = 1,
- },
- {
- .vendor = "Verizon",
- .device = "LG G Pad 8.3",
- .build = "VK81010c",
- .check_sigs = 0x88f11080,
- .hdr = 0x88fd81b8,
- .lg = 1,
- },
- {
- .vendor = "International",
- .device = "LG Optimus L9 II",
- .build = "D60510a",
- .check_sigs = 0x88f10d98,
- .hdr = 0x88f84aa4,
- .lg = 1,
- },
- {
- .vendor = "MetroPCS",
- .device = "LG Optimus F6",
- .build = "MS50010e",
- .check_sigs = 0x88f10260,
- .hdr = 0x88f70508,
- .lg = 1,
- },
- {
- .vendor = "Open EU",
- .device = "LG Optimus F6",
- .build = "D50510a",
- .check_sigs = 0x88f10284,
- .hdr = 0x88f70aa4,
- .lg = 1,
- },
- {
- .vendor = "KDDI",
- .device = "LG Isai",
- .build = "LGL22",
- .check_sigs = 0xf813458,
- .hdr = 0xf8d41c0,
- .lg = 1,
- },
- {
- .vendor = "KDDI",
- .device = "LG",
- .build = "LGL21",
- .check_sigs = 0x88f10218,
- .hdr = 0x88f50198,
- .lg = 1,
- },
- {
- .vendor = "KT",
- .device = "LG Optimus GK",
- .build = "F220K",
- .check_sigs = 0x88f11034,
- .hdr = 0x88f54418,
- .lg = 1,
- },
- {
- .vendor = "International",
- .device = "LG Vu 3",
- .build = "F300L",
- .check_sigs = 0xf813170,
- .hdr = 0xf8d2440,
- .lg = 1,
- },
- {
- .vendor = "Sprint",
- .device = "LG Viper",
- .build = "LS840ZVK",
- .check_sigs = 0x4010fe18,
- .hdr = 0x40194198,
- .lg = 1,
- },
- {
- .vendor = "International",
- .device = "LG G Flex",
- .build = "D95510a",
- .check_sigs = 0xf812490,
- .hdr = 0xf8c2440,
- .lg = 1,
- },
-};
-
-static unsigned char patch[] = PATCH;
-
-int patch_shellcode(unsigned int header, unsigned int ramdisk)
-{
-
- unsigned int i;
- int found_header, found_ramdisk;
- unsigned int *ptr;
-
- found_header = 0;
- found_ramdisk = 0;
-
- for (i = 0; i < sizeof(patch); i++) {
- ptr = (unsigned int *)&patch[i];
- if (*ptr == 0xffffffff) {
- *ptr = header;
- found_header = 1;
- }
-
- if (*ptr == 0xeeeeeeee) {
- *ptr = ramdisk;
- found_ramdisk = 1;
- }
- }
-
- if (found_header && found_ramdisk)
- return 0;
-
- return -1;
-}
-
-int loki_patch(const char* partition_label, const char* aboot_image, const char* in_image, const char* out_image)
-{
- int ifd, ofd, aboot_fd, pos, i, recovery, offset, fake_size;
- unsigned int orig_ramdisk_size, orig_kernel_size, page_kernel_size, page_ramdisk_size, page_size, page_mask;
- unsigned long target, aboot_base;
- void *orig, *aboot, *ptr;
- struct target *tgt;
- struct stat st;
- struct boot_img_hdr *hdr;
- struct loki_hdr *loki_hdr;
- char *buf;
-
- if (!strcmp(partition_label, "boot")) {
- recovery = 0;
- } else if (!strcmp(partition_label, "recovery")) {
- recovery = 1;
- } else {
- printf("[+] First argument must be \"boot\" or \"recovery\".\n");
- return 1;
- }
-
- /* Open input files */
- aboot_fd = open(aboot_image, O_RDONLY);
- if (aboot_fd < 0) {
- printf("[-] Failed to open %s for reading.\n", aboot_image);
- return 1;
- }
-
- ifd = open(in_image, O_RDONLY);
- if (ifd < 0) {
- printf("[-] Failed to open %s for reading.\n", in_image);
- return 1;
- }
-
- ofd = open(out_image, O_WRONLY|O_CREAT|O_TRUNC, 0644);
- if (ofd < 0) {
- printf("[-] Failed to open %s for writing.\n", out_image);
- return 1;
- }
-
- /* Find the signature checking function via pattern matching */
- if (fstat(aboot_fd, &st)) {
- printf("[-] fstat() failed.\n");
- return 1;
- }
-
- aboot = mmap(0, (st.st_size + 0xfff) & ~0xfff, PROT_READ, MAP_PRIVATE, aboot_fd, 0);
- if (aboot == MAP_FAILED) {
- printf("[-] Failed to mmap aboot.\n");
- return 1;
- }
-
- target = 0;
- aboot_base = *(unsigned int *)(aboot + 12) - 0x28;
-
- for (ptr = aboot; ptr < aboot + st.st_size - 0x1000; ptr++) {
- if (!memcmp(ptr, PATTERN1, 8) ||
- !memcmp(ptr, PATTERN2, 8) ||
- !memcmp(ptr, PATTERN3, 8) ||
- !memcmp(ptr, PATTERN4, 8) ||
- !memcmp(ptr, PATTERN5, 8)) {
-
- target = (unsigned long)ptr - (unsigned long)aboot + aboot_base;
- break;
- }
- }
-
- /* Do a second pass for the second LG pattern. This is necessary because
- * apparently some LG models have both LG patterns, which throws off the
- * fingerprinting. */
-
- if (!target) {
- for (ptr = aboot; ptr < aboot + st.st_size - 0x1000; ptr++) {
- if (!memcmp(ptr, PATTERN6, 8)) {
-
- target = (unsigned long)ptr - (unsigned long)aboot + aboot_base;
- break;
- }
- }
- }
-
- if (!target) {
- printf("[-] Failed to find function to patch.\n");
- return 1;
- }
-
- tgt = NULL;
-
- for (i = 0; i < (sizeof(targets)/sizeof(targets[0])); i++) {
- if (targets[i].check_sigs == target) {
- tgt = &targets[i];
- break;
- }
- }
-
- if (!tgt) {
- printf("[-] Unsupported aboot image.\n");
- return 1;
- }
-
- printf("[+] Detected target %s %s build %s\n", tgt->vendor, tgt->device, tgt->build);
-
- /* Map the original boot/recovery image */
- if (fstat(ifd, &st)) {
- printf("[-] fstat() failed.\n");
- return 1;
- }
-
- orig = mmap(0, (st.st_size + 0x2000 + 0xfff) & ~0xfff, PROT_READ|PROT_WRITE, MAP_PRIVATE, ifd, 0);
- if (orig == MAP_FAILED) {
- printf("[-] Failed to mmap input file.\n");
- return 1;
- }
-
- hdr = orig;
- loki_hdr = orig + 0x400;
-
- if (!memcmp(loki_hdr->magic, "LOKI", 4)) {
- printf("[-] Input file is already a Loki image.\n");
-
- /* Copy the entire file to the output transparently */
- if (write(ofd, orig, st.st_size) != st.st_size) {
- printf("[-] Failed to copy Loki image.\n");
- return 1;
- }
-
- printf("[+] Copied Loki image to %s.\n", out_image);
-
- return 0;
- }
-
- /* Set the Loki header */
- memcpy(loki_hdr->magic, "LOKI", 4);
- loki_hdr->recovery = recovery;
- strncpy(loki_hdr->build, tgt->build, sizeof(loki_hdr->build) - 1);
-
- page_size = hdr->page_size;
- page_mask = hdr->page_size - 1;
-
- orig_kernel_size = hdr->kernel_size;
- orig_ramdisk_size = hdr->ramdisk_size;
-
- printf("[+] Original kernel address: %.08x\n", hdr->kernel_addr);
- printf("[+] Original ramdisk address: %.08x\n", hdr->ramdisk_addr);
-
- /* Store the original values in unused fields of the header */
- loki_hdr->orig_kernel_size = orig_kernel_size;
- loki_hdr->orig_ramdisk_size = orig_ramdisk_size;
- loki_hdr->ramdisk_addr = hdr->kernel_addr + ((hdr->kernel_size + page_mask) & ~page_mask);
-
- if (patch_shellcode(tgt->hdr, hdr->ramdisk_addr) < 0) {
- printf("[-] Failed to patch shellcode.\n");
- return 1;
- }
-
- /* Ramdisk must be aligned to a page boundary */
- hdr->kernel_size = ((hdr->kernel_size + page_mask) & ~page_mask) + hdr->ramdisk_size;
-
- /* Guarantee 16-byte alignment */
- offset = tgt->check_sigs & 0xf;
-
- hdr->ramdisk_addr = tgt->check_sigs - offset;
-
- if (tgt->lg) {
- fake_size = page_size;
- hdr->ramdisk_size = page_size;
- }
- else {
- fake_size = 0x200;
- hdr->ramdisk_size = 0;
- }
-
- /* Write the image header */
- if (write(ofd, orig, page_size) != page_size) {
- printf("[-] Failed to write header to output file.\n");
- return 1;
- }
-
- page_kernel_size = (orig_kernel_size + page_mask) & ~page_mask;
-
- /* Write the kernel */
- if (write(ofd, orig + page_size, page_kernel_size) != page_kernel_size) {
- printf("[-] Failed to write kernel to output file.\n");
- return 1;
- }
-
- page_ramdisk_size = (orig_ramdisk_size + page_mask) & ~page_mask;
-
- /* Write the ramdisk */
- if (write(ofd, orig + page_size + page_kernel_size, page_ramdisk_size) != page_ramdisk_size) {
- printf("[-] Failed to write ramdisk to output file.\n");
- return 1;
- }
-
- /* Write fake_size bytes of original code to the output */
- buf = malloc(fake_size);
- if (!buf) {
- printf("[-] Out of memory.\n");
- return 1;
- }
-
- lseek(aboot_fd, tgt->check_sigs - aboot_base - offset, SEEK_SET);
- read(aboot_fd, buf, fake_size);
-
- if (write(ofd, buf, fake_size) != fake_size) {
- printf("[-] Failed to write original aboot code to output file.\n");
- return 1;
- }
-
- /* Save this position for later */
- pos = lseek(ofd, 0, SEEK_CUR);
-
- /* Write the device tree if needed */
- if (hdr->dt_size) {
-
- printf("[+] Writing device tree.\n");
-
- if (write(ofd, orig + page_size + page_kernel_size + page_ramdisk_size, hdr->dt_size) != hdr->dt_size) {
- printf("[-] Failed to write device tree to output file.\n");
- return 1;
- }
- }
-
- lseek(ofd, pos - (fake_size - offset), SEEK_SET);
-
- /* Write the patch */
- if (write(ofd, patch, sizeof(patch)) != sizeof(patch)) {
- printf("[-] Failed to write patch to output file.\n");
- return 1;
- }
-
- close(ifd);
- close(ofd);
- close(aboot_fd);
-
- printf("[+] Output file written to %s\n", out_image);
-
- return 0;
-}
diff --git a/releasetools/loki_unlok.c b/releasetools/loki_unlok.c
deleted file mode 100644
index f2e685a..0000000
--- a/releasetools/loki_unlok.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * loki_unlok
- *
- * A utility to revert the changes made by loki_patch.
- *
- * by Dan Rosenberg (@djrbliss)
- *
- */
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "loki.h"
-
-static unsigned char patch[] = PATCH;
-
-/* Find the original address of the ramdisk, which
- * was embedded in the shellcode. */
-int find_ramdisk_addr(void *img, int sz)
-{
-
- int i, ramdisk = 0;
-
- for (i = 0; i < sz - (sizeof(patch) - 9); i++) {
- if (!memcmp((char *)img + i, patch, sizeof(patch)-9)) {
- ramdisk = *(int *)(img + i + sizeof(patch) - 5);
- break;
- }
- }
-
- return ramdisk;
-}
-
-int loki_unlok(const char* in_image, const char* out_image)
-{
- int ifd, ofd;
- unsigned int orig_ramdisk_size, orig_kernel_size, orig_ramdisk_addr;
- unsigned int page_kernel_size, page_ramdisk_size, page_size, page_mask, fake_size;
- void *orig;
- struct stat st;
- struct boot_img_hdr *hdr;
- struct loki_hdr *loki_hdr;
-
- ifd = open(in_image, O_RDONLY);
- if (ifd < 0) {
- printf("[-] Failed to open %s for reading.\n", in_image);
- return 1;
- }
-
- ofd = open(out_image, O_WRONLY|O_CREAT|O_TRUNC, 0644);
- if (ofd < 0) {
- printf("[-] Failed to open %s for writing.\n", out_image);
- return 1;
- }
-
- /* Map the original boot/recovery image */
- if (fstat(ifd, &st)) {
- printf("[-] fstat() failed.\n");
- return 1;
- }
-
- orig = mmap(0, (st.st_size + 0x2000 + 0xfff) & ~0xfff, PROT_READ|PROT_WRITE, MAP_PRIVATE, ifd, 0);
- if (orig == MAP_FAILED) {
- printf("[-] Failed to mmap input file.\n");
- return 1;
- }
-
- hdr = orig;
- loki_hdr = orig + 0x400;
-
- if (memcmp(loki_hdr->magic, "LOKI", 4)) {
- printf("[-] Input file is not a Loki image.\n");
-
- /* Copy the entire file to the output transparently */
- if (write(ofd, orig, st.st_size) != st.st_size) {
- printf("[-] Failed to copy Loki image.\n");
- return 1;
- }
-
- printf("[+] Copied Loki image to %s.\n", out_image);
-
- return 0;
- }
-
- page_size = hdr->page_size;
- page_mask = hdr->page_size - 1;
-
- /* Infer the size of the fake block based on the newer ramdisk address */
- if (hdr->ramdisk_addr > 0x88f00000 || hdr->ramdisk_addr < 0xfa00000)
- fake_size = page_size;
- else
- fake_size = 0x200;
-
- orig_ramdisk_addr = find_ramdisk_addr(orig, st.st_size);
- if (orig_ramdisk_addr == 0) {
- printf("[-] Failed to find original ramdisk address.\n");
- return 1;
- }
-
- /* Restore the original header values */
- hdr->ramdisk_addr = orig_ramdisk_addr;
- hdr->kernel_size = orig_kernel_size = loki_hdr->orig_kernel_size;
- hdr->ramdisk_size = orig_ramdisk_size = loki_hdr->orig_ramdisk_size;
-
- /* Erase the loki header */
- memset(loki_hdr, 0, sizeof(*loki_hdr));
-
- /* Write the image header */
- if (write(ofd, orig, page_size) != page_size) {
- printf("[-] Failed to write header to output file.\n");
- return 1;
- }
-
- page_kernel_size = (orig_kernel_size + page_mask) & ~page_mask;
-
- /* Write the kernel */
- if (write(ofd, orig + page_size, page_kernel_size) != page_kernel_size) {
- printf("[-] Failed to write kernel to output file.\n");
- return 1;
- }
-
- page_ramdisk_size = (orig_ramdisk_size + page_mask) & ~page_mask;
-
- /* Write the ramdisk */
- if (write(ofd, orig + page_size + page_kernel_size, page_ramdisk_size) != page_ramdisk_size) {
- printf("[-] Failed to write ramdisk to output file.\n");
- return 1;
- }
-
- /* Write the device tree if needed */
- if (hdr->dt_size) {
-
- printf("[+] Writing device tree.\n");
-
- /* Skip an additional fake_size (page_size of 0x200) bytes */
- if (write(ofd, orig + page_size + page_kernel_size + page_ramdisk_size + fake_size, hdr->dt_size) != hdr->dt_size) {
- printf("[-] Failed to write device tree to output file.\n");
- return 1;
- }
- }
-
- close(ifd);
- close(ofd);
-
- printf("[+] Output file written to %s\n", out_image);
-
- return 0;
-}
diff --git a/releasetools/releasetools.py b/releasetools/releasetools.py
deleted file mode 100644
index d686593..0000000
--- a/releasetools/releasetools.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2012 The Android Open Source Project
-# Copyright (C) 2013 The CyanogenMod Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#
-#
-# This leverages the loki_patch utility created by djrbliss which allows us
-# to bypass the bootloader checks on jfltevzw and jflteatt
-# See here for more information on loki: https://github.com/djrbliss/loki
-#
-
-"""Custom OTA commands for jf devices with locked bootloaders"""
-
-def FullOTA_InstallEnd(info):
- info.script.script = [cmd for cmd in info.script.script if not "boot.img" in cmd]
- info.script.script = [cmd for cmd in info.script.script if not "show_progress(0.100000, 0);" in cmd]
- info.script.AppendExtra('package_extract_file("boot.img", "/tmp/boot.img");')
- info.script.AppendExtra('assert(run_program("/sbin/sh", "/system/etc/loki.sh") == 0);')
- info.script.AppendExtra('ifelse(is_substring("I337", getprop("ro.bootloader")), run_program("/sbin/sh", "-c", "busybox cp -R /system/blobs/gsm/* /system/"));')
- info.script.AppendExtra('ifelse(is_substring("I545", getprop("ro.bootloader")), run_program("/sbin/sh", "-c", "busybox cp -R /system/blobs/cdma/* /system/"));')
- info.script.AppendExtra('ifelse(is_substring("I545", getprop("ro.bootloader")), run_program("/sbin/sh", "-c", "busybox cp -R /system/blobs/vzw/* /system/"));')
- info.script.AppendExtra('ifelse(is_substring("I545", getprop("ro.bootloader")), run_program("/sbin/sh", "-c", "busybox sed -i \'s/ro.com.google.clientidbase=android-google/ro.com.google.clientidbase=android-verizon/g\' /system/build.prop"));')
- info.script.AppendExtra('ifelse(is_substring("L720", getprop("ro.bootloader")), run_program("/sbin/sh", "-c", "busybox cp -R /system/blobs/cdma/* /system/"));')
- info.script.AppendExtra('ifelse(is_substring("M919", getprop("ro.bootloader")), run_program("/sbin/sh", "-c", "busybox cp -R /system/blobs/gsm/* /system/"));')
- info.script.AppendExtra('ifelse(is_substring("R970", getprop("ro.bootloader")), run_program("/sbin/sh", "-c", "busybox cp -R /system/blobs/cdma/* /system/"));')
- info.script.AppendExtra('ifelse(is_substring("I9505", getprop("ro.bootloader")), run_program("/sbin/sh", "-c", "busybox cp -R /system/blobs/gsm/* /system/"));')
- info.script.AppendExtra('ifelse(is_substring("I9507", getprop("ro.bootloader")), run_program("/sbin/sh", "-c", "busybox cp -R /system/blobs/gsm/* /system/"));')
- info.script.AppendExtra('ifelse(is_substring("I9508", getprop("ro.bootloader")), run_program("/sbin/sh", "-c", "busybox cp -R /system/blobs/gsm/* /system/"));')
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
deleted file mode 100644
index 1ad0ec4..0000000
--- a/rootdir/Android.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := fstab.qcom
-LOCAL_MODULE_TAGS := optional eng
-LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/fstab.qcom
-LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := init.carrier.rc
-LOCAL_MODULE_TAGS := optional eng
-LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/init.carrier.rc
-LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := init.qcom.rc
-LOCAL_MODULE_TAGS := optional eng
-LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/init.qcom.rc
-LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := init.qcom.usb.rc
-LOCAL_MODULE_TAGS := optional eng
-LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/init.qcom.usb.rc
-LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := init.target.rc
-LOCAL_MODULE_TAGS := optional eng
-LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/init.target.rc
-LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := ueventd.qcom.rc
-LOCAL_MODULE_TAGS := optional eng
-LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/ueventd.qcom.rc
-LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := init.crda.sh
-LOCAL_MODULE_TAGS := optional eng
-LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/init.crda.sh
-include $(BUILD_PREBUILT)
-
diff --git a/rootdir/etc/fstab.qcom b/rootdir/etc/fstab.qcom
deleted file mode 100644
index dd22bd9..0000000
--- a/rootdir/etc/fstab.qcom
+++ /dev/null
@@ -1,16 +0,0 @@
-# Android fstab file.
-# The filesystem that contains the filesystem checker binary (typically /system) cannot
-# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
-
-#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
-/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
-/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
-/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1,errors=panic wait
-/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 nosuid,nodev,noatime,noauto_da_alloc,journal_async_commit,errors=panic wait,check
-/dev/block/platform/msm_sdcc.1/by-name/apnhlos /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 wait
-/dev/block/platform/msm_sdcc.1/by-name/mdm /firmware-mdm vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 wait
-/dev/block/platform/msm_sdcc.1/by-name/efs /efs ext4 nosuid,nodev,noatime,noauto_da_alloc,journal_async_commit,errors=panic wait,check
-/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 nosuid,nodev,noatime,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=footer
-
-/devices/platform/msm_sdcc.2/mmc_host/mmc2 auto auto defaults voldmanaged=sdcard1:auto
-/devices/platform/msm_hsusb_host/usb auto auto defaults voldmanaged=usbdisk:auto
diff --git a/rootdir/etc/init.carrier.rc b/rootdir/etc/init.carrier.rc
deleted file mode 100644
index ae136b2..0000000
--- a/rootdir/etc/init.carrier.rc
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (c) 2009-2012, Code Aurora Forum. 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 Code Aurora 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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.
-#
-
-on boot
-
-# permissions for bluetooth.
- setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr"
- chown bluetooth net_bt_stack ro.bt.bdaddr_path
- chown bluetooth net_bt_stack /dev/ttyHS0
- chmod 0660 /dev/ttyHS0
- chmod 0660 /sys/class/rfkill/rfkill0/state
- chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
- chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type
-
-# bluetooth LPM
- chmod 0660 /proc/bluetooth/sleep/lpm
- chmod 0220 /proc/bluetooth/sleep/btwrite
- chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm
- chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite
- chmod 0600 /dev/btlock
- chown bluetooth bluetooth /dev/btlock
-
- chown radio system /sys/class/sec/switch/usb_sel
- chown radio system /sys/class/sec/switch/usb_state
- chown radio system /sys/class/sec/switch/uart_sel
- chown radio system /sys/class/sec/switch/apo_factory
diff --git a/rootdir/etc/init.crda.sh b/rootdir/etc/init.crda.sh
deleted file mode 100644
index cfd38c1..0000000
--- a/rootdir/etc/init.crda.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/system/bin/sh
-# Copyright (c) 2012-2013, 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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.
-#
-
-country=`getprop wlan.crda.country`
-# crda takes input in COUNTRY environment variable
-if [ $country != "" ]
-then
-COUNTRY="$country" /system/bin/crda
-fi
diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc
deleted file mode 100644
index a15e67a..0000000
--- a/rootdir/etc/init.qcom.rc
+++ /dev/null
@@ -1,807 +0,0 @@
-# Copyright (c) 2009-2013, 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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.
-#
-
-import init.qcom.usb.rc
-
-on early-init
- write /sys/block/mmcblk0/queue/scheduler noop
-
- # Increase max readahead size to 512 KB
- write /sys/block/mmcblk0/queue/read_ahead_kb 512
- write /sys/block/mmcblk1/queue/read_ahead_kb 512
-
-on init
- # Set permissions for persist partition
- mkdir /persist 0771 system system
-
- mkdir /mnt/shell/emulated 0700 shell shell
- mkdir /storage 0550 system sdcard_r
- mkdir /storage/emulated 0555 root root
-
- #External storage directories
- mkdir /mnt/media_rw/sdcard0 0700 media_rw media_rw
- mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
- mkdir /mnt/media_rw/usbdisk 0700 media_rw media_rw
-
- mkdir /storage/sdcard0 0700 root root
- mkdir /storage/sdcard1 0700 root root
- mkdir /storage/usbdisk 0700 root root
-
- export EXTERNAL_STORAGE /storage/emulated/legacy
- export SECONDARY_STORAGE /storage/sdcard1:/storage/usbdisk
- export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
- export EMULATED_STORAGE_TARGET /storage/emulated
-
- # Support legacy paths
- symlink /storage/emulated/legacy /sdcard
- symlink /storage/emulated/legacy /mnt/sdcard
- symlink /storage/emulated/legacy /storage/sdcard0
- symlink /mnt/shell/emulated/0 /storage/emulated/legacy
- symlink /storage/sdcard1 /extSdCard
- symlink /storage/sdcard1 /mnt/extSdCard
- symlink /storage/sdcard1 /external_sd
- symlink /storage/usbdisk /usbdisk
- symlink /storage/usbdisk /mnt/usbdisk
-
-on early-boot
- # set RLIMIT_MEMLOCK to 64MB
- setrlimit 8 67108864 67108864
- setprop qcom.audio.init complete
- chown system graphics /sys/class/graphics/fb1/hpd
- chown system graphics /sys/class/graphics/fb1/vendor_name
- chown system graphics /sys/class/graphics/fb1/product_description
- chown system system /sys/class/graphics/fb1/format_3d
- chmod 0664 /sys/class/graphics/fb1/hpd
- chmod 0664 /sys/class/graphics/fb1/vendor_name
- chmod 0664 /sys/class/graphics/fb1/product_description
- chmod 0664 /sys/class/graphics/fb1/format_3d
- chmod 0664 /sys/class/graphics/fb1/video_mode
- symlink /dev/graphics/fb1 /dev/graphics/hdmi
-
-on boot-pause
- exec system/bin/battery_charging
-
-on boot
- chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
- chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
- chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
- chown bluetooth bluetooth /proc/bluetooth/sleep/proto
- chown system system /sys/module/sco/parameters/disable_esco
- chown bluetooth bluetooth /sys/module/hci_smd/parameters/hcismd_set
- chmod 0660 /sys/module/bluetooth_power/parameters/power
- chmod 0660 /sys/module/hci_smd/parameters/hcismd_set
- chmod 0660 /sys/class/rfkill/rfkill0/state
- chmod 0660 /proc/bluetooth/sleep/proto
- chown bluetooth net_bt_stack /dev/ttyHS0
- chmod 0660 /dev/ttyHS0
- chown bluetooth bluetooth /sys/devices/platform/msm_serial_hs.0/clock
- chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock
-
- chmod 0660 /dev/ttyHS2
- chown bluetooth bluetooth /dev/ttyHS2
-
- #Create QMUX deamon socket area
- mkdir /dev/socket/qmux_radio 0770 radio radio
- chmod 2770 /dev/socket/qmux_radio
- mkdir /dev/socket/qmux_audio 0770 media audio
- chmod 2770 /dev/socket/qmux_audio
- mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
- chmod 2770 /dev/socket/qmux_bluetooth
- mkdir /dev/socket/qmux_gps 0770 gps gps
- chmod 2770 /dev/socket/qmux_gps
-
- setprop wifi.interface wlan0
-
- setprop ro.telephony.call_ring.multiple false
-
- #Set SUID bit for usbhub
- #chmod 4755 /system/bin/usbhub
- #chmod 755 /system/bin/usbhub_init
-
- #Remove SUID bit for iproute2 ip tool
- chmod 0755 /system/bin/ip
-
-
- chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state
-
- # Change permissions for fps_level nodes
- chown system graphics /sys/class/graphics/fb0/msm_fb_fps_level
- chown system graphics /sys/class/graphics/fb1/msm_fb_fps_level
- chown system graphics /sys/class/graphics/fb2/msm_fb_fps_level
- chmod 644 /sys/class/graphics/fb0/msm_fb_fps_level
- chmod 400 /sys/class/graphics/fb1/msm_fb_fps_level
- chmod 400 /sys/class/graphics/fb2/msm_fb_fps_level
-
- #For bridgemgr daemon to inform the USB driver of the correct transport
- chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport
-
- #To allow interfaces to get v6 address when tethering is enabled
- write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_sdio0/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_sdio1/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_sdio2/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_sdio3/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_sdio4/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_usb0/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_usb1/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_usb2/accept_ra 2
- write /proc/sys/net/ipv6/conf/rmnet_usb3/accept_ra 2
-
- # To prevent out of order acknowledgements from making
- # connection tracking to treat them as not belonging to
- # the connection they belong to.
- # Otherwise, a weird issue happens in which some long
- # connections on high-throughput links get dropped when
- # an ack packet comes out of order
- write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1
-
- # Flash storage isn't a good entropy source, and only causes locking
- # overhead in the kernel. Turn it off.
- write /sys/block/mmcblk0/queue/add_random 0
-
- # initialize MDM modem
- write /sys/module/rmnet_usb/parameters/rmnet_data_init 1
- chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
-
-# import cne init file
-on post-fs
- chown system system /sys/block/mmcblk0/queue/scheduler
- chmod 0664 /sys/block/mmcblk0/queue/scheduler
- chown system system /sys/block/mmcblk1/queue/scheduler
- chmod 0664 /sys/block/mmcblk1/queue/scheduler
-
- # for controlling write performance boosting
- chown system radio /sys/block/mmcblk0/bkops_en
- chmod 0664 /sys/block/mmcblk0/bkops_en
-
-# msm specific files that need to be created on /data
-on post-fs-data
- # we will remap this as /mnt/sdcard with the sdcard fuse tool
- mkdir /data/media 0775 media_rw media_rw
- chown media_rw media_rw /data/media
-
- mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
-
- # Create the directories used by the Wireless subsystem
- mkdir /data/misc/wifi 0770 wifi system
- mkdir /data/misc/wifi/sockets 0770 wifi wifi
- mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
- mkdir /data/misc/dhcp 0775 dhcp dhcp
- chown dhcp dhcp /data/misc/dhcp
-
- # Create the directories used by CnE subsystem
- mkdir /data/connectivity 0771 system system
- chown system system /data/connectivity
-
- mkdir /data/connectivity/nsrm 0771 system system
- chown system system /data/connectivity/nsrm
-
- # for WIFI TRP/TIS
- chown system root /data/.psm.info
- chmod 0664 /data/.psm.info
-
- # for WIFI Antena Selection
- chown system root /data/.ant.info
- chmod 0664 /data/.ant.info
-
- # for WIFI Version
- write /data/.wifiver.info 0
- chown system root /data/.wifiver.info
- chmod 0666 /data/.wifiver.info
-
- # for WIFI Cert
- chmod 0664 /data/.bustxglom.info
- chmod 0664 /data/.roamoff.info
- chmod 0664 /data/.frameburst.info
- chmod 0664 /data/.txbf.info
-
- # for WIFI MAC address
- mkdir /efs/wifi 0775 radio system
- chown system system /efs/wifi/.mac.info
- chmod 0664 /efs/wifi/.mac.info
-
- # Create directory used by audio subsystem
- mkdir /data/misc/audio 0770 audio audio
-
- chmod 0664 /sys/devices/platform/msm_sdcc.1/polling
- chmod 0664 /sys/devices/platform/msm_sdcc.2/polling
- chmod 0664 /sys/devices/platform/msm_sdcc.3/polling
- chmod 0664 /sys/devices/platform/msm_sdcc.4/polling
-
- # Chown polling nodes as needed from UI running on system server
- chown system system /sys/devices/platform/msm_sdcc.1/polling
- chown system system /sys/devices/platform/msm_sdcc.2/polling
- chown system system /sys/devices/platform/msm_sdcc.3/polling
- chown system system /sys/devices/platform/msm_sdcc.4/polling
-
- # For disabling softkeys *FIXME*
- chown root system /sys/class/leds/button-backlight/max_brightness
- chmod 0664 /sys/class/leds/button-backlight/max_brightness
-
- # torch
- chmod 0666 /sys/class/leds/torch-sec1/brightness
-
- chown system system /sys/class/sec/sec_touchkey/keypad_enable
- chmod 0660 /sys/class/sec/sec_touchkey/keypad_enable
-
- chown system camera /sys/class/leds/torch-sec1/brightness
-
- # Color Calibration
- chown root system /sys/class/misc/gammacontrol/tuner
- chmod 0664 /sys/class/misc/gammacontrol/tuner
-
- #Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant
- mkdir /data/system 0775 system system
- rm /data/system/wpa_supplicant
-
- #Create directories for gpsone_daemon services
- mkdir /data/misc/location/gpsone_d 0770 system gps
-
- #Create directories for QuIPS
- mkdir /data/misc/quipc 0770 system gps
-
- #Create directories for Location services
- mkdir /data/misc/location 0770 gps gps
- mkdir /data/misc/location/mq 0770 gps gps
- mkdir /data/misc/location/xtwifi 0770 gps gps
-
- #Create directory from IMS services
- mkdir /data/shared 0755
- chown system system /data/shared
-
- #Create directory for FOTA
- mkdir /data/fota 0771
- chown system system /data/fota
-
- #Create directory for hostapd
- mkdir /data/hostapd 0770 system wifi
-
- # Create /data/time folder for time-services
- mkdir /data/time/ 0700 system system
-
- mkdir /data/audio/ 0770 media audio
-
- setprop vold.post_fs_data_done 1
-
- # GPIO DVS
- chown radio system /sys/class/secgpio_check/secgpio_check_all/secgpio_ctrl
-
-on property:init.svc.surfaceflinger=stopped
- stop ppd
- stop hdmid
-
-on property:init.svc.wpa_supplicant=stopped
- stop dhcpcd
-
-on property:bluetooth.isEnabled=true
- start btwlancoex
- write /sys/class/bluetooth/hci0/idle_timeout 7000
-
-on property:bluetooth.sap.status=running
- start bt-sap
-
-on property:bluetooth.sap.status=stopped
- stop bt-sap
-
-on property:bluetooth.dun.status=running
- start bt-dun
-
-on property:bluetooth.dun.status=stopped
- stop bt-dun
-
-on property:vold.decrypt=trigger_restart_framework
- start config_bluetooth
-
-service irsc_util /system/bin/logwrapper /system/bin/irsc_util "/etc/sec_config"
- class main
- user root
- oneshot
-
-service cnd /system/bin/cnd
- class late_start
- socket cnd stream 660 root radio
- disabled
-
-service rmt_storage /system/bin/rmt_storage
- class core
- user root
- disabled
-
-on property:ro.boot.emmc=true
- start rmt_storage
-
-service config_bluetooth /system/bin/sh /system/etc/init.qcom.bt.sh "onboot"
- class core
- user root
- oneshot
-
-service bt-dun /system/bin/sh /system/etc/init.qcom.btdun.sh
- class late_start
- user bluetooth
- group bluetooth net_bt_admin inet
- disabled
- oneshot
-
-service bt-sap /system/bin/sapd 15
- user bluetooth
- group bluetooth net_bt_admin
- class late_start
- disabled
- oneshot
-
-service bridgemgrd /system/bin/bridgemgrd
- class late_start
- user radio
- group radio qcom_diag
- disabled
-
-service port-bridge /system/bin/port-bridge /dev/smd0 /dev/ttyGS0
- class late_start
- user system
- group system inet
- disabled
-
-on property:ro.baseband="msm"
- # Enable BT-DUN only for all msms
- setprop ro.qualcomm.bluetooth.dun false
-
-
-# QMUX must be in multiple groups to support external process connections
-service qmuxd /system/bin/qmuxd
- class main
- user radio
- group radio audio bluetooth gps qcom_diag log
-
-# Adjust socket buffer to enlarge TCP receive window for high bandwidth
-# but only if ro.data.large_tcp_window_size property is set.
-on property:ro.data.large_tcp_window_size=true
- write /proc/sys/net/ipv4/tcp_adv_win_scale 2
-
-service netmgrd /system/bin/netmgrd
- class main
-
-#service sensors /system/bin/sensors.qcom
-# class late_start
-# user root
-# group root
-# disabled
-
-service btwlancoex /system/bin/sh /system/etc/init.qcom.coex.sh
- class late_start
- user bluetooth
- group bluetooth net_bt_admin inet net_admin net_raw
- disabled
- oneshot
-
-service p2p_supplicant /system/bin/wpa_supplicant \
- -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
- -I/system/etc/wifi/wpa_supplicant_overlay.conf -O/data/misc/wifi/sockets -N \
- -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
- -I/system/etc/wifi/p2p_supplicant_overlay.conf \
- -puse_p2p_group_interface=1 -puse_multi_chan_concurrent=1 \
- -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
- # we will start as root and wpa_supplicant will switch to user wifi
- # after setting up the capabilities required for WEXT
- # user wifi
- # group wifi inet keystore
- class main
- socket wpa_wlan0 dgram 660 wifi wifi
- disabled
- oneshot
-
-service wpa_supplicant /system/bin/wpa_supplicant -g@android:wpa_wlan0 \
- -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
- # we will start as root and wpa_supplicant will switch to user wifi
- # after setting up the capabilities required for WEXT
- # user wifi
- # group wifi inet keystore
- class main
- socket wpa_wlan0 dgram 660 wifi wifi
- disabled
- oneshot
-
-service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
- class late_start
- disabled
- oneshot
-
-service dhcpcd_p2p /system/bin/dhcpcd -ABKLG
- class late_start
- disabled
- oneshot
-
-service iprenew_wlan0 /system/bin/dhcpcd -n
- class late_start
- disabled
- oneshot
-
-service iprenew_p2p /system/bin/dhcpcd -n
- class late_start
- disabled
- oneshot
-
-service dhcpcd_bt-pan /system/bin/dhcpcd -BKLG
- class late_start
- disabled
- oneshot
-
-service iprenew_bt-pan /system/bin/dhcpcd -n
- class late_start
- disabled
- oneshot
-
-#for WiFi MFG(TestMode)
-service mfgloader /system/bin/mfgloader
- class main
- disabled
- oneshot
-
-service wlandutservice /system/bin/wlandutservice
- class main
- user system
- group wifi net_raw net_admin system inet
- disabled
- oneshot
-
-on property:init.svc.macloader=stopped
- chown system root /data/.cid.info
- chmod 0664 /data/.cid.info
- chown system root /data/.rev
- chmod 0664 /data/.rev
-# end of wifi
-
-on property:crypto.driver.load=1
- insmod /system/lib/modules/qce.ko
- insmod /system/lib/modules/qcedev.ko
-
-on property:crypto.driver.load=0
- exec /system/bin/rmmod qcedev.ko
- exec /system/bin/rmmod qce.ko
-
-service drmdiag /system/bin/drmdiagapp
- class late_start
- user root
- disabled
- oneshot
-
-on property:drmdiag.load=1
- start drmdiag
-
-on property:drmdiag.load=0
- stop drmdiag
-
-service wifi-sdio-on /system/bin/sh /system/etc/init.qcom.sdio.sh
- class late_start
- group wifi inet
- disabled
- oneshot
-
-service wifi-crda /system/bin/sh /system/etc/init.crda.sh
- class late_start
- user root
- disabled
- oneshot
-
-on property:sys.boot_completed=1
- write /sys/block/mmcblk0/queue/scheduler row
-
- write /sys/module/rpm_resources/enable_low_power/L2_cache 1
- write /sys/module/rpm_resources/enable_low_power/pxo 1
- write /sys/module/rpm_resources/enable_low_power/vdd_dig 1
- write /sys/module/rpm_resources/enable_low_power/vdd_mem 1
- write /sys/module/pm_8x60/modes/cpu0/retention/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu1/retention/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu2/retention/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu3/retention/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1
- write /sys/module/msm_thermal/core_control/enabled 0
- write /sys/devices/system/cpu/cpu1/online 1
- write /sys/devices/system/cpu/cpu2/online 1
- write /sys/devices/system/cpu/cpu3/online 1
- write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 90000
- write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 1134000
- write /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay 30000
- write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 30000
- write /sys/devices/system/cpu/cpufreq/interactive/sync_freq 810000
- write /sys/devices/system/cpu/cpufreq/interactive/sync_freq_load_threshold 80
- write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 90
- write /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 1
- write /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq 810000
- write /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load 70
- write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000
- write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000
- write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 384000
- write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 384000
- write /dev/cpuctl/apps/cpu.notify_on_migrate 1
- write /sys/module/msm_thermal/core_control/enabled 1
- chown root system /sys/devices/system/cpu/mfreq
- chmod 220 /sys/devices/system/cpu/mfreq
- chown system system /sys/devices/system/cpu/cpu1/online
- chown system system /sys/devices/system/cpu/cpu2/online
- chown system system /sys/devices/system/cpu/cpu3/online
- chmod 664 /sys/devices/system/cpu/cpu1/online
- chmod 664 /sys/devices/system/cpu/cpu2/online
- chmod 664 /sys/devices/system/cpu/cpu3/online
- # Set DCVS parameters for CPU
- write /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us 40000
- write /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us 40000
- write /sys/module/msm_dcvs/cores/cpu0/em_win_size_min_us 100000
- write /sys/module/msm_dcvs/cores/cpu0/em_win_size_max_us 500000
- write /sys/module/msm_dcvs/cores/cpu0/slack_mode_dynamic 0
- write /sys/module/msm_dcvs/cores/cpu0/disable_pc_threshold 1000000
- write /sys/module/msm_dcvs/cores/cpu1/slack_time_max_us 25000
- write /sys/module/msm_dcvs/cores/cpu1/slack_time_min_us 25000
- write /sys/module/msm_dcvs/cores/cpu1/em_win_size_min_us 100000
- write /sys/module/msm_dcvs/cores/cpu1/em_win_size_max_us 500000
- write /sys/module/msm_dcvs/cores/cpu1/slack_mode_dynamic 0
- write /sys/module/msm_dcvs/cores/cpu1/disable_pc_threshold 1000000
- write /sys/module/msm_dcvs/cores/cpu2/slack_time_max_us 25000
- write /sys/module/msm_dcvs/cores/cpu2/slack_time_min_us 25000
- write /sys/module/msm_dcvs/cores/cpu2/em_win_size_min_us 100000
- write /sys/module/msm_dcvs/cores/cpu2/em_win_size_max_us 500000
- write /sys/module/msm_dcvs/cores/cpu2/slack_mode_dynamic 0
- write /sys/module/msm_dcvs/cores/cpu2/disable_pc_threshold 1000000
- write /sys/module/msm_dcvs/cores/cpu3/slack_time_max_us 25000
- write /sys/module/msm_dcvs/cores/cpu3/slack_time_min_us 25000
- write /sys/module/msm_dcvs/cores/cpu3/em_win_size_min_us 100000
- write /sys/module/msm_dcvs/cores/cpu3/em_win_size_max_us 500000
- write /sys/module/msm_dcvs/cores/cpu3/slack_mode_dynamic 0
- write /sys/module/msm_dcvs/cores/cpu3/disable_pc_threshold 1000000
- # Set DCVS parameters for GPU
- write /sys/module/msm_dcvs/cores/gpu0/slack_time_max_us 20000
- write /sys/module/msm_dcvs/cores/gpu0/slack_time_min_us 20000
- write /sys/module/msm_dcvs/cores/gpu0/slack_mode_dynamic 0
- # Set msm_mpdecision parameters
- write /sys/module/msm_mpdecision/slack_time_max_us 45000
- write /sys/module/msm_mpdecision/slack_time_min_us 15000
- write /sys/module/msm_mpdecision/em_win_size_min_us 100000
- write /sys/module/msm_mpdecision/em_win_size_max_us 1000000
- write /sys/module/msm_mpdecision/online_util_pct_min 3
- write /sys/module/msm_mpdecision/online_util_pct_max 25
- write /sys/module/msm_mpdecision/em_max_util_pct 97
- write /sys/module/msm_mpdecision/rq_avg_poll_ms 2
- write /sys/module/msm_mpdecision/mp_em_rounding_point_min 10
- write /sys/module/msm_mpdecision/mp_em_rounding_point_max 85
- write /sys/module/msm_mpdecision/iowait_threshold_pct 50
- # Set permissions for the nodes needed by display on/off hook
- chown system system /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us
- chown system system /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us
- chown system system /sys/module/msm_mpdecision/slack_time_max_us
- chown system system /sys/module/msm_mpdecision/slack_time_min_us
- chmod 664 /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us
- chmod 664 /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us
- chmod 664 /sys/module/msm_mpdecision/slack_time_max_us
- chmod 664 /sys/module/msm_mpdecision/slack_time_min_us
- # Set performance profile
- setprop sys.perf.profile 1
-
-#service atfwd /system/bin/ATFWD-daemon
-# class late_start
-# user system
-# group system radio
-# onrestart /system/bin/log -t RIL-ATFWD -p w "ATFWD daemon restarted"
-
-service hdmid /system/bin/hdmid
- class late_start
- user system
- group system graphics
- socket hdmid stream 0660 system system
- disabled
-
-on property:ro.hdmi.enable=true
- start hdmid
-
-service ppd /system/bin/mm-pp-daemon
- class late_start
- user system
- socket pps stream 0660 system system graphics
- group system graphics
-
-service hostapd /system/bin/hostapd -dddd /data/hostapd/hostapd.conf
- class late_start
- user root
- group root
- oneshot
- disabled
-
-service ds_fmc_appd /system/bin/ds_fmc_appd -p "rmnet0" -D
- class late_start
- group radio wifi inet
- disabled
- oneshot
-
-on property:persist.data.ds_fmc_app.mode=1
- start ds_fmc_appd
-
-on property:ro.data.large_tcp_window_size=true
- # Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB)
- write /proc/sys/net/ipv4/tcp_adv_win_scale 2
-
-service profiler_daemon /system/bin/profiler_daemon
- class late_start
- user root
- group root
- disabled
-
-# virtual sdcard daemon running as media_rw (1023)
-service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
- class late_start
- oneshot
-
-service fuse_sdcard0 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard0 /storage/sdcard0
- class late_start
- disabled
-
-service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
- class late_start
- disabled
-
-service fuse_usbdisk /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/usbdisk /storage/usbdisk
- class late_start
- disabled
-
-on property:ro.fuse_sdcard=true
- start sdcard
-
-# This will make sure that sdcard service starts as late_start.
-on nonencrypted
- setprop ro.fuse_sdcard ${persist.fuse_sdcard}
-
-on property:vold.decrypt=trigger_restart_framework
- setprop ro.fuse_sdcard ${persist.fuse_sdcard}
-
-service charger /charger
- class charger
-
-#Disable boot timeout for external modems.
-on property:persist.sys.mdm.timeout_disable=1
- write /sys/module/mdm_common/parameters/disable_boot_timeout 1
-# Limit to SoC reset (1) and independent SSR (3)
-on property:persist.sys.ssr.restart_level=1
- write /sys/module/subsystem_restart/parameters/restart_level 1
-on property:persist.sys.ssr.restart_level=3
- write /sys/module/subsystem_restart/parameters/restart_level 3
-
-# Powersave
-on property:sys.perf.profile=0
- stop mpdecision
- write /sys/module/msm_thermal/core_control/enabled 0
- write /sys/devices/system/cpu/cpu0/online 1
- write /sys/devices/system/cpu/cpu1/online 1
- write /sys/devices/system/cpu/cpu2/online 1
- write /sys/devices/system/cpu/cpu3/online 1
- write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor conservative
- write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor conservative
- write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor conservative
- write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor conservative
- write /sys/devices/system/cpu/cpufreq/conservative/down_threshold 65
- write /sys/devices/system/cpu/cpufreq/conservative/freq_step 5
- write /sys/devices/system/cpu/cpufreq/conservative/ignore_nice_load 1
- write /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor 1
- write /sys/devices/system/cpu/cpufreq/conservative/sampling_rate 180000
- write /sys/devices/system/cpu/cpufreq/conservative/sampling_rate_min 180000
- write /sys/devices/system/cpu/cpufreq/conservative/up_threshold 90
- write /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor ondemand
- write /sys/module/msm_thermal/core_control/enabled 1
- start mpdecision
-
-# Balanced
-on property:sys.perf.profile=1
- stop mpdecision
- write /sys/module/msm_thermal/core_control/enabled 0
- write /sys/devices/system/cpu/cpu0/online 1
- write /sys/devices/system/cpu/cpu1/online 1
- write /sys/devices/system/cpu/cpu2/online 1
- write /sys/devices/system/cpu/cpu3/online 1
- write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
- write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
- write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive
- write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive
- write /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay 30000
- write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 90
- write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 1134000
- write /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 1
- write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 90000
- write /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor 2
- write /sys/devices/system/cpu/cpufreq/interactive/sync_freq 810000
- write /sys/devices/system/cpu/cpufreq/interactive/target_loads 90
- write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 30000
- write /sys/devices/system/cpu/cpufreq/interactive/timer_slack 80000
- write /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq 810000
- write /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load 70
- write /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor ondemand
- write /sys/module/msm_thermal/core_control/enabled 1
- start mpdecision
-
-# High performance
-on property:sys.perf.profile=2
- stop mpdecision
- write /sys/devices/system/cpu/cpu0/online 1
- write /sys/devices/system/cpu/cpu1/online 1
- write /sys/devices/system/cpu/cpu2/online 1
- write /sys/devices/system/cpu/cpu3/online 1
- write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor performance
- write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor performance
- write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor performance
- write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor performance
- write /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor performance
-
-on charger
- mount_all fstab.qcom
- class_start charger
- write /sys/devices/system/cpu/cpu1/online 1
- write /sys/devices/system/cpu/cpu2/online 1
- write /sys/devices/system/cpu/cpu3/online 1
- write /sys/module/rpm_resources/enable_low_power/L2_cache 1
- write /sys/module/rpm_resources/enable_low_power/pxo 1
- write /sys/module/rpm_resources/enable_low_power/vdd_dig 1
- write /sys/module/rpm_resources/enable_low_power/vdd_mem 1
- write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled 1
- write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled 1
- write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 0
- write /sys/module/pm_8x60/modes/cpu1/power_collapse/idle_enabled 0
- write /sys/module/pm_8x60/modes/cpu2/power_collapse/idle_enabled 0
- write /sys/module/pm_8x60/modes/cpu3/power_collapse/idle_enabled 0
- write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "powersave"
- write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "powersave"
- write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "powersave"
- write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "powersave"
- write /sys/devices/system/cpu/cpu1/online 0
- write /sys/devices/system/cpu/cpu2/online 0
- write /sys/devices/system/cpu/cpu3/online 0
diff --git a/rootdir/etc/init.qcom.usb.rc b/rootdir/etc/init.qcom.usb.rc
deleted file mode 100644
index c7198f0..0000000
--- a/rootdir/etc/init.qcom.usb.rc
+++ /dev/null
@@ -1,724 +0,0 @@
-# Copyright (c) 2011-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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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.
-#
-
-on init
- write /sys/class/android_usb/android0/iSerial ${ro.serialno}
- write /sys/class/android_usb/android0/f_rndis/wceis 1
-
-# This should only be used during device bringup
-on property:sys.usb.config=mtp,diag,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/functions mtp,diag,adb
- write /sys/module/ci13xxx_msm/parameters/streaming 1
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-# USB Composite for Samsung USB Driver
-on property:sys.usb.config=mtp,conn_gadget
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/f_acm/instances 1
- write /sys/class/android_usb/android0/functions mtp,acm,conn_gadget
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mtp,conn_gadget,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/f_acm/instances 1
- write /sys/class/android_usb/android0/functions mtp,acm,conn_gadget,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mtp
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/f_acm/acm_transports tty
- write /sys/class/android_usb/android0/functions mtp,acm
- write /sys/module/ci13xxx_msm/parameters/streaming 1
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mtp,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/f_acm/acm_transports tty
- write /sys/class/android_usb/android0/functions mtp,acm,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=ptp
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6865
- write /sys/class/android_usb/android0/functions ptp
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=ptp,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6866
- write /sys/class/android_usb/android0/functions ptp,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=rndis
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6863
- write /sys/class/android_usb/android0/functions rndis
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=rndis,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6864
- write /sys/class/android_usb/android0/functions rndis,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-# rndis,acm,diag and rmnet,acm,diag are used for IOT Hidden Menu
-on property:sys.usb.config=rndis,acm,diag
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6864
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_acm/acm_transports hsic
- write /sys/class/android_usb/android0/f_acm/acm_transport_names serial_hsic
- write /sys/class/android_usb/android0/functions rndis,acm,diag
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=rmnet,acm,diag
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 685D
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_acm/acm_transports hsic
- write /sys/class/android_usb/android0/f_acm/acm_transport_names serial_hsic
- write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
- write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic
- write /sys/class/android_usb/android0/functions diag,acm,rmnet
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,acm,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 685D
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_acm/acm_transports hsic
- write /sys/class/android_usb/android0/f_acm/acm_transport_names serial_hsic
- write /sys/class/android_usb/android0/functions diag,acm,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-# For CDFS composite
-on property:sys.usb.config=mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 685B
- write /sys/class/android_usb/android0/functions mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 685E
- write /sys/class/android_usb/android0/f_acm/instances 1
- write /sys/class/android_usb/android0/functions mass_storage,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mass_storage,mtp
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/functions mtp,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mass_storage,mtp,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/functions mtp,mass_storage,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mass_storage,acm
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 685E
- write /sys/class/android_usb/android0/f_acm/instances 1
- write /sys/class/android_usb/android0/functions acm,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mass_storage,acm,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 685E
- write /sys/class/android_usb/android0/f_acm/instances 1
- write /sys/class/android_usb/android0/functions acm,mass_storage,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mass_storage,acm,mtp
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/f_acm/instances 1
- write /sys/class/android_usb/android0/functions mtp,acm,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mass_storage,acm,mtp,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 04E8
- write /sys/class/android_usb/android0/idProduct 6860
- write /sys/class/android_usb/android0/f_acm/instances 1
- write /sys/class/android_usb/android0/functions mtp,acm,mass_storage,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-# USB compositions
-#on property:sys.usb.config=diag,adb
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct 901D
-# write /sys/class/android_usb/android0/f_diag/clients diag
-# write /sys/class/android_usb/android0/functions diag,adb
-# write /sys/class/android_usb/android0/enable 1
-# start adbd
-# setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_bam,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9025
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_serial/transports smd,tty
- write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
- write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_bam,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903D
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty
- write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
- write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_bam,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9026
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_serial/transports smd,tty
- write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
- write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_bam,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903E
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty
- write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
- write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_smd,rmnet_smd_sdio,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9037
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_serial/transports sdio,smd
- write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_smd,rmnet_smd_sdio,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903B
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_acm/acm_transports sdio,smd
- write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_smd,rmnet_smd_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9038
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_serial/transports sdio,smd
- write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_smd,rmnet_smd_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903C
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_acm/acm_transports sdio,smd
- write /sys/class/android_usb/android0/functions diag,acm,rmnet_smd_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_tty,rmnet_sdio,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9031
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_serial/transports sdio,tty
- write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_tty,rmnet_sdio,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903B
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_acm/acm_transports sdio,tty
- write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_tty,rmnet_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9032
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_serial/transports sdio,tty
- write /sys/class/android_usb/android0/functions diag,serial,rmnet_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_tty,rmnet_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903C
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_acm/acm_transports sdio,tty
- write /sys/class/android_usb/android0/functions diag,acm,rmnet_sdio,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9025
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_serial/transports tty,tty
- write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- start port-bridge
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,acm_tty,acm_tty,rmnet_smd,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903D
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_acm/acm_transports tty,tty
- write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- start port-bridge
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9026
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_serial/transports tty,tty
- write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start port-bridge
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,acm_tty,acm_tty,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903E
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_acm/acm_transports tty,tty
- write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_smd,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9025
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_serial/transports smd,tty
- write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_smd,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903D
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty
- write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- start port-bridge
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9026
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_serial/transports smd,tty
- write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903E
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty
- write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-# Fusion 3 composition
-on property:sys.usb.config=diag,serial_hsic,serial_tty,rmnet_hsic,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9025
- write /sys/class/android_usb/android0/f_diag/clients diag
- write /sys/class/android_usb/android0/f_serial/transports hsic,tty
- write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
- write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-# Fusion 3 composition with diag_mdm and adb
-on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9031
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_serial/transports hsic,tty
- write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
- write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-# Fusion 3 composition with diag_mdm
-on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9032
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/f_serial/transports hsic,tty
- write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
- write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-# Fusion 3 DSDA composition with adb
-on property:sys.usb.config=diag,diag_mdm,diag_qsc,serial_hsic,serial_hsuart,rmnet_hsic,rmnet_hsuart,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9065
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc
- write /sys/class/android_usb/android0/f_serial/transports hsic,hsuart
- write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsuart,hsuart
- write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-# Fusion 3 composition without adb
-on property:sys.usb.config=diag,diag_mdm,diag_qsc,serial_hsic,serial_hsuart,rmnet_hsic,rmnet_hsuart,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9066
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc
- write /sys/class/android_usb/android0/f_serial/transports hsic,hsuart
- write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsuart,hsuart
- write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-# Fusion 2.2 composition with diag_qsc and adb
-on property:sys.usb.config=diag,diag_qsc,serial_smd,serial_tty,serial_hsuart,rmnet_hsuart,mass_storage,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9053
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_qsc
- write /sys/class/android_usb/android0/f_serial/transports smd,tty,hsuart
- write /sys/class/android_usb/android0/f_rmnet/transports smd,bam,hsuart,hsuart
- write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-# Fusion 2.2 composition with diag_qsc
-on property:sys.usb.config=diag,diag_qsc,serial_smd,serial_tty,serial_hsuart,rmnet_hsuart,mass_storage
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9054
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_qsc
- write /sys/class/android_usb/android0/f_serial/transports smd,tty,hsuart
- write /sys/class/android_usb/android0/f_rmnet/transports smd,bam,hsuart,hsuart
- write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=rndis
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct F00E
-# write /sys/class/android_usb/android0/functions rndis
-# write /sys/class/android_usb/android0/enable 1
-# setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=rndis,adb
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct 9024
-# write /sys/class/android_usb/android0/functions rndis,adb
-# write /sys/class/android_usb/android0/enable 1
-# start adbd
-# setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=rndis,diag
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct 902C
-# write /sys/class/android_usb/android0/f_diag/clients diag
-# write /sys/class/android_usb/android0/functions rndis,diag
-# write /sys/class/android_usb/android0/enable 1
-# setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=rndis,diag,adb
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct 902D
-# write /sys/class/android_usb/android0/f_diag/clients diag
-# write /sys/class/android_usb/android0/functions rndis,diag,adb
-# write /sys/class/android_usb/android0/enable 1
-# start adbd
-# setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=rndis,diag,diag_mdm
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9041
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/functions rndis,diag
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=rndis,diag,diag_mdm,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9042
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/functions rndis,diag,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=ptp
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct 904D
-# write /sys/class/android_usb/android0/functions ptp
-# write /sys/class/android_usb/android0/enable 1
-# setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=ptp,adb
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct 904E
-# write /sys/class/android_usb/android0/functions ptp,adb
-# write /sys/class/android_usb/android0/enable 1
-# start adbd
-# setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=mtp
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct F003
-# write /sys/class/android_usb/android0/functions mtp
-# write /sys/class/android_usb/android0/enable 1
-# setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=mtp,adb
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct 9039
-# write /sys/class/android_usb/android0/functions mtp,adb
-# write /sys/class/android_usb/android0/enable 1
-# start adbd
-# setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=mtp,diag
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct 901B
-# write /sys/class/android_usb/android0/f_diag/clients diag
-# write /sys/class/android_usb/android0/functions mtp,diag
-# write /sys/class/android_usb/android0/enable 1
-# setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=mtp,diag,adb
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct 903A
-# write /sys/class/android_usb/android0/f_diag/clients diag
-# write /sys/class/android_usb/android0/functions mtp,diag,adb
-# write /sys/class/android_usb/android0/enable 1
-# start adbd
-# setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mtp,diag,diag_mdm
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9040
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/functions mtp,diag
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=mtp,diag,diag_mdm,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 903F
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/functions mtp,diag,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,diag_mdm,ccid
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9045
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/functions diag,ccid
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,diag_mdm,ccid,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9044
- write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
- write /sys/class/android_usb/android0/functions diag,adb,ccid
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
-
-#on property:sys.usb.config=mass_storage,adb
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct 9015
-# write /sys/class/android_usb/android0/functions adb,mass_storage
-# write /sys/class/android_usb/android0/enable 1
-# start adbd
-# setprop sys.usb.state ${sys.usb.config}
-
-#Mass-storage only composition
-#on property:sys.usb.config=mass_storage
-# write /sys/class/android_usb/android0/enable 0
-# write /sys/class/android_usb/android0/idVendor 05C6
-# write /sys/class/android_usb/android0/idProduct F000
-# write /sys/class/android_usb/android0/functions mass_storage
-# write /sys/class/android_usb/android0/enable 1
-# setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,qdss
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 904A
- write /sys/class/android_usb/android0/functions diag,qdss
- write /sys/class/android_usb/android0/enable 1
- setprop sys.usb.state ${sys.usb.config}
-
-on property:sys.usb.config=diag,qdss,adb
- write /sys/class/android_usb/android0/enable 0
- write /sys/class/android_usb/android0/idVendor 05C6
- write /sys/class/android_usb/android0/idProduct 9060
- write /sys/class/android_usb/android0/functions diag,qdss,adb
- write /sys/class/android_usb/android0/enable 1
- start adbd
- setprop sys.usb.state ${sys.usb.config}
diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc
deleted file mode 100644
index 39b3959..0000000
--- a/rootdir/etc/init.target.rc
+++ /dev/null
@@ -1,360 +0,0 @@
-# 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
-# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-#
-
-on early-init
- mkdir /firmware 0771 system system
- mkdir /firmware-mdm 0771 system system
- mkdir /efs 0771 system system
- symlink /data/tombstones /tombstones
- mkdir /efs 0771 system radio
- mount debugfs debugfs /sys/kernel/debug
-
-on fs
- mount_all fstab.qcom
- setprop ro.crypto.fuse_sdcard true
-
- chown system radio /efs
- chmod 0771 /efs
- restorecon_recursive /efs
-
- chown system radio /dev/block/platform/msm_sdcc.1/by-name
- chmod 0775 /dev/block/platform/msm_sdcc.1/by-name
-
-on boot
- write /sys/devices/i2c-3/3-0024/cyttsp_update_fw 1
- write /sys/devices/i2c-3/3-005b/update_fw 1
- start qcamerasvr
-
-on post-fs-data
- mkdir /data/tombstones 0771 system system
- mkdir /tombstones/modem 0771 system system
- mkdir /tombstones/lpass 0771 system system
- mkdir /tombstones/wcnss 0771 system system
- mkdir /tombstones/dsps 0771 system system
- mkdir /tombstones/mdm 0771 system system
- mkdir /tombstones/mdm2 0771 system system
-
- #sensors
- write /sys/class/input/input5/distortion "400 50 15"
- write /sys/class/input/input6/distortion "400 50 15"
- write /sys/class/input/input7/distortion "400 50 15"
-
- # MDNIE
- chown system system /sys/class/mdnie/mdnie/lcdtype
- chown system system /sys/class/mdnie/mdnie/lcd_power
- chown system media_rw /sys/class/mdnie/mdnie/scenario
- chown system system /sys/class/mdnie/mdnie/tuning
- chown system media_rw /sys/class/mdnie/mdnie/outdoor
- chown system system /sys/class/mdnie/mdnie/mdnie_temp
- chown system media_rw /sys/class/mdnie/mdnie/mode
- chown system system /sys/class/mdnie/mdnie/negative
- chown system media_rw /sys/class/mdnie/mdnie/playspeed
- chown system system /sys/class/lcd/panel/window_type
- chown radio system /sys/class/lcd/panel/power_reduce
- chown system media_rw /sys/class/mdnie/mdnie/accessibility
- chown system system /sys/class/mdnie/mdnie/cabc
- chown radio system /sys/class/lcd/panel/siop_enable
- chown radio system /sys/class/lcd/panel/temperature
-
- # Adjust YUV to RGB Conversion
- chown system media_rw /sys/class/graphics/fb0/csc_cfg
- chmod 0660 /sys/class/graphics/fb0/csc_cfg
-
- # Dynamic FPS
- chown radio system /sys/class/lcd/panel/fps_change
- chmod 0664 /sys/class/lcd/panel/fps_change
-
- # Auto Brightness
- chown system system /sys/class/backlight/panel/auto_brightness
- chmod 0660 /sys/class/backlight/panel/auto_brightness
-
- # Permission for Touchscreen, Touchkey.
- chown radio system /sys/class/sec/sec_touchkey/touch_sensitivity
- chown radio system /sys/class/sec/sec_touchkey/touchkey_firm_update
- chown system radio /sys/class/sec/tsp/cmd
- chown system radio /sys/class/sec/sec_touchkey/glove_mode
- chown system radio /sys/class/sec/sec_touchkey/flip_mode
-
- chown system system /sys/class/timed_output/vibrator/enable
- chown system system /sys/class/leds/keyboard-backlight/brightness
- chown system system /sys/class/leds/lcd-backlight/brightness
- chown system system /sys/class/leds/button-backlight/brightness
- chown system system /sys/class/leds/jogball-backlight/brightness
- chown system system /sys/class/leds/red/brightness
- chown system system /sys/class/leds/green/brightness
- chown system system /sys/class/leds/blue/brightness
- chown system system /sys/class/leds/red/device/grpfreq
- chown system system /sys/class/leds/red/device/grppwm
- chown system system /sys/class/leds/red/device/blink
- chown system system /sys/class/timed_output/vibrator/enable
- chown system system /sys/module/sco/parameters/disable_esco
- chown system system /sys/kernel/ipv4/tcp_wmem_min
- chown system system /sys/kernel/ipv4/tcp_wmem_def
- chown system system /sys/kernel/ipv4/tcp_wmem_max
- chown system system /sys/kernel/ipv4/tcp_rmem_min
- chown system system /sys/kernel/ipv4/tcp_rmem_def
- chown system system /sys/kernel/ipv4/tcp_rmem_max
- chown root radio /proc/cmdline
-
- # Set these so we can remotely update SELinux policy
- chown system system /sys/fs/selinux/load
- chown system system /sys/fs/selinux/enforce
-
- # Permissions for Led
- chown system system /sys/class/sec/led/led_r
- chown system system /sys/class/sec/led/led_g
- chown system system /sys/class/sec/led/led_b
- chown system system /sys/class/sec/led/led_pattern
- chown system system /sys/class/sec/led/led_blink
- chown system system /sys/class/sec/led/led_lowpower
-
- # <Sensors & NFC>
- # Accelerometer_sensor
- chown system radio /sys/class/sensors/accelerometer_sensor/raw_data
- chown system radio /sys/class/sensors/accelerometer_sensor/calibration
- chown system radio /sys/class/sensors/accelerometer_sensor/reactive_alert
- chown system radio /sys/class/sensors/accelerometer_sensor/vendor
- chown system radio /sys/class/sensors/accelerometer_sensor/name
-
- # Proximity_sensor
- chown system radio /sys/class/sensors/proximity_sensor/state
- chown system radio /sys/class/sensors/proximity_sensor/raw_data
- chown system radio /sys/class/sensors/proximity_sensor/prox_avg
- chown system radio /sys/class/sensors/proximity_sensor/prox_cal
- chown system radio /sys/class/sensors/proximity_sensor/vendor
- chown system radio /sys/class/sensors/proximity_sensor/name
- chown system radio /sys/class/sensors/proximity_sensor/thresh_high
- chown system radio /sys/class/sensors/proximity_sensor/thresh_low
- chown system radio /sys/class/sensors/proximity_sensor/barcode_emul_en
- chown system radio /sys/class/sensors/proximity_sensor/enable
-
- # Light_sensor
- chown system radio /sys/class/sensors/light_sensor/lux
- chown system radio /sys/class/sensors/light_sensor/raw_data
- chown system radio /sys/class/sensors/light_sensor/vendor
- chown system radio /sys/class/sensors/light_sensor/name
- chown system radio /sys/class/sensors/light_sensor/enable
-
- # Gyro_sensor
- chown system radio /sys/class/sensors/gyro_sensor/power_on
- chown system radio /sys/class/sensors/gyro_sensor/power_off
- chown system radio /sys/class/sensors/gyro_sensor/temperature
- chown system radio /sys/class/sensors/gyro_sensor/selftest
- chown system radio /sys/class/sensors/gyro_sensor/selftest_dps
- chown system radio /sys/class/sensors/gyro_sensor/vendor
- chown system radio /sys/class/sensors/gyro_sensor/name
-
- # Barometer_sensor
- chown system radio /sys/class/sensors/barometer_sensor/sea_level_pressure
- chown system radio /sys/class/sensors/barometer_sensor/vendor
- chown system radio /sys/class/sensors/barometer_sensor/name
- chown system radio /sys/class/sensors/barometer_sensor/calibration
- chown system radio /sys/class/sensors/barometer_sensor/eeprom_check
-
- # Magnetic_sensor
- # chown system radio /dev/akm8963
- chown system radio /sys/class/sensors/magnetic_sensor/raw_data
- chown system radio /sys/class/sensors/magnetic_sensor/vendor
- chown system radio /sys/class/sensors/magnetic_sensor/name
-
- # uv_sensor
- chown system radio /sys/class/sensors/uv_sensor/vendor
- chown system radio /sys/class/sensors/uv_sensor/name
- chown system radio /sys/class/sensors/uv_sensor/raw_data
- chown system radio /sys/class/sensors/uv_sensor/power_on
- chown system radio /sys/class/sensors/uv_sensor/power_off
-
- # Temphumidity_sensor
- chown system radio /sys/class/sensors/temphumidity_sensor/vendor
- chown system radio /sys/class/sensors/temphumidity_sensor/name
- chown system radio /sys/class/sensors/temphumidity_sensor/engine_ver
- chown system radio /sys/class/sensors/temphumidity_sensor/engine_ver2
- chown system radio /sys/class/sensors/temphumidity_sensor/cp_thm
- chown system radio /sys/class/sensors/temphumidity_sensor/send_accuracy
-
- # SensorHub
- chown system radio /sys/class/sensors/ssp_sensor/enable
- chown system radio /sys/class/sensors/ssp_sensor/enable_irq
- chown system radio /sys/class/sensors/ssp_sensor/mcu_rev
- chown system radio /sys/class/sensors/ssp_sensor/mcu_name
- chown system radio /sys/class/sensors/ssp_sensor/mcu_test
- chown system radio /sys/class/sensors/ssp_sensor/mcu_reset
- chown system radio /sys/class/sensors/ssp_sensor/mcu_update
- chown system radio /sys/class/sensors/ssp_sensor/mcu_sleep_test
- chown system radio /sys/class/sensors/ssp_sensor/ori_poll_delay
- chown system radio /sys/class/sensors/ssp_sensor/mag_poll_delay
- chown system radio /sys/class/sensors/ssp_sensor/temp_humi_poll_delay
-
- # Gesture_sensor
- chown system radio /sys/class/sensors/gesture_sensor/ir_current
- chown system radio /sys/class/sensors/gesture_sensor/selftest
-
- # IrLed
- chmod 0660 /dev/ice4_dev
- chown system system /dev/ice4_dev
-
- # Vibrator
- chown system system /sys/class/timed_output/vibrator/pwm_default
- chmod 0660 /sys/class/timed_output/vibrator/pwm_default
- chown system system /sys/class/timed_output/vibrator/pwm_max
- chmod 0660 /sys/class/timed_output/vibrator/pwm_max
- chown system system /sys/class/timed_output/vibrator/pwm_min
- chmod 0660 /sys/class/timed_output/vibrator/pwm_min
- chown system system /sys/class/timed_output/vibrator/pwm_threshold
- chmod 0660 /sys/class/timed_output/vibrator/pwm_threshold
- chown system system /sys/class/timed_output/vibrator/pwm_value
- chmod 0660 /sys/class/timed_output/vibrator/pwm_value
-
- # NFC_NXP
- setprop ro.nfc.port "I2C"
- chmod 0600 /dev/pn544
- chown nfc nfc /dev/pn544
-
- # NFC_BROADCOM
- chmod 0600 /dev/bcm2079x
- chown nfc nfc /dev/bcm2079x
- mkdir /data/nfc
- mkdir /data/nfc/param
- chmod 0700 /data/nfc
- chmod 0700 /data/nfc/param
- chown nfc nfc /data/nfc
- chown nfc nfc /data/nfc/param
-
- # Permissions for Barcode Emul
- chown system radio /sys/class/sec/sec_barcode_emul/barcode_send
- chown system radio /sys/class/sec/sec_barcode_emul/barcode_ver_check
- chown system radio /sys/class/sec/sec_barcode_emul/barcode_led_status
-
- # IR_LED
- chown system radio /sys/class/sec/sec_ir/ir_send
- chown system radio /sys/class/sec/sec_ir/ir_send_result
-
- # Permission for fast dormacy for RIL
- chown system radio /sys/devices/virtual/sec/bamdmux/waketime
-
- # Define TCP buffer sizes for various networks
- # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
- setprop net.tcp.buffersize.default 4096,87380,704512,4096,16384,110208
- setprop net.tcp.buffersize.wifi 524288,1048576,2560000,524288,1048576,2560000
- setprop net.tcp.buffersize.lte 524288,1048576,2560000,524288,1048576,2560000
- setprop net.tcp.buffersize.umts 4094,87380,704512,4096,16384,110208
- setprop net.tcp.buffersize.hspa 4094,87380,704512,4096,16384,262144
- setprop net.tcp.buffersize.hsupa 4094,87380,704512,4096,16384,262144
- setprop net.tcp.buffersize.hsdpa 4094,87380,704512,4096,16384,262144
- setprop net.tcp.buffersize.hspap 4094,87380,1220608,4096,16384,1220608
- setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
- setprop net.tcp.buffersize.gprs 4092,30000,30000,4096,8760,11680
- setprop net.tcp.buffersize.evdo 4094,87380,262144,4096,16384,262144
-
-# Assign TCP buffer thresholds to be ceiling value of technology maximums
-# Increased technology maximums should be reflected here.
- write /proc/sys/net/core/rmem_max 1048576
- write /proc/sys/net/core/wmem_max 2097152
-
- # HDCP 2.x
- mkdir /data/system/hdcp2 0775 system system
-
- # h2k permission
- chown radio system /efs/redata.bin
- chmod 0644 /efs/h2k.dat
- chown radio radio /efs/h2k.dat
- mkdir /data/misc/radio/hatp 0775 radio system
-
- # Panel color temperature
- chmod 0660 /sys/class/lcd/panel/panel_colors
- chown system system /sys/class/lcd/panel/panel_colors
-
-#start camera server as daemon
-service qcamerasvr /system/bin/mm-qcamera-daemon
- class late_start
- user camera
- group camera system inet input graphics net_bt_stack
-
-service thermal-engine /system/bin/thermal-engine
- class main
- user root
- group root
-
-service mpdecision /system/bin/mpdecision --avg_comp
- user root
- group root system
- disabled
-
-service kickstart /system/bin/qcks -i /firmware-mdm/image/
- user root
- group radio cache inet misc audio sdcard_rw log system
- oneshot
- disabled
-
-service mdm_helper /system/bin/mdm_helper
- class main
- onrestart setprop ro.service.mdm_helper_restarted "true"
- disabled
-
-service qseecomd /system/bin/qseecomd
- class core
- user system
- group system
-
-# Start kickstart if mdm is detected
-on property:ro.baseband=mdm
- mkdir /data/qcks 0770 system system
- start kickstart
-
-# Start up mdm_helper if sglte detected
-on property:ro.baseband=sglte
- mkdir /data/misc/mdmhelperdata 0700
- start mdm_helper
-
-service time_daemon /system/bin/time_daemon
- class late_start
- user root
- group root
-
-# bugreport is triggered by holding down volume down, volume up and power
-service bugreport /system/bin/dumpstate -d -p -B \
- -o /data/data/com.android.shell/files/bugreports/bugreport
- class main
- disabled
- oneshot
- keycodes 114 115 116
-
-# SISO-ANDR-PERF :: START Changing scheduler to row after boot complete
-on property:sys.boot_completed=1
- write /sys/block/mmcblk0/queue/scheduler row
-
-# insthk
-service insthk /system/bin/insthk
- class main
- user root
- disabled
- oneshot
-
-on property:sys.qseecomd.enable=true
- start insthk
diff --git a/rootdir/etc/ueventd.qcom.rc b/rootdir/etc/ueventd.qcom.rc
deleted file mode 100644
index ecbea63..0000000
--- a/rootdir/etc/ueventd.qcom.rc
+++ /dev/null
@@ -1,174 +0,0 @@
-# Copyright (c) 2012-2013, 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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.
-#
-
-# the DIAG device node is not world writable/readable.
-/dev/diag 0660 system qcom_diag
-/dev/genlock 0666 system system
-/dev/kgsl 0666 system system
-/dev/kgsl-3d0 0666 system system
-/dev/kgsl-2d0 0666 root root
-/dev/kgsl-2d1 0666 root root
-/dev/ion 0664 system system
-/dev/rtc0 0660 system system
-/dev/smd0 0660 system system
-/dev/smd4 0660 system system
-/dev/smd_cxm_qmi 0640 radio radio
-/dev/smd7 0660 bluetooth bluetooth
-/dev/radio0 0640 system system
-/dev/rfcomm0 0660 bluetooth bluetooth
-/dev/gss 0660 gps gps
-/dev/smdcntl0 0640 radio radio
-/dev/smdcntl1 0640 radio radio
-/dev/smdcntl2 0640 radio radio
-/dev/smdcntl3 0640 radio radio
-/dev/smdcntl4 0640 radio radio
-/dev/smdcntl5 0640 radio radio
-/dev/smdcntl6 0640 radio radio
-/dev/smdcntl7 0640 radio radio
-/dev/smdcnt_rev0 0640 radio radio
-/dev/smdcnt_rev1 0640 radio radio
-/dev/smdcnt_rev2 0640 radio radio
-/dev/smdcnt_rev3 0640 radio radio
-/dev/smdcnt_rev4 0640 radio radio
-/dev/smdcnt_rev5 0640 radio radio
-/dev/smdcnt_rev6 0640 radio radio
-/dev/smdcnt_rev7 0640 radio radio
-/dev/smdcnt_rev8 0640 radio radio
-/dev/smuxctl32 0640 radio radio
-/dev/sdioctl0 0640 radio radio
-/dev/sdioctl1 0640 radio radio
-/dev/sdioctl2 0640 radio radio
-/dev/sdioctl3 0640 radio radio
-/dev/sdioctl4 0640 radio radio
-/dev/sdioctl5 0640 radio radio
-/dev/sdioctl6 0640 radio radio
-/dev/sdioctl7 0640 radio radio
-/dev/sdioctl8 0640 radio radio
-/dev/rmnet_mux_ctrl 0640 radio radio
-/dev/ks_hsic_bridge 0660 system system
-/dev/efs_hsic_bridge 0660 system system
-/dev/hsicctl0 0640 radio radio
-/dev/hsicctl1 0640 radio radio
-/dev/hsicctl2 0640 radio radio
-/dev/hsicctl3 0640 radio radio
-/dev/hsicctl4 0640 radio radio
-/dev/hsicctl5 0640 radio radio
-/dev/hsicctl6 0640 radio radio
-/dev/hsicctl7 0640 radio radio
-/dev/hsicctl8 0640 radio radio
-/dev/hsicctl9 0640 radio radio
-/dev/hsicctl10 0640 radio radio
-/dev/hsicctl11 0640 radio radio
-/dev/hsicctl12 0640 radio radio
-/dev/hsicctl13 0640 radio radio
-/dev/hsicctl14 0640 radio radio
-/dev/hsicctl15 0640 radio radio
-/dev/hsicctl16 0640 radio radio
-/dev/hsusbctl0 0640 radio radio
-/dev/hsusbctl1 0640 radio radio
-/dev/hsusbctl2 0640 radio radio
-/dev/hsusbctl3 0640 radio radio
-/dev/video* 0660 system camera
-/dev/media* 0660 system camera
-/dev/v4l-subdev* 0660 system camera
-/dev/qseecom 0660 system drmrpc
-/dev/gemini0 0660 system camera
-/dev/jpeg0 0660 system camera
-/dev/jpeg1 0660 system camera
-/dev/jpeg2 0660 system camera
-/dev/msm_camera/* 0660 system camera
-/dev/gemini/ 0660 system camera
-/dev/mercury0 0660 system camera
-/dev/msm_vidc_reg 0660 system audio
-/dev/msm_vidc_dec 0660 system audio
-/dev/msm_vidc_dec_sec 0660 system audio
-/dev/msm_vidc_enc 0660 system audio
-/dev/msm_rotator 0660 system system
-/dev/hw_random 0660 system system
-
-#permissions for audio
-/dev/msm_qcelp 0660 system audio
-/dev/msm_evrc 0660 system audio
-/dev/msm_wma 0660 system audio
-/dev/msm_wmapro 0660 system audio
-/dev/msm_amrnb 0660 system audio
-/dev/msm_amrwb 0660 system audio
-/dev/msm_amrwbplus 0660 system audio
-/dev/msm_aac 0660 system audio
-/dev/msm_multi_aac 0660 system audio
-/dev/msm_aac_in 0660 system audio
-/dev/msm_qcelp_in 0660 system audio
-/dev/msm_evrc_in 0660 system audio
-/dev/msm_amrnb_in 0640 system audio
-/dev/msm_a2dp_in 0660 system audio
-/dev/msm_ac3 0660 system audio
-/dev/msm_acdb 0660 system audio
-/dev/msm_cad 0660 system audio
-/dev/msm_fm 0660 system audio
-/dev/msm_mvs 0660 system audio
-/dev/msm_pcm_lp_dec 0660 system audio
-/dev/msm_preproc_ctl 0660 system audio
-/dev/msm_rtac 0660 system audio
-/dev/msm_voicememo 0660 system audio
-/dev/smd3 0660 bluetooth net_bt_stack
-/dev/smd2 0660 bluetooth net_bt_stack
-/dev/ttyHSL1 0660 system system
-/dev/mdm 0660 system radio
-/sys/devices/virtual/smdpkt/smdcntl* open_timeout 0664 radio radio
-/dev/sdio_tty_ciq_00 0660 system system
-/dev/tty_sdio_00 0660 system system
-/dev/ttyGS0 0660 system system
-/dev/i2c-5 0660 media media
-
-# DVB devices
-/dev/dvb/adapter0/demux* 0444 media media
-/dev/dvb/adapter0/dvr* 0664 media media
-/dev/dvb/adapter0/video* 0664 media media
-
-# native sensors
-/sys/devices/i2c-12/12-* pollrate_ms 0664 system system
-/sys/devices/i2c-12/12-* enable 0664 system system
-/sys/devices/i2c-12/12-* poll_delay 0664 system system
-
-# wlan
-/dev/wcnss_wlan 0660 system system
-# MDM devices
-/dev/block/mmcblk0p13 0660 system radio
-/dev/block/mmcblk0p14 0660 system radio
-/dev/block/mmcblk0p15 0660 system radio
-
-# sysfs properties
-/sys/devices/virtual/input/input* enable 0660 root input
-/sys/devices/virtual/input/input* poll_delay 0660 root input
-/sys/devices/virtual/usb_composite/* enable 0664 root system
-
-# sensor sysfs properties
-/sys/devices/virtual/input/input* poll_delay 0660 system radio
-/sys/devices/virtual/input/input* enable 0660 system radio
-
-# sensorhub
-/dev/ssp_sensorhub 0660 system system
diff --git a/sepolicy/app.te b/sepolicy/app.te
deleted file mode 100644
index eb71391..0000000
--- a/sepolicy/app.te
+++ /dev/null
@@ -1,3 +0,0 @@
-# Grant GPU access to all processes started by Zygote.
-# They need that to render the standard UI.
-allow appdomain gpu_device:chr_file rw_file_perms;
diff --git a/sepolicy/bluetooth.te b/sepolicy/bluetooth.te
deleted file mode 100644
index 523b252..0000000
--- a/sepolicy/bluetooth.te
+++ /dev/null
@@ -1 +0,0 @@
-allow bluetooth smd_device:chr_file rw_file_perms;
diff --git a/sepolicy/device.te b/sepolicy/device.te
deleted file mode 100644
index a8c6747..0000000
--- a/sepolicy/device.te
+++ /dev/null
@@ -1,17 +0,0 @@
-# GPU (used by most UI apps)
-type gpu_device, dev_type;
-
-# Qualcomm Secure Execution Environment Communicator (QSEECOM) device
-type qseecom_device, dev_type;
-
-type diag_device, dev_type;
-type bcm2079x_device, dev_type;
-
-# Qualcomm MSM Audio ACDB device
-type msm_acdb_device, dev_type;
-
-# Kickstart device used by QC qcks
-type kickstart_device, dev_type;
-
-# SMD device, used by hci_qcomm_init
-type smd_device, dev_type;
diff --git a/sepolicy/domain.te b/sepolicy/domain.te
deleted file mode 100644
index 45925a7..0000000
--- a/sepolicy/domain.te
+++ /dev/null
@@ -1 +0,0 @@
-allow domain init_tmpfs:file read;
diff --git a/sepolicy/drmserver.te b/sepolicy/drmserver.te
deleted file mode 100644
index 0c8b461..0000000
--- a/sepolicy/drmserver.te
+++ /dev/null
@@ -1,3 +0,0 @@
-# Grant DRM Service access to Qualcomm Secure Execution Environment Communicator (QSEECOM) device
-allow drmserver qseecom_device:chr_file rw_file_perms;
-allow drmserver sdcard_external:file open;
diff --git a/sepolicy/file.te b/sepolicy/file.te
deleted file mode 100644
index 86094a8..0000000
--- a/sepolicy/file.te
+++ /dev/null
@@ -1,11 +0,0 @@
-# Qualcomm MSM Interface (QMI) socket types
-type qmux_audio_socket, file_type;
-type qmux_bluetooth_socket, file_type;
-type qmux_gps_socket, file_type;
-type qmux_radio_socket, file_type;
-
-type firmware_file, fs_type;
-
-allow efs_file rootfs:filesystem associate;
-allow cache_file rootfs:filesystem associate;
-allow asec_apk_file rootfs:filesystem associate;
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
deleted file mode 100644
index 5406505..0000000
--- a/sepolicy/file_contexts
+++ /dev/null
@@ -1,33 +0,0 @@
-# GPU device
-/dev/kgsl-3d0 u:object_r:gpu_device:s0
-/dev/msm_rotator u:object_r:gpu_device:s0
-
-# Qualcomm Secure Execution Environment Communicator (QSEECOM) device
-/dev/qseecom u:object_r:qseecom_device:s0
-
-# Qualcomm MSM Interface (QMI) devices
-/dev/socket/qmux_audio/* u:object_r:qmux_audio_socket:s0
-/dev/socket/qmux_bluetooth/* u:object_r:qmux_bluetooth_socket:s0
-/dev/socket/qmux_gps/* u:object_r:qmux_gps_socket:s0
-/dev/socket/qmux_radio/* u:object_r:qmux_radio_socket:s0
-
-/dev/bcm2079x-i2c u:object_r:bcm2079x_device:s0
-/dev/diag u:object_r:diag_device:s0
-/dev/media([0-9])+ u:object_r:camera_device:s0
-/dev/smd([0-9])+ u:object_r:smd_device:s0
-/dev/mdm u:object_r:radio_device:s0
-
-# Qualcomm MSM Audio ACDB device
-/dev/msm_acdb u:object_r:msm_acdb_device:s0
-
-/dev/ks_hsic_bridge u:object_r:kickstart_device:s0
-/dev/efs_hsic_bridge u:object_r:kickstart_device:s0
-
-/system/bin/qcks u:object_r:kickstart_exec:s0
-/system/bin/efsks u:object_r:kickstart_exec:s0
-/system/bin/ks u:object_r:kickstart_exec:s0
-
-/data/nfc(/.*)? u:object_r:nfc_data_file:s0
-
-/system/bin/hci_qcomm_init u:object_r:hci_exec:s0
-/system/bin/bdAddrLoader u:object_r:hci_exec:s0
diff --git a/sepolicy/hci_init.te b/sepolicy/hci_init.te
deleted file mode 100644
index 85f5d32..0000000
--- a/sepolicy/hci_init.te
+++ /dev/null
@@ -1,6 +0,0 @@
-type hci_init, domain;
-permissive hci_init;
-type hci_exec, file_type, exec_type;
-type hci_data_file, file_type;
-domain_auto_trans(shell, hci_exec, hci_init)
-unconfined_domain(hci_init)
diff --git a/sepolicy/healthd.te b/sepolicy/healthd.te
deleted file mode 100644
index a9a1502..0000000
--- a/sepolicy/healthd.te
+++ /dev/null
@@ -1 +0,0 @@
-allow healthd rootfs:file entrypoint;
diff --git a/sepolicy/init.te b/sepolicy/init.te
deleted file mode 100644
index 3f11893..0000000
--- a/sepolicy/init.te
+++ /dev/null
@@ -1 +0,0 @@
-allow init wpa_socket:unix_dgram_socket { bind create };
diff --git a/sepolicy/init_shell.te b/sepolicy/init_shell.te
deleted file mode 100644
index 204392f..0000000
--- a/sepolicy/init_shell.te
+++ /dev/null
@@ -1,6 +0,0 @@
-allow init_shell diag_device:chr_file { read write };
-allow init_shell hci_exec:file rx_file_perms;
-allow init_shell bluetooth_prop:property_service set;
-allow init_shell smd_device:chr_file rw_file_perms;
-allow init_shell unlabeled:file r_file_perms;
-allow init_shell init:fifo_file r_file_perms;
diff --git a/sepolicy/keystore.te b/sepolicy/keystore.te
deleted file mode 100644
index 2583cac..0000000
--- a/sepolicy/keystore.te
+++ /dev/null
@@ -1,3 +0,0 @@
-# Grant keystore daemon access to Qualcomm Secure Execution Environment Communicator (QSEECOM) device
-allow keystore qseecom_device:chr_file rw_file_perms;
-
diff --git a/sepolicy/kickstart.te b/sepolicy/kickstart.te
deleted file mode 100644
index f4a4a26..0000000
--- a/sepolicy/kickstart.te
+++ /dev/null
@@ -1,5 +0,0 @@
-type kickstart, domain;
-permissive kickstart;
-type kickstart_exec, file_type, exec_type;
-domain_auto_trans(init, kickstart_exec, kickstart)
-unconfined_domain(kickstart)
diff --git a/sepolicy/mediaserver.te b/sepolicy/mediaserver.te
deleted file mode 100644
index dacaacf..0000000
--- a/sepolicy/mediaserver.te
+++ /dev/null
@@ -1,13 +0,0 @@
-# Grant access to Qualcomm MSM Audio ACDB device to mediaserver
-allow mediaserver msm_acdb_device:chr_file rw_file_perms;
-
-# Grant access to Qualcomm MSM Interface (QMI) audio sockets to mediaserver
-allow mediaserver qmux_audio_socket:sock_file create_file_perms;
-allow mediaserver qmux_audio_socket:dir rw_dir_perms;
-
-# Permit mediaserver to create sockets
-allow mediaserver self:socket create;
-
-# Grant access to audio firmware files to mediaserver
-allow mediaserver audio_firmware_file:dir ra_dir_perms;
-allow mediaserver audio_firmware_file:file create_file_perms;
diff --git a/sepolicy/nfc.te b/sepolicy/nfc.te
deleted file mode 100644
index 593608d..0000000
--- a/sepolicy/nfc.te
+++ /dev/null
@@ -1 +0,0 @@
-allow nfc bcm2079x_device:chr_file rw_file_perms;
diff --git a/sepolicy/rild.te b/sepolicy/rild.te
deleted file mode 100644
index 419c583..0000000
--- a/sepolicy/rild.te
+++ /dev/null
@@ -1,5 +0,0 @@
-allow rild diag_device:chr_file rw_file_perms;
-
-# Grant access to Qualcomm MSM Interface (QMI) radio sockets to RILD
-allow rild qmux_radio_socket:sock_file create_file_perms;
-allow rild qmux_radio_socket:dir rw_dir_perms;
diff --git a/sepolicy/surfaceflinger.te b/sepolicy/surfaceflinger.te
deleted file mode 100644
index 787432d..0000000
--- a/sepolicy/surfaceflinger.te
+++ /dev/null
@@ -1,9 +0,0 @@
-# Grant GPU access to SurfaceFlinger
-allow surfaceflinger gpu_device:chr_file rw_file_perms;
-
-allow surfaceflinger sysfs:file rw_file_perms;
-
-# Read from /data/local/tmp
-allow surfaceflinger shell_data_file:dir search;
-allow surfaceflinger shell_data_file:file { open getattr read };
-allow surfaceflinger shell_data_file:lnk_file read;
diff --git a/sepolicy/system.te b/sepolicy/system.te
deleted file mode 100644
index 1a5f4c5..0000000
--- a/sepolicy/system.te
+++ /dev/null
@@ -1,10 +0,0 @@
-# Grant GPU access to system apps (e.g., PowerManagerService)
-allow system gpu_device:chr_file rw_file_perms;
-allow system diag_device:chr_file rw_file_perms;
-
-# Grant access to Qualcomm MSM Interface (QMI) radio sockets to system apps
-# (e.g., LocationManager)
-allow system qmux_radio_socket:sock_file create_file_perms;
-allow system qmux_radio_socket:dir rw_dir_perms;
-
-allow system wpa_socket:unix_dgram_socket sendto;
diff --git a/sepolicy/ueventd.te b/sepolicy/ueventd.te
deleted file mode 100644
index 367fe8d..0000000
--- a/sepolicy/ueventd.te
+++ /dev/null
@@ -1,6 +0,0 @@
-allow ueventd sdcard_external:dir search;
-allow ueventd sdcard_external:file r_file_perms;
-allow ueventd wifi_data_file:dir search;
-allow ueventd wifi_data_file:file r_file_perms;
-allow ueventd firmware_file:dir r_dir_perms;
-allow ueventd firmware_file:file r_file_perms;
diff --git a/sepolicy/wpa.te b/sepolicy/wpa.te
deleted file mode 100644
index 5f8988f..0000000
--- a/sepolicy/wpa.te
+++ /dev/null
@@ -1,2 +0,0 @@
-allow wpa devpts:chr_file rw_file_perms;
-allow wpa wpa_socket:unix_dgram_socket { read write };
diff --git a/sepolicy/wpa_socket.te b/sepolicy/wpa_socket.te
deleted file mode 100644
index 7cf3600..0000000
--- a/sepolicy/wpa_socket.te
+++ /dev/null
@@ -1 +0,0 @@
-allow wpa_socket system:unix_dgram_socket sendto;
diff --git a/system.prop b/system.prop
index 000484c..eab2325 100644
--- a/system.prop
+++ b/system.prop
@@ -1,63 +1,5 @@
# system.prop for jflte
-#
-
-# audio
-persist.audio.fluence.mode=endfire
-persist.audio.vr.enable=false
-persist.audio.handset.mic=digital
-persist.audio.speaker.location=high
-ro.qc.sdk.audio.fluencetype=fluence
-
-# display
-ro.hwui.text_cache_width=2048
-ro.opengles.version=196608
-ro.sf.lcd_density=480
-
-# radio
-persist.data.ds_fmc_app.mode=0
-persist.data_netmgrd_nint=16
-persist.omh.enabled=1
-persist.radio.add_power_save=1
-persist.radio.apm_sim_not_pwdn=1
-persist.radio.fill_eons=1
-persist.radio.mode_pref_nv10=1
-persist.radio.use_se_table_only=1
+# cannot take spaces
rild.libargs=-d /dev/smd0
-rild.libpath=/system/lib/libsec-ril.so
-ro.telephony.ril.v3=newDriverCallU,newDialCode
-
-# gps
-ro.gps.agps_provider=1
-ro.qc.sdk.izat.premium_enabled=0
-ro.qc.sdk.izat.service_mask=0x0
-persist.gps.qc_nlp_in_use=0
-
-# media
-lpa.decode=true
-mm.enable.smoothstreaming=true
-
-# nitz
-persist.rild.nitz_plmn=""
-persist.rild.nitz_long_ons_0=""
-persist.rild.nitz_long_ons_1=""
-persist.rild.nitz_long_ons_2=""
-persist.rild.nitz_long_ons_3=""
-persist.rild.nitz_short_ons_0=""
-persist.rild.nitz_short_ons_1=""
-persist.rild.nitz_short_ons_2=""
-persist.rild.nitz_short_ons_3=""
-
-# qualcomm
-persist.timed.enable=true
-ro.vendor.extension_library=/system/vendor/lib/libqc-opt.so
-
-# recovery
-ro.cwm.enable_key_repeat=true
-ro.cwm.repeatable_keys=114,115
-
-# ril
-ro.telephony.ril_class=SamsungQualcommRIL
-
-# wifi
-wifi.interface=wlan0
+persist.radio.mode_pref_nv10=1
diff --git a/wifi/p2p_supplicant_overlay.conf b/wifi/p2p_supplicant_overlay.conf
deleted file mode 100644
index acbace2..0000000
--- a/wifi/p2p_supplicant_overlay.conf
+++ /dev/null
@@ -1 +0,0 @@
-disable_scan_offload=1
diff --git a/wifi/wpa_supplicant_overlay.conf b/wifi/wpa_supplicant_overlay.conf
deleted file mode 100644
index 58c2639..0000000
--- a/wifi/wpa_supplicant_overlay.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-disable_scan_offload=1
-p2p_disabled=1