├── sepolicy
├── shell.te
├── debuggerd.te
├── nfc.te
├── hostapd.te
├── wpa.te
├── mm-qcamerad.te
├── wcnss_service.te
├── toolbox.te
├── file.te
├── mediaserver.te
├── adjust_settings.te
├── init.te
├── system_server.te
├── sensord.te
├── qti_init_shell.te
└── file_contexts
├── vendorsetup.sh
├── configs
├── msm_irqbalance.conf
├── softiron_matrix.txt
├── qmi_config.xml
└── audio_policy.conf
├── wifi
├── p2p_supplicant_overlay.conf
├── wpa_supplicant_overlay.conf
├── WCNSS_cfg.dat
├── WCNSS_qcom_wlan_nv.bin
└── Android.mk
├── keylayout
├── Headset.kl
├── gpio-keys.kl
└── atmel_mxt_ts_T100_touchscreen.kl
├── overlay
├── packages
│ ├── apps
│ │ ├── Trebuchet
│ │ │ └── res
│ │ │ │ └── values
│ │ │ │ └── preferences_defaults.xml
│ │ ├── Dialer
│ │ │ └── res
│ │ │ │ └── values
│ │ │ │ └── config.xml
│ │ ├── Snap
│ │ │ └── res
│ │ │ │ └── values
│ │ │ │ ├── config.xml
│ │ │ │ └── qcomarrays.xml
│ │ └── Bluetooth
│ │ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ └── services
│ │ ├── Telecomm
│ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ │ └── Telephony
│ │ └── res
│ │ └── values
│ │ └── config.xml
└── frameworks
│ └── base
│ ├── packages
│ ├── SettingsProvider
│ │ └── res
│ │ │ └── values
│ │ │ └── defaults.xml
│ └── SystemUI
│ │ └── res
│ │ └── values
│ │ └── config.xml
│ └── core
│ └── res
│ └── res
│ └── xml
│ └── power_profile.xml
├── cm.dependencies
├── healthd
├── Android.mk
└── healthd_board_msm.cpp
├── libshim
├── Android.mk
└── gui
│ └── SensorManager.h
├── camera
├── Android.mk
└── CameraWrapper.cpp
├── gps
├── etc
│ ├── quipc.conf
│ ├── sap.conf
│ ├── flp.conf
│ └── gps.conf
├── Android.mk
├── loc_api
│ ├── Android.mk
│ └── libloc_api_50001
│ │ ├── loc_eng_log.cpp
│ │ ├── loc_eng_log.h
│ │ ├── loc_eng_xtra.h
│ │ ├── loc_eng_nmea.h
│ │ ├── loc_eng_dmn_conn_glue_pipe.h
│ │ ├── loc_eng_dmn_conn_glue_msg.h
│ │ ├── Makefile.am
│ │ ├── loc_eng_ni.h
│ │ ├── Android.mk
│ │ ├── loc.h
│ │ ├── loc_eng_dmn_conn.h
│ │ ├── gps.c
│ │ ├── loc_eng_dmn_conn_thread_helper.h
│ │ └── loc_eng_dmn_conn_handler.h
├── core
│ ├── Android.mk
│ ├── loc_core_log.h
│ ├── MsgTask.h
│ ├── LBSProxyBase.h
│ ├── LocAdapterProxyBase.h
│ ├── ContextBase.h
│ ├── LocDualContext.h
│ ├── UlpProxyBase.h
│ ├── gps_extended.h
│ ├── LocAdapterBase.cpp
│ ├── ContextBase.cpp
│ ├── MsgTask.cpp
│ └── LocAdapterBase.h
├── utils
│ ├── Android.mk
│ ├── Makefile.am
│ ├── loc_timer.h
│ ├── loc_log.h
│ ├── loc_target.h
│ ├── loc_cfg.h
│ ├── loc_misc_utils.h
│ └── loc_misc_utils.cpp
└── platform_lib_abstractions
│ ├── platform_lib_time.h
│ ├── platform_lib_includes.h
│ ├── elapsed_millis_since_boot.cpp
│ └── platform_lib_macros.h
├── AndroidProducts.mk
├── cm.mk
├── liblight
└── Android.mk
├── include
└── camera
│ └── CameraParametersExtra.h
├── full_piccolo.mk
├── bluetooth
└── bdroid_buildcfg.h
├── rootdir
├── etc
│ ├── init.atmel_ts.sh
│ └── fstab.qcom
└── Android.mk
├── cmhw
└── src
│ └── org
│ └── cyanogenmod
│ └── hardware
│ ├── DisplayColorCalibration.java
│ ├── KeyDisabler.java
│ └── VibratorHW.java
├── nfc
├── libnfc-brcm-20795a20.conf
├── nfcee_access.xml
└── libnfc-brcm.conf
├── system.prop
├── Android.mk
└── BoardConfig.mk
/sepolicy/shell.te:
--------------------------------------------------------------------------------
1 | allow shell su:process signal;
2 |
--------------------------------------------------------------------------------
/vendorsetup.sh:
--------------------------------------------------------------------------------
1 | add_lunch_combo cm_piccolo-userdebug
2 |
--------------------------------------------------------------------------------
/sepolicy/debuggerd.te :
--------------------------------------------------------------------------------
1 | allow debuggerd init:process ptrace;
2 |
--------------------------------------------------------------------------------
/sepolicy/nfc.te:
--------------------------------------------------------------------------------
1 | allow nfc nfc_device:chr_file { read write ioctl };
--------------------------------------------------------------------------------
/sepolicy/hostapd.te:
--------------------------------------------------------------------------------
1 | allow hostapd wifi_data_file:sock_file write;
2 |
--------------------------------------------------------------------------------
/sepolicy/wpa.te:
--------------------------------------------------------------------------------
1 | allow wpa wifi_data_file:sock_file { create setattr };
2 |
--------------------------------------------------------------------------------
/configs/msm_irqbalance.conf:
--------------------------------------------------------------------------------
1 | PRIO=0,0,0,0,1,1,1,1
2 | IGNORED_IRQ=20,39,200,203
3 |
--------------------------------------------------------------------------------
/sepolicy/mm-qcamerad.te:
--------------------------------------------------------------------------------
1 | allow mm-qcamerad system_data_file:dir { write add_name };
2 |
--------------------------------------------------------------------------------
/wifi/p2p_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_no_group_iface=1
3 |
--------------------------------------------------------------------------------
/wifi/wpa_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_disabled=1
3 | p2p_no_group_iface=1
4 |
--------------------------------------------------------------------------------
/configs/softiron_matrix.txt:
--------------------------------------------------------------------------------
1 | 1.14903,0.02956,-0.02433,0.009245,0.77427,0.00325,-0.02171,-0.01217,1.135585
2 |
--------------------------------------------------------------------------------
/wifi/WCNSS_cfg.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piccolo-dev/android_device_bq_piccolo/HEAD/wifi/WCNSS_cfg.dat
--------------------------------------------------------------------------------
/sepolicy/wcnss_service.te:
--------------------------------------------------------------------------------
1 | allow wcnss_service persist_file:file setattr;
2 | allow wcnss_service self:capability chown;
3 |
--------------------------------------------------------------------------------
/wifi/WCNSS_qcom_wlan_nv.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piccolo-dev/android_device_bq_piccolo/HEAD/wifi/WCNSS_qcom_wlan_nv.bin
--------------------------------------------------------------------------------
/sepolicy/toolbox.te:
--------------------------------------------------------------------------------
1 | allow toolbox sysfs:dir setattr;
2 | allow toolbox sysfs:file setattr;
3 | allow toolbox touchpanel_sysfs:file { getattr setattr };
4 |
--------------------------------------------------------------------------------
/sepolicy/file.te:
--------------------------------------------------------------------------------
1 | # CMHW
2 | type touchpanel_sysfs, fs_type, sysfs_type;
3 | type vibeamp_sysfs, fs_type, sysfs_type;
4 |
5 | type leds_device, file_type, dev_type;
6 |
--------------------------------------------------------------------------------
/keylayout/Headset.kl:
--------------------------------------------------------------------------------
1 | key 256 HEADSETHOOK
2 | key 257 HEADSETHOOK
3 | key 258 VOLUME_UP
4 | key 259 VOLUME_UP
5 | key 260 VOLUME_DOWN
6 | key 261 VOLUME_DOWN
7 |
--------------------------------------------------------------------------------
/sepolicy/mediaserver.te:
--------------------------------------------------------------------------------
1 | allow mediaserver sensorservice_service:service_manager find;
2 | binder_call(mediaserver, servicemanager);
3 | binder_call(mediaserver, sensorservice_service);
4 |
--------------------------------------------------------------------------------
/sepolicy/adjust_settings.te:
--------------------------------------------------------------------------------
1 | type adjust_settings, domain;
2 | type adjust_settings_exec, exec_type, file_type;
3 | init_daemon_domain(adjust_settings);
4 |
5 | allow adjust_settings self:capability { dac_read_search dac_override };
--------------------------------------------------------------------------------
/overlay/packages/apps/Trebuchet/res/values/preferences_defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 |
5 |
--------------------------------------------------------------------------------
/sepolicy/init.te:
--------------------------------------------------------------------------------
1 | allow init self:process execmem;
2 | allow init self:tcp_socket create;
3 | allow init self:tcp_socket setopt;
4 | allow init self:tcp_socket { bind listen };
5 | allow init node:tcp_socket node_bind;
6 |
7 | allow init system_data_file:fifo_file write;
--------------------------------------------------------------------------------
/cm.dependencies:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "repository": "android_device_qcom_common",
4 | "target_path": "device/qcom/common"
5 | },
6 | {
7 | "repository": "android_external_sony_boringssl-compat",
8 | "target_path": "external/sony/boringssl-compat"
9 | }
10 | ]
11 |
--------------------------------------------------------------------------------
/healthd/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 | LOCAL_SRC_FILES := healthd_board_msm.cpp
5 | LOCAL_MODULE := libhealthd.$(TARGET_BOARD_PLATFORM)
6 | LOCAL_CFLAGS := -Werror
7 | LOCAL_C_INCLUDES := system/core/healthd bootable/recovery
8 | include $(BUILD_STATIC_LIBRARY)
9 |
--------------------------------------------------------------------------------
/sepolicy/system_server.te:
--------------------------------------------------------------------------------
1 | # CMHW
2 | allow system_server touchpanel_sysfs:file rw_file_perms;
3 | allow system_server touchpanel_sysfs:dir { search };
4 | allow system_server vibeamp_sysfs:file rw_file_perms;
5 |
6 | # Sensors
7 | allow system_server sensors_data_file:dir r_dir_perms;
8 | allow system_server sensors_data_file:fifo_file rw_file_perms;
9 |
--------------------------------------------------------------------------------
/libshim/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_SRC_FILES := \
6 | android/sensor.cpp \
7 | gui/SensorManager.cpp
8 |
9 | LOCAL_C_INCLUDES := gui
10 | LOCAL_SHARED_LIBRARIES := libgui libutils liblog libbinder libandroid
11 | LOCAL_MODULE := libshim_camera
12 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
13 |
14 | include $(BUILD_SHARED_LIBRARY)
15 |
--------------------------------------------------------------------------------
/sepolicy/sensord.te:
--------------------------------------------------------------------------------
1 | # Access to input devices
2 | allow sensors input_device:dir search;
3 | allow sensors input_device:chr_file open;
4 | allow sensors input_device:chr_file read;
5 |
6 | # Allow fowner to own files
7 | allow sensors self:capability { fowner };
8 |
9 | # Allow fifo file handling in /data/misc/sensor
10 | allow sensors sensors_data_file:fifo_file create_file_perms;
11 |
12 |
13 |
--------------------------------------------------------------------------------
/camera/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_C_INCLUDES := \
6 | system/media/camera/include
7 |
8 | LOCAL_SRC_FILES := \
9 | CameraWrapper.cpp
10 |
11 | LOCAL_SHARED_LIBRARIES := \
12 | libhardware liblog libgui libutils
13 |
14 | LOCAL_MODULE_RELATIVE_PATH := hw
15 | LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM)
16 | LOCAL_MODULE_TAGS := optional
17 |
18 | include $(BUILD_SHARED_LIBRARY)
19 |
--------------------------------------------------------------------------------
/sepolicy/qti_init_shell.te:
--------------------------------------------------------------------------------
1 | allow qti_init_shell btnvtool_exec:file getattr;
2 | allow qti_init_shell btnvtool_exec:file execute;
3 | allow qti_init_shell qmuxd:unix_stream_socket connectto;
4 | allow qti_init_shell qmuxd_socket:dir { write add_name };
5 | allow qti_init_shell qmuxd_socket:dir search;
6 | allow qti_init_shell qmuxd_socket:sock_file { write create setattr };
7 | allow qti_init_shell sysfs:dir setattr;
8 | allow qti_init_shell touchpanel_sysfs:file { getattr setattr };
9 |
--------------------------------------------------------------------------------
/gps/etc/quipc.conf:
--------------------------------------------------------------------------------
1 | # X86 ONLY - UBUNTU:
2 | # Set QUIPC_CONF_PATH environment variable to indicate the path of this file, e.g:
3 | # export QUIPC_CONF_PATH="/usr2/arahmat/quipc.conf"
4 |
5 | # URL for QUIPS server (N3)
6 | QUIPS_SERVER_URL = https://n3.indoor.izat-location.net/quipsds/LookupService
7 |
8 | # URL for RAS server
9 | RAS_SERVER_URL = https://r1.indoor.izat-location.net/ras/DeviceRegistration
10 |
11 | # Password for secured MSAP-enabled AP
12 | SSID_PWD = qu1pspsk
13 |
--------------------------------------------------------------------------------
/AndroidProducts.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2015 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 | PRODUCT_MAKEFILES := \
18 | $(LOCAL_DIR)/full_piccolo.mk
19 |
--------------------------------------------------------------------------------
/gps/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2015 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 |
19 | include $(call all-subdir-makefiles,$(LOCAL_PATH))
--------------------------------------------------------------------------------
/cm.mk:
--------------------------------------------------------------------------------
1 | # Boot animation
2 | TARGET_SCREEN_HEIGHT := 1920
3 | TARGET_SCREEN_WIDTH := 1080
4 |
5 | # Inherit some common CM stuff
6 | $(call inherit-product, vendor/cm/config/common_full_phone.mk)
7 |
8 | # Inherit device configuration
9 | $(call inherit-product, device/bq/piccolo/full_piccolo.mk)
10 |
11 | PRODUCT_RELEASE_NAME := Aquaris M5
12 | PRODUCT_NAME := cm_piccolo
13 |
14 | # Set product device & name
15 | PRODUCT_BUILD_PROP_OVERRIDES += \
16 | TARGET_DEVICE=Aquaris_M5 PRODUCT_NAME=Aquaris_M5
17 |
18 | PRODUCT_BUILD_PROP_OVERRIDES += \
19 | BUILD_FINGERPRINT=bq/Aquaris_M5/Aquaris_M5:5.1.1/LMY47V/1456452315:user/release-keys \
20 | PRIVATE_BUILD_DESC="msm8916_32-user 5.1.1 LMY47V 607 release-keys"
21 |
22 | PRODUCT_GMS_CLIENTID_BASE := android-bq
23 |
--------------------------------------------------------------------------------
/gps/loc_api/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2015 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 |
19 | include $(call all-subdir-makefiles,$(LOCAL_PATH))
20 |
--------------------------------------------------------------------------------
/sepolicy/file_contexts:
--------------------------------------------------------------------------------
1 | # Camera
2 | /data/cam_socket([0-9])+ u:object_r:camera_socket:s0
3 |
4 | # CMHW
5 | /sys/devices/soc.0/78b9000.i2c/i2c-5/5-004a/en_gesture u:object_r:touchpanel_sysfs:s0
6 | /sys/devices/soc.0/78b9000.i2c/i2c-5/5-004a/disable_keys u:object_r:touchpanel_sysfs:s0
7 | /sys/devices/virtual/timed_output/vibrator/vtg_level u:object_r:vibeamp_sysfs:s0
8 |
9 | # FRP
10 | /dev/block/bootdevice/by-name/config u:object_r:frp_block_device:s0
11 |
12 | # Misc
13 | /system/bin/adjust_settings u:object_r:adjust_settings_exec:s0
14 |
15 | # NFC
16 | /dev/bcm2079x u:object_r:nfc_device:s0
17 |
18 | # Sensord
19 | /system/bin/sensord u:object_r:sensors_exec:s0
20 | /data/misc/sensor(/.*)? u:object_r:sensors_data_file:s0
21 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 | true
21 |
22 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Dialer/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | true
19 | 4
20 |
21 |
--------------------------------------------------------------------------------
/overlay/packages/services/Telecomm/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 |
20 |
21 | true
22 |
23 |
24 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Snap/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | false
21 |
22 |
23 | false
24 |
25 |
--------------------------------------------------------------------------------
/liblight/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2008 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 | LOCAL_PATH:= $(call my-dir)
16 | # HAL module implemenation stored in
17 | # hw/..so
18 | include $(CLEAR_VARS)
19 |
20 | LOCAL_SRC_FILES := lights.c
21 | LOCAL_MODULE_RELATIVE_PATH := hw
22 | LOCAL_SHARED_LIBRARIES := liblog
23 | LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdlights\"
24 | LOCAL_MODULE := lights.$(TARGET_BOARD_PLATFORM)
25 | LOCAL_MODULE_TAGS := optional
26 |
27 | include $(BUILD_SHARED_LIBRARY)
28 |
--------------------------------------------------------------------------------
/include/camera/CameraParametersExtra.h:
--------------------------------------------------------------------------------
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 | #define CAMERA_PARAMETERS_EXTRA_C \
18 | const char CameraParameters::KEY_BEAUTY_BRIGHTEN[] = "arc-beauty-brighten"; \
19 | const char CameraParameters::KEY_BEAUTY_SOFTEN[] = "arc-beauty-soften"; \
20 | const char CameraParameters::KEY_BEAUTY_ENABLE[] = "arc-beauty-enable"; \
21 | \
22 |
23 | #define CAMERA_PARAMETERS_EXTRA_H \
24 | static const char KEY_BEAUTY_BRIGHTEN[]; \
25 | static const char KEY_BEAUTY_SOFTEN[]; \
26 | static const char KEY_BEAUTY_ENABLE[]; \
27 | \
28 |
--------------------------------------------------------------------------------
/full_piccolo.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2015 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 | # Inherit from the common Open Source product configuration
18 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
19 |
20 | # Inherit from hardware-specific part of the product configuration
21 | $(call inherit-product, device/bq/piccolo/device.mk)
22 | $(call inherit-product-if-exists, vendor/bq/piccolo/piccolo-vendor.mk)
23 |
24 | # Device identifier. This must come after all inclusions.
25 | PRODUCT_DEVICE := piccolo
26 | PRODUCT_NAME := full_piccolo
27 | PRODUCT_BRAND := bq
28 | PRODUCT_MODEL := Aquaris M5
29 | PRODUCT_MANUFACTURER := bq
30 |
--------------------------------------------------------------------------------
/bluetooth/bdroid_buildcfg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 The Android Open Source Project
3 | * Copyright (C) 2015 The CyanogenMod 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 | #ifndef _BDROID_BUILDCFG_H
19 | #define _BDROID_BUILDCFG_H
20 |
21 | #define BTM_DEF_LOCAL_NAME "bq Aquaris M5"
22 |
23 | // Disables read remote device feature
24 | #define BTA_SKIP_BLE_READ_REMOTE_FEAT FALSE
25 | #define MAX_ACL_CONNECTIONS 7
26 | #define MAX_L2CAP_CHANNELS 16
27 | #define BLE_VND_INCLUDED TRUE
28 | // skips conn update at conn completion
29 | #define BTA_BLE_SKIP_CONN_UPD FALSE
30 | #define BLE_PERIPHERAL_ADV_NAME FALSE
31 | #define BT_CLEAN_TURN_ON_DISABLED 1
32 | #endif
33 |
--------------------------------------------------------------------------------
/gps/core/Android.mk:
--------------------------------------------------------------------------------
1 | ifneq ($(BUILD_TINY_ANDROID),true)
2 |
3 | LOCAL_PATH := $(call my-dir)
4 |
5 | include $(CLEAR_VARS)
6 |
7 | LOCAL_MODULE := libloc_core
8 | LOCAL_MODULE_OWNER := qcom
9 |
10 | LOCAL_MODULE_TAGS := optional
11 |
12 | ifeq ($(TARGET_DEVICE),apq8026_lw)
13 | LOCAL_CFLAGS += -DPDK_FEATURE_SET
14 | endif
15 |
16 | LOCAL_SHARED_LIBRARIES := \
17 | libutils \
18 | libcutils \
19 | libgps.utils \
20 | libdl
21 |
22 | LOCAL_SRC_FILES += \
23 | MsgTask.cpp \
24 | LocApiBase.cpp \
25 | LocAdapterBase.cpp \
26 | ContextBase.cpp \
27 | LocDualContext.cpp \
28 | loc_core_log.cpp
29 |
30 | LOCAL_CFLAGS += \
31 | -fno-short-enums \
32 | -D_ANDROID_
33 |
34 | LOCAL_C_INCLUDES:= \
35 | $(TARGET_OUT_HEADERS)/gps.utils
36 |
37 | LOCAL_COPY_HEADERS_TO:= libloc_core/
38 | LOCAL_COPY_HEADERS:= \
39 | MsgTask.h \
40 | LocApiBase.h \
41 | LocAdapterBase.h \
42 | ContextBase.h \
43 | LocDualContext.h \
44 | LBSProxyBase.h \
45 | UlpProxyBase.h \
46 | gps_extended_c.h \
47 | gps_extended.h \
48 | loc_core_log.h \
49 | LocAdapterProxyBase.h
50 |
51 | LOCAL_PRELINK_MODULE := false
52 |
53 | include $(BUILD_SHARED_LIBRARY)
54 |
55 | endif # not BUILD_TINY_ANDROID
56 |
--------------------------------------------------------------------------------
/overlay/packages/services/Telephony/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
21 | true
22 |
23 |
24 | true
25 |
26 |
27 | true
28 |
29 |
30 |
--------------------------------------------------------------------------------
/gps/utils/Android.mk:
--------------------------------------------------------------------------------
1 | ifneq ($(BUILD_TINY_ANDROID),true)
2 | #Compile this library only for builds with the latest modem image
3 |
4 | LOCAL_PATH := $(call my-dir)
5 |
6 | include $(CLEAR_VARS)
7 |
8 | ## Libs
9 | LOCAL_SHARED_LIBRARIES := \
10 | libutils \
11 | libcutils \
12 | liblog
13 |
14 | LOCAL_SRC_FILES += \
15 | loc_log.cpp \
16 | loc_cfg.cpp \
17 | msg_q.c \
18 | linked_list.c \
19 | loc_target.cpp \
20 | loc_timer.c \
21 | ../platform_lib_abstractions/elapsed_millis_since_boot.cpp \
22 | loc_misc_utils.cpp
23 |
24 | LOCAL_CFLAGS += \
25 | -fno-short-enums \
26 | -D_ANDROID_
27 |
28 | ifeq ($(TARGET_BUILD_VARIANT),user)
29 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER
30 | endif
31 |
32 | LOCAL_LDFLAGS += -Wl,--export-dynamic
33 |
34 | ## Includes
35 | LOCAL_C_INCLUDES:= \
36 | $(LOCAL_PATH)/../platform_lib_abstractions
37 |
38 | LOCAL_COPY_HEADERS_TO:= gps.utils/
39 | LOCAL_COPY_HEADERS:= \
40 | loc_log.h \
41 | loc_cfg.h \
42 | log_util.h \
43 | linked_list.h \
44 | msg_q.h \
45 | loc_target.h \
46 | loc_timer.h \
47 | ../platform_lib_abstractions/platform_lib_includes.h \
48 | ../platform_lib_abstractions/platform_lib_time.h \
49 | ../platform_lib_abstractions/platform_lib_macros.h \
50 | loc_misc_utils.h
51 |
52 | LOCAL_MODULE := libgps.utils
53 |
54 | LOCAL_MODULE_TAGS := optional
55 |
56 | LOCAL_PRELINK_MODULE := false
57 |
58 | include $(BUILD_SHARED_LIBRARY)
59 | endif # not BUILD_TINY_ANDROID
60 |
--------------------------------------------------------------------------------
/gps/utils/Makefile.am:
--------------------------------------------------------------------------------
1 | AM_CFLAGS = -Wundef \
2 | -MD \
3 | -Wno-trigraphs \
4 | -g -O0 \
5 | -fno-inline \
6 | -fno-short-enums \
7 | -fpic \
8 | -I../platform_lib_abstractions
9 |
10 | libgps_utils_so_la_h_sources = log_util.h \
11 | msg_q.h \
12 | linked_list.h \
13 | loc_cfg.h \
14 | loc_log.h \
15 | ../platform_lib_abstractions/platform_lib_includes.h \
16 | ../platform_lib_abstractions/platform_lib_time.h \
17 | ../platform_lib_abstractions/platform_lib_macros.h
18 |
19 | libgps_utils_so_la_c_sources = linked_list.c \
20 | msg_q.c \
21 | loc_cfg.cpp \
22 | loc_log.cpp \
23 | ../platform_lib_abstractions/elapsed_millis_since_boot.cpp
24 |
25 | library_includedir = $(pkgincludedir)/utils
26 |
27 | library_include_HEADERS = $(libgps_utils_so_la_h_sources)
28 |
29 | libgps_utils_so_la_SOURCES = $(libgps_utils_so_la_c_sources)
30 |
31 | if USE_GLIB
32 | libgps_utils_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
33 | libgps_utils_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
34 | libgps_utils_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
35 | else
36 | libgps_utils_so_la_CFLAGS = $(AM_CFLAGS)
37 | libgps_utils_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
38 | libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
39 | endif
40 |
41 | libgps_utils_so_la_LIBADD = -lstdc++ -lcutils
42 |
43 | #Create and Install libraries
44 | lib_LTLIBRARIES = libgps_utils_so.la
45 |
--------------------------------------------------------------------------------
/rootdir/etc/init.atmel_ts.sh:
--------------------------------------------------------------------------------
1 | #!/system/bin/sh
2 |
3 | sleep 2
4 |
5 | insmod /data/temp/mxt.ko
6 |
7 | cd /sys/bus/i2c/devices/5-004a
8 |
9 | chown root root *
10 | chmod 666 update_cfg
11 | #chmod 666 update_fw
12 |
13 | #format: [family id]_[variant id]_[version]_[build].fw
14 | #format: [family id]_[variant id]_[version]_[build].raw
15 |
16 | #UID for config match
17 | #format: [family id]_[variant id]_[version]_[build].raw.[UID TAG]
18 | echo "2" > t19
19 |
20 | #enable f/w upgrade
21 | #echo "A4_15_2.2_AA.fw" > update_fw
22 |
23 | #update new config
24 | echo "A4_15_2.2_AA.raw" > update_cfg
25 |
26 | #for pid (pid name = 01)
27 | # switch to "A4_15_2.1_AA.raw.01"
28 |
29 | sleep 1
30 |
31 | #enable plugin
32 | #
33 | #format: pl enable [hex]
34 | #[0] : CAL
35 | #[1] : MSC
36 | #[2] : PI
37 | #[3] : CLIP
38 | #[4] : PLUG PAUSE
39 | echo "pl enable 6" > plugin
40 |
41 | #PTC auto tune (should enable MSC above,sleep 5s for tune complete)
42 | #[0] : tune not store
43 | #[1] : tune and store
44 | #[2] : re-tune and not store
45 | #[3] : re-tune and store
46 | #[other value] : report tune status
47 | #echo "msc ptc tune 1" > plugin
48 | #sleep 7
49 |
50 | #set gesture list
51 | #format: ; ;...
52 | #you could run command "cat gesture_list" for current config list
53 | #: bit[0]: enable
54 | # bit[1]: disable,
55 | # bit[3] status (1: excuted)
56 | #echo "LEFT 1;UNLOCK0 1;e 1;" > gesture_list
57 | echo "TAP 1;" > gesture_list
58 |
59 | #enable gesture feature
60 | #echo 1 > en_gesture
61 |
62 | #echo "pl enable 7" > plugin
63 | chmod 440 update_cfg
64 | #chmod 440 update_fw
65 |
66 |
--------------------------------------------------------------------------------
/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=0
11 | ACCEL_RANDOM_WALK_SPECTRAL_DENSITY=0
12 | ANGLE_RANDOM_WALK_SPECTRAL_DENSITY=0
13 | RATE_RANDOM_WALK_SPECTRAL_DENSITY=0
14 | VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY=0
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=0
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 |
--------------------------------------------------------------------------------
/cmhw/src/org/cyanogenmod/hardware/DisplayColorCalibration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 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.cyanogenmod.hardware;
18 |
19 | import java.io.File;
20 | import java.util.Scanner;
21 | import org.cyanogenmod.hardware.util.FileUtils;
22 |
23 | public class DisplayColorCalibration {
24 | private static final String COLOR_FILE = "/sys/class/graphics/fb0/rgb";
25 |
26 | public static boolean isSupported() {
27 | File f = new File(COLOR_FILE);
28 | return f.exists();
29 | }
30 |
31 | public static int getMaxValue() {
32 | return 32768;
33 | }
34 |
35 | public static int getMinValue() {
36 | return 255;
37 | }
38 |
39 | public static int getDefValue() {
40 | return getMaxValue();
41 | }
42 |
43 | public static String getCurColors() {
44 | return FileUtils.readOneLine(COLOR_FILE);
45 | }
46 |
47 | public static boolean setColors(String colors) {
48 | return FileUtils.writeLine(COLOR_FILE, colors);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/cmhw/src/org/cyanogenmod/hardware/KeyDisabler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 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.cyanogenmod.hardware;
18 |
19 | import org.cyanogenmod.hardware.util.FileUtils;
20 |
21 | import java.io.File;
22 |
23 | /*
24 | * Disable capacitive keys
25 | *
26 | * This is intended for use on devices in which the capacitive keys
27 | * can be fully disabled for replacement with a soft navbar. You
28 | * really should not be using this on a device with mechanical or
29 | * otherwise visible-when-inactive keys
30 | */
31 |
32 | public class KeyDisabler {
33 |
34 | private static String KEY_CONTROL_PATH = "/sys/devices/soc.0/78b9000.i2c/i2c-5/5-004a/disable_keys";
35 |
36 | public static boolean isSupported() {
37 | return new File(KEY_CONTROL_PATH).exists();
38 | }
39 |
40 | public static boolean isActive() {
41 | return Integer.parseInt(FileUtils.readOneLine(KEY_CONTROL_PATH)) == 1;
42 | }
43 |
44 | public static boolean setActive(boolean state) {
45 | return FileUtils.writeLine(KEY_CONTROL_PATH, state ? "1" : "0");
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/cmhw/src/org/cyanogenmod/hardware/VibratorHW.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 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.cyanogenmod.hardware;
18 |
19 | import org.cyanogenmod.hardware.util.FileUtils;
20 | import java.io.File;
21 |
22 | public class VibratorHW {
23 | private static String CONTROL_PATH = "/sys/devices/virtual/timed_output/vibrator/vtg_level";
24 |
25 | public static boolean isSupported() {
26 | return new File(CONTROL_PATH).exists();
27 | }
28 |
29 | public static int getMaxIntensity() {
30 | return 31;
31 | }
32 |
33 | public static int getMinIntensity() {
34 | return 19;
35 | }
36 |
37 | public static int getWarningThreshold() {
38 | return -1;
39 | }
40 |
41 | public static int getCurIntensity() {
42 | return Integer.parseInt(FileUtils.readOneLine(CONTROL_PATH));
43 | }
44 |
45 | public static int getDefaultIntensity() {
46 | return 27;
47 | }
48 |
49 | public static boolean setIntensity(int intensity) {
50 | return FileUtils.writeLine(CONTROL_PATH, String.valueOf(intensity));
51 | }
52 | }
--------------------------------------------------------------------------------
/wifi/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH:= $(call my-dir)
2 |
3 | ifeq ($(strip $(BOARD_HAS_QCOM_WLAN)),true)
4 |
5 | include $(CLEAR_VARS)
6 | LOCAL_MODULE := hostapd_default.conf
7 | LOCAL_MODULE_TAGS := optional
8 | LOCAL_MODULE_CLASS := ETC
9 | LOCAL_SRC_FILES := $(LOCAL_MODULE)
10 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/hostapd
11 | include $(BUILD_PREBUILT)
12 |
13 | include $(CLEAR_VARS)
14 | LOCAL_MODULE := p2p_supplicant_overlay.conf
15 | LOCAL_MODULE_TAGS := optional
16 | LOCAL_MODULE_CLASS := ETC
17 | LOCAL_SRC_FILES := $(LOCAL_MODULE)
18 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/wifi
19 | include $(BUILD_PREBUILT)
20 |
21 | include $(CLEAR_VARS)
22 | LOCAL_MODULE := wpa_supplicant_overlay.conf
23 | LOCAL_MODULE_TAGS := optional
24 | LOCAL_MODULE_CLASS := ETC
25 | LOCAL_SRC_FILES := $(LOCAL_MODULE)
26 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/wifi
27 | include $(BUILD_PREBUILT)
28 |
29 | include $(CLEAR_VARS)
30 | LOCAL_MODULE := WCNSS_cfg.dat
31 | LOCAL_MODULE_TAGS := optional
32 | LOCAL_MODULE_CLASS := ETC
33 | LOCAL_SRC_FILES := $(LOCAL_MODULE)
34 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima
35 | include $(BUILD_PREBUILT)
36 |
37 | include $(CLEAR_VARS)
38 | LOCAL_MODULE := WCNSS_qcom_wlan_nv.bin
39 | LOCAL_MODULE_TAGS := optional
40 | LOCAL_MODULE_CLASS := ETC
41 | LOCAL_SRC_FILES := $(LOCAL_MODULE)
42 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima
43 | include $(BUILD_PREBUILT)
44 |
45 | include $(CLEAR_VARS)
46 | LOCAL_MODULE := WCNSS_wlan_dictionary.dat
47 | LOCAL_MODULE_TAGS := optional
48 | LOCAL_MODULE_CLASS := ETC
49 | LOCAL_SRC_FILES := $(LOCAL_MODULE)
50 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware/wlan/prima
51 | include $(BUILD_PREBUILT)
52 |
53 | endif
54 |
--------------------------------------------------------------------------------
/keylayout/gpio-keys.kl:
--------------------------------------------------------------------------------
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 | key 115 VOLUME_UP
29 | key 114 VOLUME_DOWN
30 | key 102 HOME
31 | key 528 FOCUS
32 | key 766 CAMERA
33 |
--------------------------------------------------------------------------------
/keylayout/atmel_mxt_ts_T100_touchscreen.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 |
27 | key 139 MENU VIRTUAL
28 | key 172 HOME VIRTUAL
29 | key 158 BACK VIRTUAL
30 | key 217 SEARCH
31 | key 580 APP_SWITCH VIRTUAL
32 | key 116 POWER
33 |
34 |
--------------------------------------------------------------------------------
/rootdir/etc/fstab.qcom:
--------------------------------------------------------------------------------
1 | # Android fstab file.
2 | # The filesystem that contains the filesystem checker binary (typically /system) cannot
3 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
4 |
5 | #
6 |
7 | /dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait
8 | /dev/block/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1 wait,check
9 | /dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,check,encryptable=footer,length=-16384
10 | /dev/block/bootdevice/by-name/persist /persist ext4 nosuid,nodev,barrier=1 wait
11 | /dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=222,fmask=333,context=u:object_r:firmware_file:s0 wait
12 |
13 | /dev/block/bootdevice/by-name/boot /boot emmc defaults defaults
14 | /dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults
15 |
16 | /devices/soc.0/7864900.sdhci/mmc_host* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
17 | /devices/platform/msm_hsusb* auto auto defaults voldmanaged=usb:auto
18 |
--------------------------------------------------------------------------------
/rootdir/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH:= $(call my-dir)
2 |
3 | # Configuration scripts
4 |
5 | include $(CLEAR_VARS)
6 | LOCAL_MODULE := init.qcom.bt.sh
7 | LOCAL_MODULE_TAGS := optional eng
8 | LOCAL_MODULE_CLASS := ETC
9 | LOCAL_SRC_FILES := etc/init.qcom.bt.sh
10 | include $(BUILD_PREBUILT)
11 |
12 | include $(CLEAR_VARS)
13 | LOCAL_MODULE := init.atmel_ts.sh
14 | LOCAL_MODULE_TAGS := optional eng
15 | LOCAL_MODULE_CLASS := ETC
16 | LOCAL_SRC_FILES := etc/init.atmel_ts.sh
17 | include $(BUILD_PREBUILT)
18 |
19 | # Init scripts
20 |
21 | include $(CLEAR_VARS)
22 | LOCAL_MODULE := fstab.qcom
23 | LOCAL_MODULE_TAGS := optional eng
24 | LOCAL_MODULE_CLASS := ETC
25 | LOCAL_SRC_FILES := etc/fstab.qcom
26 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
27 | include $(BUILD_PREBUILT)
28 |
29 | include $(CLEAR_VARS)
30 | LOCAL_MODULE := init.qcom.usb.rc
31 | LOCAL_MODULE_TAGS := optional eng
32 | LOCAL_MODULE_CLASS := ETC
33 | LOCAL_SRC_FILES := etc/init.qcom.usb.rc
34 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
35 | include $(BUILD_PREBUILT)
36 |
37 | include $(CLEAR_VARS)
38 | LOCAL_MODULE := init.qcom.rc
39 | LOCAL_MODULE_TAGS := optional eng
40 | LOCAL_MODULE_CLASS := ETC
41 | LOCAL_SRC_FILES := etc/init.qcom.rc
42 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
43 | include $(BUILD_PREBUILT)
44 |
45 | include $(CLEAR_VARS)
46 | LOCAL_MODULE := init.qcom.power.rc
47 | LOCAL_MODULE_TAGS := optional eng
48 | LOCAL_MODULE_CLASS := ETC
49 | LOCAL_SRC_FILES := etc/init.qcom.power.rc
50 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
51 | include $(BUILD_PREBUILT)
52 |
53 | include $(CLEAR_VARS)
54 | LOCAL_MODULE := ueventd.qcom.rc
55 | LOCAL_MODULE_TAGS := optional eng
56 | LOCAL_MODULE_CLASS := ETC
57 | LOCAL_SRC_FILES := etc/ueventd.qcom.rc
58 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
59 | include $(BUILD_PREBUILT)
60 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/gps/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 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Snap/res/values/qcomarrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
23 |
24 |
25 |
26 |
27 | - @string/pref_camera_hfr_entry_off
28 | - @string/pref_camera_hfr_entry_2x
29 | - @string/pref_camera_hfr_entry_3x
30 | - @string/pref_camera_hfr_entry_4x
31 | - @string/pref_camera_hfr_entry_hsr_60
32 | - @string/pref_camera_hfr_entry_hsr_90
33 | - @string/pref_camera_hfr_entry_hsr_120
34 |
35 |
36 |
37 | - off
38 | - hfr60
39 | - hfr90
40 | - hfr120
41 | - hsr60
42 | - hsr90
43 | - hsr120
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/gps/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 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 | true
35 |
36 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/xml/power_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | - 0
4 | - 54
5 | - 229
6 | - 133
7 | - 2.1
8 | - 1.23
9 | - 228
10 | - 99
11 | - 46.1
12 | - 93.2
13 | - 443
14 | - 430
15 | - 131.6
16 | - 242
17 | - 42.1
18 |
19 | 18
20 | 4
21 |
22 |
23 | 200000
24 | 345600
25 | 400000
26 | 533333
27 | 800000
28 | 960000
29 | 1113600
30 | 1344000
31 | 1459200
32 |
33 | - 3.9
34 | - 15
35 |
36 | 46
37 | 95
38 | 102
39 | 144
40 | 176
41 | 199
42 | 314
43 | 379
44 | 403
45 |
46 | - 3120
47 |
48 | .0002
49 | .002
50 | .02
51 | .2
52 | 2
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 |
--------------------------------------------------------------------------------
/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=0x03
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/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 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Bluetooth/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 | true
34 | true
35 | true
36 | true
37 |
38 |
--------------------------------------------------------------------------------
/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 |
35 | #define NMEA_SENTENCE_MAX_LENGTH 200
36 |
37 | void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p);
38 | int loc_eng_nmea_put_checksum(char *pNmea, int maxSize);
39 | void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const GpsSvStatus &svStatus, const GpsLocationExtended &locationExtended);
40 | 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);
41 |
42 | #endif // LOC_ENG_NMEA_H
43 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/libshim/gui/SensorManager.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 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 | #ifndef ANDROID_GUI_SENSOR_MANAGER_H
18 | #define ANDROID_GUI_SENSOR_MANAGER_H
19 |
20 | #include
21 | #include
22 |
23 | #include
24 |
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 | #include
31 |
32 | // ----------------------------------------------------------------------------
33 | // Concrete types for the NDK
34 | struct ASensorManager { };
35 |
36 | // ----------------------------------------------------------------------------
37 | namespace android {
38 | // ----------------------------------------------------------------------------
39 |
40 | class ISensorServer;
41 | class Sensor;
42 | class SensorEventQueue;
43 |
44 | // ----------------------------------------------------------------------------
45 |
46 | class SensorManager :
47 | public ASensorManager,
48 | public Singleton
49 | {
50 | public:
51 | SensorManager();
52 | ~SensorManager();
53 |
54 | ssize_t getSensorList(Sensor const* const** list) const;
55 | Sensor const* getDefaultSensor(int type);
56 | sp createEventQueue();
57 |
58 | private:
59 | // DeathRecipient interface
60 | void sensorManagerDied();
61 |
62 | status_t assertStateLocked() const;
63 |
64 | private:
65 | mutable Mutex mLock;
66 | mutable sp mSensorServer;
67 | mutable Sensor const** mSensorList;
68 | mutable Vector mSensors;
69 | mutable sp mDeathObserver;
70 | };
71 |
72 | // ----------------------------------------------------------------------------
73 | }; // namespace android
74 |
75 | #endif // ANDROID_GUI_SENSOR_MANAGER_H
76 |
77 |
--------------------------------------------------------------------------------
/gps/utils/loc_timer.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 |
30 | #ifndef __LOC_DELAY_H__
31 | #define __LOC_DELAY_H__
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif /* __cplusplus */
36 | #include
37 | #include "log_util.h"
38 |
39 | /*
40 | Return values:
41 | Success = 0
42 | Failure = Non zero
43 | */
44 | typedef void(*loc_timer_callback)(void *user_data, int result);
45 |
46 |
47 | /*
48 | Returns the handle, which can be used to stop the timer
49 | */
50 | void* loc_timer_start(unsigned int delay_msec,
51 | loc_timer_callback,
52 | void* user_data);
53 |
54 | /*
55 | handle becomes invalid upon the return of the callback
56 | */
57 | void loc_timer_stop(void* handle);
58 |
59 | #ifdef __cplusplus
60 | }
61 | #endif /* __cplusplus */
62 |
63 | #endif //__LOC_DELAY_H__
64 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/gps/utils/loc_log.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 |
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 "loc_target.h"
40 |
41 | typedef struct
42 | {
43 | char name[128];
44 | long val;
45 | } loc_name_val_s_type;
46 |
47 | #define NAME_VAL(x) {"" #x "", x }
48 |
49 | #define UNKNOWN_STR "UNKNOWN"
50 |
51 | #define CHECK_MASK(type, value, mask_var, mask) \
52 | ((mask_var & mask) ? (type) value : (type) (-1))
53 |
54 | /* Get names from value */
55 | const char* loc_get_name_from_mask(loc_name_val_s_type table[], int table_size, long mask);
56 | const char* loc_get_name_from_val(loc_name_val_s_type table[], int table_size, long value);
57 | const char* loc_get_msg_q_status(int status);
58 | const char* loc_get_target_name(unsigned int target);
59 |
60 | extern const char* log_succ_fail_string(int is_succ);
61 |
62 | extern char *loc_get_time(char *time_string, unsigned long buf_size);
63 |
64 | #ifdef __cplusplus
65 | }
66 | #endif
67 |
68 | #endif /* LOC_LOG_H */
69 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/gps/core/MsgTask.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 | #ifndef __MSG_TASK__
30 | #define __MSG_TASK__
31 |
32 | #include
33 | #include
34 | #include
35 | #include
36 |
37 | namespace loc_core {
38 |
39 | struct LocMsg {
40 | inline LocMsg() {}
41 | inline virtual ~LocMsg() {}
42 | virtual void proc() const = 0;
43 | inline virtual void log() const {}
44 | };
45 |
46 | class MsgTask {
47 | public:
48 | typedef void* (*tStart)(void*);
49 | typedef pthread_t (*tCreate)(const char* name, tStart start, void* arg);
50 | typedef int (*tAssociate)();
51 | MsgTask(tCreate tCreator, const char* threadName);
52 | MsgTask(tAssociate tAssociator, const char* threadName);
53 | ~MsgTask();
54 | void sendMsg(const LocMsg* msg) const;
55 | void associate(tAssociate tAssociator) const;
56 |
57 | private:
58 | const void* mQ;
59 | tAssociate mAssociator;
60 | MsgTask(const void* q, tAssociate associator);
61 | static void* loopMain(void* copy);
62 | void createPThread(const char* name);
63 | };
64 |
65 | } // namespace loc_core
66 |
67 | #endif //__MSG_TASK__
68 |
--------------------------------------------------------------------------------
/gps/loc_api/libloc_api_50001/Makefile.am:
--------------------------------------------------------------------------------
1 | AM_CFLAGS = \
2 | -I../../utils \
3 | -I../../platform_lib_abstractions \
4 | -fno-short-enums \
5 | -DFEATURE_GNSS_BIT_API
6 |
7 | libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp
8 |
9 | if USE_GLIB
10 | libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
11 | libloc_adapter_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
12 | libloc_adapter_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
13 | else
14 | libloc_adapter_so_la_CFLAGS = $(AM_CFLAGS)
15 | libloc_adapter_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
16 | libloc_adapter_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
17 | endif
18 | libloc_adapter_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la
19 |
20 |
21 | libloc_eng_so_la_SOURCES = \
22 | loc_eng.cpp \
23 | loc_eng_agps.cpp \
24 | loc_eng_xtra.cpp \
25 | loc_eng_ni.cpp \
26 | loc_eng_log.cpp \
27 | loc_eng_dmn_conn.cpp \
28 | loc_eng_dmn_conn_handler.cpp \
29 | loc_eng_dmn_conn_thread_helper.c \
30 | loc_eng_dmn_conn_glue_msg.c \
31 | loc_eng_dmn_conn_glue_pipe.c
32 |
33 |
34 | if USE_GLIB
35 | libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
36 | libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
37 | libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
38 | else
39 | libloc_eng_so_la_CFLAGS = $(AM_CFLAGS)
40 | libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
41 | libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
42 | endif
43 |
44 | libloc_eng_so_la_LIBADD = -lstdc++ -lcutils -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la
45 |
46 |
47 | libgps_default_so_la_SOURCES = \
48 | loc.cpp \
49 | gps.c
50 |
51 | if USE_GLIB
52 | libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
53 | libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
54 | libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
55 | else
56 | libgps_default_so_la_CFLAGS = $(AM_CFLAGS)
57 | libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
58 | libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
59 | endif
60 |
61 | libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la
62 |
63 | library_include_HEADERS = \
64 | LocEngAdapter.h \
65 | loc.h \
66 | loc_eng.h \
67 | loc_eng_xtra.h \
68 | loc_eng_ni.h \
69 | loc_eng_agps.h \
70 | loc_eng_msg.h \
71 | loc_eng_log.h
72 |
73 | library_includedir = $(pkgincludedir)/libloc_api_50001
74 |
75 | #Create and Install libraries
76 | lib_LTLIBRARIES = libloc_adapter_so.la libloc_eng_so.la libgps_default_so.la
77 |
--------------------------------------------------------------------------------
/gps/core/LBSProxyBase.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013-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 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 | return NULL;
47 | }
48 | protected:
49 | inline LBSProxyBase() {}
50 | public:
51 | inline virtual ~LBSProxyBase() {}
52 | inline virtual void requestUlp(LocAdapterBase* adapter,
53 | unsigned long capabilities) const {}
54 | inline virtual bool hasAgpsExtendedCapabilities() const { return false; }
55 | inline virtual bool hasCPIExtendedCapabilities() const { return false; }
56 | virtual void injectFeatureConfig(ContextBase* context) const {}
57 | };
58 |
59 | typedef LBSProxyBase* (getLBSProxy_t)();
60 |
61 | } // namespace loc_core
62 |
63 | #endif // IZAT_PROXY_BASE_H
64 |
--------------------------------------------------------------------------------
/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 | };
61 |
62 | } // namespace loc_core
63 |
64 | #endif //LOC_ADAPTER_PROXY_BASE_H
65 |
--------------------------------------------------------------------------------
/nfc/libnfc-brcm-20795a20.conf:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Firmware patch file
3 | FW_PATCH="/vendor/firmware/BCM20795A2_001.003.025.0005.0035_Generic_I2C_NCD_Unsigned_configdata.ncd"
4 |
5 | ###############################################################################
6 | # Firmware pre-patch file (sent before the above patch file)
7 | #FW_PRE_PATCH="/vendor/firmware/BCM20795A2_001.003.025.0005.0000_Generic_I2C_NCD_Unsigned_configdata.ncd"
8 |
9 | ###############################################################################
10 | # LPTD mode configuration
11 | LPTD_CFG={10:B9:0E:01:00:FF:FF:00:00:8B:13:00:10:00:06:00:00}
12 |
13 | ###############################################################################
14 | # Reverse LPTD mode configuration
15 | REV_LPTD_CFG={03:B9:01:39}
16 |
17 | ###############################################################################
18 | # Startup Configuration (256 bytes maximum)
19 | #NFA_DM_START_UP_CFG={1A:80:01:01:E3:04:00:01:1D:0F:E4:08:5C:16:00:00:00:00:00:00:CA:05:00:00:00:00:08}
20 |
21 | # Baseline Add E2 E5 D6 DD parameter
22 | #NFA_DM_START_UP_CFG={80:80:01:01:E3:04:00:01:1D:0F:E4:08:5C:16:00:00:00:00:00:00:CA:05:00:00:00:00:08:E2:08:67:1D:00:12:20:00:00:00:E5:0D:8A:5A:01:72:62:11:05:04:12:6D:0A:00:14:D6:0D:01:02:00:00:00:00:00:00:01:00:00:00:00:DD:3C:00:00:20:00:00:00:01:85:00:00:00:00:00:00:55:55:55:55:55:55:55:55:55:55:55:55:55:00:A8:00:02:6D:50:77:82:E3:4C:7F:6D:54:97:42:E3:8C:0F:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00}
23 |
24 | # Reviewed By US team
25 | #NFA_DM_START_UP_CFG={63:80:01:01:E3:04:00:01:16:0D:E4:09:5C:16:08:08:06:04:03:02:00:CA:05:00:00:00:00:08:E2:05:67:1D:00:12:20:E5:0D:8A:5A:01:72:62:11:05:04:12:6D:0A:00:14:D6:01:01:DD:2D:00:00:20:00:00:00:01:85:00:00:00:00:00:00:55:55:55:55:55:55:55:55:55:55:55:55:55:00:A8:00:02:6D:50:77:82:E3:4C:7F:6D:54:97:42:E3:8C:0F}
26 |
27 | # AFE3-CLM Based on TCL-Ido3-4.7
28 | NFA_DM_START_UP_CFG={66:80:01:01:E2:04:67:1D:00:12:E3:04:02:00:1D:0F:E4:09:56:22:00:00:00:00:00:00:00:E5:0D:89:59:00:70:56:11:05:04:12:60:0A:00:14:CA:05:00:00:00:00:08:D6:01:00:DD:2D:00:00:20:00:00:00:01:85:00:00:00:00:00:00:55:55:55:55:55:55:55:55:55:55:55:55:55:00:A8:00:02:60:60:77:82:E3:4C:7F:60:60:97:42:E3:8C:0F:E1:02:69:01}
29 |
30 | ###############################################################################
31 | # Pre-Discovery Startup Configuration (256 bytes maximum)
32 | NFA_DM_PRE_DISCOVERY_CFG={0A:C2:08:03:00:C3:04:40:4B:4C:00}
33 |
34 | #NFA_DM_PRE_DISCOVERY_CFG={0A:C2:08:13:00:C3:04:40:4B:4C:00}
35 |
36 | ###############################################################################
37 | # Snooze Mode Settings
38 | SNOOZE_MODE_CFG={08:00:00:00:01}
39 |
40 | ###############################################################################
41 | # Choose the presence-check algorithm for type-4 tag.
42 | PRESENCE_CHECK_ALGORITHM=1
43 |
44 |
--------------------------------------------------------------------------------
/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/loc_api/libloc_api_50001/Android.mk:
--------------------------------------------------------------------------------
1 | ifneq ($(BUILD_TINY_ANDROID),true)
2 | #Compile this library only for builds with the latest modem image
3 |
4 | LOCAL_PATH := $(call my-dir)
5 |
6 | include $(CLEAR_VARS)
7 |
8 | LOCAL_MODULE := libloc_eng
9 | LOCAL_MODULE_OWNER := qcom
10 |
11 | LOCAL_MODULE_TAGS := optional
12 |
13 | LOCAL_SHARED_LIBRARIES := \
14 | libutils \
15 | libcutils \
16 | libdl \
17 | liblog \
18 | libloc_core \
19 | libgps.utils
20 |
21 | LOCAL_SRC_FILES += \
22 | loc_eng.cpp \
23 | loc_eng_agps.cpp \
24 | loc_eng_xtra.cpp \
25 | loc_eng_ni.cpp \
26 | loc_eng_log.cpp \
27 | loc_eng_nmea.cpp \
28 | LocEngAdapter.cpp
29 |
30 | LOCAL_SRC_FILES += \
31 | loc_eng_dmn_conn.cpp \
32 | loc_eng_dmn_conn_handler.cpp \
33 | loc_eng_dmn_conn_thread_helper.c \
34 | loc_eng_dmn_conn_glue_msg.c \
35 | loc_eng_dmn_conn_glue_pipe.c
36 |
37 | LOCAL_CFLAGS += \
38 | -fno-short-enums \
39 | -D_ANDROID_
40 |
41 | LOCAL_C_INCLUDES:= \
42 | $(TARGET_OUT_HEADERS)/gps.utils \
43 | $(TARGET_OUT_HEADERS)/libloc_core \
44 | $(LOCAL_PATH)
45 |
46 | LOCAL_COPY_HEADERS_TO:= libloc_eng/
47 | LOCAL_COPY_HEADERS:= \
48 | LocEngAdapter.h \
49 | loc.h \
50 | loc_eng.h \
51 | loc_eng_xtra.h \
52 | loc_eng_ni.h \
53 | loc_eng_agps.h \
54 | loc_eng_msg.h \
55 | loc_eng_log.h
56 |
57 | LOCAL_PRELINK_MODULE := false
58 |
59 | include $(BUILD_SHARED_LIBRARY)
60 |
61 | include $(CLEAR_VARS)
62 |
63 | LOCAL_MODULE := gps.$(TARGET_BOARD_PLATFORM)
64 | LOCAL_MODULE_OWNER := qcom
65 |
66 | LOCAL_MODULE_TAGS := optional
67 |
68 | ## Libs
69 |
70 | LOCAL_SHARED_LIBRARIES := \
71 | libutils \
72 | libcutils \
73 | liblog \
74 | libloc_eng \
75 | libloc_core \
76 | libgps.utils \
77 | libdl
78 |
79 | ifneq ($(filter $(TARGET_DEVICE), apq8084 msm8960), false)
80 | endif
81 |
82 | LOCAL_SRC_FILES += \
83 | loc.cpp \
84 | gps.c
85 |
86 | LOCAL_CFLAGS += \
87 | -fno-short-enums \
88 | -D_ANDROID_ \
89 |
90 | ifeq ($(TARGET_USES_QCOM_BSP), true)
91 | LOCAL_CFLAGS += -DTARGET_USES_QCOM_BSP
92 | endif
93 |
94 | ## Includes
95 | LOCAL_C_INCLUDES:= \
96 | $(TARGET_OUT_HEADERS)/gps.utils \
97 | $(TARGET_OUT_HEADERS)/libloc_core
98 |
99 | #ifeq ($(filter $(TARGET_DEVICE), apq8064 msm8960),)
100 | #$(call print-vars, $(TARGET_DEVICE))
101 | #LOCAL_SHARED_LIBRARIES += \
102 | # libmdmdetect \
103 | # libperipheral_client
104 | #
105 | #LOCAL_C_INCLUDES += \
106 | # $(TARGET_OUT_HEADERS)/libmdmdetect/inc \
107 | # $(TARGET_OUT_HEADERS)/libperipheralclient/inc
108 | #LOCAL_CFLAGS += \
109 | # -DMODEM_POWER_VOTE
110 | #endif
111 |
112 | LOCAL_PRELINK_MODULE := false
113 | LOCAL_MODULE_RELATIVE_PATH := hw
114 |
115 | include $(BUILD_SHARED_LIBRARY)
116 |
117 | endif # not BUILD_TINY_ANDROID
118 |
--------------------------------------------------------------------------------
/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 | typedef void (*loc_shutdown_cb) (void);
48 |
49 | typedef struct {
50 | loc_location_cb_ext location_cb;
51 | gps_status_callback status_cb;
52 | loc_sv_status_cb_ext sv_status_cb;
53 | gps_nmea_callback nmea_cb;
54 | gps_set_capabilities set_capabilities_cb;
55 | gps_acquire_wakelock acquire_wakelock_cb;
56 | gps_release_wakelock release_wakelock_cb;
57 | gps_create_thread create_thread_cb;
58 | loc_ext_parser location_ext_parser;
59 | loc_ext_parser sv_ext_parser;
60 | gps_request_utc_time request_utc_time_cb;
61 | loc_shutdown_cb shutdown_cb;
62 | } LocCallbacks;
63 |
64 | #ifdef __cplusplus
65 | }
66 | #endif /* __cplusplus */
67 |
68 | #endif //__LOC_H__
69 |
--------------------------------------------------------------------------------
/nfc/nfcee_access.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/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 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 | #include
32 | #include
33 |
34 | extern const GpsInterface* get_gps_interface();
35 |
36 | const GpsInterface* gps__get_gps_interface(struct gps_device_t* dev)
37 | {
38 | return get_gps_interface();
39 | }
40 |
41 | static int open_gps(const struct hw_module_t* module, char const* name,
42 | struct hw_device_t** device)
43 | {
44 | struct gps_device_t *dev = (struct gps_device_t *) malloc(sizeof(struct gps_device_t));
45 |
46 | if(dev == NULL)
47 | return -1;
48 |
49 | memset(dev, 0, sizeof(*dev));
50 |
51 | dev->common.tag = HARDWARE_DEVICE_TAG;
52 | dev->common.version = 0;
53 | dev->common.module = (struct hw_module_t*)module;
54 | dev->get_gps_interface = gps__get_gps_interface;
55 |
56 | *device = (struct hw_device_t*)dev;
57 | return 0;
58 | }
59 |
60 | static struct hw_module_methods_t gps_module_methods = {
61 | .open = open_gps
62 | };
63 |
64 | struct hw_module_t HAL_MODULE_INFO_SYM = {
65 | .tag = HARDWARE_MODULE_TAG,
66 | .module_api_version = 1,
67 | .hal_api_version = 0,
68 | .id = GPS_HARDWARE_MODULE_ID,
69 | .name = "loc_api GPS Module",
70 | .author = "Qualcomm USA, Inc.",
71 | .methods = &gps_module_methods,
72 | };
73 |
--------------------------------------------------------------------------------
/gps/core/ContextBase.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_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 requestUlp(LocAdapterBase* adapter,
62 | unsigned long capabilities) {
63 | mLBSProxy->requestUlp(adapter, capabilities);
64 | }
65 | inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); }
66 | };
67 |
68 | } // namespace loc_core
69 |
70 | #endif //__LOC_CONTEXT_BASE__
71 |
--------------------------------------------------------------------------------
/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_PDS TARGET_SET(GNSS_PDS, NO_SSC)
39 | #define TARGET_AUTO TARGET_SET(GNSS_AUTO, NO_SSC)
40 | #define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC)
41 | #define getTargetGnssType(target) (target>>1)
42 |
43 | #ifdef __cplusplus
44 | extern "C"
45 | {
46 | #endif
47 |
48 | unsigned int loc_get_target(void);
49 |
50 | /*The character array passed to this function should have length
51 | of atleast PROPERTY_VALUE_MAX*/
52 | void loc_get_target_baseband(char *baseband, int array_length);
53 | /*The character array passed to this function should have length
54 | of atleast PROPERTY_VALUE_MAX*/
55 | void loc_get_platform_name(char *platform_name, int array_length);
56 |
57 | /* Please remember to update 'target_name' in loc_log.cpp,
58 | if do any changes to this enum. */
59 | typedef enum {
60 | GNSS_NONE = 0,
61 | GNSS_MSM,
62 | GNSS_GSS,
63 | GNSS_MDM,
64 | GNSS_QCA1530,
65 | GNSS_PDS,
66 | GNSS_AUTO,
67 | GNSS_UNKNOWN
68 | }GNSS_TARGET;
69 |
70 | typedef enum {
71 | NO_SSC = 0,
72 | HAS_SSC
73 | }SSC_TYPE;
74 |
75 | #ifdef __cplusplus
76 | }
77 | #endif
78 |
79 | #endif /*LOC_TARGET_H*/
80 |
--------------------------------------------------------------------------------
/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(MsgTask::tCreate tCreator,
45 | const char* name);
46 | static const MsgTask* getMsgTask(MsgTask::tAssociate tAssociate,
47 | const char* name);
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(MsgTask::tCreate tCreator,
61 | const char* name);
62 | static ContextBase* getLocFgContext(MsgTask::tAssociate tAssociate,
63 | const char* name);
64 | static ContextBase* getLocBgContext(MsgTask::tCreate tCreator,
65 | const char* name);
66 | static ContextBase* getLocBgContext(MsgTask::tAssociate tAssociate,
67 | const char* name);
68 | static void injectFeatureConfig(ContextBase *context);
69 | };
70 |
71 | }
72 |
73 | #endif //__LOC_ENG_CONTEXT__
74 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/system.prop:
--------------------------------------------------------------------------------
1 |
2 | # Audio
3 | ro.qc.sdk.audio.ssr=false
4 | ro.qc.sdk.audio.fluencetype=fluence
5 | persist.audio.fluence.voicecall=true
6 | persist.audio.fluence.voicerec=false
7 | persist.audio.fluence.speaker=true
8 | tunnel.audio.encode=false
9 | audio.offload.buffer.size.kb=64
10 | audio.offload.min.duration.secs=30
11 | audio.offload.gapless.enabled=true
12 | audio.offload.video=true
13 | audio.deep_buffer.media=true
14 | use.voice.path.for.pcm.voip=true
15 | voice.playback.conc.disabled=true
16 | voice.record.conc.disabled=true
17 | voice.voip.conc.disabled=true
18 | ro.fm.transmitter=false
19 | persist.sys.fm=qn8035
20 |
21 | # Camera
22 | morpho.hdr.enable=1
23 | morpho.hdr.nthreads=8
24 | morpho.hdr.dumpframe=0
25 | morpho.hdr.ghostdsl=4
26 | morpho.hdr.reliablerrt=85
27 | morpho.hdr.ghostrt=60
28 | morpho.hdr.failsoftms=1
29 | morpho.hdr.ghostrsl=6
30 | morpho.hdr.fmcolorcontrast=8
31 | morpho.hdr.fmcolorsaturation=2
32 | morpho.hdr.ev0=0
33 | morpho.hdr.ev1=-9
34 | morpho.hdr.ev2=9
35 | morpho.denoiser.enable=0
36 | morpho.denoiser.nthreads=4
37 | morpho.denoiser.lumanrl=3
38 | morpho.denoiser.chromanrl=3
39 | morpho.denoiser.spikenoise=1
40 | morpho.denoiser.umaskthreshold=0
41 | morpho.denoiser.umaskweight=256
42 | persist.camera.cpp.duplication=false
43 | persist.camera.pip.support=0
44 |
45 | # CNE
46 | persist.cne.feature=1
47 |
48 | # Display
49 | debug.composition.type=c2d
50 | persist.hwc.mdpcomp.enable=true
51 | debug.mdpcomp.idletime=600
52 | debug.sf.gpu_comp_tiling=1
53 | sys.hwc.gpu_perf_mode=1
54 | debug.enable.sglscale=1
55 | ro.opengles.version=196609
56 | ro.sf.lcd_density=480
57 |
58 | # Enable B service
59 | ro.sys.fw.bservice_enable=true
60 | ro.sys.fw.bservice_limit=5
61 | ro.sys.fw.bservice_age=5000
62 |
63 | # Factory reset protection
64 | ro.frp.pst=/dev/block/bootdevice/by-name/config
65 |
66 | # GPS
67 | ro.gps.agps_provider=1
68 | ro.qc.sdk.izat.premium.enabled=0
69 | ro.qc.sdk.izat.service_mask=0x0
70 | persist.gps.qc_nlp_in_use=0
71 |
72 | # Media
73 | media.stagefright.enable-player=true
74 | media.stagefright.enable-http=true
75 | media.stagefright.enable-aac=true
76 | media.stagefright.enable-qcp=true
77 | media.stagefright.enable-fma2dp=true
78 | media.stagefright.enable-scan=true
79 | media.msm8939hw=0
80 | media.msm8929hw=0
81 | mm.enable.smoothstreaming=true
82 | mmp.enable.3g2=true
83 | media.aac_51_output_enabled=true
84 | media.stagefright.use-awesome=false
85 | vidc.enc.narrow.searchrange=1
86 | drm.service.enabled=1
87 |
88 | # Perfd
89 | ro.min_freq_0=960000
90 | ro.min_freq_4=800000
91 |
92 | # Set max background services
93 | ro.config.max_starting_bg=8
94 |
95 | # Telephony
96 | rild.libpath=/system/vendor/lib/libril-qc-qmi-1.so
97 | rild.libargs=-d /dev/smd0
98 | ril.subscription.types=NV,RUIM
99 | persist.data.netmgrd.qos.enable=true
100 | telephony.lteOnCdmaDevice=1
101 | persist.radio.rat_on=combine
102 | persist.data.qmi.adb_logmask=0
103 | persist.radio.apm_sim_not_pwdn=1
104 | persist.radio.multisim.config=dsds
105 | persist.env.spec=Default
106 | persist.radio.mode_pref_nv10=0
107 | persist.radio.proc_nw_scan=1
108 | persist.radio.disable_flexmap=1
109 | persist.radio.sib16_support=1
110 | ro.telephony.call_ring.multiple=false
111 | ro.telephony.ril.config=simactivation
112 |
113 | # Trim
114 | ro.sys.fw.use_trim_settings=true
115 | ro.sys.fw.empty_app_percent=50
116 | ro.sys.fw.trim_empty_percent=100
117 | ro.sys.fw.trim_cache_percent=100
118 | ro.sys.fw.trim_enable_memory=1073741824
119 |
120 | # OTA
121 | cm.updater.uri=https://ota1.randomdroids.com/api
122 |
123 | # USB
124 | ro.sys.usb.default.config=diag,serial_smd,serial_tty,mass_storage,adb
125 |
126 | # WiFi
127 | ro.disableWifiApFirmwareReload=true
128 |
--------------------------------------------------------------------------------
/gps/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/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=http://xtrapath1.izatcloud.net/xtra2.bin
4 | #XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra2.bin
5 | #XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra2.bin
6 |
7 | #Version check for XTRA
8 | #DISABLE = 0
9 | #AUTO = 1
10 | #XTRA2 = 2
11 | #XTRA3 = 3
12 | XTRA_VERSION_CHECK=0
13 |
14 | # Error Estimate
15 | # _SET = 1
16 | # _CLEAR = 0
17 | ERR_ESTIMATE=0
18 |
19 | #Test
20 | NTP_SERVER=time.gpsonextra.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 = 3
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 1.0
44 | SUPL_VER=0x20000
45 |
46 | # Emergency SUPL, 1=enable, 0=disable
47 | SUPL_ES=1
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=
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=0x37
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.google.com
80 | SUPL_PORT=7275
81 |
82 | # FOR C2K PDE SUPPORT, set the following
83 | # C2K_HOST=c2k.pde.com or IP
84 | # C2K_PORT=1234
85 |
86 | # Bitmask of slots that are available
87 | # for write/install to, where 1s indicate writable,
88 | # and the default value is 0 where no slots
89 | # are writable. For example, AGPS_CERT_WRITABLE_MASK
90 | # of b1000001010 makes 3 slots available
91 | # and the remaining 7 slots unwritable.
92 | #AGPS_CERT_WRITABLE_MASK=0
93 |
94 | ####################################
95 | # LTE Positioning Profile Settings
96 | ####################################
97 | # 0: Enable RRLP on LTE(Default)
98 | # 1: Enable LPP_User_Plane on LTE
99 | # 2: Enable LPP_Control_Plane
100 | # 3: Enable both LPP_User_Plane and LPP_Control_Plane
101 | LPP_PROFILE = 0
102 |
103 | ################################
104 | # EXTRA SETTINGS
105 | ################################
106 | # NMEA provider (1=Modem Processor, 0=Application Processor)
107 | NMEA_PROVIDER=0
108 | # Mark if it is a SGLTE target (1=SGLTE, 0=nonSGLTE)
109 | SGLTE_TARGET=0
110 |
111 | ##################################################
112 | # Select Positioning Protocol on A-GLONASS system
113 | ##################################################
114 | # 0x1: RRC CPlane
115 | # 0x2: RRLP UPlane
116 | # 0x4: LLP Uplane
117 | A_GLONASS_POS_PROTOCOL_SELECT = 0
118 |
--------------------------------------------------------------------------------
/gps/core/UlpProxyBase.h:
--------------------------------------------------------------------------------
1 | /* Copyright (c) 2013-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 ULP_PROXY_BASE_H
30 | #define ULP_PROXY_BASE_H
31 |
32 | #include
33 |
34 | namespace loc_core {
35 |
36 | class LocAdapterBase;
37 |
38 | class UlpProxyBase {
39 | public:
40 | LocPosMode mPosMode;
41 | bool mFixSet;
42 | inline UlpProxyBase() {
43 | mPosMode.mode = LOC_POSITION_MODE_INVALID;
44 | mFixSet = false;
45 | }
46 | inline virtual ~UlpProxyBase() {}
47 | inline virtual bool sendStartFix() { mFixSet = true; return false; }
48 | inline virtual bool sendStopFix() { mFixSet = false; return false; }
49 | inline virtual bool sendFixMode(LocPosMode ¶ms) {
50 | mPosMode = params;
51 | return false;
52 | }
53 |
54 | inline virtual bool reportPosition(UlpLocation &location,
55 | GpsLocationExtended &locationExtended,
56 | void* locationExt,
57 | enum loc_sess_status status,
58 | LocPosTechMask loc_technology_mask) {
59 | return false;
60 | }
61 | inline virtual bool reportSv(GpsSvStatus &svStatus,
62 | GpsLocationExtended &locationExtended,
63 | void* svExt) {
64 | return false;
65 | }
66 | inline virtual bool reportStatus(GpsStatusValue status) {
67 | return false;
68 | }
69 | inline virtual void setAdapter(LocAdapterBase* adapter) {}
70 | inline virtual void setCapabilities(unsigned long capabilities) {}
71 | inline virtual bool reportBatchingSession(GpsExtBatchOptions &options,
72 | bool active) {
73 | return false;
74 | }
75 | inline virtual bool reportPositions(GpsExtLocation * locations,
76 | int32_t number_of_locations,
77 | enum loc_sess_status status,
78 | LocPosTechMask techMask) {
79 | return false;
80 | }
81 | };
82 |
83 | } // namespace loc_core
84 |
85 | #endif // ULP_PROXY_BASE_H
86 |
--------------------------------------------------------------------------------
/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/loc_cfg.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_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 | char param_name[LOC_MAX_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 | loc_param_s_type* config_table,
82 | uint32_t table_length);
83 | int loc_read_conf_r(FILE *conf_fp, loc_param_s_type* config_table,
84 | uint32_t table_length);
85 | int loc_update_conf(const char* conf_data, int32_t length,
86 | loc_param_s_type* config_table, uint32_t table_length);
87 | #ifdef __cplusplus
88 | }
89 | #endif
90 |
91 | #endif /* LOC_CFG_H */
92 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2015 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 |
19 | ifeq ($(TARGET_DEVICE),piccolo)
20 |
21 | include $(call all-makefiles-under,$(LOCAL_PATH))
22 |
23 | include $(CLEAR_VARS)
24 |
25 | # CMN
26 | CMN_IMAGES := \
27 | cmnlib.b00 cmnlib.b01 cmnlib.b02 cmnlib.b03 cmnlib.mdt
28 |
29 | CMN_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(CMN_IMAGES)))
30 | $(CMN_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
31 | @echo "CMN firmware link: $@"
32 | @mkdir -p $(dir $@)
33 | @rm -rf $@
34 | $(hide) ln -sf /firmware/image/$(notdir $@) $@
35 |
36 | ALL_DEFAULT_INSTALLED_MODULES += $(CMN_SYMLINKS)
37 |
38 | # ISDB
39 | ISDB_IMAGES := \
40 | isdbtmm.b00 isdbtmm.b01 isdbtmm.b02 isdbtmm.b03 isdbtmm.mdt
41 |
42 | ISDB_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(ISDB_IMAGES)))
43 | $(ISDB_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
44 | @echo "ISDB firmware link: $@"
45 | @mkdir -p $(dir $@)
46 | @rm -rf $@
47 | $(hide) ln -sf /firmware/image/$(notdir $@) $@
48 |
49 | ALL_DEFAULT_INSTALLED_MODULES += $(ISDB_SYMLINKS)
50 |
51 | # KEYMASTER
52 | KM_IMAGES := \
53 | keymaster.b00 keymaster.b01 keymaster.b02 keymaster.b03 keymaster.mdt
54 |
55 | KM_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/firmware/keymaster/,$(notdir $(KM_IMAGES)))
56 | $(KM_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
57 | @echo "Keymaster Firmware link: $@"
58 | @mkdir -p $(dir $@)
59 | @rm -rf $@
60 | $(hide) ln -sf /firmware/image/$(subst r,,$(notdir $@)) $@
61 |
62 | ALL_DEFAULT_INSTALLED_MODULES += $(KM_SYMLINKS)
63 |
64 | # MBA
65 | MBA_IMAGE := \
66 | mba.mbn
67 |
68 | MBA_SYMLINK := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(MBA_IMAGE)))
69 | $(MBA_SYMLINK): $(LOCAL_INSTALLED_MODULE)
70 | @echo "MBA firmware link: $@"
71 | @mkdir -p $(dir $@)
72 | @rm -rf $@
73 | $(hide) ln -sf /firmware/$(notdir $@) $@
74 |
75 | ALL_DEFAULT_INSTALLED_MODULES += $(MBA_SYMLINK)
76 |
77 | # MODEM
78 | MODEM_IMAGES := \
79 | modem.b00 modem.b01 modem.b02 modem.b03 modem.b04 modem.b05 \
80 | modem.b06 modem.b07 modem.b08 modem.b10 modem.b11 modem.b14 \
81 | modem.b15 modem.b16 modem.b17 modem.b18 modem.b19 modem.b20 \
82 | modem.b23 modem.b24 modem.b25 modem.b27 modem.b28 modem.mdt
83 |
84 | MODEM_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(MODEM_IMAGES)))
85 | $(MODEM_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
86 | @echo "Modem firmware link: $@"
87 | @mkdir -p $(dir $@)
88 | @rm -rf $@
89 | $(hide) ln -sf /firmware/$(notdir $@) $@
90 |
91 | ALL_DEFAULT_INSTALLED_MODULES += $(MODEM_SYMLINKS)
92 |
93 | # PLAYREADY
94 | PLAYREADY_IMAGES := \
95 | playread.b00 playread.b01 playread.b02 playread.b03 playread.mdt
96 |
97 | PLAYREADY_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(PLAYREADY_IMAGES)))
98 | $(PLAYREADY_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
99 | @echo "Playready Firmware link: $@"
100 | @mkdir -p $(dir $@)
101 | @rm -rf $@
102 | $(hide) ln -sf /firmware/image/$(notdir $@) $@
103 |
104 | ALL_DEFAULT_INSTALLED_MODULES += $(PLAYREADY_SYMLINKS)
105 |
106 | # WCNSS
107 | WCNSS_IMAGES := \
108 | wcnss.b00 wcnss.b01 wcnss.b02 wcnss.b04 wcnss.b06 wcnss.b09 \
109 | wcnss.b10 wcnss.b11 wcnss.mdt
110 |
111 | WCNSS_SYMLINKS := $(addprefix $(TARGET_OUT_ETC)/firmware/,$(notdir $(WCNSS_IMAGES)))
112 | $(WCNSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
113 | @echo "WCNSS Firmware link: $@"
114 | @mkdir -p $(dir $@)
115 | @rm -rf $@
116 | $(hide) ln -sf /firmware/image/$(notdir $@) $@
117 |
118 | ALL_DEFAULT_INSTALLED_MODULES += $(WCNSS_SYMLINKS)
119 |
120 | # Create a link for the WCNSS config file, which ends up as a writable
121 | # version in /system/etc/wifi/
122 | $(shell mkdir -p $(TARGET_OUT)/etc/firmware/wlan/prima; \
123 | ln -sf /system/etc/wifi/WCNSS_qcom_cfg.ini \
124 | $(TARGET_OUT)/etc/firmware/wlan/prima/WCNSS_qcom_cfg.ini)
125 |
126 | endif
127 |
--------------------------------------------------------------------------------
/camera/CameraWrapper.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014, 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 | /**
18 | * @file CameraWrapper.cpp
19 | *
20 | * This file wraps a vendor camera module.
21 | *
22 | */
23 |
24 | //#define LOG_NDEBUG 0
25 |
26 | #define LOG_TAG "CameraWrapper"
27 | #include
28 |
29 | #include
30 | #include
31 | #include
32 | #include
33 |
34 | static android::Mutex gCameraWrapperLock;
35 | static camera_module_t *gVendorModule = 0;
36 |
37 | static int camera_device_open(const hw_module_t *module, const char *name,
38 | hw_device_t **device);
39 | static int camera_get_number_of_cameras(void);
40 | static int camera_get_camera_info(int camera_id, struct camera_info *info);
41 |
42 | static struct hw_module_methods_t camera_module_methods = {
43 | .open = camera_device_open
44 | };
45 |
46 | camera_module_t HAL_MODULE_INFO_SYM = {
47 | .common = {
48 | .tag = HARDWARE_MODULE_TAG,
49 | .module_api_version = CAMERA_MODULE_API_VERSION_1_0,
50 | .hal_api_version = HARDWARE_HAL_API_VERSION,
51 | .id = CAMERA_HARDWARE_MODULE_ID,
52 | .name = "piccolo Camera Wrapper",
53 | .author = "The CyanogenMod Project",
54 | .methods = &camera_module_methods,
55 | .dso = NULL, /* remove compilation warnings */
56 | .reserved = {0}, /* remove compilation warnings */
57 | },
58 | .get_number_of_cameras = camera_get_number_of_cameras,
59 | .get_camera_info = camera_get_camera_info,
60 | .set_callbacks = NULL, /* remove compilation warnings */
61 | .get_vendor_tag_ops = NULL, /* remove compilation warnings */
62 | .open_legacy = NULL, /* remove compilation warnings */
63 | .set_torch_mode = NULL, /* remove compilation warnings */
64 | .init = NULL, /* remove compilation warnings */
65 | .reserved = {0}, /* remove compilation warnings */
66 | };
67 |
68 | static int check_vendor_module()
69 | {
70 | int rv = 0;
71 | ALOGV("%s", __FUNCTION__);
72 |
73 | if (gVendorModule)
74 | return 0;
75 |
76 | rv = hw_get_module_by_class("camera", "vendor",
77 | (const hw_module_t**)&gVendorModule);
78 | if (rv)
79 | ALOGE("failed to open vendor camera module");
80 | return rv;
81 | }
82 |
83 | static bool can_talk_to_sensormanager()
84 | {
85 | android::SensorManager& sensorManager(
86 | android::SensorManager::getInstanceForPackage(android::String16("camera")));
87 | android::Sensor const * const * sensorList;
88 | return sensorManager.getSensorList(&sensorList) >= 0;
89 | }
90 |
91 | static int camera_device_open(const hw_module_t *module, const char *name,
92 | hw_device_t **device)
93 | {
94 | int rv = 0;
95 | int num_cameras = 0;
96 | int cameraid;
97 |
98 | android::Mutex::Autolock lock(gCameraWrapperLock);
99 |
100 | ALOGV("%s", __FUNCTION__);
101 |
102 | if (name == NULL || check_vendor_module() != android::NO_ERROR) {
103 | return -EINVAL;
104 | }
105 |
106 | // mm-qcamera-daemon blocks until initialization of sensorservice
107 | // and might miss V4L events generated by the HAL during that time,
108 | // causing HAL initialization failures. Avoid those failures by waiting
109 | // for sensorservice initialization before opening the HAL.
110 | if (!can_talk_to_sensormanager()) {
111 | ALOGE("Waiting for sensor service failed.");
112 | return android::NO_INIT;
113 | }
114 |
115 | return gVendorModule->common.methods->open(
116 | (const hw_module_t*)gVendorModule, name, device);
117 | }
118 |
119 | static int camera_get_number_of_cameras(void)
120 | {
121 | ALOGV("%s", __FUNCTION__);
122 | if (check_vendor_module())
123 | return 0;
124 | return gVendorModule->get_number_of_cameras();
125 | }
126 |
127 | static int camera_get_camera_info(int camera_id, struct camera_info *info)
128 | {
129 | ALOGV("%s", __FUNCTION__);
130 | if (check_vendor_module())
131 | return 0;
132 |
133 | return gVendorModule->get_camera_info(camera_id, info);
134 | }
135 |
--------------------------------------------------------------------------------
/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 | DEFAULT_IMPL()
74 |
75 | void LocAdapterBase::
76 | reportSv(GpsSvStatus &svStatus,
77 | GpsLocationExtended &locationExtended,
78 | void* svExt)
79 | DEFAULT_IMPL()
80 |
81 |
82 | void LocAdapterBase::
83 | reportStatus(GpsStatusValue status)
84 | DEFAULT_IMPL()
85 |
86 |
87 | void LocAdapterBase::
88 | reportNmea(const char* nmea, int length)
89 | DEFAULT_IMPL()
90 |
91 | bool LocAdapterBase::
92 | reportXtraServer(const char* url1, const char* url2,
93 | const char* url3, const int maxlength)
94 | DEFAULT_IMPL(false)
95 |
96 | bool LocAdapterBase::
97 | requestXtraData()
98 | DEFAULT_IMPL(false)
99 |
100 | bool LocAdapterBase::
101 | requestTime()
102 | DEFAULT_IMPL(false)
103 |
104 | bool LocAdapterBase::
105 | requestLocation()
106 | DEFAULT_IMPL(false)
107 |
108 | bool LocAdapterBase::
109 | requestATL(int connHandle, AGpsType agps_type)
110 | DEFAULT_IMPL(false)
111 |
112 | bool LocAdapterBase::
113 | releaseATL(int connHandle)
114 | DEFAULT_IMPL(false)
115 |
116 | bool LocAdapterBase::
117 | requestSuplES(int connHandle)
118 | DEFAULT_IMPL(false)
119 |
120 | bool LocAdapterBase::
121 | reportDataCallOpened()
122 | DEFAULT_IMPL(false)
123 |
124 | bool LocAdapterBase::
125 | reportDataCallClosed()
126 | DEFAULT_IMPL(false)
127 |
128 | bool LocAdapterBase::
129 | requestNiNotify(GpsNiNotification ¬ify, const void* data)
130 | DEFAULT_IMPL(false)
131 |
132 | void LocAdapterBase::
133 | shutdown()
134 | DEFAULT_IMPL()
135 | } // namespace loc_core
136 |
--------------------------------------------------------------------------------
/nfc/libnfc-brcm.conf:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Application options
3 | APPL_TRACE_LEVEL=0xFF
4 | PROTOCOL_TRACE_LEVEL=0xFFFFFFFF
5 |
6 | ###############################################################################
7 | # File used for NFA storage
8 | NFA_STORAGE="/data/nfc"
9 | PRESERVE_STORAGE=1
10 |
11 | ###############################################################################
12 | # Various Delay settings (in ms) used in USERIAL
13 | POWER_ON_DELAY=300
14 | PRE_POWER_OFF_DELAY=10
15 | CE3_PRE_POWER_OFF_DELAY=1500
16 |
17 | ###############################################################################
18 | # Maximum time (ms) to wait for RESET NTF after setting REG_PU to high
19 | NFCC_ENABLE_TIMEOUT=2000
20 |
21 |
22 | ###############################################################################
23 | # Startup Vendor Specific Configuration (100 bytes maximum);
24 | # byte[0] TLV total len = 0x5
25 | # byte[1] NCI_MTS_CMD|NCI_GID_PROP = 0x2f
26 | # byte[2] NCI_MSG_FRAME_LOG = 0x9
27 | # byte[3] 2
28 | # byte[4] 0=turn off RF frame logging; 1=turn on
29 | # byte[5] 0=turn off SWP frame logging; 1=turn on
30 | # NFA_DM_START_UP_VSC_CFG={05:2F:09:02:01:01}
31 |
32 | ###############################################################################
33 | # Override the stack default for NFA_EE_MAX_EE_SUPPORTED set in nfc_target.h.
34 | NFA_MAX_EE_SUPPORTED=2
35 |
36 | ###############################################################################
37 | # Configure the default NfcA/IsoDep techology and protocol route. Can be
38 | # either a secure element (e.g. 0xF4) or the host (0x00)
39 | #DEFAULT_ISODEP_ROUTE=0xF3
40 |
41 | ###############################################################################
42 | # Configure the default "off-host" AID route. The default is 0xF4
43 | DEFAULT_OFFHOST_ROUTE=0xF3
44 |
45 | ###############################################################################
46 | # Configure CE Listen mask based on SE technologies supported.
47 | CE_ISODEP_LISTEN_MODE=2
48 |
49 | ###############################################################################
50 | # Warm reset command for Oberthur
51 | OBERTHUR_WARM_RESET_COMMAND=0x03
52 |
53 | ###############################################################################
54 | # Exclude some technologies when establishing the listen mask.
55 | UICC_LISTEN_TECH_EXCLUDE_MASK=0x10
56 |
57 | ###############################################################################
58 | # AID for Empty Select command
59 | AID_FOR_EMPTY_SELECT={08:A0:00:00:01:51:00:00:00}
60 |
61 | ###############################################################################
62 | # Force tag polling for the specific technology(s).
63 | POLLING_TECH_MASK=0xEF
64 |
65 | ###############################################################################
66 | # When screen is turned off, specify the desired power state of the controller.
67 | SCREEN_OFF_POWER_STATE=3
68 |
69 | ###############################################################################
70 | # transport driver
71 | TRANSPORT_DRIVER="/dev/bcm2079x"
72 |
73 | ###############################################################################
74 | # power control driver
75 | POWER_CONTROL_DRIVER="/dev/bcm2079x"
76 |
77 | ###############################################################################
78 | # Insert a delay in microseconds per byte after a write to NFCC.
79 | NFC_WRITE_DELAY=20
80 |
81 | ###############################################################################
82 | # Insert a delay in milliseconds after NFC_WAKE and before write to NFCC
83 | NFC_WAKE_DELAY=20
84 |
85 | ###############################################################################
86 | # Override the NFC stack's crystal frequency selection algorithm.
87 | XTAL_HARDWARE_ID=0x20795A20
88 | XTAL_FREQUENCY=19200
89 | XTAL_FREQ_INDEX=3
90 |
91 | ###############################################################################
92 | # AID Filtering feature
93 | ENABLE_AID_FILTERING=0
94 |
95 | ###############################################################################
96 | # Select controller support for AID matching
97 | # the default value is 0.
98 | # 0 Exact matching only
99 | # 1 Exact+Prefix matching
100 | # 2 Prefix matching only
101 | AID_MATCHING_MODE=2
102 |
103 | ###############################################################################
104 | # Select transport prefix
105 | # the default value is 0.
106 | # 0 The NFCC does not use a one-byte transport prefix (ie. 20797 and newer)
107 | # 1 The NFCC uses a one-byte transport prefix (ie. 20795 and older)
108 | TRANSPORT_PREFIX=1
109 |
110 | ###############################################################################
111 | # NCI Hal Module name
112 | NCI_HAL_MODULE="nfc_nci.bcm2079x"
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/configs/qmi_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 1
15 | 2
16 |
17 |
18 | QMI_PORT_RMNET_MHI_0
19 | QMI_PORT_RMNET_MHI_1
20 |
21 |
22 |
23 | QMI_CONN_ID_RMNET_MHI_0
24 | QMI_CONN_ID_RMNET_MHI_1
25 |
26 |
27 |
28 | /dev/mhi_pipe_14
29 | /dev/mhi_pipe_16
30 |
31 |
32 |
33 | /tmp/data/mhi_pipe_14
34 | /tmp/data/mhi_pipe_16
35 |
36 |
37 |
38 | MHICTL0
39 | MHICTL1
40 |
41 |
42 |
43 | LINUX_QMI_TRANSPORT_MHI
44 | LINUX_QMI_TRANSPORT_MHI
45 |
46 |
47 |
48 | 1
49 | 1
50 |
51 |
52 |
53 | 1
54 | 0
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | 1
63 | 1
64 |
65 |
66 | QMI_PORT_RMNET_IPA_0
67 |
68 |
69 |
70 | QMI_CONN_ID_RMNET_0
71 | QMI_CONN_ID_RMNET_8
72 |
73 |
74 |
75 | /dev/smdcntl0
76 | /dev/smdcntl8
77 |
78 |
79 |
80 | /tmp/data/smdcntl0
81 | /tmp/data/smdcntl8
82 |
83 |
84 |
85 | DATA5_CNTL
86 | DATA14_CNTL
87 |
88 |
89 |
90 | LINUX_QMI_TRANSPORT_SMD
91 | LINUX_QMI_TRANSPORT_SMD
92 |
93 |
94 |
95 | 1
96 | 1
97 |
98 |
99 |
100 | 1
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 | 1
109 | 2
110 |
111 |
112 | QMI_PORT_RMNET_0
113 | QMI_PORT_RMNET_8
114 |
115 |
116 |
117 | QMI_CONN_ID_RMNET_0
118 | QMI_CONN_ID_RMNET_8
119 |
120 |
121 |
122 | /dev/smdcntl0
123 | /dev/smdcntl8
124 |
125 |
126 |
127 | /tmp/data/smdcntl0
128 | /tmp/data/smdcntl8
129 |
130 |
131 |
132 | DATA5_CNTL
133 | DATA40_CNTL
134 |
135 |
136 |
137 | LINUX_QMI_TRANSPORT_SMD
138 | LINUX_QMI_TRANSPORT_SMD
139 |
140 |
141 |
142 | 1
143 | 1
144 |
145 |
146 |
147 | 1
148 | 0
149 |
150 |
151 |
152 |
153 |
154 |
--------------------------------------------------------------------------------
/gps/core/MsgTask.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 | #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 | namespace loc_core {
40 |
41 | #define MAX_TASK_COMM_LEN 15
42 |
43 | static void LocMsgDestroy(void* msg) {
44 | delete (LocMsg*)msg;
45 | }
46 |
47 | MsgTask::MsgTask(tCreate tCreator, const char* threadName) :
48 | mQ(msg_q_init2()), mAssociator(NULL){
49 | if (tCreator) {
50 | tCreator(threadName, loopMain,
51 | (void*)new MsgTask(mQ, mAssociator));
52 | } else {
53 | createPThread(threadName);
54 | }
55 | }
56 |
57 | MsgTask::MsgTask(tAssociate tAssociator, const char* threadName) :
58 | mQ(msg_q_init2()), mAssociator(tAssociator){
59 | createPThread(threadName);
60 | }
61 |
62 | inline
63 | MsgTask::MsgTask(const void* q, tAssociate associator) :
64 | mQ(q), mAssociator(associator){
65 | }
66 |
67 | MsgTask::~MsgTask() {
68 | msg_q_unblock((void*)mQ);
69 | }
70 |
71 | void MsgTask::associate(tAssociate tAssociator) const {
72 | struct LocAssociateMsg : public LocMsg {
73 | tAssociate mAssociator;
74 | inline LocAssociateMsg(tAssociate associator) :
75 | LocMsg(), mAssociator(associator) {}
76 | inline virtual void proc() const {
77 | if (mAssociator) {
78 | LOC_LOGD("MsgTask::associate");
79 | mAssociator();
80 | }
81 | }
82 | };
83 | sendMsg(new LocAssociateMsg(tAssociator));
84 | }
85 |
86 | void MsgTask::createPThread(const char* threadName) {
87 | pthread_attr_t attr;
88 | pthread_attr_init(&attr);
89 | pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
90 |
91 | pthread_t tid;
92 | // create the thread here, then if successful
93 | // and a name is given, we set the thread name
94 | if (!pthread_create(&tid, &attr, loopMain,
95 | (void*)new MsgTask(mQ, mAssociator)) &&
96 | NULL != threadName) {
97 | char lname[MAX_TASK_COMM_LEN+1];
98 | memcpy(lname, threadName, MAX_TASK_COMM_LEN);
99 | lname[MAX_TASK_COMM_LEN] = 0;
100 | pthread_setname_np(tid, lname);
101 | }
102 | }
103 |
104 | void MsgTask::sendMsg(const LocMsg* msg) const {
105 | msg_q_snd((void*)mQ, (void*)msg, LocMsgDestroy);
106 | }
107 |
108 | void* MsgTask::loopMain(void* arg) {
109 | MsgTask* copy = (MsgTask*)arg;
110 |
111 | // make sure we do not run in background scheduling group
112 | set_sched_policy(gettid(), SP_FOREGROUND);
113 |
114 | if (NULL != copy->mAssociator) {
115 | copy->mAssociator();
116 | }
117 |
118 | LocMsg* msg;
119 | int cnt = 0;
120 |
121 | while (1) {
122 | LOC_LOGD("MsgTask::loop() %d listening ...\n", cnt++);
123 |
124 | msq_q_err_type result = msg_q_rcv((void*)copy->mQ, (void **)&msg);
125 |
126 | if (eMSG_Q_SUCCESS != result) {
127 | LOC_LOGE("%s:%d] fail receiving msg: %s\n", __func__, __LINE__,
128 | loc_get_msg_q_status(result));
129 | // destroy the Q and exit
130 | msg_q_destroy((void**)&(copy->mQ));
131 | delete copy;
132 | return NULL;
133 | }
134 |
135 | msg->log();
136 | // there is where each individual msg handling is invoked
137 | msg->proc();
138 |
139 | delete msg;
140 | }
141 |
142 | delete copy;
143 |
144 | return NULL;
145 | }
146 |
147 | }
148 |
--------------------------------------------------------------------------------
/gps/core/LocAdapterBase.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_API_ADAPTER_BASE_H
30 | #define LOC_API_ADAPTER_BASE_H
31 |
32 | #include
33 | #include
34 | #include
35 |
36 | namespace loc_core {
37 |
38 | class LocAdapterProxyBase;
39 |
40 | class LocAdapterBase {
41 | protected:
42 | LOC_API_ADAPTER_EVENT_MASK_T mEvtMask;
43 | ContextBase* mContext;
44 | LocApiBase* mLocApi;
45 | LocAdapterProxyBase* mLocAdapterProxyBase;
46 | const MsgTask* mMsgTask;
47 |
48 | inline LocAdapterBase(const MsgTask* msgTask) :
49 | mEvtMask(0), mContext(NULL), mLocApi(NULL),
50 | mLocAdapterProxyBase(NULL), mMsgTask(msgTask) {}
51 | public:
52 | inline virtual ~LocAdapterBase() { mLocApi->removeAdapter(this); }
53 | LocAdapterBase(const LOC_API_ADAPTER_EVENT_MASK_T mask,
54 | ContextBase* context, LocAdapterProxyBase *adapterProxyBase = NULL);
55 | inline LOC_API_ADAPTER_EVENT_MASK_T
56 | checkMask(LOC_API_ADAPTER_EVENT_MASK_T mask) const {
57 | return mEvtMask & mask;
58 | }
59 |
60 | inline LOC_API_ADAPTER_EVENT_MASK_T getEvtMask() const {
61 | return mEvtMask;
62 | }
63 |
64 | inline void sendMsg(const LocMsg* msg) const {
65 | mMsgTask->sendMsg(msg);
66 | }
67 |
68 | inline void sendMsg(const LocMsg* msg) {
69 | mMsgTask->sendMsg(msg);
70 | }
71 |
72 | inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event,
73 | loc_registration_mask_status isEnabled)
74 | {
75 | mEvtMask =
76 | isEnabled == LOC_REGISTRATION_MASK_ENABLED ? (mEvtMask|event):(mEvtMask&~event);
77 |
78 | mLocApi->updateEvtMask();
79 | }
80 |
81 | // This will be overridden by the individual adapters
82 | // if necessary.
83 | inline virtual void setUlpProxy(UlpProxyBase* ulp) {}
84 | virtual void handleEngineUpEvent();
85 | virtual void handleEngineDownEvent();
86 | inline virtual void setPositionModeInt(LocPosMode& posMode) {}
87 | virtual void startFixInt() {}
88 | virtual void stopFixInt() {}
89 | virtual void getZppInt() {}
90 | virtual void reportPosition(UlpLocation &location,
91 | GpsLocationExtended &locationExtended,
92 | void* locationExt,
93 | enum loc_sess_status status,
94 | LocPosTechMask loc_technology_mask);
95 | virtual void reportSv(GpsSvStatus &svStatus,
96 | GpsLocationExtended &locationExtended,
97 | void* svExt);
98 | virtual void reportStatus(GpsStatusValue status);
99 | virtual void reportNmea(const char* nmea, int length);
100 | virtual bool reportXtraServer(const char* url1, const char* url2,
101 | const char* url3, const int maxlength);
102 | virtual bool requestXtraData();
103 | virtual bool requestTime();
104 | virtual bool requestLocation();
105 | virtual bool requestATL(int connHandle, AGpsType agps_type);
106 | virtual bool releaseATL(int connHandle);
107 | virtual bool requestSuplES(int connHandle);
108 | virtual bool reportDataCallOpened();
109 | virtual bool reportDataCallClosed();
110 | virtual bool requestNiNotify(GpsNiNotification ¬ify,
111 | const void* data);
112 | inline virtual bool isInSession() { return false; }
113 | virtual void shutdown();
114 | ContextBase* getContext() const { return mContext; }
115 | };
116 |
117 | } // namespace loc_core
118 |
119 | #endif //LOC_API_ADAPTER_BASE_H
120 |
--------------------------------------------------------------------------------
/configs/audio_policy.conf:
--------------------------------------------------------------------------------
1 | # Global configuration section: lists input and output devices always present on the device
2 | # as well as the output device selected by default.
3 | # Devices are designated by a string that corresponds to the enum in audio.h
4 |
5 | global_configuration {
6 | attached_output_devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER
7 | default_output_device AUDIO_DEVICE_OUT_SPEAKER
8 | attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_FM_TUNER
9 | }
10 |
11 | # audio hardware module section: contains descriptors for all audio hw modules present on the
12 | # device. Each hw module node is named after the corresponding hw module library base name.
13 | # For instance, "primary" corresponds to audio.primary..so.
14 | # The "primary" module is mandatory and must include at least one output with
15 | # AUDIO_OUTPUT_FLAG_PRIMARY flag.
16 | # Each module descriptor contains one or more output profile descriptors and zero or more
17 | # input profile descriptors. Each profile lists all the parameters supported by a given output
18 | # or input stream category.
19 | # The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding
20 | # to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n".
21 |
22 | audio_hw_modules {
23 | primary {
24 | outputs {
25 | primary {
26 | sampling_rates 8000|11025|16000|22050|32000|44100|48000
27 | channel_masks AUDIO_CHANNEL_OUT_MONO|AUDIO_CHANNEL_OUT_STEREO
28 | formats AUDIO_FORMAT_PCM_16_BIT
29 | devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET
30 | flags AUDIO_OUTPUT_FLAG_PRIMARY
31 | }
32 | low_latency {
33 | sampling_rates 44100|48000
34 | channel_masks AUDIO_CHANNEL_OUT_STEREO
35 | formats AUDIO_FORMAT_PCM_16_BIT
36 | devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_PROXY|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET
37 | flags AUDIO_OUTPUT_FLAG_FAST
38 | }
39 | compress_offload {
40 | sampling_rates 8000|11025|16000|22050|32000|44100|48000
41 | channel_masks AUDIO_CHANNEL_OUT_MONO|AUDIO_CHANNEL_OUT_STEREO
42 | formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2
43 | devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO
44 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING
45 | }
46 | voip_rx {
47 | sampling_rates 8000|16000
48 | channel_masks AUDIO_CHANNEL_OUT_MONO
49 | formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_AMR_NB|AUDIO_FORMAT_AMR_WB|AUDIO_FORMAT_QCELP|AUDIO_FORMAT_EVRC|AUDIO_FORMAT_EVRCB|AUDIO_FORMAT_EVRCWB|AUDIO_FORMAT_EVRCNW
50 | devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_ALL_USB|AUDIO_DEVICE_OUT_ALL_SCO
51 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_VOIP_RX
52 | }
53 | }
54 | inputs {
55 | primary {
56 | sampling_rates 8000|11025|12000|16000|22050|24000|32000|44100|48000
57 | channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_FRONT_BACK
58 | formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_AMR_NB|AUDIO_FORMAT_AMR_WB|AUDIO_FORMAT_QCELP|AUDIO_FORMAT_EVRC|AUDIO_FORMAT_EVRCB|AUDIO_FORMAT_EVRCWB|AUDIO_FORMAT_EVRCNW
59 | devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_FM_TUNER
60 | }
61 | }
62 | }
63 | a2dp {
64 | outputs {
65 | a2dp {
66 | sampling_rates 44100
67 | channel_masks AUDIO_CHANNEL_OUT_STEREO
68 | formats AUDIO_FORMAT_PCM_16_BIT
69 | devices AUDIO_DEVICE_OUT_ALL_A2DP
70 | }
71 | }
72 | }
73 | usb {
74 | outputs {
75 | usb_accessory {
76 | sampling_rates 44100
77 | channel_masks AUDIO_CHANNEL_OUT_STEREO
78 | formats AUDIO_FORMAT_PCM_16_BIT
79 | devices AUDIO_DEVICE_OUT_USB_ACCESSORY
80 | }
81 | usb_device {
82 | sampling_rates dynamic
83 | channel_masks dynamic
84 | formats dynamic
85 | devices AUDIO_DEVICE_OUT_USB_DEVICE
86 | }
87 | }
88 | inputs {
89 | usb_device {
90 | sampling_rates dynamic
91 | channel_masks AUDIO_CHANNEL_IN_STEREO
92 | formats AUDIO_FORMAT_PCM_16_BIT
93 | devices AUDIO_DEVICE_IN_USB_DEVICE
94 | }
95 | }
96 | }
97 | r_submix {
98 | outputs {
99 | submix {
100 | sampling_rates 48000
101 | channel_masks AUDIO_CHANNEL_OUT_STEREO
102 | formats AUDIO_FORMAT_PCM_16_BIT
103 | devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
104 | }
105 | }
106 | inputs {
107 | submix {
108 | sampling_rates 48000
109 | channel_masks AUDIO_CHANNEL_IN_STEREO
110 | formats AUDIO_FORMAT_PCM_16_BIT
111 | devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
112 | }
113 | }
114 | }
115 | }
116 |
117 |
--------------------------------------------------------------------------------
/healthd/healthd_board_msm.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *Copyright (c) 2015, 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
6 | *met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above
10 | * copyright notice, this list of conditions and the following
11 | * disclaimer in the documentation and/or other materials provided
12 | * with the distribution.
13 | * * Neither the name of The Linux Foundation nor the names of its
14 | * contributors may be used to endorse or promote products derived
15 | * from this software without specific prior written permission.
16 | *
17 | *THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18 | *WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 | *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20 | *ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21 | *BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 | *CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 | *SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24 | *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 | *WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 | *OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 | *IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | #include
31 | #include
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include
38 | #include
39 | #include "minui/minui.h"
40 |
41 | #define BACKLIGHT_PATH "/sys/class/leds/lcd-backlight/brightness"
42 |
43 | #define CHARGING_ENABLED_PATH "/sys/class/power_supply/battery/charging_enabled"
44 |
45 | #define LOGE(x...) do { KLOG_ERROR("charger", x); } while (0)
46 | #define LOGW(x...) do { KLOG_WARNING("charger", x); } while (0)
47 | #define LOGV(x...) do { KLOG_DEBUG("charger", x); } while (0)
48 |
49 | static int write_file_int(char const* path, int value)
50 | {
51 | int fd;
52 | char buffer[20];
53 | int rc = -1, bytes;
54 |
55 | fd = open(path, O_WRONLY);
56 | if (fd >= 0) {
57 | bytes = snprintf(buffer, sizeof(buffer), "%d\n", value);
58 | rc = write(fd, buffer, bytes);
59 | close(fd);
60 | }
61 |
62 | return rc > 0 ? 0 : -1;
63 | }
64 |
65 | #define STR_LEN 8
66 | void healthd_board_mode_charger_draw_battery(
67 | struct android::BatteryProperties *batt_prop)
68 | {
69 | char cap_str[STR_LEN];
70 | int x, y;
71 | int str_len_px;
72 | static int char_height = -1, char_width = -1;
73 |
74 | if (char_height == -1 && char_width == -1)
75 | gr_font_size(&char_width, &char_height);
76 | snprintf(cap_str, (STR_LEN - 1), "%d%%", batt_prop->batteryLevel);
77 | str_len_px = gr_measure(cap_str);
78 | x = (gr_fb_width() - str_len_px) / 2;
79 | y = (gr_fb_height() + char_height) / 2;
80 | gr_color(0xa4, 0xc6, 0x39, 255);
81 | gr_text(x, y, cap_str, 0);
82 | }
83 |
84 | void healthd_board_mode_charger_battery_update(
85 | struct android::BatteryProperties*)
86 | {
87 |
88 | }
89 |
90 |
91 | #define BACKLIGHT_ON_LEVEL 100
92 | #define BACKLIGHT_OFF_LEVEL 0
93 | void healthd_board_mode_charger_set_backlight(bool en)
94 | {
95 | int fd;
96 | char buffer[10];
97 |
98 | if (access(BACKLIGHT_PATH, R_OK | W_OK) != 0)
99 | {
100 | LOGW("Backlight control not support\n");
101 | return;
102 | }
103 |
104 | memset(buffer, '\0', sizeof(buffer));
105 | fd = open(BACKLIGHT_PATH, O_RDWR);
106 | if (fd < 0) {
107 | LOGE("Could not open backlight node : %s\n", strerror(errno));
108 | goto cleanup;
109 | }
110 | LOGV("set backlight status to %d\n", en);
111 | if (en)
112 | snprintf(buffer, sizeof(buffer), "%d\n", BACKLIGHT_ON_LEVEL);
113 | else
114 | snprintf(buffer, sizeof(buffer), "%d\n", BACKLIGHT_OFF_LEVEL);
115 |
116 | if (write(fd, buffer,strlen(buffer)) < 0) {
117 | LOGE("Could not write to backlight node : %s\n", strerror(errno));
118 | goto cleanup;
119 | }
120 | cleanup:
121 | if (fd >= 0)
122 | close(fd);
123 | }
124 |
125 | void healthd_board_mode_charger_init()
126 | {
127 | int ret;
128 | char buff[8] = "\0";
129 | int charging_enabled = 0;
130 | int fd;
131 |
132 | /* check the charging is enabled or not */
133 | fd = open(CHARGING_ENABLED_PATH, O_RDONLY);
134 | if (fd < 0)
135 | return;
136 | ret = read(fd, buff, sizeof(buff));
137 | close(fd);
138 | if (ret > 0 && sscanf(buff, "%d\n", &charging_enabled)) {
139 | /* if charging is disabled, reboot and exit power off charging */
140 | if (charging_enabled)
141 | return;
142 | LOGW("android charging is disabled, exit!\n");
143 | android_reboot(ANDROID_RB_RESTART, 0, 0);
144 | }
145 | }
146 |
147 | void healthd_board_init(struct healthd_config*)
148 | {
149 | // use defaults
150 | }
151 |
152 | int healthd_board_battery_update(struct android::BatteryProperties*)
153 | {
154 | // return 0 to log periodic polled battery status to kernel log
155 | return 1;
156 | }
157 |
--------------------------------------------------------------------------------
/BoardConfig.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2015 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 | # Bootloader
18 | TARGET_BOOTLOADER_BOARD_NAME := msm8916
19 | TARGET_NO_BOOTLOADER := true
20 | TARGET_NO_RADIOIMAGE := true
21 |
22 | # Platform
23 | TARGET_BOARD_PLATFORM := msm8916
24 | TARGET_BOARD_PLATFORM_GPU := qcom-adreno405
25 |
26 | # Architecture
27 | TARGET_ARCH := arm
28 | TARGET_ARCH_VARIANT := armv7-a-neon
29 | TARGET_CPU_ABI := armeabi-v7a
30 | TARGET_CPU_ABI2 := armeabi
31 | TARGET_CPU_VARIANT := cortex-a53
32 |
33 | TARGET_GLOBAL_CFLAGS += -mfpu=neon -mfloat-abi=softfp
34 | TARGET_GLOBAL_CPPFLAGS += -mfpu=neon -mfloat-abi=softfp
35 |
36 | # Kernel
37 | TARGET_KERNEL_SOURCE := kernel/bq/piccolo
38 | TARGET_KERNEL_CONFIG := cyanogenmod_piccolo_defconfig
39 | TARGET_KERNEL_ARCH := arm
40 | BOARD_KERNEL_CMDLINE := androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=30 msm_rtb.filter=0x3F ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1
41 | BOARD_KERNEL_BASE := 0x80000000
42 | BOARD_KERNEL_PAGESIZE := 2048
43 | BOARD_KERNEL_SEPARATED_DT := true
44 | BOARD_RAMDISK_OFFSET := 0x01000000
45 | BOARD_KERNEL_TAGS_OFFSET := 0x00000100
46 | BOARD_DTBTOOL_ARGS := -2
47 |
48 | # Assert
49 | TARGET_OTA_ASSERT_DEVICE := aquarism5,piccolo
50 |
51 | # ANT+
52 | BOARD_ANT_WIRELESS_DEVICE := "qualcomm-smd"
53 |
54 | # Audio
55 | BOARD_USES_ALSA_AUDIO := true
56 | AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE := true
57 | AUDIO_FEATURE_ENABLED_FM_POWER_OPT := true
58 | AUDIO_FEATURE_ENABLED_NEW_SAMPLE_RATE := true
59 | USE_CUSTOM_AUDIO_POLICY := 1
60 |
61 | # Bluetooth
62 | BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/bq/piccolo/bluetooth
63 | BOARD_HAVE_BLUETOOTH := true
64 | BOARD_HAVE_BLUETOOTH_QCOM := true
65 | BLUETOOTH_HCI_USE_MCT := true
66 | FEATURE_QCRIL_UIM_SAP_SERVER_MODE := true
67 |
68 | # Camera
69 | COMMON_GLOBAL_CFLAGS += -DCAMERA_VENDOR_L_COMPAT
70 |
71 | # Charger
72 | BOARD_CHARGER_DISABLE_INIT_BLANK := true
73 | BOARD_HAL_STATIC_LIBRARIES := libhealthd.msm8916
74 |
75 | # CMHW
76 | BOARD_HARDWARE_CLASS := device/bq/piccolo/cmhw/src
77 | TARGET_TAP_TO_WAKE_NODE := "/sys/devices/soc.0/78b9000.i2c/i2c-5/5-004a/en_gesture"
78 |
79 | # Add suffix variable to uniquely identify the board
80 | TARGET_BOARD_SUFFIX := _32
81 |
82 | # Encryption
83 | TARGET_HW_DISK_ENCRYPTION := true
84 |
85 | # Filesystem
86 | BOARD_BOOTIMAGE_PARTITION_SIZE := 0x02000000
87 | BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x02000000
88 | BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1556925644
89 | BOARD_USERDATAIMAGE_PARTITION_SIZE := 13013734522 # (BOARD_USERDATAIMAGE_PARTITION_SIZE - 16384 for crypto footer)
90 | BOARD_CACHEIMAGE_PARTITION_SIZE := 405798912
91 | BOARD_PERSISTIMAGE_PARTITION_SIZE := 28311552
92 | BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64)
93 |
94 | # FM
95 | TARGET_QCOM_NO_FM_FIRMWARE := true
96 |
97 | # Graphics
98 | TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true
99 | MAX_VIRTUAL_DISPLAY_DIMENSION := 2048
100 | TARGET_USES_C2D_COMPOSITION := true
101 | TARGET_USES_ION := true
102 | USE_OPENGL_RENDERER := true
103 | NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
104 | OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
105 |
106 | # Shader cache config options
107 | # Maximum size of the GLES Shaders that can be cached for reuse.
108 | # Increase the size if shaders of size greater than 12KB are used.
109 | MAX_EGL_CACHE_KEY_SIZE := 12*1024
110 |
111 | # Maximum GLES shader cache size for each app to store the compiled shader
112 | # binaries. Decrease the size if RAM or Flash Storage size is a limitation
113 | # of the device.
114 | MAX_EGL_CACHE_SIZE := 2048*1024
115 |
116 | # Headers
117 | TARGET_SPECIFIC_HEADER_PATH := device/bq/piccolo/include
118 |
119 | # Init
120 | TARGET_PLATFORM_DEVICE_BASE := /devices/soc.0/
121 |
122 | # Keymaster
123 | TARGET_KEYMASTER_WAIT_FOR_QSEE := true
124 |
125 | # Lights
126 | TARGET_PROVIDES_LIBLIGHT := true
127 |
128 | # Memory
129 | MALLOC_IMPL := dlmalloc
130 |
131 | # Power
132 | TARGET_POWERHAL_VARIANT := qcom
133 |
134 | # QCOM hardware
135 | BOARD_USES_QCOM_HARDWARE := true
136 |
137 | # Recovery
138 | TARGET_RECOVERY_FSTAB := device/bq/piccolo/rootdir/etc/fstab.qcom
139 | TARGET_USERIMAGES_USE_EXT4 := true
140 | BOARD_SUPPRESS_EMMC_WIPE := true
141 | COMMON_GLOBAL_CFLAGS += -DRECOVERY_FONT='"roboto_15x24.h"'
142 |
143 | # RIL
144 | TARGET_RIL_VARIANT := caf
145 |
146 | # SELinux
147 | include device/qcom/sepolicy/sepolicy.mk
148 | BOARD_SEPOLICY_DIRS += device/bq/piccolo/sepolicy
149 |
150 | # Time services
151 | BOARD_USES_QC_TIME_SERVICES := true
152 |
153 | # Wifi
154 | BOARD_HAS_QCOM_WLAN := true
155 | BOARD_HAS_QCOM_WLAN_SDK := true
156 | BOARD_WLAN_DEVICE := qcwcn
157 | BOARD_HOSTAPD_DRIVER := NL80211
158 | BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_qcwcn
159 | BOARD_WPA_SUPPLICANT_DRIVER := NL80211
160 | BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_qcwcn
161 | WIFI_DRIVER_FW_PATH_STA := "sta"
162 | WIFI_DRIVER_FW_PATH_AP := "ap"
163 | WPA_SUPPLICANT_VERSION := VER_0_8_X
164 |
165 | # Inherit from the proprietary version
166 | -include vendor/bq/piccolo/BoardConfigVendor.mk
167 |
--------------------------------------------------------------------------------