├── sepolicy
├── nfc.te
├── shell.te
├── wcnss_service.te
├── zygote.te
├── bluetooth_loader.te
├── system_app.te
├── tee.te
├── mediaserver.te
├── ueventd.te
├── system_server.te
├── isolated_app.te
├── webview_zygote.te
├── mm-qcamerad.te
├── vendor_init.te
├── lmkd.te
├── private
│ └── vendor_init.te
├── sensors.te
├── hwservicemanager.te
├── priv-app.te
├── file_contexts
└── init.te
├── gps
├── loc_api
│ ├── Android.mk
│ └── libloc_api_50001
│ │ ├── loc_eng_log.cpp
│ │ ├── loc_eng_log.h
│ │ ├── Android.mk
│ │ ├── loc_eng_xtra.h
│ │ ├── loc_eng_nmea.h
│ │ ├── loc_eng_dmn_conn_glue_pipe.h
│ │ ├── loc_eng_dmn_conn_glue_msg.h
│ │ ├── loc.h
│ │ ├── loc_eng_ni.h
│ │ ├── loc_eng_dmn_conn.h
│ │ ├── gps.c
│ │ ├── loc_eng_dmn_conn_thread_helper.h
│ │ └── loc_eng_dmn_conn_handler.h
├── Android.mk
├── core
│ ├── Android.mk
│ ├── loc_core_log.h
│ ├── LBSProxyBase.h
│ ├── LocAdapterProxyBase.h
│ ├── ContextBase.h
│ ├── LocDualContext.h
│ ├── gps_extended.h
│ ├── UlpProxyBase.h
│ ├── ContextBase.cpp
│ └── LocAdapterBase.cpp
├── utils
│ ├── Android.mk
│ ├── platform_lib_abstractions
│ │ ├── platform_lib_time.h
│ │ ├── platform_lib_includes.h
│ │ ├── elapsed_millis_since_boot.cpp
│ │ └── platform_lib_macros.h
│ ├── loc_log.h
│ ├── MsgTask.h
│ ├── LocSharedLock.h
│ ├── loc_timer.h
│ ├── LocTimer.h
│ ├── loc_target.h
│ ├── MsgTask.cpp
│ ├── LocThread.h
│ ├── loc_cfg.h
│ ├── LocHeap.h
│ ├── loc_misc_utils.h
│ └── loc_misc_utils.cpp
└── etc
│ ├── sap.conf
│ ├── flp.conf
│ └── gps.conf
├── README.md
├── wifi
├── wpa_supplicant_overlay.conf
├── p2p_supplicant_overlay.conf
├── WCNSS_cfg.dat
├── WCNSS_qcom_wlan_nv.bin
└── Android.mk
├── charger
└── images
│ ├── battery_fail.png
│ └── battery_scale.png
├── seccomp
├── mediaextractor.policy
└── mediacodec.policy
├── lineage.dependencies
├── configs
├── privapp-permissions-qti.xml
├── external_camera_config.xml
├── sec_config
├── nfcee_access.xml
├── thermal-engine-8974.conf
└── nfc-nci.conf
├── rootdir
├── etc
│ ├── init.pantech.usb.sh
│ ├── twrp.fstab
│ ├── fstab.qcom
│ └── init.qcom.bt.sh
└── Android.mk
├── libshims
├── atomic.cpp
└── Android.mk
├── Android.mk
├── overlay
├── packages
│ ├── apps
│ │ ├── Dialer
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── android
│ │ │ │ └── dialer
│ │ │ │ └── callrecord
│ │ │ │ └── res
│ │ │ │ └── values
│ │ │ │ └── config.xml
│ │ ├── Settings
│ │ │ └── res
│ │ │ │ └── values
│ │ │ │ ├── config.xml
│ │ │ │ └── arrays.xml
│ │ ├── LineageParts
│ │ │ └── res
│ │ │ │ └── values
│ │ │ │ └── config.xml
│ │ └── Snap
│ │ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ └── services
│ │ ├── Telecomm
│ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ │ └── Telephony
│ │ └── res
│ │ └── values
│ │ └── config.xml
└── frameworks
│ └── base
│ ├── packages
│ └── SettingsProvider
│ │ └── res
│ │ └── values
│ │ └── defaults.xml
│ └── core
│ └── res
│ └── res
│ ├── values-mcc302-mnc370
│ └── config.xml
│ ├── values-mcc302-mnc610
│ └── config.xml
│ ├── values-mcc302-mnc640
│ └── config.xml
│ ├── values-mcc302-mnc720
│ └── config.xml
│ ├── values-mcc302-mnc220
│ └── config.xml
│ └── values-mcc302-mnc221
│ └── config.xml
├── voice_processing
├── Android.mk
└── voice_processing_descriptors.c
├── overlay-lineage
└── frameworks
│ └── base
│ ├── packages
│ └── SystemUI
│ │ └── res
│ │ └── values
│ │ └── config.xml
│ └── core
│ └── res
│ └── res
│ └── values
│ └── config.xml
├── setup-makefiles.sh
├── lineagehw
└── org
│ └── lineageos
│ └── hardware
│ └── KeyDisabler.java
├── keylayout
├── cr-tk-300k.kl
└── gpio-keys.kl
├── extract-files.sh
├── twrp.mk
├── system.prop
├── audio
├── audio_platform_info.xml
└── audio_effects.xml
└── compatibility_matrix.xml
/sepolicy/nfc.te:
--------------------------------------------------------------------------------
1 | allow nfc firmware_file:file execute;
2 |
--------------------------------------------------------------------------------
/gps/loc_api/Android.mk:
--------------------------------------------------------------------------------
1 | include $(call all-subdir-makefiles)
2 |
--------------------------------------------------------------------------------
/sepolicy/shell.te:
--------------------------------------------------------------------------------
1 | allow shell kernel:system syslog_read;
2 |
--------------------------------------------------------------------------------
/sepolicy/wcnss_service.te:
--------------------------------------------------------------------------------
1 | allow wcnss_service wifi_prop:property_service set;
2 |
--------------------------------------------------------------------------------
/sepolicy/zygote.te:
--------------------------------------------------------------------------------
1 | allow zygote proc_cmdline:file { getattr open read };
2 |
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Copyright 2016, TekCafe Team
2 |
3 | Share Device Tree For PANTECH SKY VEGA MSM8974
4 |
--------------------------------------------------------------------------------
/sepolicy/bluetooth_loader.te:
--------------------------------------------------------------------------------
1 | allow bluetooth_loader bluetooth_data_file:file { read open };
2 |
--------------------------------------------------------------------------------
/sepolicy/system_app.te:
--------------------------------------------------------------------------------
1 | allow system_app proc_pagetypeinfo:file { open read getattr };
2 |
3 |
--------------------------------------------------------------------------------
/sepolicy/tee.te:
--------------------------------------------------------------------------------
1 | allow tee exfat:file { getattr open read };
2 | allow tee exfat:dir search;
3 |
--------------------------------------------------------------------------------
/sepolicy/mediaserver.te:
--------------------------------------------------------------------------------
1 | allow mediaserver hal_lineage_camera_motor_hwservice:hwservice_manager find;
2 |
--------------------------------------------------------------------------------
/sepolicy/ueventd.te:
--------------------------------------------------------------------------------
1 | allow ueventd exfat:file { getattr open read };
2 | allow ueventd exfat:dir search;
3 |
--------------------------------------------------------------------------------
/wifi/wpa_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_disabled=1
3 | tdls_external_control=1
4 |
--------------------------------------------------------------------------------
/wifi/p2p_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_search_delay=100
3 | p2p_no_group_iface=1
4 |
--------------------------------------------------------------------------------
/sepolicy/system_server.te:
--------------------------------------------------------------------------------
1 | allow system_server init:binder call;
2 | allow system_server unlabeled:file unlink;
3 |
--------------------------------------------------------------------------------
/wifi/WCNSS_cfg.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SuperiorOS-Devices/device_pantech_msm8974-common/pie/wifi/WCNSS_cfg.dat
--------------------------------------------------------------------------------
/sepolicy/isolated_app.te:
--------------------------------------------------------------------------------
1 | allow isolated_app app_data_file:dir getattr;
2 | allow isolated_app app_data_file:file setattr;
3 |
--------------------------------------------------------------------------------
/sepolicy/webview_zygote.te:
--------------------------------------------------------------------------------
1 | allow webview_zygote zygote:unix_dgram_socket write;
2 | allow webview_zygote theme_data_file:dir search;
3 |
--------------------------------------------------------------------------------
/wifi/WCNSS_qcom_wlan_nv.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SuperiorOS-Devices/device_pantech_msm8974-common/pie/wifi/WCNSS_qcom_wlan_nv.bin
--------------------------------------------------------------------------------
/charger/images/battery_fail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SuperiorOS-Devices/device_pantech_msm8974-common/pie/charger/images/battery_fail.png
--------------------------------------------------------------------------------
/charger/images/battery_scale.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SuperiorOS-Devices/device_pantech_msm8974-common/pie/charger/images/battery_scale.png
--------------------------------------------------------------------------------
/sepolicy/mm-qcamerad.te:
--------------------------------------------------------------------------------
1 | allow mm-qcamerad vendor_file:file execmod;
2 | allow mm-qcamerad system_data_file:dir { add_name remove_name write };
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor_init.te:
--------------------------------------------------------------------------------
1 | allow vendor_init wifi_data_file:dir { search setattr };
2 | allow vendor_init rootfs:dir { write create setattr add_name };
3 |
4 |
--------------------------------------------------------------------------------
/sepolicy/lmkd.te:
--------------------------------------------------------------------------------
1 | allow lmkd init:unix_stream_socket connectto;
2 | allow lmkd property_socket:sock_file write;
3 | allow lmkd system_prop:property_service set;
4 |
5 |
--------------------------------------------------------------------------------
/seccomp/mediaextractor.policy:
--------------------------------------------------------------------------------
1 | # device specific syscalls.
2 | # extension of services/mediaextractor/minijail/seccomp_policy/mediaextractor-seccomp-arm.policy
3 | readlinkat: 1
4 | pread64: 1
5 |
--------------------------------------------------------------------------------
/sepolicy/private/vendor_init.te:
--------------------------------------------------------------------------------
1 | typeattribute vendor_init data_between_core_and_vendor_violators;
2 |
3 | allow vendor_init {
4 | dpmd_data_file
5 | seemp_data_file
6 | }:dir create_dir_perms;
7 |
--------------------------------------------------------------------------------
/sepolicy/sensors.te:
--------------------------------------------------------------------------------
1 | allow sensors self:capability sys_nice;
2 | allow sensors persist_file:dir { open search getattr setattr read };
3 | allow sensors persist_file:file { append open getattr read write };
4 |
--------------------------------------------------------------------------------
/sepolicy/hwservicemanager.te:
--------------------------------------------------------------------------------
1 | allow hwservicemanager init:binder call;
2 | allow hwservicemanager init:dir search;
3 | allow hwservicemanager init:file { open read };
4 | allow hwservicemanager init:process getattr;
5 |
--------------------------------------------------------------------------------
/seccomp/mediacodec.policy:
--------------------------------------------------------------------------------
1 | # device specific syscalls
2 | # extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy
3 | pselect6: 1
4 | eventfd2: 1
5 | sendto: 1
6 | recvfrom: 1
7 | _llseek: 1
8 |
--------------------------------------------------------------------------------
/lineage.dependencies:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "repository": "android_vendor_pantech",
4 | "target_path": "vendor/pantech"
5 | },
6 | {
7 | "repository": "android_kernel_pantech_msm8x74",
8 | "target_path": "kernel/pantech/msm8x74"
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/configs/privapp-permissions-qti.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/sepolicy/priv-app.te:
--------------------------------------------------------------------------------
1 | allow priv_app proc_interrupts:file open;
2 | allow priv_app proc_modules:file { getattr open };
3 | allow priv_app sysfs:file { open read };
4 | allow priv_app sysfs_android_usb:file open;
5 | allow priv_app device:dir open;
6 | allow priv_app sysfs:file getattr;
7 |
8 |
--------------------------------------------------------------------------------
/rootdir/etc/init.pantech.usb.sh:
--------------------------------------------------------------------------------
1 | # Allow persistent usb charging disabling
2 | target=`getprop ro.board.platform`
3 | usbchgdisabled=`getprop persist.usb.chgdisabled`
4 | case "$usbchgdisabled" in
5 | "") ;; #Do nothing here
6 | * )
7 | echo "$usbchgdisabled" > /sys/module/pm8921_charger/parameters/disabled
8 | esac
9 |
--------------------------------------------------------------------------------
/sepolicy/file_contexts:
--------------------------------------------------------------------------------
1 | # Misc
2 | /dev/block/platform/msm_sdcc\.1/by-name/emmclog u:object_r:misc_block_device:s0
3 |
4 | # Old camera socket
5 | /data/cam_socket1 u:object_r:camera_socket:s0
6 | /data/cam_socket2 u:object_r:camera_socket:s0
7 |
8 | # NFC
9 | /dev/pn54.* u:object_r:nfc_device:s0
10 |
--------------------------------------------------------------------------------
/sepolicy/init.te:
--------------------------------------------------------------------------------
1 | allow init hwservicemanager:binder { call transfer };
2 | allow init shell_exec:file execute_no_trans;
3 | allow init sysfs:file { open write };
4 | allow init sysfs_graphics:file { open write };
5 | allow init vendor_file:file execute_no_trans;
6 | allow init hal_light_hwservice:hwservice_manager add;
7 | allow init hidl_base_hwservice:hwservice_manager add;
8 | allow init system_file:file execute_no_trans;
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/configs/external_camera_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 0
6 | 1
7 | 2
8 | 32
9 | 33
10 | 34
11 | 35
12 | 38
13 | 39
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/gps/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2017 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | include $(call first-makefiles-under,$(call my-dir))
18 |
--------------------------------------------------------------------------------
/libshims/atomic.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #define ANDROID_ATOMIC_INLINE
19 | extern "C" {
20 | #include
21 | }
22 |
--------------------------------------------------------------------------------
/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2014 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | LOCAL_PATH := $(call my-dir)
18 |
19 | ifneq ($(filter ef56 ef59 ef60 ef63 ef65,$(TARGET_DEVICE)),)
20 | include $(call all-subdir-makefiles,$(LOCAL_PATH))
21 |
22 | endif
23 |
--------------------------------------------------------------------------------
/wifi/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH:= $(call my-dir)
2 |
3 | #----------------------------------------------------------------------
4 | # Copy additional target-specific files
5 | #----------------------------------------------------------------------
6 | ifeq ($(strip $(BOARD_HAS_QCOM_WLAN)),true)
7 | include $(CLEAR_VARS)
8 | LOCAL_MODULE := wpa_supplicant_overlay.conf
9 | LOCAL_MODULE_TAGS := optional
10 | LOCAL_MODULE_CLASS := ETC
11 | LOCAL_SRC_FILES := $(LOCAL_MODULE)
12 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/wifi
13 | include $(BUILD_PREBUILT)
14 |
15 | include $(CLEAR_VARS)
16 | LOCAL_MODULE := p2p_supplicant_overlay.conf
17 | LOCAL_MODULE_TAGS := optional
18 | LOCAL_MODULE_CLASS := ETC
19 | LOCAL_SRC_FILES := $(LOCAL_MODULE)
20 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/wifi
21 | include $(BUILD_PREBUILT)
22 |
23 | endif
24 |
--------------------------------------------------------------------------------
/rootdir/etc/twrp.fstab:
--------------------------------------------------------------------------------
1 | # mount point fstype device [device2]
2 |
3 | /boot emmc /dev/block/platform/msm_sdcc.1/by-name/boot
4 | /cache ext4 /dev/block/platform/msm_sdcc.1/by-name/cache
5 | /persist ext4 /dev/block/platform/msm_sdcc.1/by-name/persist
6 | /data ext4 /dev/block/platform/msm_sdcc.1/by-name/userdata
7 | /recovery emmc /dev/block/platform/msm_sdcc.1/by-name/recovery
8 | /rawdata emmc /dev/block/platform/msm_sdcc.1/by-name/rawdata flags=display="IMEI";backup=1
9 | /modemst1 emmc /dev/block/platform/msm_sdcc.1/by-name/modemst1 flags=backup=1;subpartitionof=/rawdata
10 | /modemst2 emmc /dev/block/platform/msm_sdcc.1/by-name/modemst2 flags=backup=1;subpartitionof=/rawdata
11 | /external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
12 | /system ext4 /dev/block/platform/msm_sdcc.1/by-name/system
13 | /misc emmc /dev/block/platform/msm_sdcc.1/by-name/emmclog
14 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | true
19 | 4
20 |
21 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Settings/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
20 | true
21 |
22 |
--------------------------------------------------------------------------------
/gps/core/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := libloc_core
6 | LOCAL_MODULE_OWNER := qcom
7 | LOCAL_PROPRIETARY_MODULE := true
8 |
9 | LOCAL_MODULE_TAGS := optional
10 |
11 | LOCAL_SHARED_LIBRARIES := \
12 | liblog \
13 | libutils \
14 | libcutils \
15 | libgps.utils \
16 | libdl
17 |
18 | LOCAL_SRC_FILES += \
19 | LocApiBase.cpp \
20 | LocAdapterBase.cpp \
21 | ContextBase.cpp \
22 | LocDualContext.cpp \
23 | loc_core_log.cpp
24 |
25 | LOCAL_CFLAGS += \
26 | -fno-short-enums \
27 | -D_ANDROID_ \
28 | -Wno-unused-parameter
29 |
30 | LOCAL_C_INCLUDES:= \
31 | $(TARGET_OUT_HEADERS)/gps.utils \
32 | $(TARGET_OUT_HEADERS)/libflp
33 |
34 | LOCAL_HEADER_LIBRARIES := libgps.utils_headers
35 |
36 | include $(BUILD_SHARED_LIBRARY)
37 |
38 | include $(CLEAR_VARS)
39 | LOCAL_MODULE := libloc_core_headers
40 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
41 | include $(BUILD_HEADER_LIBRARY)
42 |
--------------------------------------------------------------------------------
/overlay/packages/services/Telecomm/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 |
20 |
21 | true
22 |
23 |
24 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Settings/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
21 |
22 |
24 |
25 | - 0
26 | - -1
27 | - -1
28 |
29 |
30 |
--------------------------------------------------------------------------------
/voice_processing/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright 2013 The Android Open Source Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | ifneq ($(filter ef56 ef59 ef60 ef63 ef65, $(TARGET_DEVICE)),)
16 |
17 | LOCAL_PATH:= $(call my-dir)
18 |
19 | include $(CLEAR_VARS)
20 |
21 | LOCAL_SRC_FILES := \
22 | voice_processing_descriptors.c
23 |
24 | LOCAL_C_INCLUDES += \
25 | $(call include-path-for, audio-effects)
26 |
27 | LOCAL_MODULE := libqcomvoiceprocessingdescriptors
28 | LOCAL_MODULE_TAGS := optional
29 | LOCAL_MODULE_OWNER := qcom
30 | LOCAL_VENDOR_MODULE := true
31 | LOCAL_MODULE_RELATIVE_PATH := soundfx
32 |
33 | include $(BUILD_SHARED_LIBRARY)
34 |
35 | endif
36 |
--------------------------------------------------------------------------------
/libshims/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2017 The LineageOS Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | LOCAL_PATH := $(call my-dir)
16 |
17 | include $(CLEAR_VARS)
18 |
19 | LOCAL_SRC_FILES := atomic.cpp
20 | LOCAL_MODULE := libshim_atomic
21 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
22 | LOCAL_PROPRIETARY_MODULE := true
23 |
24 | include $(BUILD_SHARED_LIBRARY)
25 |
26 | include $(CLEAR_VARS)
27 |
28 | LOCAL_SRC_FILES := CameraParameters.cpp
29 |
30 | LOCAL_MODULE := libshim_camera_parameters
31 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
32 | LOCAL_MODULE_TAGS := optional
33 | LOCAL_PROPRIETARY_MODULE := true
34 | LOCAL_32_BIT_ONLY := true
35 |
36 | include $(BUILD_SHARED_LIBRARY)
37 |
--------------------------------------------------------------------------------
/overlay-lineage/frameworks/base/packages/SystemUI/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
22 |
23 |
24 |
25 | true
26 |
27 |
28 | true
29 |
30 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 | false
21 |
22 | 30000
23 |
24 | true
25 |
26 | 87
27 |
28 |
--------------------------------------------------------------------------------
/overlay/packages/apps/LineageParts/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
22 |
23 | - 4
24 | - 2
25 | - 8
26 | - 9
27 | - 7
28 | - 1
29 |
30 |
31 |
--------------------------------------------------------------------------------
/configs/sec_config:
--------------------------------------------------------------------------------
1 | /* IPC Security Config */
2 | /* :: */
3 | 16:4294967295:1000:3004
4 | /* Allow SS CTL service to be used by system and net_raw processes */
5 | 43:4294967295:1000:3004
6 | /* Allow RCS service to aquire net_raw permission */
7 | 18:4294967295:1001:3004
8 | /* Allow QMID service to aquire net_raw permission */
9 | 3:4294967295:1001:3004
10 | 2:4294967295:1001:3004
11 | 42:4294967295:1001:3004
12 | 18:4294967295:1001:3004
13 | 9:4294967295:1001:3004
14 | 1:4294967295:1001:3004
15 | 4:4294967295:1001:3004
16 | 2797:4294967295:1001:3004
17 | 2808:4294967295:1001:3004:1000
18 | /* DPM */
19 | 47:4294967295:1001:3004
20 | /* Allow communication to some QMI services with radio privilages */
21 | /* Format is :: */
22 | /* PBM */
23 | 12:4294967295:1001
24 | /* WMS */
25 | 5:4294967295:1001
26 | /* IMS VT */
27 | 32:4294967295:1001
28 | /* IMSP */
29 | 31:4294967295:1001
30 | /* PDC */
31 | 36:4294967295:1001
32 | /* SAR */
33 | 17:4294967295:1001
34 | /* RFRPE */
35 | 41:4294967295:1001
36 | /*UIM*/
37 | 11:4294967295:1001
38 | /*CAT*/
39 | 10:4294967295:1001
40 | /*IMSA*/
41 | 33:4294967295:1001
42 | /* Allow Data dpmd to access QMI DFS */
43 | 48:4294967295:1000:3004
44 | /* DIAG */
45 | 4097:4294967295:3009
46 |
--------------------------------------------------------------------------------
/gps/utils/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | ## Libs
6 | LOCAL_SHARED_LIBRARIES := \
7 | libutils \
8 | libcutils \
9 | liblog
10 |
11 | LOCAL_SRC_FILES += \
12 | loc_log.cpp \
13 | loc_cfg.cpp \
14 | msg_q.c \
15 | linked_list.c \
16 | loc_target.cpp \
17 | platform_lib_abstractions/elapsed_millis_since_boot.cpp \
18 | LocHeap.cpp \
19 | LocTimer.cpp \
20 | LocThread.cpp \
21 | MsgTask.cpp \
22 | loc_misc_utils.cpp
23 |
24 | # Flag -std=c++11 is not accepted by compiler when LOCAL_CLANG is set to true
25 | LOCAL_CFLAGS += \
26 | -fno-short-enums \
27 | -D_ANDROID_ \
28 | -Wno-unused-parameter
29 |
30 | ifeq ($(TARGET_BUILD_VARIANT),user)
31 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER
32 | endif
33 |
34 | LOCAL_LDFLAGS += -Wl,--export-dynamic
35 |
36 | ## Includes
37 | LOCAL_C_INCLUDES:= \
38 | $(LOCAL_PATH)/platform_lib_abstractions
39 |
40 | LOCAL_MODULE := libgps.utils
41 | LOCAL_MODULE_OWNER := qcom
42 | LOCAL_PROPRIETARY_MODULE := true
43 |
44 | LOCAL_MODULE_TAGS := optional
45 |
46 | include $(BUILD_SHARED_LIBRARY)
47 |
48 | include $(CLEAR_VARS)
49 | LOCAL_MODULE := libgps.utils_headers
50 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) $(LOCAL_PATH)/platform_lib_abstractions
51 | include $(BUILD_HEADER_LIBRARY)
52 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Snap/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
17 |
18 |
20 | 50
21 |
22 |
23 | true
24 |
25 |
26 | true
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/setup-makefiles.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (C) 2016 The LineageOS Project
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | set -e
19 |
20 | # Load extract_utils and do some sanity checks
21 | MY_DIR="${BASH_SOURCE%/*}"
22 | if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
23 |
24 | CM_ROOT="$MY_DIR"/../../..
25 |
26 | HELPER="$CM_ROOT"/vendor/lineage/build/tools/extract_utils.sh
27 | if [ ! -f "$HELPER" ]; then
28 | echo "Unable to find helper script at $HELPER"
29 | exit 1
30 | fi
31 | . "$HELPER"
32 |
33 | # Initialize the helper for common device
34 | setup_vendor "$DEVICE_COMMON" "$VENDOR" "$CM_ROOT" true
35 |
36 | # Copyright headers and common guards
37 | write_headers "ef56 ef59 ef60 ef63 ef65"
38 |
39 | write_makefiles "$MY_DIR"/proprietary-files.txt
40 |
41 | write_footers
42 |
43 | # Reinitialize the helper for device
44 | setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT"
45 |
46 | # Copyright headers and guards
47 | write_headers
48 |
49 | write_makefiles "$MY_DIR"/../$DEVICE/device-proprietary-files.txt
50 |
51 | write_footers
52 |
--------------------------------------------------------------------------------
/overlay/packages/services/Telephony/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
18 |
19 |
21 |
22 |
23 |
27 | true
28 |
29 |
--------------------------------------------------------------------------------
/lineagehw/org/lineageos/hardware/KeyDisabler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The CyanogenMod Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.lineageos.hardware;
18 |
19 | import org.lineageos.internal.util.FileUtils;
20 |
21 | /*
22 | * Disable capacitive keys
23 | *
24 | * This is intended for use on devices in which the capacitive keys
25 | * can be fully disabled for replacement with a soft navbar. You
26 | * really should not be using this on a device with mechanical or
27 | * otherwise visible-when-inactive keys
28 | */
29 |
30 | public class KeyDisabler {
31 |
32 | private static String CONTROL_PATH = "/proc/touchpanel/keypad_enable";
33 |
34 | public static boolean isSupported() {
35 | return FileUtils.isFileWritable(CONTROL_PATH);
36 | }
37 |
38 | public static boolean isActive() {
39 | return FileUtils.readOneLine(CONTROL_PATH).equals("0");
40 | }
41 |
42 | public static boolean setActive(boolean state) {
43 | return FileUtils.writeLine(CONTROL_PATH, (state ? "0" : "1"));
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc370/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra3grc.bin
25 | - XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra3grc.bin
26 | - XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra3grc.bin
27 | - SUPL_HOST=supl.google.com
28 | - SUPL_PORT=7275
29 | - SUPL_VER=0x20000
30 | - SUPL_MODE=1
31 | - SUPL_ES=0
32 | - LPP_PROFILE=2
33 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
34 | - A_GLONASS_POS_PROTOCOL_SELECT=0
35 | - GPS_LOCK=0
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc610/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra3grc.bin
25 | - XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra3grc.bin
26 | - XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra3grc.bin
27 | - SUPL_HOST=supl.google.com
28 | - SUPL_PORT=7275
29 | - SUPL_VER=0x20000
30 | - SUPL_MODE=1
31 | - SUPL_ES=0
32 | - LPP_PROFILE=2
33 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
34 | - A_GLONASS_POS_PROTOCOL_SELECT=0
35 | - GPS_LOCK=0
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc640/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra3grc.bin
25 | - XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra3grc.bin
26 | - XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra3grc.bin
27 | - SUPL_HOST=supl.google.com
28 | - SUPL_PORT=7275
29 | - SUPL_VER=0x20000
30 | - SUPL_MODE=1
31 | - SUPL_ES=0
32 | - LPP_PROFILE=2
33 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
34 | - A_GLONASS_POS_PROTOCOL_SELECT=0
35 | - GPS_LOCK=0
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc720/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra3grc.bin
25 | - XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra3grc.bin
26 | - XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra3grc.bin
27 | - SUPL_HOST=supl.google.com
28 | - SUPL_PORT=7275
29 | - SUPL_VER=0x20000
30 | - SUPL_MODE=1
31 | - SUPL_ES=0
32 | - LPP_PROFILE=2
33 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
34 | - A_GLONASS_POS_PROTOCOL_SELECT=0
35 | - GPS_LOCK=0
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/keylayout/cr-tk-300k.kl:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2016, The Sayanogen Project. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are
5 | # met:
6 | # * Redistributions of source code must retain the above copyright
7 | # notice, this list of conditions and the following disclaimer.
8 | # * Redistributions in binary form must reproduce the above
9 | # copyright notice, this list of conditions and the following
10 | # disclaimer in the documentation and/or other materials provided
11 | # with the distribution.
12 | # * Neither the name of The Linux Foundation nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 |
27 | key 139 MENU VIRTUAL
28 | key 158 BACK VIRTUAL
29 | key 102 HOME
30 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc220/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra3grc.bin
25 | - XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra3grc.bin
26 | - XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra3grc.bin
27 | - SUPL_HOST=supl.telusmobility.com
28 | - SUPL_PORT=7275
29 | - SUPL_VER=0x20000
30 | - SUPL_MODE=1
31 | - SUPL_ES=0
32 | - LPP_PROFILE=3
33 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
34 | - A_GLONASS_POS_PROTOCOL_SELECT=0
35 | - GPS_LOCK=0
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values-mcc302-mnc221/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 |
23 |
24 | - XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra3grc.bin
25 | - XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra3grc.bin
26 | - XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra3grc.bin
27 | - SUPL_HOST=supl.telusmobility.com
28 | - SUPL_PORT=7275
29 | - SUPL_VER=0x20000
30 | - SUPL_MODE=1
31 | - SUPL_ES=0
32 | - LPP_PROFILE=3
33 | - USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
34 | - A_GLONASS_POS_PROTOCOL_SELECT=0
35 | - GPS_LOCK=0
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/keylayout/gpio-keys.kl:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2012, The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are
5 | # met:
6 | # * Redistributions of source code must retain the above copyright
7 | # notice, this list of conditions and the following disclaimer.
8 | # * Redistributions in binary form must reproduce the above
9 | # copyright notice, this list of conditions and the following
10 | # disclaimer in the documentation and/or other materials provided
11 | # with the distribution.
12 | # * Neither the name of The Linux Foundation nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
28 | key 115 VOLUME_UP
29 | key 114 VOLUME_DOWN
30 | key 102 HOME
31 | key 528 FOCUS
32 | key 766 CAMERA
33 | key 28 ENTER
34 | key 251 HOME
35 |
36 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc_eng_log.cpp:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #define LOG_NDDEBUG 0
31 | #define LOG_TAG "LocSvc_eng"
32 |
33 | #include "loc_log.h"
34 | #include "loc_eng_log.h"
35 |
36 |
--------------------------------------------------------------------------------
/extract-files.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (C) 2016 The LineageOS Project
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | set -e
19 |
20 | # Load extractutils and do some sanity checks
21 | MY_DIR="${BASH_SOURCE%/*}"
22 | if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
23 |
24 | CM_ROOT="$MY_DIR"/../../..
25 |
26 | HELPER="$CM_ROOT"/vendor/lineage/build/tools/extract_utils.sh
27 | if [ ! -f "$HELPER" ]; then
28 | echo "Unable to find helper script at $HELPER"
29 | exit 1
30 | fi
31 | . "$HELPER"
32 |
33 | if [ $# -eq 0 ]; then
34 | SRC=adb
35 | else
36 | if [ $# -eq 1 ]; then
37 | SRC=$1
38 | else
39 | echo "$0: bad number of arguments"
40 | echo ""
41 | echo "usage: $0 [PATH_TO_EXPANDED_ROM]"
42 | echo ""
43 | echo "If PATH_TO_EXPANDED_ROM is not specified, blobs will be extracted from"
44 | echo "the device using adb pull."
45 | exit 1
46 | fi
47 | fi
48 |
49 | # Initialize the helper for common device
50 | setup_vendor "$DEVICE_COMMON" "$VENDOR" "$CM_ROOT" true
51 |
52 | extract "$MY_DIR"/proprietary-files.txt "$SRC"
53 |
54 | # Reinitialize the helper for device
55 | setup_vendor "$DEVICE" "$VENDOR" "$CM_ROOT"
56 |
57 | extract "$MY_DIR"/../$DEVICE/device-proprietary-files.txt "$SRC"
58 |
59 | "$MY_DIR"/setup-makefiles.sh
60 |
--------------------------------------------------------------------------------
/twrp.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2017, The LineageOS Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | RECOVERY_VARIANT := twrp
16 | TW_EXCLUDE_SUPERSU := true
17 | TW_USE_TOOLBOX := true
18 |
19 | # TWRP FSTAB
20 | PRODUCT_COPY_FILES += \
21 | device/pantech/msm8974-common/rootdir/etc/twrp.fstab:recovery/root/etc/twrp.fstab
22 |
23 | # TWRP UI
24 | DEVICE_RESOLUTION := 1080x1920
25 | TW_THEME := portrait_hdpi
26 | TW_DEFAULT_EXTERNAL_STORAGE := true
27 | BOARD_VOLD_EMMC_SHARES_DEV_MAJOR := true
28 | TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
29 | TW_INPUT_BLACKLIST := "fpc1080Mouse"
30 | BOARD_HAS_LARGE_FILESYSTEM := true
31 | TW_NO_USB_STORAGE := true
32 | TW_CRYPTO_FS_TYPE := "ext4"
33 | TARGET_RECOVERY_QCOM_RTC_FIX := true
34 | BOARD_SUPPRESS_SECURE_ERASE := true
35 | BOARD_SUPPRESS_EMMC_WIPE := true
36 | RECOVERY_SDCARD_ON_DATA := true
37 | RECOVERY_GRAPHICS_USE_LINELENGTH := true
38 | TW_EXTRA_LANGUAGES := true
39 | TW_DEFAULT_EXTERNAL_STORAGE := true
40 | TW_INCLUDE_JB_CRYPTO := true
41 | TW_INCLUDE_CRYPTO := true
42 | TW_BRIGHTNESS_PATH := "/sys/class/leds/lcd-backlight/brightness"
43 | TW_MAX_BRIGHTNESS := 255
44 | TW_DEFAULT_BRIGHTNESS := 175
45 | TARGET_USES_LOGD := true
46 | TW_SCREEN_BLANK_ON_BOOT := true
47 | TW_EXCLUDE_SUPERSU := true
48 | TW_TIME_ZONE_GUISEL := "THAIST-7;THAIDT"
49 |
50 |
51 |
--------------------------------------------------------------------------------
/gps/utils/platform_lib_abstractions/platform_lib_time.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef _PLATFORM_LIB_TIME_H_
30 | #define _PLATFORM_LIB_TIME_H_
31 |
32 | int64_t systemTime(int clock);
33 | int64_t elapsedMillisSinceBoot();
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/gps/utils/platform_lib_abstractions/platform_lib_includes.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef _PLATFORM_LIB_INCLUDES_H_
30 | #define _PLATFORM_LIB_INCLUDES_H_
31 |
32 | #include "platform_lib_time.h"
33 | #include "platform_lib_macros.h"
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/gps/etc/sap.conf:
--------------------------------------------------------------------------------
1 | ################################
2 | # Sensor Settings
3 | ################################
4 | #The following parameters are optional.
5 | #Internal defaults support MEMS sensors
6 | #native to most handset devices.
7 | #Device specific sensor characterization
8 | #for improved performance is possible as
9 | #described in SAP application notes.
10 | #GYRO_BIAS_RANDOM_WALK=
11 | #ACCEL_RANDOM_WALK_SPECTRAL_DENSITY=
12 | #ANGLE_RANDOM_WALK_SPECTRAL_DENSITY=
13 | #RATE_RANDOM_WALK_SPECTRAL_DENSITY=
14 | #VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY=
15 |
16 | # Sensor Sampling Rate Parameters for Low-Data Rate Filter (should be greater than 0)
17 | # used in loc_eng_reinit
18 | SENSOR_ACCEL_BATCHES_PER_SEC=2
19 | SENSOR_ACCEL_SAMPLES_PER_BATCH=5
20 | SENSOR_GYRO_BATCHES_PER_SEC=2
21 | SENSOR_GYRO_SAMPLES_PER_BATCH=5
22 | # Sensor Sampling Rate Parameters for High-Data Rate Filter (should be greater than 0)
23 | SENSOR_ACCEL_BATCHES_PER_SEC_HIGH=4
24 | SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH=25
25 | SENSOR_GYRO_BATCHES_PER_SEC_HIGH=4
26 | SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH=25
27 |
28 | # Sensor Control Mode (0=AUTO, 1=FORCE_ON)
29 | # used in loc_eng_reinit
30 | SENSOR_CONTROL_MODE=0
31 |
32 | # Enable or Disable Sensors for GPS use (0=Enable, 1=Disable)
33 | # used in loc_eng_reinit
34 | SENSOR_USAGE=1
35 |
36 | # Choose GSIFF sensor provider (1=Snapdragon Sensors Core, 2=Android NDK)
37 | SENSOR_PROVIDER=1
38 |
39 | # Bit mask used to define which sensor algorithms are used.
40 | # Setting each bit has the following definition:
41 | # 0x1 - DISABLE_INS_POSITIONING_FILTER
42 | # 0x0 - ENABLE_INS_POSITIONING_FILTER
43 | SENSOR_ALGORITHM_CONFIG_MASK=0x1
44 |
45 | # Time source used by Sensor HAL
46 | # Setting this value controls accuracy of location sensor services.
47 | # 0 - Unknown
48 | # 1 - CLOCK_BOOTTIME
49 | # 2 - CLOCK_MONOTONIC
50 | # 3 - CLOCK_REALTIME
51 | # 4 - CLOCK_BOOTTIME using Alarm timer interface
52 | NDK_PROVIDER_TIME_SOURCE=1
53 |
54 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc_eng_log.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef LOC_ENG_LOG_H
31 | #define LOC_ENG_LOG_H
32 |
33 | #ifdef __cplusplus
34 | extern "C"
35 | {
36 | #endif
37 |
38 | #include
39 |
40 | #ifdef __cplusplus
41 | }
42 | #endif
43 |
44 | #endif /* LOC_ENG_LOG_H */
45 |
--------------------------------------------------------------------------------
/overlay-lineage/frameworks/base/core/res/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
22 | true
23 |
24 |
26 | com.android.systemui/com.android.systemui.doze.DozeService
27 |
28 |
30 | true
31 |
32 |
33 | true
34 |
35 |
38 | 17
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/gps/etc/flp.conf:
--------------------------------------------------------------------------------
1 | ###################################
2 | ##### FLP settings #####
3 | ###################################
4 |
5 | ###################################
6 | # FLP BATCHING SIZE
7 | ###################################
8 | # The number of batched locations
9 | # requested to modem. The desired number
10 | # defined below may not be satisfied, as
11 | # the modem can only return the number
12 | # of batched locations that can be allocated,
13 | # which is limited by memory. The default
14 | # batch size defined as 20 as below.
15 | BATCH_SIZE=20
16 |
17 | ###################################
18 | # FLP BATCHING SESSION TIMEOUT
19 | ###################################
20 | # Duration with which batch session timeout
21 | # happens in milliseconds. If not specified
22 | # or set to zero, batching session timeout
23 | # defaults to 20 seconds by the modem.
24 | # BATCH_SESSION_TIMEOUT=20000
25 |
26 | ###################################
27 | # FLP CAPABILITIES BIT MASK
28 | ###################################
29 | # GEOFENCE = 0x01
30 | # BATCHING = 0x02
31 | # default = GEOFENCE | BATCHING
32 | CAPABILITIES=0x00
33 |
34 | ###################################
35 | # FLP BATCHING ACCURACY
36 | ###################################
37 | # Set to one of the defined values below
38 | # to define the accuracy of batching.
39 | # If not specified, accuracy defaults
40 | # to LOW.
41 | # FLP BATCHING ACCURACY values:
42 | # Low accuracy = 0
43 | # Medium accuracy = 1
44 | # High accuracy = 2
45 | ACCURACY=0
46 |
47 | ###################################
48 | # FLP GEOFENCE RESPONSIVENESS
49 | ###################################
50 | # If set to one of the defined values below,
51 | # it will override the responsiveness for
52 | # FLP geofence, which implements the fused
53 | # location API. If not set to a value defined
54 | # below, which is default, it will not
55 | # override the responsivness.
56 | # FLP_GEOFENCE_RESPONSIVENESS_OVERRIDE Values:
57 | # 1: LOW responsiveness
58 | # 2: MEDIUM responsiveness
59 | # 3: HIGH responsiveness
60 | FLP_GEOFENCE_RESPONSIVENESS_OVERRIDE = 0
61 |
--------------------------------------------------------------------------------
/gps/utils/platform_lib_abstractions/elapsed_millis_since_boot.cpp:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #include
30 | #include
31 | #include "platform_lib_time.h"
32 |
33 | int64_t systemTime(int clock)
34 | {
35 | struct timeval t;
36 | t.tv_sec = t.tv_usec = 0;
37 | gettimeofday(&t, NULL);
38 | return t.tv_sec*1000000LL + t.tv_usec;
39 | }
40 |
41 |
42 | int64_t elapsedMillisSinceBoot()
43 | {
44 | int64_t t_us = systemTime(0);
45 | return (int64_t) t_us / 1000LL;
46 | }
47 |
--------------------------------------------------------------------------------
/rootdir/etc/fstab.qcom:
--------------------------------------------------------------------------------
1 | # Android fstab file.
2 | # The filesystem that contains the filesystem e2fsck binary (typically /system) cannot
3 | # specify 'check', and must come before any filesystems that do specify 'check'
4 |
5 | # NOTE: /system partition is now early-mounted and the fstab entry is specified in device tree (duplicated below for recovery image purposes only):
6 | # /proc/device-tree/firmware/android/fstab/system
7 |
8 | #
9 | /dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
10 | /dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
11 | /dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait,recoveryonly
12 | /dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs noatime,nosuid,nodev,inline_xattr latemount,wait,check,formattable,encryptable=/persist/metadata
13 | /dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc latemount,wait,check,formattable,encryptable=/persist/metadata
14 | /dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs noatime,nosuid,nodev,inline_xattr wait,check,formattable
15 | /dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1 wait,check,formattable
16 | /dev/block/platform/msm_sdcc.1/by-name/emmclog /misc emmc defaults defaults
17 | /dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 noatime,nosuid,nodev,barrier=1 wait,check
18 | /dev/block/platform/msm_sdcc.1/by-name/modem /firmware sdfat shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 wait
19 |
20 | /devices/msm_sdcc.2/mmc_host/mmc1* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
21 | /devices/platform/xhci-hcd* auto auto defaults voldmanaged=usb:auto
22 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := libloc_eng
6 | LOCAL_MODULE_OWNER := qcom
7 | LOCAL_PROPRIETARY_MODULE := true
8 |
9 | LOCAL_MODULE_TAGS := optional
10 |
11 | LOCAL_SHARED_LIBRARIES := \
12 | libutils \
13 | libcutils \
14 | libdl \
15 | liblog \
16 | libloc_core \
17 | libgps.utils
18 |
19 | LOCAL_SRC_FILES += \
20 | loc_eng.cpp \
21 | loc_eng_agps.cpp \
22 | loc_eng_xtra.cpp \
23 | loc_eng_ni.cpp \
24 | loc_eng_log.cpp \
25 | loc_eng_nmea.cpp \
26 | LocEngAdapter.cpp
27 |
28 | LOCAL_SRC_FILES += \
29 | loc_eng_dmn_conn.cpp \
30 | loc_eng_dmn_conn_handler.cpp \
31 | loc_eng_dmn_conn_thread_helper.c \
32 | loc_eng_dmn_conn_glue_msg.c \
33 | loc_eng_dmn_conn_glue_pipe.c
34 |
35 | LOCAL_CFLAGS += \
36 | -fno-short-enums \
37 | -D_ANDROID_ \
38 | -Wno-unused-parameter
39 |
40 | LOCAL_C_INCLUDES:= \
41 | $(TARGET_OUT_HEADERS)/gps.utils \
42 | $(TARGET_OUT_HEADERS)/libloc_core \
43 | $(LOCAL_PATH) \
44 | $(TARGET_OUT_HEADERS)/libflp
45 |
46 | LOCAL_HEADER_LIBRARIES := libgps.utils_headers libloc_core_headers
47 |
48 | include $(BUILD_SHARED_LIBRARY)
49 |
50 | include $(CLEAR_VARS)
51 | LOCAL_MODULE := libloc_eng_headers
52 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
53 | include $(BUILD_HEADER_LIBRARY)
54 |
55 | include $(CLEAR_VARS)
56 |
57 | LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM)
58 | LOCAL_MODULE_OWNER := qcom
59 | LOCAL_PROPRIETARY_MODULE := true
60 |
61 | LOCAL_MODULE_TAGS := optional
62 |
63 | ## Libs
64 | LOCAL_SHARED_LIBRARIES := \
65 | libutils \
66 | libcutils \
67 | liblog \
68 | libloc_eng \
69 | libloc_core \
70 | libgps.utils \
71 | libdl
72 |
73 | LOCAL_SRC_FILES += \
74 | loc.cpp \
75 | gps.c
76 |
77 | LOCAL_CFLAGS += \
78 | -fno-short-enums \
79 | -D_ANDROID_ \
80 | -Wno-unused-parameter
81 |
82 | ## Includes
83 | LOCAL_C_INCLUDES:= \
84 | $(TARGET_OUT_HEADERS)/gps.utils \
85 | $(TARGET_OUT_HEADERS)/libloc_core \
86 | $(TARGET_OUT_HEADERS)/libflp
87 |
88 | LOCAL_MODULE_RELATIVE_PATH := hw
89 |
90 | LOCAL_HEADER_LIBRARIES := libgps.utils_headers libloc_core_headers
91 |
92 | include $(BUILD_SHARED_LIBRARY)
93 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc_eng_xtra.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2009,2011 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef LOC_ENG_XTRA_H
31 | #define LOC_ENG_XTRA_H
32 |
33 | #include
34 |
35 | // Module data
36 | typedef struct
37 | {
38 | // loc_eng_ioctl_cb_data_s_type ioctl_cb_data;
39 | gps_xtra_download_request download_request_cb;
40 | report_xtra_server report_xtra_server_cb;
41 |
42 | // XTRA data buffer
43 | char *xtra_data_for_injection; // NULL if no pending data
44 | int xtra_data_len;
45 | } loc_eng_xtra_data_s_type;
46 |
47 | #endif // LOC_ENG_XTRA_H
48 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc_eng_nmea.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef LOC_ENG_NMEA_H
31 | #define LOC_ENG_NMEA_H
32 |
33 | #include
34 | #include
35 |
36 | #define NMEA_SENTENCE_MAX_LENGTH 200
37 |
38 | void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p);
39 | int loc_eng_nmea_put_checksum(char *pNmea, int maxSize);
40 | void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const HaxxSvStatus &svStatus, const GpsLocationExtended &locationExtended);
41 | 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);
42 |
43 | #endif // LOC_ENG_NMEA_H
44 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_pipe.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef LOC_ENG_DMN_CONN_GLUE_PIPE_H
30 | #define LOC_ENG_DMN_CONN_GLUE_PIPE_H
31 |
32 | #ifdef __cplusplus
33 | extern "C" {
34 | #endif /* __cplusplus */
35 |
36 | #include
37 |
38 | int loc_eng_dmn_conn_glue_pipeget(const char * pipe_name, int mode);
39 | int loc_eng_dmn_conn_glue_piperemove(const char * pipe_name, int fd);
40 | int loc_eng_dmn_conn_glue_pipewrite(int fd, const void * buf, size_t sz);
41 | int loc_eng_dmn_conn_glue_piperead(int fd, void * buf, size_t sz);
42 |
43 | int loc_eng_dmn_conn_glue_pipeflush(int fd);
44 | int loc_eng_dmn_conn_glue_pipeunblock(int fd);
45 |
46 | #ifdef __cplusplus
47 | }
48 | #endif /* __cplusplus */
49 |
50 | #endif /* LOC_ENG_DMN_CONN_GLUE_PIPE_H */
51 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_glue_msg.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef LOC_ENG_DMN_CONN_GLUE_MSG_H
30 | #define LOC_ENG_DMN_CONN_GLUE_MSG_H
31 |
32 | #ifdef __cplusplus
33 | extern "C" {
34 | #endif /* __cplusplus */
35 |
36 |
37 | #include
38 | #include "loc_eng_dmn_conn_glue_pipe.h"
39 |
40 | int loc_eng_dmn_conn_glue_msgget(const char * q_path, int mode);
41 | int loc_eng_dmn_conn_glue_msgremove(const char * q_path, int msgqid);
42 | int loc_eng_dmn_conn_glue_msgsnd(int msgqid, const void * msgp, size_t msgsz);
43 | int loc_eng_dmn_conn_glue_msgrcv(int msgqid, void *msgp, size_t msgsz);
44 | int loc_eng_dmn_conn_glue_msgflush(int msgqid);
45 | int loc_eng_dmn_conn_glue_msgunblock(int msgqid);
46 |
47 | #ifdef __cplusplus
48 | }
49 | #endif /* __cplusplus */
50 |
51 | #endif /* LOC_ENG_DMN_CONN_GLUE_MSG_H */
52 |
--------------------------------------------------------------------------------
/configs/nfcee_access.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/system.prop:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # system.prop for msm8974
4 | #
5 |
6 | # RIL
7 | persist.data.netmgrd.qos.enable=true
8 | persist.data.tcpackprio.enable=true
9 | ro.data.large_tcp_window_size=true
10 | persist.radio.add_power_save=1
11 | persist.radio.apm_sim_not_pwdn=1
12 | rild.libpath=/system/vendor/lib/libril-qc-qmi-1.so
13 | ro.data.large_tcp_window_size=true
14 | ro.ril.ext.ecclist=112,911,999,110,122,119,120,000,08,118
15 | ro.telephony.call_ring.multiple=0
16 | rild.libargs=-d /dev/smd0
17 | ro.telephony.default_network=9
18 | ro.use_data_netmgrd=true
19 | telephony.lteOnGsmDevice=1
20 |
21 | # Audio
22 | mm.enable.sec.smoothstreaming=true
23 | af.fast_track_multiplier=1
24 | audio_hal.period_size=192
25 | audio.offload.buffer.size.kb=32
26 | audio.offload.video=true
27 | audio.offload.multiple.enabled=false
28 | audio.offload.gapless.enabled=true
29 | media.aac_51_output_enabled=true
30 | audio.offload.pcm.16bit.enable=true
31 | audio.offload.pcm.24bit.enable=true
32 | audio.deep_buffer.media=true
33 | ro.config.media_vol_steps=25
34 | ro.config.vc_call_vol_steps=7
35 | ro.qc.sdk.audio.fluencetype=fluence
36 | persist.audio.fluence.speaker=true
37 | persist.audio.fluence.voicecall=true
38 |
39 | # Bluetooth
40 | vendor.qcom.bluetooth.soc=pronto
41 | ro.bluetooth.hfp.ver=1.7
42 | ro.qualcomm.bt.hci_transport=smd
43 |
44 | ro.bluetooth.dun=false
45 | ro.bluetooth.sap=false
46 |
47 | # Camera
48 | camera2.portability.force_api=1
49 |
50 | # Perf
51 | ro.qualcomm.perf.cores_online=2
52 | ro.vendor.extension_library=libqti-perfd-client.so
53 | drm.service.enabled=true
54 |
55 | # Memory optimizations
56 | ro.vendor.qti.sys.fw.bservice_enable=true
57 |
58 | # Graphics
59 | ro.sf.lcd_density=480
60 | ro.opengles.version=196608
61 | ro.hdcp2.rx=tz
62 | ro.qualcomm.cabl=0
63 | ro.secwvk=144
64 | debug.sf.hw=1
65 | debug.mdpcomp.logs=0
66 | persist.hwc.mdpcomp.enable=true
67 | persist.debug.wfd.enable=1
68 | debug.hwui.use_buffer_age=false
69 |
70 | # QMI
71 | persist.data.qmi.adb_logmask=0
72 |
73 | # Sensors
74 | ro.qc.sdk.camera.facialproc=true
75 | ro.qc.sdk.gestures.camera=false
76 |
77 | # Time services
78 | persist.timed.enable=true
79 |
80 | # Wifi
81 | wifi.interface=wlan0
82 | wifi.supplicant_scan_interval=15
83 |
84 | # SDcardfs
85 | # ro.sys.sdcardfs=true
86 |
87 | # OTG
88 | persist.sys.usb.control=disable
89 | persist.sys.isUsbOtgEnabled=true
90 | persist.pantech.usb.version=0
91 |
92 | # Dalvik heap
93 | dalvik.vm.heapstartsize=16m
94 | dalvik.vm.heapgrowthlimit=192m
95 | dalvik.vm.heapsize=512m
96 | dalvik.vm.heaptargetutilization=0.75
97 | dalvik.vm.heapminfree=2m
98 | dalvik.vm.heapmaxfree=8m
99 |
100 |
--------------------------------------------------------------------------------
/configs/thermal-engine-8974.conf:
--------------------------------------------------------------------------------
1 | sampling 5000
2 |
3 | [CPU0_MONITOR]
4 | algo_type monitor
5 | sensor cpu0
6 | sampling 5000
7 | thresholds 120000
8 | thresholds_clr 115000
9 | actions shutdown
10 | action_info 0
11 |
12 | [CPU1_MONITOR]
13 | algo_type monitor
14 | sensor cpu1
15 | sampling 5000
16 | thresholds 120000
17 | thresholds_clr 115000
18 | actions shutdown
19 | action_info 0
20 |
21 | [CPU2_MONITOR]
22 | algo_type monitor
23 | sensor cpu2
24 | sampling 5000
25 | thresholds 120000
26 | thresholds_clr 115000
27 | actions shutdown
28 | action_info 0
29 |
30 | [CPU3_MONITOR]
31 | algo_type monitor
32 | sensor cpu3
33 | sampling 5000
34 | thresholds 120000
35 | thresholds_clr 115000
36 | actions shutdown
37 | action_info 0
38 |
39 | [HOTPLUG-CPU1]
40 | algo_type monitor
41 | sensor cpu1
42 | sampling 500
43 | thresholds 110000
44 | thresholds_clr 95000
45 | actions hotplug_1
46 |
47 | [HOTPLUG-CPU2]
48 | algo_type monitor
49 | sensor cpu2
50 | sampling 500
51 | thresholds 110000
52 | thresholds_clr 95000
53 | actions hotplug_2
54 |
55 | [HOTPLUG-CPU3]
56 | algo_type monitor
57 | sensor cpu3
58 | sampling 500
59 | thresholds 110000
60 | thresholds_clr 95000
61 | actions hotplug_3
62 |
63 | [PID-CPU0]
64 | disable 1
65 |
66 | [PID-CPU1]
67 | disable 1
68 |
69 | [PID-CPU2]
70 | disable 1
71 |
72 | [PID-CPU3]
73 | disable 1
74 |
75 | [PID-POPMEM]
76 | disable 1
77 |
78 | [SS-CPU0]
79 | algo_type ss
80 | sensor cpu0
81 | sampling 65
82 | device cpu
83 | set_point 65000
84 | set_point_clr 55000
85 |
86 | [SS-CPU1]
87 | algo_type ss
88 | sensor cpu1
89 | sampling 65
90 | device cpu
91 | set_point 65000
92 | set_point_clr 55000
93 |
94 | [SS-CPU2]
95 | algo_type ss
96 | sensor cpu2
97 | sampling 65
98 | device cpu
99 | set_point 65000
100 | set_point_clr 55000
101 |
102 | [SS-CPU3]
103 | algo_type ss
104 | sensor cpu3
105 | sampling 65
106 | device cpu
107 | set_point 65000
108 | set_point_clr 55000
109 |
110 | [SS-POPMEM]
111 | algo_type ss
112 | sensor pop_mem
113 | sampling 65
114 | device cpu
115 | set_point 65000
116 | set_point_clr 55000
117 |
118 |
119 |
--------------------------------------------------------------------------------
/gps/core/loc_core_log.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef LOC_CORE_LOG_H
31 | #define LOC_CORE_LOG_H
32 |
33 | #ifdef __cplusplus
34 | extern "C"
35 | {
36 | #endif
37 |
38 | #include
39 | #include
40 |
41 | const char* loc_get_gps_status_name(GpsStatusValue gps_status);
42 | const char* loc_get_position_mode_name(GpsPositionMode mode);
43 | const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur);
44 | const char* loc_get_aiding_data_mask_names(GpsAidingData data);
45 | const char* loc_get_agps_type_name(AGpsType type);
46 | const char* loc_get_ni_type_name(GpsNiType type);
47 | const char* loc_get_ni_response_name(GpsUserResponseType response);
48 | const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding);
49 | const char* loc_get_agps_bear_name(AGpsBearerType bear);
50 | const char* loc_get_server_type_name(LocServerType type);
51 | const char* loc_get_position_sess_status_name(enum loc_sess_status status);
52 | const char* loc_get_agps_status_name(AGpsStatusValue status);
53 |
54 | #ifdef __cplusplus
55 | }
56 | #endif
57 |
58 | #endif /* LOC_CORE_LOG_H */
59 |
--------------------------------------------------------------------------------
/voice_processing/voice_processing_descriptors.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | //------------------------------------------------------------------------------
19 | // Effect descriptors
20 | //------------------------------------------------------------------------------
21 |
22 | // UUIDs for effect types have been generated from http://www.itu.int/ITU-T/asn1/uuid.html
23 | // as the pre processing effects are not defined by OpenSL ES
24 |
25 | // Acoustic Echo Cancellation 29dfd020-e88b-11e5-b505-0002a5d5c51b
26 | const effect_descriptor_t qcom_product_aec_descriptor = {
27 | { 0x7b491460, 0x8d4d, 0x11e0, 0xbd61, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // type
28 | { 0x29dfd020, 0xe88b, 0x11e5, 0xb505, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // uuid
29 | EFFECT_CONTROL_API_VERSION,
30 | (EFFECT_FLAG_TYPE_PRE_PROC|EFFECT_FLAG_DEVICE_IND),
31 | 0,
32 | 0,
33 | "Acoustic Echo Canceler",
34 | "Qualcomm Fluence for OPPO msm8974"
35 | };
36 |
37 | // Noise suppression e4eb6b40-e88b-11e5-b6ad-0002a5d5c51b
38 | const effect_descriptor_t qcom_product_ns_descriptor = {
39 | { 0x58b4b260, 0x8e06, 0x11e0, 0xaa8e, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // type
40 | { 0xe4eb6b40, 0xe88b, 0x11e5, 0xb6ad, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // uuid
41 | EFFECT_CONTROL_API_VERSION,
42 | (EFFECT_FLAG_TYPE_PRE_PROC|EFFECT_FLAG_DEVICE_IND),
43 | 0,
44 | 0,
45 | "Noise Suppression",
46 | "Qualcomm Fluence for OPPO msm8974"
47 | };
48 |
49 | //ENABLE_AGC
50 | // Automatic Gain Control e6cdbac0-4a7c-11e4-a018-0002a5d5c51b
51 | //const effect_descriptor_t qcom_product_agc_descriptor = {
52 | // { 0x0a8abfe0, 0x654c, 0x11e0, 0xba26, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // type
53 | // { 0xe6cdbac0, 0x4a7c, 0x11e4, 0xa018, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b } }, // uuid
54 | // EFFECT_CONTROL_API_VERSION,
55 | // (EFFECT_FLAG_TYPE_PRE_PROC|EFFECT_FLAG_DEVICE_IND),
56 | // 0,
57 | // 0,
58 | // "Automatic Gain Control",
59 | // "Qualcomm Fluence for OPPO msm8974"
60 | //};
61 |
62 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011,2014 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef __LOC_H__
31 | #define __LOC_H__
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif /* __cplusplus */
36 |
37 | #include
38 | #include
39 | #include
40 | #include
41 |
42 | #define XTRA_DATA_MAX_SIZE 100000 /*bytes*/
43 |
44 | typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt);
45 | typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt);
46 | typedef void* (*loc_ext_parser)(void* data);
47 |
48 | typedef struct {
49 | loc_location_cb_ext location_cb;
50 | gps_status_callback status_cb;
51 | loc_sv_status_cb_ext sv_status_cb;
52 | gps_nmea_callback nmea_cb;
53 | gps_set_capabilities set_capabilities_cb;
54 | gps_acquire_wakelock acquire_wakelock_cb;
55 | gps_release_wakelock release_wakelock_cb;
56 | gps_create_thread create_thread_cb;
57 | loc_ext_parser location_ext_parser;
58 | loc_ext_parser sv_ext_parser;
59 | gps_request_utc_time request_utc_time_cb;
60 | } LocCallbacks;
61 |
62 | #ifdef __cplusplus
63 | }
64 | #endif /* __cplusplus */
65 |
66 | #endif //__LOC_H__
67 |
--------------------------------------------------------------------------------
/gps/utils/loc_log.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2012, 2015 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef LOC_LOG_H
31 | #define LOC_LOG_H
32 |
33 | #ifdef __cplusplus
34 | extern "C"
35 | {
36 | #endif
37 |
38 | #include
39 | #include
40 | #include "loc_target.h"
41 |
42 | typedef struct
43 | {
44 | const char *name;
45 | long val;
46 | } loc_name_val_s_type;
47 |
48 | #define NAME_VAL(x) {"" #x "", x }
49 |
50 | #define UNKNOWN_STR "UNKNOWN"
51 |
52 | #define CHECK_MASK(type, value, mask_var, mask) \
53 | (((mask_var) & (mask)) ? (type) (value) : (type) (-1))
54 |
55 | #define LOC_TABLE_SIZE(table) (sizeof(table)/sizeof((table)[0]))
56 |
57 | /* Get names from value */
58 | const char* loc_get_name_from_mask(const loc_name_val_s_type table[], size_t table_size, long mask);
59 | const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t table_size, long value);
60 | const char* loc_get_msg_q_status(int status);
61 | const char* loc_get_target_name(unsigned int target);
62 |
63 | extern const char* log_succ_fail_string(int is_succ);
64 |
65 | extern char *loc_get_time(char *time_string, size_t buf_size);
66 |
67 | #ifdef __cplusplus
68 | }
69 | #endif
70 |
71 | #endif /* LOC_LOG_H */
72 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc_eng_ni.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2009,2011,2014 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef LOC_ENG_NI_H
31 | #define LOC_ENG_NI_H
32 |
33 | #include
34 | #include
35 |
36 | #define LOC_NI_NO_RESPONSE_TIME 20 /* secs */
37 | #define LOC_NI_NOTIF_KEY_ADDRESS "Address"
38 | #define GPS_NI_RESPONSE_IGNORE 4
39 |
40 | typedef struct {
41 | pthread_t thread; /* NI thread */
42 | int respTimeLeft; /* examine time for NI response */
43 | bool respRecvd; /* NI User reponse received or not from Java layer*/
44 | void* rawRequest;
45 | int reqID; /* ID to check against response */
46 | GpsUserResponseType resp;
47 | pthread_cond_t tCond;
48 | pthread_mutex_t tLock;
49 | LocEngAdapter* adapter;
50 | } loc_eng_ni_session_s_type;
51 |
52 | typedef struct {
53 | loc_eng_ni_session_s_type session; /* SUPL NI Session */
54 | loc_eng_ni_session_s_type sessionEs; /* Emergency SUPL NI Session */
55 | int reqIDCounter;
56 | } loc_eng_ni_data_s_type;
57 |
58 |
59 | #endif /* LOC_ENG_NI_H */
60 |
--------------------------------------------------------------------------------
/gps/utils/MsgTask.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2013,2015 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef __MSG_TASK__
30 | #define __MSG_TASK__
31 |
32 | #include
33 |
34 | struct LocMsg {
35 | inline LocMsg() {}
36 | inline virtual ~LocMsg() {}
37 | virtual void proc() const = 0;
38 | inline virtual void log() const {}
39 | };
40 |
41 | class MsgTask : public LocRunnable {
42 | const void* mQ;
43 | LocThread* mThread;
44 | friend class LocThreadDelegate;
45 | protected:
46 | virtual ~MsgTask();
47 | public:
48 | MsgTask(LocThread::tCreate tCreator, const char* threadName = NULL, bool joinable = true);
49 | MsgTask(const char* threadName = NULL, bool joinable = true);
50 | // this obj will be deleted once thread is deleted
51 | void destroy();
52 | void sendMsg(const LocMsg* msg) const;
53 | // Overrides of LocRunnable methods
54 | // This method will be repeated called until it returns false; or
55 | // until thread is stopped.
56 | virtual bool run();
57 |
58 | // The method to be run before thread loop (conditionally repeatedly)
59 | // calls run()
60 | virtual void prerun();
61 |
62 | // The method to be run after thread loop (conditionally repeatedly)
63 | // calls run()
64 | inline virtual void postrun() {}
65 | };
66 |
67 | #endif //__MSG_TASK__
68 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2012,2014 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef LOC_ENG_DATA_SERVER_H
30 | #define LOC_ENG_DATA_SERVER_H
31 |
32 | #include "loc_eng_dmn_conn_thread_helper.h"
33 |
34 | #ifdef _ANDROID_
35 |
36 | #define GPSONE_LOC_API_Q_PATH "/data/misc/location/gpsone_d/gpsone_loc_api_q"
37 | #define GPSONE_LOC_API_RESP_Q_PATH "/data/misc/location/gpsone_d/gpsone_loc_api_resp_q"
38 | #define QUIPC_CTRL_Q_PATH "/data/misc/location/gpsone_d/quipc_ctrl_q"
39 | #define MSAPM_CTRL_Q_PATH "/data/misc/location/gpsone_d/msapm_ctrl_q"
40 | #define MSAPU_CTRL_Q_PATH "/data/misc/location/gpsone_d/msapu_ctrl_q"
41 |
42 | #else
43 |
44 | #define GPSONE_LOC_API_Q_PATH "/tmp/gpsone_loc_api_q"
45 | #define GPSONE_LOC_API_RESP_Q_PATH "/tmp/gpsone_loc_api_resp_q"
46 | #define QUIPC_CTRL_Q_PATH "/tmp/quipc_ctrl_q"
47 | #define MSAPM_CTRL_Q_PATH "/tmp/msapm_ctrl_q"
48 | #define MSAPU_CTRL_Q_PATH "/tmp/msapu_ctrl_q"
49 |
50 | #endif
51 |
52 | int loc_eng_dmn_conn_loc_api_server_launch(thelper_create_thread create_thread_cb,
53 | const char * loc_api_q_path, const char * ctrl_q_path, void *agps_handle);
54 | int loc_eng_dmn_conn_loc_api_server_unblock(void);
55 | int loc_eng_dmn_conn_loc_api_server_join(void);
56 | int loc_eng_dmn_conn_loc_api_server_data_conn(int, int);
57 |
58 | #endif /* LOC_ENG_DATA_SERVER_H */
59 |
60 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/gps.c:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011,2015 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #include
31 |
32 | #include
33 | #include
34 |
35 | extern const GpsInterface* get_gps_interface();
36 |
37 | const GpsInterface* gps__get_gps_interface(struct gps_device_t* dev)
38 | {
39 | return get_gps_interface();
40 | }
41 |
42 | static int open_gps(const struct hw_module_t* module, char const* name,
43 | struct hw_device_t** device)
44 | {
45 | struct gps_device_t *dev = (struct gps_device_t *) malloc(sizeof(struct gps_device_t));
46 |
47 | if(dev == NULL)
48 | return -1;
49 |
50 | memset(dev, 0, sizeof(*dev));
51 |
52 | dev->common.tag = HARDWARE_DEVICE_TAG;
53 | dev->common.version = 0;
54 | dev->common.module = (struct hw_module_t*)module;
55 | dev->get_gps_interface = gps__get_gps_interface;
56 |
57 | *device = (struct hw_device_t*)dev;
58 | return 0;
59 | }
60 |
61 | static struct hw_module_methods_t gps_module_methods = {
62 | .open = open_gps
63 | };
64 |
65 | struct hw_module_t HAL_MODULE_INFO_SYM = {
66 | .tag = HARDWARE_MODULE_TAG,
67 | .module_api_version = 1,
68 | .hal_api_version = 0,
69 | .id = GPS_HARDWARE_MODULE_ID,
70 | .name = "loc_api GPS Module",
71 | .author = "Qualcomm USA, Inc.",
72 | .methods = &gps_module_methods,
73 | };
74 |
--------------------------------------------------------------------------------
/rootdir/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2016 The CyanogenMod Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | LOCAL_PATH:= $(call my-dir)
18 | include $(CLEAR_VARS)
19 |
20 | # QCOM config scripts
21 |
22 | include $(CLEAR_VARS)
23 | LOCAL_MODULE := init.qcom.bt.sh
24 | LOCAL_MODULE_TAGS := optional
25 | LOCAL_MODULE_CLASS := ETC
26 | LOCAL_SRC_FILES := etc/init.qcom.bt.sh
27 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
28 | include $(BUILD_PREBUILT)
29 |
30 | # Device init files
31 |
32 | include $(CLEAR_VARS)
33 | LOCAL_MODULE := fstab.qcom
34 | LOCAL_MODULE_TAGS := optional eng
35 | LOCAL_MODULE_CLASS := ETC
36 | LOCAL_SRC_FILES := etc/fstab.qcom
37 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)
38 | include $(BUILD_PREBUILT)
39 |
40 | include $(CLEAR_VARS)
41 | LOCAL_MODULE := init.target.rc
42 | LOCAL_MODULE_TAGS := optional eng
43 | LOCAL_MODULE_CLASS := ETC
44 | LOCAL_SRC_FILES := etc/init.target.rc
45 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
46 | include $(BUILD_PREBUILT)
47 |
48 | include $(CLEAR_VARS)
49 | LOCAL_MODULE := init.qcom.rc
50 | LOCAL_MODULE_TAGS := optional eng
51 | LOCAL_MODULE_CLASS := ETC
52 | LOCAL_SRC_FILES := etc/init.qcom.rc
53 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
54 | include $(BUILD_PREBUILT)
55 |
56 | include $(CLEAR_VARS)
57 | LOCAL_MODULE := init.pantech.usb.rc
58 | LOCAL_MODULE_TAGS := optional eng
59 | LOCAL_MODULE_CLASS := ETC
60 | LOCAL_SRC_FILES := etc/init.pantech.usb.rc
61 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
62 |
63 | include $(BUILD_PREBUILT)
64 |
65 | include $(CLEAR_VARS)
66 | LOCAL_MODULE := init.pantech.usb.sh
67 | LOCAL_MODULE_TAGS := optional eng
68 | LOCAL_MODULE_CLASS := ETC
69 | LOCAL_SRC_FILES := etc/init.pantech.usb.sh
70 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
71 | include $(BUILD_PREBUILT)
72 |
73 | include $(CLEAR_VARS)
74 | LOCAL_MODULE := init.qcom.power.rc
75 | LOCAL_MODULE_TAGS := optional eng
76 | LOCAL_MODULE_CLASS := ETC
77 | LOCAL_SRC_FILES := etc/init.qcom.power.rc
78 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
79 | include $(BUILD_PREBUILT)
80 |
81 | include $(CLEAR_VARS)
82 | LOCAL_MODULE := ueventd.qcom.rc
83 | LOCAL_MODULE_STEM := ueventd.rc
84 | LOCAL_MODULE_TAGS := optional
85 | LOCAL_MODULE_CLASS := ETC
86 | LOCAL_SRC_FILES := etc/ueventd.qcom.rc
87 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)
88 | include $(BUILD_PREBUILT)
89 |
90 |
--------------------------------------------------------------------------------
/gps/utils/LocSharedLock.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2015, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef __LOC_SHARED_LOCK__
30 | #define __LOC_SHARED_LOCK__
31 |
32 | #include
33 | #include
34 | #include
35 |
36 | // This is a utility created for use cases such that there are more than
37 | // one client who need to share the same lock, but it is not predictable
38 | // which of these clients is to last to go away. This shared lock deletes
39 | // itself when the last client calls its drop() method. To add a cient,
40 | // this share lock's share() method has to be called, so that the obj
41 | // can maintain an accurate client count.
42 | class LocSharedLock {
43 | volatile int32_t mRef;
44 | pthread_mutex_t mMutex;
45 | inline ~LocSharedLock() { pthread_mutex_destroy(&mMutex); }
46 | public:
47 | // first client to create this LockSharedLock
48 | inline LocSharedLock() : mRef(1) { pthread_mutex_init(&mMutex, NULL); }
49 | // following client(s) are to *share()* this lock created by the first client
50 | inline LocSharedLock* share() { android_atomic_inc(&mRef); return this; }
51 | // whe a client no longer needs this shared lock, drop() shall be called.
52 | inline void drop() { if (1 == android_atomic_dec(&mRef)) delete this; }
53 | // locking the lock to enter critical section
54 | inline void lock() { pthread_mutex_lock(&mMutex); }
55 | // unlocking the lock to leave the critical section
56 | inline void unlock() { pthread_mutex_unlock(&mMutex); }
57 | };
58 |
59 | #endif //__LOC_SHARED_LOCK__
60 |
--------------------------------------------------------------------------------
/gps/core/LBSProxyBase.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef IZAT_PROXY_BASE_H
30 | #define IZAT_PROXY_BASE_H
31 | #include
32 | #include
33 |
34 | namespace loc_core {
35 |
36 | class LocApiBase;
37 | class LocAdapterBase;
38 | class ContextBase;
39 |
40 | class LBSProxyBase {
41 | friend class ContextBase;
42 | inline virtual LocApiBase*
43 | getLocApi(const MsgTask* msgTask,
44 | LOC_API_ADAPTER_EVENT_MASK_T exMask,
45 | ContextBase* context) const {
46 |
47 | (void)msgTask;
48 | (void)exMask;
49 | (void)context;
50 | return NULL;
51 | }
52 | protected:
53 | inline LBSProxyBase() {}
54 | public:
55 | inline virtual ~LBSProxyBase() {}
56 | inline virtual void requestUlp(LocAdapterBase* adapter,
57 | unsigned long capabilities) const {
58 |
59 | (void)adapter;
60 | (void)capabilities;
61 | }
62 | inline virtual bool hasAgpsExtendedCapabilities() const { return false; }
63 | inline virtual bool hasCPIExtendedCapabilities() const { return false; }
64 | inline virtual void modemPowerVote(bool power) const {
65 |
66 | (void)power;
67 | }
68 | virtual void injectFeatureConfig(ContextBase* context) const {
69 |
70 | (void)context;
71 | }
72 | inline virtual IzatDevId_t getIzatDevId() const { return 0; }
73 | };
74 |
75 | typedef LBSProxyBase* (getLBSProxy_t)();
76 |
77 | } // namespace loc_core
78 |
79 | #endif // IZAT_PROXY_BASE_H
80 |
--------------------------------------------------------------------------------
/audio/audio_platform_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/gps/core/LocAdapterProxyBase.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2014 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef LOC_ADAPTER_PROXY_BASE_H
31 | #define LOC_ADAPTER_PROXY_BASE_H
32 |
33 | #include
34 | #include
35 |
36 | namespace loc_core {
37 |
38 | class LocAdapterProxyBase {
39 | private:
40 | LocAdapterBase *mLocAdapterBase;
41 | protected:
42 | inline LocAdapterProxyBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
43 | ContextBase* context):
44 | mLocAdapterBase(new LocAdapterBase(mask, context, this)) {
45 | }
46 | inline virtual ~LocAdapterProxyBase() {
47 | delete mLocAdapterBase;
48 | }
49 | ContextBase* getContext() const {
50 | return mLocAdapterBase->getContext();
51 | }
52 | inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event,
53 | loc_registration_mask_status isEnabled) {
54 | mLocAdapterBase->updateEvtMask(event,isEnabled);
55 | }
56 |
57 | public:
58 | inline virtual void handleEngineUpEvent() {};
59 | inline virtual void handleEngineDownEvent() {};
60 | inline virtual bool reportPosition(UlpLocation &location,
61 | GpsLocationExtended &locationExtended,
62 | enum loc_sess_status status,
63 | LocPosTechMask loc_technology_mask) {
64 |
65 | (void)location;
66 | (void)locationExtended;
67 | (void)status;
68 | (void)loc_technology_mask;
69 | return false;
70 | }
71 | };
72 |
73 | } // namespace loc_core
74 |
75 | #endif //LOC_ADAPTER_PROXY_BASE_H
76 |
--------------------------------------------------------------------------------
/compatibility_matrix.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 | android.frameworks.displayservice
11 | 1.0
12 |
13 | IDisplayService
14 | default
15 |
16 |
17 |
18 | android.frameworks.schedulerservice
19 | 1.0
20 |
21 | ISchedulingPolicyService
22 | default
23 |
24 |
25 |
26 | android.frameworks.sensorservice
27 | 1.0
28 |
29 | ISensorManager
30 | default
31 |
32 |
33 |
34 | android.hardware.graphics.composer
35 | 2.1
36 |
37 | IComposer
38 | vr
39 |
40 |
41 |
42 | android.hidl.allocator
43 | 1.0
44 |
45 | IAllocator
46 | ashmem
47 |
48 |
49 |
50 | android.hidl.manager
51 | 1.1
52 |
53 | IServiceManager
54 | default
55 |
56 |
57 |
58 | android.hidl.memory
59 | 1.0
60 |
61 | IMapper
62 | ashmem
63 |
64 |
65 |
66 | android.hidl.token
67 | 1.0
68 |
69 | ITokenManager
70 | default
71 |
72 |
73 |
74 | android.system.net.netd
75 | 1.0
76 |
77 | INetd
78 | default
79 |
80 |
81 |
82 | android.system.wifi.keystore
83 | 1.0
84 |
85 | IKeystore
86 | default
87 |
88 |
89 |
90 | netutils-wrapper
91 | 1.0
92 |
93 |
94 |
--------------------------------------------------------------------------------
/gps/utils/loc_timer.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013,2015 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef __LOC_DELAY_H__
31 | #define __LOC_DELAY_H__
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif /* __cplusplus */
36 | #include
37 |
38 | /*
39 | user_data: client context pointer, passthrough. Originally received
40 | from calling client when loc_timer_start() is called.
41 | result: 0 if timer successfully timed out; else timer failed.
42 | */
43 | typedef void (*loc_timer_callback)(void *user_data, int32_t result);
44 |
45 |
46 | /*
47 | delay_msec: timeout value for the timer.
48 | cb_func: callback function pointer, implemented by client.
49 | Can not be NULL.
50 | user_data: client context pointer, passthrough. Will be
51 | returned when loc_timer_callback() is called.
52 | wakeOnExpire: true if to wake up CPU (if sleeping) upon timer
53 | expiration and notify the client.
54 | false if to wait until next time CPU wakes up (if
55 | sleeping) and then notify the client.
56 | Returns the handle, which can be used to stop the timer
57 | NULL, if timer start fails (e.g. if cb_func is NULL).
58 | */
59 | void* loc_timer_start(uint64_t delay_msec,
60 | loc_timer_callback cb_func,
61 | void *user_data,
62 | bool wake_on_expire=false);
63 |
64 | /*
65 | handle becomes invalid upon the return of the callback
66 | */
67 | void loc_timer_stop(void*& handle);
68 |
69 | #ifdef __cplusplus
70 | }
71 | #endif /* __cplusplus */
72 |
73 | #endif //__LOC_DELAY_H__
74 |
--------------------------------------------------------------------------------
/gps/utils/LocTimer.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2015, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef __LOC_TIMER_CPP_H__
31 | #define __LOC_TIMER_CPP_H__
32 |
33 | #include
34 | #include
35 |
36 | // opaque class to provide service implementation.
37 | class LocTimerDelegate;
38 | class LocSharedLock;
39 |
40 | // LocTimer client must extend this class and implementthe callback.
41 | // start() / stop() methods are to arm / disarm timer.
42 | class LocTimer
43 | {
44 | LocTimerDelegate* mTimer;
45 | LocSharedLock* mLock;
46 | // don't really want mLock to be manipulated by clients, yet LocTimer
47 | // has to have a reference to the lock so that the delete of LocTimer
48 | // and LocTimerDelegate can work together on their share resources.
49 | friend class LocTimerDelegate;
50 |
51 | public:
52 | LocTimer();
53 | virtual ~LocTimer();
54 |
55 | // timeOutInMs: timeout delay in ms
56 | // wakeOnExpire: true if to wake up CPU (if sleeping) upon timer
57 | // expiration and notify the client.
58 | // false if to wait until next time CPU wakes up (if
59 | // sleeping) and then notify the client.
60 | // return: true on success;
61 | // false on failure, e.g. timer is already running.
62 | bool start(uint32_t timeOutInMs, bool wakeOnExpire);
63 |
64 | // return: true on success;
65 | // false on failure, e.g. timer is not running.
66 | bool stop();
67 |
68 | // LocTimer client Should implement this method.
69 | // This method is used for timeout calling back to client. This method
70 | // should be short enough (eg: send a message to your own thread).
71 | virtual void timeOutCallback() = 0;
72 | };
73 |
74 | #endif //__LOC_DELAY_H__
75 |
--------------------------------------------------------------------------------
/gps/utils/loc_target.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef LOC_TARGET_H
30 | #define LOC_TARGET_H
31 | #define TARGET_SET(gnss,ssc) ( (gnss<<1)|ssc )
32 | #define TARGET_DEFAULT TARGET_SET(GNSS_MSM, HAS_SSC)
33 | #define TARGET_MDM TARGET_SET(GNSS_MDM, HAS_SSC)
34 | #define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC)
35 | #define TARGET_MPQ TARGET_SET(GNSS_NONE,NO_SSC)
36 | #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC)
37 | #define TARGET_QCA1530 TARGET_SET(GNSS_QCA1530, NO_SSC)
38 | #define TARGET_AUTO TARGET_SET(GNSS_AUTO, NO_SSC)
39 | #define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC)
40 | #define getTargetGnssType(target) (target>>1)
41 |
42 | #ifdef __cplusplus
43 | extern "C"
44 | {
45 | #endif
46 |
47 | unsigned int loc_get_target(void);
48 |
49 | /*The character array passed to this function should have length
50 | of atleast PROPERTY_VALUE_MAX*/
51 | void loc_get_target_baseband(char *baseband, int array_length);
52 | /*The character array passed to this function should have length
53 | of atleast PROPERTY_VALUE_MAX*/
54 | void loc_get_platform_name(char *platform_name, int array_length);
55 | /*Reads the property ro.lean to identify if this is a lean target
56 | Returns:
57 | 0 if not a lean and mean target
58 | 1 if this is a lean and mean target*/
59 | int loc_identify_lean_target();
60 |
61 | /* Please remember to update 'target_name' in loc_log.cpp,
62 | if do any changes to this enum. */
63 | typedef enum {
64 | GNSS_NONE = 0,
65 | GNSS_MSM,
66 | GNSS_GSS,
67 | GNSS_MDM,
68 | GNSS_QCA1530,
69 | GNSS_AUTO,
70 | GNSS_UNKNOWN
71 | }GNSS_TARGET;
72 |
73 | typedef enum {
74 | NO_SSC = 0,
75 | HAS_SSC
76 | }SSC_TYPE;
77 |
78 | #ifdef __cplusplus
79 | }
80 | #endif
81 |
82 | #endif /*LOC_TARGET_H*/
83 |
--------------------------------------------------------------------------------
/gps/core/ContextBase.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef __LOC_CONTEXT_BASE__
30 | #define __LOC_CONTEXT_BASE__
31 |
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 |
38 | namespace loc_core {
39 |
40 | class LocAdapterBase;
41 |
42 | class ContextBase {
43 | static LBSProxyBase* getLBSProxy(const char* libName);
44 | LocApiBase* createLocApi(LOC_API_ADAPTER_EVENT_MASK_T excludedMask);
45 | protected:
46 | const LBSProxyBase* mLBSProxy;
47 | const MsgTask* mMsgTask;
48 | LocApiBase* mLocApi;
49 | LocApiProxyBase *mLocApiProxy;
50 | public:
51 | ContextBase(const MsgTask* msgTask,
52 | LOC_API_ADAPTER_EVENT_MASK_T exMask,
53 | const char* libName);
54 | inline virtual ~ContextBase() { delete mLocApi; delete mLBSProxy; }
55 |
56 | inline const MsgTask* getMsgTask() { return mMsgTask; }
57 | inline LocApiBase* getLocApi() { return mLocApi; }
58 | inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; }
59 | inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); }
60 | inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); }
61 | inline void modemPowerVote(bool power) const { return mLBSProxy->modemPowerVote(power); }
62 | inline void requestUlp(LocAdapterBase* adapter,
63 | unsigned long capabilities) {
64 | mLBSProxy->requestUlp(adapter, capabilities);
65 | }
66 | inline IzatDevId_t getIzatDevId() const {
67 | return mLBSProxy->getIzatDevId();
68 | }
69 | inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); }
70 | };
71 |
72 | } // namespace loc_core
73 |
74 | #endif //__LOC_CONTEXT_BASE__
75 |
--------------------------------------------------------------------------------
/gps/core/LocDualContext.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef __LOC_ENG_CONTEXT__
30 | #define __LOC_ENG_CONTEXT__
31 |
32 | #include
33 | #include
34 | #include
35 | #include
36 |
37 | namespace loc_core {
38 |
39 | class LocDualContext : public ContextBase {
40 | static const MsgTask* mMsgTask;
41 | static ContextBase* mFgContext;
42 | static ContextBase* mBgContext;
43 | static ContextBase* mInjectContext;
44 | static const MsgTask* getMsgTask(LocThread::tCreate tCreator,
45 | const char* name, bool joinable = true);
46 | static const MsgTask* getMsgTask(const char* name, bool joinable = true);
47 | static pthread_mutex_t mGetLocContextMutex;
48 |
49 | protected:
50 | LocDualContext(const MsgTask* msgTask,
51 | LOC_API_ADAPTER_EVENT_MASK_T exMask);
52 | inline virtual ~LocDualContext() {}
53 |
54 | public:
55 | static const char* mLBSLibName;
56 | static const LOC_API_ADAPTER_EVENT_MASK_T mFgExclMask;
57 | static const LOC_API_ADAPTER_EVENT_MASK_T mBgExclMask;
58 | static const char* mLocationHalName;
59 |
60 | static ContextBase* getLocFgContext(LocThread::tCreate tCreator, LocMsg* firstMsg,
61 | const char* name, bool joinable = true);
62 | inline static ContextBase* getLocFgContext(const char* name, bool joinable = true) {
63 | return getLocFgContext(NULL, NULL, name, joinable);
64 | }
65 | static ContextBase* getLocBgContext(LocThread::tCreate tCreator, LocMsg* firstMsg,
66 | const char* name, bool joinable = true);
67 | inline static ContextBase* getLocBgContext(const char* name, bool joinable = true) {
68 | return getLocBgContext(NULL, NULL, name, joinable);
69 | }
70 |
71 | static void injectFeatureConfig(ContextBase *context);
72 | };
73 |
74 | }
75 |
76 | #endif //__LOC_ENG_CONTEXT__
77 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_thread_helper.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef __LOC_ENG_DMN_CONN_THREAD_HELPER_H__
30 | #define __LOC_ENG_DMN_CONN_THREAD_HELPER_H__
31 |
32 | #ifdef __cplusplus
33 | extern "C" {
34 | #endif /* __cplusplus */
35 |
36 | #include
37 |
38 | struct loc_eng_dmn_conn_thelper {
39 | unsigned char thread_exit;
40 | unsigned char thread_ready;
41 | pthread_cond_t thread_cond;
42 | pthread_mutex_t thread_mutex;
43 | pthread_t thread_id;
44 | void * thread_context;
45 | int (*thread_proc_init) (void * context);
46 | int (*thread_proc_pre) (void * context);
47 | int (*thread_proc) (void * context);
48 | int (*thread_proc_post) (void * context);
49 | };
50 |
51 | typedef pthread_t (* thelper_create_thread)(const char* name, void (*start)(void *), void* arg);
52 | int loc_eng_dmn_conn_launch_thelper(struct loc_eng_dmn_conn_thelper * thelper,
53 | int (*thread_proc_init) (void * context),
54 | int (*thread_proc_pre) (void * context),
55 | int (*thread_proc) (void * context),
56 | int (*thread_proc_post) (void * context),
57 | thelper_create_thread create_thread_cb,
58 | void * context);
59 |
60 | int loc_eng_dmn_conn_unblock_thelper(struct loc_eng_dmn_conn_thelper * thelper);
61 | int loc_eng_dmn_conn_join_thelper(struct loc_eng_dmn_conn_thelper * thelper);
62 |
63 | /* if only need to use signal */
64 | int thelper_signal_init(struct loc_eng_dmn_conn_thelper * thelper);
65 | int thelper_signal_destroy(struct loc_eng_dmn_conn_thelper * thelper);
66 | int thelper_signal_wait(struct loc_eng_dmn_conn_thelper * thelper);
67 | int thelper_signal_ready(struct loc_eng_dmn_conn_thelper * thelper);
68 | int thelper_signal_block(struct loc_eng_dmn_conn_thelper * thelper);
69 |
70 | #ifdef __cplusplus
71 | }
72 | #endif /* __cplusplus */
73 |
74 | #endif /* __LOC_ENG_DMN_CONN_THREAD_HELPER_H__ */
75 |
--------------------------------------------------------------------------------
/rootdir/etc/init.qcom.bt.sh:
--------------------------------------------------------------------------------
1 | #!/vendor/bin/sh
2 | # Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are met:
6 | # * Redistributions of source code must retain the above copyright
7 | # notice, this list of conditions and the following disclaimer.
8 | # * Redistributions in binary form must reproduce the above copyright
9 | # notice, this list of conditions and the following disclaimer in the
10 | # documentation and/or other materials provided with the distribution.
11 | # * Neither the name of The Linux Foundation nor
12 | # the names of its contributors may be used to endorse or promote
13 | # products derived from this software without specific prior written
14 | # permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | #
28 |
29 | LOG_TAG="qcom-bluetooth"
30 | LOG_NAME="${0}:"
31 |
32 | loge ()
33 | {
34 | /system/vendor/bin/log -t $LOG_TAG -p e "$LOG_NAME $@"
35 | }
36 |
37 | logi ()
38 | {
39 | /system/vendor/bin/log -t $LOG_TAG -p i "$LOG_NAME $@"
40 | }
41 |
42 | failed ()
43 | {
44 | loge "$1: exit code $2"
45 | exit $2
46 | }
47 |
48 | POWER_CLASS=`getprop qcom.bt.dev_power_class`
49 | LE_POWER_CLASS=`getprop qcom.bt.le_dev_pwr_class`
50 |
51 | setprop vendor.bluetooth.status off
52 |
53 | case $POWER_CLASS in
54 | 1) PWR_CLASS="-p 0" ;
55 | logi "Power Class: 1";;
56 | 2) PWR_CLASS="-p 1" ;
57 | logi "Power Class: 2";;
58 | 3) PWR_CLASS="-p 2" ;
59 | logi "Power Class: CUSTOM";;
60 | *) PWR_CLASS="";
61 | logi "Power Class: Ignored. Default(1) used (1-CLASS1/2-CLASS2/3-CUSTOM)";
62 | logi "Power Class: To override, Before turning BT ON; setprop qcom.bt.dev_power_class <1 or 2 or 3>";;
63 | esac
64 |
65 | case $LE_POWER_CLASS in
66 | 1) LE_PWR_CLASS="-P 0" ;
67 | logi "LE Power Class: 1";;
68 | 2) LE_PWR_CLASS="-P 1" ;
69 | logi "LE Power Class: 2";;
70 | 3) LE_PWR_CLASS="-P 2" ;
71 | logi "LE Power Class: CUSTOM";;
72 | *) LE_PWR_CLASS="-P 1";
73 | logi "LE Power Class: Ignored. Default(2) used (1-CLASS1/2-CLASS2/3-CUSTOM)";
74 | logi "LE Power Class: To override, Before turning BT ON; setprop qcom.bt.le_dev_pwr_class <1 or 2 or 3>";;
75 | esac
76 |
77 | eval $(/system/vendor/bin/hci_qcomm_init -e $PWR_CLASS $LE_PWR_CLASS && echo "exit_code_hci_qcomm_init=0" || echo "exit_code_hci_qcomm_init=1")
78 |
79 | case $exit_code_hci_qcomm_init in
80 | 0) logi "Bluetooth QSoC firmware download succeeded, $BTS_DEVICE $BTS_TYPE $BTS_BAUD $BTS_ADDRESS";;
81 | *) failed "Bluetooth QSoC firmware download failed" $exit_code_hci_qcomm_init;
82 | setprop vendor.bluetooth.status off
83 | exit $exit_code_hci_qcomm_init;;
84 | esac
85 |
86 | setprop vendor.bluetooth.status on
87 | exit 0
88 |
--------------------------------------------------------------------------------
/gps/utils/platform_lib_abstractions/platform_lib_macros.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef __PLATFORM_LIB_MACROS_H__
30 | #define __PLATFORM_LIB_MACROS_H__
31 |
32 | #include
33 |
34 | #define TS_PRINTF(format, x...) \
35 | { \
36 | struct timeval tv; \
37 | struct timezone tz; \
38 | int hh, mm, ss; \
39 | gettimeofday(&tv, &tz); \
40 | hh = tv.tv_sec/3600%24; \
41 | mm = (tv.tv_sec%3600)/60; \
42 | ss = tv.tv_sec%60; \
43 | fprintf(stdout,"%02d:%02d:%02d.%06ld]" format "\n", hh, mm, ss, tv.tv_usec,##x); \
44 | }
45 |
46 |
47 | #ifdef USE_GLIB
48 |
49 | #define strlcat g_strlcat
50 | #define strlcpy g_strlcpy
51 |
52 | #define ALOGE(format, x...) TS_PRINTF("E/%s (%d): " format , LOG_TAG, getpid(), ##x)
53 | #define ALOGW(format, x...) TS_PRINTF("W/%s (%d): " format , LOG_TAG, getpid(), ##x)
54 | #define ALOGI(format, x...) TS_PRINTF("I/%s (%d): " format , LOG_TAG, getpid(), ##x)
55 | #define ALOGD(format, x...) TS_PRINTF("D/%s (%d): " format , LOG_TAG, getpid(), ##x)
56 | #define ALOGV(format, x...) TS_PRINTF("V/%s (%d): " format , LOG_TAG, getpid(), ##x)
57 |
58 | #define GETTID_PLATFORM_LIB_ABSTRACTION (syscall(SYS_gettid))
59 |
60 | #define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION createPthread
61 | #define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (elapsedMillisSinceBoot())
62 |
63 |
64 | #else
65 |
66 | #ifdef __cplusplus
67 | extern "C" {
68 | #endif
69 | pid_t gettid(void);
70 |
71 | #ifdef __cplusplus
72 | }
73 | #endif
74 |
75 | #define GETTID_PLATFORM_LIB_ABSTRACTION (gettid())
76 | #define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION android::AndroidRuntime::createJavaThread
77 | #define ELAPSED_MILLIS_SINCE_BOOT_PLATFORM_LIB_ABSTRACTION (android::elapsedRealtime())
78 |
79 | #endif
80 |
81 | #endif
82 |
--------------------------------------------------------------------------------
/gps/utils/MsgTask.cpp:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2013,2015 The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #define LOG_NDDEBUG 0
30 | #define LOG_TAG "LocSvc_MsgTask"
31 |
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include
38 |
39 | static void LocMsgDestroy(void* msg) {
40 | delete (LocMsg*)msg;
41 | }
42 |
43 | MsgTask::MsgTask(LocThread::tCreate tCreator,
44 | const char* threadName, bool joinable) :
45 | mQ(msg_q_init2()), mThread(new LocThread()) {
46 | if (!mThread->start(tCreator, threadName, this, joinable)) {
47 | delete mThread;
48 | mThread = NULL;
49 | }
50 | }
51 |
52 | MsgTask::MsgTask(const char* threadName, bool joinable) :
53 | mQ(msg_q_init2()), mThread(new LocThread()) {
54 | if (!mThread->start(threadName, this, joinable)) {
55 | delete mThread;
56 | mThread = NULL;
57 | }
58 | }
59 |
60 | MsgTask::~MsgTask() {
61 | msg_q_flush((void*)mQ);
62 | msg_q_destroy((void**)&mQ);
63 | }
64 |
65 | void MsgTask::destroy() {
66 | msg_q_unblock((void*)mQ);
67 | if (mThread) {
68 | LocThread* thread = mThread;
69 | mThread = NULL;
70 | delete thread;
71 | } else {
72 | delete this;
73 | }
74 | }
75 |
76 | void MsgTask::sendMsg(const LocMsg* msg) const {
77 | msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy);
78 | }
79 |
80 | void MsgTask::prerun() {
81 | // make sure we do not run in background scheduling group
82 | set_sched_policy(gettid(), SP_FOREGROUND);
83 | }
84 |
85 | bool MsgTask::run() {
86 | LOC_LOGV("MsgTask::loop() listening ...\n");
87 | LocMsg* msg;
88 | msq_q_err_type result = msg_q_rcv((void*)mQ, (void **)&msg);
89 | if (eMSG_Q_SUCCESS != result) {
90 | LOC_LOGE("%s:%d] fail receiving msg: %s\n", __func__, __LINE__,
91 | loc_get_msg_q_status(result));
92 | return false;
93 | }
94 |
95 | msg->log();
96 | // there is where each individual msg handling is invoked
97 | msg->proc();
98 |
99 | delete msg;
100 |
101 | return true;
102 | }
103 |
--------------------------------------------------------------------------------
/gps/etc/gps.conf:
--------------------------------------------------------------------------------
1 | #Uncommenting these urls would only enable
2 | #the power up auto injection and force injection(test case).
3 | #XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra3grc.bin
4 | #XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra3grc.bin
5 | #XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra3grc.bin
6 |
7 | #Version check for XTRA
8 | #DISABLE = 0
9 | #AUTO = 1
10 | #XTRA2 = 2
11 | #XTRA3 = 3
12 | XTRA_VERSION_CHECK=1
13 |
14 | # Error Estimate
15 | # _SET = 1
16 | # _CLEAR = 0
17 | ERR_ESTIMATE=0
18 |
19 | #Test
20 | # NTP_SERVER=time.izatcloud.net
21 | #Asia
22 | # NTP_SERVER=asia.pool.ntp.org
23 | #Europe
24 | # NTP_SERVER=europe.pool.ntp.org
25 | #North America
26 | #NTP_SERVER=north-america.pool.ntp.org
27 |
28 | # DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
29 | # 4 - Debug, 5 - Verbose
30 | # If DEBUG_LEVEL is commented, Android's logging levels will be used
31 | DEBUG_LEVEL = 2
32 |
33 | # Intermediate position report, 1=enable, 0=disable
34 | INTERMEDIATE_POS=0
35 |
36 | # Below bit mask configures how GPS functionalities
37 | # should be locked when user turns off GPS on Settings
38 | # Set bit 0x1 if MO GPS functionalities are to be locked
39 | # Set bit 0x2 if NI GPS functionalities are to be locked
40 | # default - non is locked for backward compatibility
41 | #GPS_LOCK = 0
42 |
43 | # supl version 2.0
44 | SUPL_VER=0x20000
45 |
46 | # Emergency SUPL, 1=enable, 0=disable
47 | #SUPL_ES=0
48 |
49 | #Choose PDN for Emergency SUPL
50 | #1 - Use emergency PDN
51 | #0 - Use regular SUPL PDN for Emergency SUPL
52 | USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1
53 |
54 | #SUPL_MODE is a bit mask set in config.xml per carrier by default.
55 | #If it is uncommented here, this value will over write the value from
56 | #config.xml.
57 | #MSA=0X2
58 | #MSB=0X1
59 | #SUPL_MODE=1
60 |
61 | # GPS Capabilities bit mask
62 | # SCHEDULING = 0x01
63 | # MSB = 0x02
64 | # MSA = 0x04
65 | # ON_DEMAND_TIME = 0x10
66 | # GEOFENCE = 0x20
67 | # default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE
68 | CAPABILITIES=0x31
69 |
70 | # Accuracy threshold for intermediate positions
71 | # less accurate positions are ignored, 0 for passing all positions
72 | # ACCURACY_THRES=5000
73 |
74 | ################################
75 | ##### AGPS server settings #####
76 | ################################
77 |
78 | # FOR SUPL SUPPORT, set the following
79 | # SUPL_HOST=supl.host.com or IP
80 | # SUPL_PORT=1234
81 | #SUPL_HOST=supl.google.com
82 | #SUPL_PORT=7275
83 |
84 | # FOR C2K PDE SUPPORT, set the following
85 | # C2K_HOST=c2k.pde.com or IP
86 | # C2K_PORT=1234
87 |
88 | # Bitmask of slots that are available
89 | # for write/install to, where 1s indicate writable,
90 | # and the default value is 0 where no slots
91 | # are writable. For example, AGPS_CERT_WRITABLE_MASK
92 | # of b1000001010 makes 3 slots available
93 | # and the remaining 7 slots unwritable.
94 | #AGPS_CERT_WRITABLE_MASK=0
95 |
96 | ####################################
97 | # LTE Positioning Profile Settings
98 | ####################################
99 | # 0: Enable RRLP on LTE(Default)
100 | # 1: Enable LPP_User_Plane on LTE
101 | # 2: Enable LPP_Control_Plane
102 | # 3: Enable both LPP_User_Plane and LPP_Control_Plane
103 | #LPP_PROFILE = 0
104 |
105 | ################################
106 | # EXTRA SETTINGS
107 | ################################
108 | # NMEA provider (1=Modem Processor, 0=Application Processor)
109 | NMEA_PROVIDER=1
110 | # Mark if it is a SGLTE target (1=SGLTE, 0=nonSGLTE)
111 | SGLTE_TARGET=0
112 |
113 | ##################################################
114 | # Select Positioning Protocol on A-GLONASS system
115 | ##################################################
116 | # 0x1: RRC CPlane
117 | # 0x2: RRLP UPlane
118 | # 0x4: LLP Uplane
119 | A_GLONASS_POS_PROTOCOL_SELECT = 15
120 |
--------------------------------------------------------------------------------
/gps/core/gps_extended.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef GPS_EXTENDED_H
30 | #define GPS_EXTENDED_H
31 |
32 | #ifdef __cplusplus
33 | extern "C" {
34 | #endif /* __cplusplus */
35 |
36 | #include
37 |
38 | struct LocPosMode
39 | {
40 | LocPositionMode mode;
41 | GpsPositionRecurrence recurrence;
42 | uint32_t min_interval;
43 | uint32_t preferred_accuracy;
44 | uint32_t preferred_time;
45 | char credentials[14];
46 | char provider[8];
47 | LocPosMode(LocPositionMode m, GpsPositionRecurrence recr,
48 | uint32_t gap, uint32_t accu, uint32_t time,
49 | const char* cred, const char* prov) :
50 | mode(m), recurrence(recr),
51 | min_interval(gap < MIN_POSSIBLE_FIX_INTERVAL ? MIN_POSSIBLE_FIX_INTERVAL : gap),
52 | preferred_accuracy(accu), preferred_time(time) {
53 | memset(credentials, 0, sizeof(credentials));
54 | memset(provider, 0, sizeof(provider));
55 | if (NULL != cred) {
56 | memcpy(credentials, cred, sizeof(credentials)-1);
57 | }
58 | if (NULL != prov) {
59 | memcpy(provider, prov, sizeof(provider)-1);
60 | }
61 | }
62 |
63 | inline LocPosMode() :
64 | mode(LOC_POSITION_MODE_MS_BASED),
65 | recurrence(GPS_POSITION_RECURRENCE_PERIODIC),
66 | min_interval(MIN_POSSIBLE_FIX_INTERVAL),
67 | preferred_accuracy(50), preferred_time(120000) {
68 | memset(credentials, 0, sizeof(credentials));
69 | memset(provider, 0, sizeof(provider));
70 | }
71 |
72 | inline bool equals(const LocPosMode &anotherMode) const
73 | {
74 | return anotherMode.mode == mode &&
75 | anotherMode.recurrence == recurrence &&
76 | anotherMode.min_interval == min_interval &&
77 | anotherMode.preferred_accuracy == preferred_accuracy &&
78 | anotherMode.preferred_time == preferred_time &&
79 | !strncmp(anotherMode.credentials, credentials, sizeof(credentials)-1) &&
80 | !strncmp(anotherMode.provider, provider, sizeof(provider)-1);
81 | }
82 |
83 | void logv() const;
84 | };
85 |
86 |
87 | #ifdef __cplusplus
88 | }
89 | #endif /* __cplusplus */
90 |
91 | #endif /* GPS_EXTENDED_H */
92 |
93 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/loc_eng_dmn_conn_handler.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef LOC_ENG_DATA_SERVER_HANDLER
30 | #define LOC_ENG_DATA_SERVER_HANDLER
31 |
32 | #include
33 | #include
34 |
35 | //for SSID_BUF_SIZE
36 | #include
37 |
38 | #ifndef SSID_BUF_SIZE
39 | #define SSID_BUF_SIZE (32+1)
40 | #endif
41 |
42 | enum {
43 | /* 0x0 - 0xEF is reserved for daemon internal */
44 | GPSONE_LOC_API_IF_REQUEST = 0xF0,
45 | GPSONE_LOC_API_IF_RELEASE,
46 | GPSONE_LOC_API_RESPONSE,
47 | GPSONE_UNBLOCK,
48 | };
49 |
50 | enum {
51 | GPSONE_LOC_API_IF_REQUEST_SUCCESS = 0xF0,
52 | GPSONE_LOC_API_IF_RELEASE_SUCCESS,
53 | GPSONE_LOC_API_IF_FAILURE,
54 | };
55 |
56 |
57 | struct ctrl_msg_response {
58 | int result;
59 | };
60 |
61 | struct ctrl_msg_unblock {
62 | int reserved;
63 | };
64 |
65 | typedef enum {
66 | IF_REQUEST_TYPE_SUPL = 0,
67 | IF_REQUEST_TYPE_WIFI,
68 | IF_REQUEST_TYPE_ANY
69 | } ctrl_if_req_type_e_type;
70 |
71 | typedef enum {
72 | IF_REQUEST_SENDER_ID_QUIPC = 0,
73 | IF_REQUEST_SENDER_ID_MSAPM,
74 | IF_REQUEST_SENDER_ID_MSAPU,
75 | IF_REQUEST_SENDER_ID_GPSONE_DAEMON,
76 | IF_REQUEST_SENDER_ID_MODEM
77 | } ctrl_if_req_sender_id_e_type;
78 |
79 | struct ctrl_msg_if_request {
80 | ctrl_if_req_type_e_type type;
81 | ctrl_if_req_sender_id_e_type sender_id;
82 | unsigned long ipv4_addr;
83 | unsigned char ipv6_addr[16];
84 | char ssid[SSID_BUF_SIZE];
85 | char password[SSID_BUF_SIZE];
86 | };
87 |
88 | /* do not change this structure */
89 | struct ctrl_msgbuf {
90 | size_t msgsz;
91 | uint16_t reserved1;
92 | uint32_t reserved2;
93 | uint8_t ctrl_type;
94 | union {
95 | struct ctrl_msg_response cmsg_response;
96 | struct ctrl_msg_unblock cmsg_unblock;
97 | struct ctrl_msg_if_request cmsg_if_request;
98 | } cmsg;
99 | };
100 |
101 | extern void* loc_api_handle;
102 |
103 | int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg, int len);
104 | int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg, int len);
105 |
106 | #endif /* LOC_ENG_DATA_SERVER_HANDLER */
107 |
--------------------------------------------------------------------------------
/gps/utils/LocThread.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2015, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef __LOC_THREAD__
30 | #define __LOC_THREAD__
31 |
32 | #include
33 | #include
34 |
35 | // abstract class to be implemented by client to provide a runnable class
36 | // which gets scheduled by LocThread
37 | class LocRunnable {
38 | public:
39 | inline LocRunnable() {}
40 | inline virtual ~LocRunnable() {}
41 |
42 | // The method to be implemented by thread clients
43 | // and be scheduled by LocThread
44 | // This method will be repeated called until it returns false; or
45 | // until thread is stopped.
46 | virtual bool run() = 0;
47 |
48 | // The method to be run before thread loop (conditionally repeatedly)
49 | // calls run()
50 | inline virtual void prerun() {}
51 |
52 | // The method to be run after thread loop (conditionally repeatedly)
53 | // calls run()
54 | inline virtual void postrun() {}
55 | };
56 |
57 | // opaque class to provide service implementation.
58 | class LocThreadDelegate;
59 |
60 | // A utility class to create a thread and run LocRunnable
61 | // caller passes in.
62 | class LocThread {
63 | LocThreadDelegate* mThread;
64 | public:
65 | inline LocThread() : mThread(NULL) {}
66 | virtual ~LocThread();
67 |
68 | typedef pthread_t (*tCreate)(const char* name, void* (*start)(void*), void* arg);
69 | // client starts thread with a runnable, which implements
70 | // the logics to fun in the created thread context.
71 | // The thread could be either joinable or detached.
72 | // runnable is an obj managed by client. Client creates and
73 | // frees it (but must be after stop() is called, or
74 | // this LocThread obj is deleted).
75 | // The obj will be deleted by LocThread if start()
76 | // returns true. Else it is client's responsibility
77 | // to delete the object
78 | // Returns 0 if success; false if failure.
79 | bool start(tCreate creator, const char* threadName, LocRunnable* runnable, bool joinable = true);
80 | inline bool start(const char* threadName, LocRunnable* runnable, bool joinable = true) {
81 | return start(NULL, threadName, runnable, joinable);
82 | }
83 |
84 | // NOTE: if this is a joinable thread, this stop may block
85 | // for a while until the thread is joined.
86 | void stop();
87 |
88 | // thread status check
89 | inline bool isRunning() { return NULL != mThread; }
90 | };
91 |
92 | #endif //__LOC_THREAD__
93 |
--------------------------------------------------------------------------------
/gps/utils/loc_cfg.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 |
30 | #ifndef LOC_CFG_H
31 | #define LOC_CFG_H
32 |
33 | #include
34 | #include
35 |
36 | #define LOC_MAX_PARAM_NAME 80
37 | #define LOC_MAX_PARAM_STRING 80
38 | #define LOC_MAX_PARAM_LINE (LOC_MAX_PARAM_NAME + LOC_MAX_PARAM_STRING)
39 |
40 | #define UTIL_UPDATE_CONF(conf_data, len, config_table) \
41 | loc_update_conf((conf_data), (len), (config_table), \
42 | sizeof(config_table) / sizeof(config_table[0]))
43 |
44 | #define UTIL_READ_CONF_DEFAULT(filename) \
45 | loc_read_conf((filename), NULL, 0);
46 |
47 | #define UTIL_READ_CONF(filename, config_table) \
48 | loc_read_conf((filename), (config_table), sizeof(config_table) / sizeof(config_table[0]))
49 |
50 | /*=============================================================================
51 | *
52 | * MODULE TYPE DECLARATION
53 | *
54 | *============================================================================*/
55 | typedef struct
56 | {
57 | const char *param_name;
58 | void *param_ptr;
59 | uint8_t *param_set; /* was this value set by config file? */
60 | char param_type; /* 'n' for number,
61 | 's' for string,
62 | 'f' for float */
63 | } loc_param_s_type;
64 |
65 | /*=============================================================================
66 | *
67 | * MODULE EXTERNAL DATA
68 | *
69 | *============================================================================*/
70 |
71 | #ifdef __cplusplus
72 | extern "C" {
73 | #endif
74 |
75 | /*=============================================================================
76 | *
77 | * MODULE EXPORTED FUNCTIONS
78 | *
79 | *============================================================================*/
80 | void loc_read_conf(const char* conf_file_name,
81 | const loc_param_s_type* config_table,
82 | uint32_t table_length);
83 | int loc_read_conf_r(FILE *conf_fp, const loc_param_s_type* config_table,
84 | uint32_t table_length);
85 | int loc_update_conf(const char* conf_data, int32_t length,
86 | const loc_param_s_type* config_table, uint32_t table_length);
87 | #ifdef __cplusplus
88 | }
89 | #endif
90 |
91 | #endif /* LOC_CFG_H */
92 |
--------------------------------------------------------------------------------
/audio/audio_effects.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/gps/core/UlpProxyBase.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef ULP_PROXY_BASE_H
30 | #define ULP_PROXY_BASE_H
31 |
32 | #include
33 |
34 | struct FlpExtLocation_s;
35 | struct FlpExtBatchOptions;
36 |
37 | namespace loc_core {
38 |
39 | class LocAdapterBase;
40 |
41 | class UlpProxyBase {
42 | public:
43 | LocPosMode mPosMode;
44 | bool mFixSet;
45 | inline UlpProxyBase() {
46 | mPosMode.mode = LOC_POSITION_MODE_INVALID;
47 | mFixSet = false;
48 | }
49 | inline virtual ~UlpProxyBase() {}
50 | inline virtual bool sendStartFix() { mFixSet = true; return false; }
51 | inline virtual bool sendStopFix() { mFixSet = false; return false; }
52 | inline virtual bool sendFixMode(LocPosMode ¶ms) {
53 | mPosMode = params;
54 | return false;
55 | }
56 |
57 | inline virtual bool reportPosition(UlpLocation &location,
58 | GpsLocationExtended &locationExtended,
59 | void* locationExt,
60 | enum loc_sess_status status,
61 | LocPosTechMask loc_technology_mask) {
62 | (void)location;
63 | (void)locationExtended;
64 | (void)locationExt;
65 | (void)status;
66 | (void)loc_technology_mask;
67 | return false;
68 | }
69 | inline virtual bool reportSv(HaxxSvStatus &svStatus,
70 | GpsLocationExtended &locationExtended,
71 | void* svExt) {
72 | (void)svStatus;
73 | (void)locationExtended;
74 | (void)svExt;
75 | return false;
76 | }
77 | inline virtual bool reportStatus(GpsStatusValue status) {
78 |
79 | (void)status;
80 | return false;
81 | }
82 | inline virtual void setAdapter(LocAdapterBase* adapter) {
83 |
84 | (void)adapter;
85 | }
86 | inline virtual void setCapabilities(unsigned long capabilities) {
87 |
88 | (void)capabilities;
89 | }
90 | inline virtual bool reportBatchingSession(FlpExtBatchOptions &options,
91 | bool active) {
92 |
93 | (void)options;
94 | (void)active;
95 | return false;
96 | }
97 | inline virtual bool reportPositions(const struct FlpExtLocation_s* locations,
98 | int32_t number_of_locations) {
99 | (void)locations;
100 | (void)number_of_locations;
101 | return false;
102 | }
103 | };
104 |
105 | } // namespace loc_core
106 |
107 | #endif // ULP_PROXY_BASE_H
108 |
--------------------------------------------------------------------------------
/gps/utils/LocHeap.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2015, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef __LOC_HEAP__
30 | #define __LOC_HEAP__
31 |
32 | #include
33 | #include
34 |
35 | // abstract class to be implemented by client to provide a rankable class
36 | class LocRankable {
37 | public:
38 | virtual inline ~LocRankable() {}
39 |
40 | // method to rank objects of such type for sorting purposes.
41 | // The pointer of the input node would be stored in the heap.
42 | // >0 if ranks higher than the input;
43 | // ==0 if equally ranks with the input;
44 | // <0 if ranks lower than the input
45 | virtual int ranks(LocRankable& rankable) = 0;
46 |
47 | // convenient method to rank objects of such type for sorting purposes.
48 | inline bool outRanks(LocRankable& rankable) { return ranks(rankable) > 0; }
49 | };
50 |
51 | // opaque class to provide service implementation.
52 | class LocHeapNode;
53 |
54 | // a heap whose left and right children are not sorted. It is sorted only vertically,
55 | // i.e. parent always ranks higher than children, if they exist. Ranking algorithm is
56 | // implemented in Rankable. The reason that there is no sort between children is to
57 | // help beter balance the tree with lower cost. When a node is pushed to the tree,
58 | // it is guaranteed that the subtree that is smaller gets to have the new node.
59 | class LocHeap {
60 | protected:
61 | LocHeapNode* mTree;
62 | public:
63 | inline LocHeap() : mTree(NULL) {}
64 | ~LocHeap();
65 |
66 | // push keeps the tree sorted by rank, it also tries to balance the
67 | // tree by adding the new node to the smaller of the subtrees.
68 | // node is reference to an obj that is managed by client, that client
69 | // creates and destroyes. The destroy should happen after the
70 | // node is popped out from the heap.
71 | void push(LocRankable& node);
72 |
73 | // Peeks the node data on tree top, which has currently the highest ranking
74 | // There is no change the tree structure with this operation
75 | // Returns NULL if the tree is empty, otherwise pointer to the node data of
76 | // the tree top.
77 | LocRankable* peek();
78 |
79 | // pop keeps the tree sorted by rank, but it does not try to balance
80 | // the tree.
81 | // Return - pointer to the node popped out, or NULL if heap is already empty
82 | LocRankable* pop();
83 |
84 | // navigating through the tree and find the node that ranks the same
85 | // as the input data, then remove it from the tree. Rank is implemented
86 | // by rankable obj.
87 | // returns the pointer to the node removed; or NULL (if failed).
88 | LocRankable* remove(LocRankable& rankable);
89 |
90 | #ifdef __LOC_UNIT_TEST__
91 | bool checkTree();
92 | uint32_t getTreeSize();
93 | #endif
94 | };
95 |
96 | #endif //__LOC_HEAP__
97 |
--------------------------------------------------------------------------------
/gps/utils/loc_misc_utils.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2014, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #ifndef _LOC_MISC_UTILS_H_
30 | #define _LOC_MISC_UTILS_H_
31 |
32 | #ifdef __cplusplus
33 | extern "C" {
34 | #endif
35 |
36 | /*===========================================================================
37 | FUNCTION loc_split_string
38 |
39 | DESCRIPTION:
40 | This function is used to split a delimiter separated string into
41 | sub-strings. This function does not allocate new memory to store the split
42 | strings. Instead, it places '\0' in places of delimiters and assings the
43 | starting address of the substring within the raw string as the string address
44 | The input raw_string no longer remains to be a collection of sub-strings
45 | after this function is executed.
46 | Please make a copy of the input string before calling this function if
47 | necessary
48 |
49 | PARAMETERS:
50 | char *raw_string: is the original string with delimiter separated substrings
51 | char **split_strings_ptr: is the arraw of pointers which will hold the addresses
52 | of individual substrings
53 | int max_num_substrings: is the maximum number of substrings that are expected
54 | by the caller. The array of pointers in the above parameter
55 | is usually this long
56 | char delimiter: is the delimiter that separates the substrings. Examples: ' ', ';'
57 |
58 | DEPENDENCIES
59 | N/A
60 |
61 | RETURN VALUE
62 | int Number of split strings
63 |
64 | SIDE EFFECTS
65 | The input raw_string no longer remains a delimiter separated single string.
66 |
67 | EXAMPLE
68 | delimiter = ' ' //space
69 | raw_string = "hello new user" //delimiter is space ' '
70 | addresses = 0123456789abcd
71 | split_strings_ptr[0] = &raw_string[0]; //split_strings_ptr[0] contains "hello"
72 | split_strings_ptr[1] = &raw_string[6]; //split_strings_ptr[1] contains "new"
73 | split_strings_ptr[2] = &raw_string[a]; //split_strings_ptr[2] contains "user"
74 |
75 | ===========================================================================*/
76 | int loc_util_split_string(char *raw_string, char **split_strings_ptr, int max_num_substrings,
77 | char delimiter);
78 |
79 | /*===========================================================================
80 | FUNCTION trim_space
81 |
82 | DESCRIPTION
83 | Removes leading and trailing spaces of the string
84 |
85 | DEPENDENCIES
86 | N/A
87 |
88 | RETURN VALUE
89 | None
90 |
91 | SIDE EFFECTS
92 | N/A
93 | ===========================================================================*/
94 | void loc_util_trim_space(char *org_string);
95 | #ifdef __cplusplus
96 | }
97 | #endif
98 |
99 | #endif //_LOC_MISC_UTILS_H_
100 |
--------------------------------------------------------------------------------
/configs/nfc-nci.conf:
--------------------------------------------------------------------------------
1 | ## this file is used by NFC Hardware Abstraction Layer at external/libnfc-nci/halimpl/
2 |
3 | ###############################################################################
4 | #chip hardware version
5 | #supported features
6 | NFC_BUILD_ID = V2.1.S.01.01.01.01.1105000707.1112132050
7 | # Application logging mask
8 | APPL_TRACE_LEVEL=0x00
9 | PROTOCOL_TRACE_LEVEL=0x00000000
10 |
11 | #####################################################################################
12 | # File used for NFA storage
13 | NFA_STORAGE="/data/nfc"
14 |
15 | NFC_WAKE_DELAY=20
16 |
17 | #default
18 | NFA_DM_START_UP_CFG={17:80:01:00:08:01:01:11:01:01:AF:02:00:07:AF:02:01:07:C0:01:01:BF:01:02}
19 | #####################################################################################
20 | # listen to the following technology(s).
21 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
22 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B.
23 |
24 | UICC_LISTEN_TECH_MASK=0x07
25 | # Protocol mask for NFC-A technology protocols(T1T,T2T and 4A).
26 | # The bits (for NFC A protocol mask)are defined in nfa_api.h.
27 | # Default is T4AT
28 | # 0x01- T1T, 0x02- T2T, 0x04- T4AT
29 | NFCA_PROTOCOL_MASK=0x04
30 | ###############################################################################
31 | # Force tag polling for the following technology(s).
32 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
33 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B |
34 | # NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 |
35 | # NFA_TECHNOLOGY_MASK_B_PRIME | NFA_TECHNOLOGY_MASK_A_ACTIVE |
36 | # NFA_TECHNOLOGY_MASK_F_ACTIVE.
37 | #
38 | # 0x01- A, 0x02- B, 0x04- F, 0x20- Kovio
39 | POLLING_TECH_MASK=0x27
40 |
41 | # Force P2P to only listen for the following technology(s).
42 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
43 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F |
44 | # NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE
45 | # 0x01- NFC DEP A , 0x04:- NFC DEP F
46 | P2P_LISTEN_TECH_MASK=0x05
47 |
48 | ###############################################################################
49 | # Firmware patch file
50 | # If the value is not set then patch download is disabled.
51 | #FW_PATCH="/system/etc/firmware/Signedrompatch.bin"
52 | #FW_PATCH_20="/system/etc/firmware/Signedrompatch_v20.bin"
53 | #FW_PATCH_21="/system/etc/firmware/Signedrompatch_v21.bin"
54 | FW_PATCH_24="/system/etc/firmware/Signedrompatch_v24.bin"
55 | #FW_PATCH_30="/system/etc/firmware/Signedrompatch_v30.bin"
56 | ###############################################################################
57 | # Firmware patch file
58 | #FW_PRE_PATCH="/system/etc/firmware/Signedromprepatch.bin"
59 | NVM_FILE_PATH="/system/etc/firmware/nfc_test.bin"
60 | FUSED_NVM_FILE_PATH="/system/etc/firmware/fused_nvm.bin"
61 | ###############################################################################
62 |
63 | #
64 | TRANSPORT_DRIVER="/dev/nfc-nci"
65 |
66 | ###############################################################################
67 | # power control driver
68 |
69 | POWER_CONTROL_DRIVER="/dev/nfc-nci"
70 |
71 | ###############################################################################
72 | # Maximum Number of Credits to be allowed by the NFCC
73 | MAX_RF_DATA_CREDITS=1
74 | ###############################################################################
75 | #Patch and nvm update flags
76 | # These flags needs to be set to enable the patch update and nvm update mechanism
77 | # of middleware
78 | ###############################################################################
79 | PATCH_UPDATE_ENABLE_FLAG=0x01
80 | NVM_UPDATE_ENABLE_FLAG=0x00
81 | FUSED_NVM_UPDATE_ENABLE_FLAG=0x00
82 | PM_ENABLE_FLAG=0x01
83 | SCREEN_OFF_POWER_STATE=0x01
84 | #0x01=enable region2 code in MW
85 | #0x00= disable region2 code in MW
86 | REGION2_ENABLE=0x01
87 | REGION2_DEBUG_ENABLE_FLAG=0x00
88 | #NFC_SCREEN_OFF_POLL_ON=1
89 | ###############################################################################
90 | # Time out value for closing the connection opened for patch download
91 | ###############################################################################
92 | PATCH_DNLD_NFC_HAL_CMD_TOUT=10000
93 | PATCH_VERSION=21
94 | ###############################################################################
95 | #Default listen mode routing table
96 | # This is the default listen mode routing configuration for NFCC.
97 | # Default is for ISO DEP and NFC DEP
98 | DEFAULT_LISTEN_MODE_ROUTING={00:02:0A:01:03:01:01:04:01:03:00:01:05}
99 | ###############################################################################
100 |
--------------------------------------------------------------------------------
/gps/core/ContextBase.cpp:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #define LOG_NDDEBUG 0
30 | #define LOG_TAG "LocSvc_CtxBase"
31 |
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include
38 | #include
39 | #include
40 |
41 | namespace loc_core {
42 |
43 | LBSProxyBase* ContextBase::getLBSProxy(const char* libName)
44 | {
45 | LBSProxyBase* proxy = NULL;
46 | LOC_LOGD("%s:%d]: getLBSProxy libname: %s\n", __func__, __LINE__, libName);
47 | void* lib = dlopen(libName, RTLD_NOW);
48 |
49 | if ((void*)NULL != lib) {
50 | getLBSProxy_t* getter = (getLBSProxy_t*)dlsym(lib, "getLBSProxy");
51 | if (NULL != getter) {
52 | proxy = (*getter)();
53 | }
54 | }
55 | if (NULL == proxy) {
56 | proxy = new LBSProxyBase();
57 | }
58 | LOC_LOGD("%s:%d]: Exiting\n", __func__, __LINE__);
59 | return proxy;
60 | }
61 |
62 | LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
63 | {
64 | LocApiBase* locApi = NULL;
65 |
66 | // first if can not be MPQ
67 | if (TARGET_MPQ != loc_get_target()) {
68 | if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) {
69 | void *handle = NULL;
70 | //try to see if LocApiV02 is present
71 | if((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) {
72 | LOC_LOGD("%s:%d]: libloc_api_v02.so is present", __func__, __LINE__);
73 | getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi");
74 | if(getter != NULL) {
75 | LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, __LINE__);
76 | locApi = (*getter)(mMsgTask, exMask, this);
77 | }
78 | }
79 | // only RPC is the option now
80 | else {
81 | LOC_LOGD("%s:%d]: libloc_api_v02.so is NOT present. Trying RPC",
82 | __func__, __LINE__);
83 | handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW);
84 | if (NULL != handle) {
85 | getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi");
86 | if (NULL != getter) {
87 | LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__, __LINE__);
88 | locApi = (*getter)(mMsgTask, exMask, this);
89 | }
90 | }
91 | }
92 | }
93 | }
94 |
95 | // locApi could still be NULL at this time
96 | // we would then create a dummy one
97 | if (NULL == locApi) {
98 | locApi = new LocApiBase(mMsgTask, exMask, this);
99 | }
100 |
101 | return locApi;
102 | }
103 |
104 | ContextBase::ContextBase(const MsgTask* msgTask,
105 | LOC_API_ADAPTER_EVENT_MASK_T exMask,
106 | const char* libName) :
107 | mLBSProxy(getLBSProxy(libName)),
108 | mMsgTask(msgTask),
109 | mLocApi(createLocApi(exMask)),
110 | mLocApiProxy(mLocApi->getLocApiProxy())
111 | {
112 | }
113 |
114 | }
115 |
--------------------------------------------------------------------------------
/gps/utils/loc_misc_utils.cpp:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2014, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 |
35 | #define LOG_NDDEBUG 0
36 | #define LOG_TAG "LocSvc_misc_utils"
37 |
38 | int loc_util_split_string(char *raw_string, char **split_strings_ptr,
39 | int max_num_substrings, char delimiter)
40 | {
41 | int raw_string_index=0;
42 | int num_split_strings=0;
43 | unsigned char end_string=0;
44 | int raw_string_length=0;
45 |
46 | if(!raw_string || !split_strings_ptr) {
47 | LOC_LOGE("%s:%d]: NULL parameters", __func__, __LINE__);
48 | num_split_strings = -1;
49 | goto err;
50 | }
51 | LOC_LOGD("%s:%d]: raw string: %s\n", __func__, __LINE__, raw_string);
52 | raw_string_length = strlen(raw_string) + 1;
53 | split_strings_ptr[num_split_strings] = &raw_string[raw_string_index];
54 | for(raw_string_index=0; raw_string_index < raw_string_length; raw_string_index++) {
55 | if(raw_string[raw_string_index] == '\0')
56 | end_string=1;
57 | if((raw_string[raw_string_index] == delimiter) || end_string) {
58 | raw_string[raw_string_index] = '\0';
59 | LOC_LOGD("%s:%d]: split string: %s\n",
60 | __func__, __LINE__, split_strings_ptr[num_split_strings]);
61 | num_split_strings++;
62 | if(((raw_string_index + 1) < raw_string_length) &&
63 | (num_split_strings < max_num_substrings)) {
64 | split_strings_ptr[num_split_strings] = &raw_string[raw_string_index+1];
65 | }
66 | else {
67 | break;
68 | }
69 | }
70 | if(end_string)
71 | break;
72 | }
73 | err:
74 | LOC_LOGD("%s:%d]: num_split_strings: %d\n", __func__, __LINE__, num_split_strings);
75 | return num_split_strings;
76 | }
77 |
78 | void loc_util_trim_space(char *org_string)
79 | {
80 | char *scan_ptr, *write_ptr;
81 | char *first_nonspace = NULL, *last_nonspace = NULL;
82 |
83 | if(org_string == NULL) {
84 | LOC_LOGE("%s:%d]: NULL parameter", __func__, __LINE__);
85 | goto err;
86 | }
87 |
88 | scan_ptr = write_ptr = org_string;
89 |
90 | while (*scan_ptr) {
91 | //Find the first non-space character
92 | if ( !isspace(*scan_ptr) && first_nonspace == NULL) {
93 | first_nonspace = scan_ptr;
94 | }
95 | //Once the first non-space character is found in the
96 | //above check, keep shifting the characters to the left
97 | //to replace the spaces
98 | if (first_nonspace != NULL) {
99 | *(write_ptr++) = *scan_ptr;
100 | //Keep track of which was the last non-space character
101 | //encountered
102 | //last_nonspace will not be updated in the case where
103 | //the string ends with spaces
104 | if ( !isspace(*scan_ptr)) {
105 | last_nonspace = write_ptr;
106 | }
107 | }
108 | scan_ptr++;
109 | }
110 | //Add NULL terminator after the last non-space character
111 | if (last_nonspace) { *last_nonspace = '\0'; }
112 | err:
113 | return;
114 | }
115 |
--------------------------------------------------------------------------------
/gps/core/LocAdapterBase.cpp:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * * Redistributions of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * * Redistributions in binary form must reproduce the above
9 | * copyright notice, this list of conditions and the following
10 | * disclaimer in the documentation and/or other materials provided
11 | * with the distribution.
12 | * * Neither the name of The Linux Foundation, nor the names of its
13 | * contributors may be used to endorse or promote products derived
14 | * from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | *
28 | */
29 | #define LOG_NDDEBUG 0
30 | #define LOG_TAG "LocSvc_LocAdapterBase"
31 |
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 |
38 | namespace loc_core {
39 |
40 | // This is the top level class, so the constructor will
41 | // always gets called. Here we prepare for the default.
42 | // But if getLocApi(targetEnumType target) is overriden,
43 | // the right locApi should get created.
44 | LocAdapterBase::LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
45 | ContextBase* context, LocAdapterProxyBase *adapterProxyBase) :
46 | mEvtMask(mask), mContext(context),
47 | mLocApi(context->getLocApi()), mLocAdapterProxyBase(adapterProxyBase),
48 | mMsgTask(context->getMsgTask())
49 | {
50 | mLocApi->addAdapter(this);
51 | }
52 |
53 | void LocAdapterBase::handleEngineUpEvent()
54 | {
55 | if (mLocAdapterProxyBase) {
56 | mLocAdapterProxyBase->handleEngineUpEvent();
57 | }
58 | }
59 |
60 | void LocAdapterBase::handleEngineDownEvent()
61 | {
62 | if (mLocAdapterProxyBase) {
63 | mLocAdapterProxyBase->handleEngineDownEvent();
64 | }
65 | }
66 |
67 | void LocAdapterBase::
68 | reportPosition(UlpLocation &location,
69 | GpsLocationExtended &locationExtended,
70 | void* locationExt,
71 | enum loc_sess_status status,
72 | LocPosTechMask loc_technology_mask) {
73 | if (mLocAdapterProxyBase == NULL ||
74 | !mLocAdapterProxyBase->reportPosition(location,
75 | locationExtended,
76 | status,
77 | loc_technology_mask)) {
78 | DEFAULT_IMPL()
79 | }
80 | }
81 |
82 | void LocAdapterBase::
83 | reportSv(HaxxSvStatus &svStatus,
84 | GpsLocationExtended &locationExtended,
85 | void* svExt)
86 | DEFAULT_IMPL()
87 |
88 |
89 | void LocAdapterBase::
90 | reportStatus(GpsStatusValue status)
91 | DEFAULT_IMPL()
92 |
93 |
94 | void LocAdapterBase::
95 | reportNmea(const char* nmea, int length)
96 | DEFAULT_IMPL()
97 |
98 | bool LocAdapterBase::
99 | reportXtraServer(const char* url1, const char* url2,
100 | const char* url3, const int maxlength)
101 | DEFAULT_IMPL(false)
102 |
103 | bool LocAdapterBase::
104 | requestXtraData()
105 | DEFAULT_IMPL(false)
106 |
107 | bool LocAdapterBase::
108 | requestTime()
109 | DEFAULT_IMPL(false)
110 |
111 | bool LocAdapterBase::
112 | requestLocation()
113 | DEFAULT_IMPL(false)
114 |
115 | bool LocAdapterBase::
116 | requestATL(int connHandle, AGpsType agps_type)
117 | DEFAULT_IMPL(false)
118 |
119 | bool LocAdapterBase::
120 | releaseATL(int connHandle)
121 | DEFAULT_IMPL(false)
122 |
123 | bool LocAdapterBase::
124 | requestSuplES(int connHandle)
125 | DEFAULT_IMPL(false)
126 |
127 | bool LocAdapterBase::
128 | reportDataCallOpened()
129 | DEFAULT_IMPL(false)
130 |
131 | bool LocAdapterBase::
132 | reportDataCallClosed()
133 | DEFAULT_IMPL(false)
134 |
135 | bool LocAdapterBase::
136 | requestNiNotify(GpsNiNotification ¬ify, const void* data)
137 | DEFAULT_IMPL(false)
138 |
139 | void LocAdapterBase::
140 | reportGpsMeasurementData(GpsData &gpsMeasurementData)
141 | DEFAULT_IMPL()
142 | } // namespace loc_core
143 |
--------------------------------------------------------------------------------