diff --git a/Android.mk b/Android.mk
old mode 100644
new mode 100755
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
old mode 100644
new mode 100755
index 25619b0..2cf6f24
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -14,4 +14,4 @@
# limitations under the License.
PRODUCT_MAKEFILES := \
- $(LOCAL_DIR)/full_gts3llte.mk
+ $(LOCAL_DIR)/lineage_gts3llte.mk
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 967b083..9d38869 100755
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -1,5 +1,6 @@
#
# Copyright (C) 2016 The CyanogenMod Project
+# Copyright (C) 2017-2018 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,6 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+#
BOARD_VENDOR := samsung
@@ -22,6 +24,9 @@ TARGET_SPECIFIC_HEADER_PATH := $(DEVICE_PATH)/include
# Assert
TARGET_OTA_ASSERT_DEVICE := gts3llte
+# ADB Legacy Interface
+TARGET_USES_LEGACY_ADB_INTERFACE := true
+
# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
@@ -30,7 +35,7 @@ TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := kryo
TARGET_2ND_ARCH := arm
-TARGET_2ND_ARCH_VARIANT := armv7-a-neon
+TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := kryo
@@ -43,23 +48,29 @@ TARGET_NO_BOOTLOADER := true
# Kernel
BOARD_KERNEL_BASE := 0x80000000
-BOARD_KERNEL_CMDLINE := console=null androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7464900.sdhci lpm_levels.sleep_disabled=1 rcupdate.rcu_expedited=1 cma=32M@0-0xffffffff
+BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7464900.sdhci lpm_levels.sleep_disabled=1 rcupdate.rcu_expedited=1 cma=32M@0-0xffffffff
BOARD_KERNEL_IMAGE_NAME := Image.gz
BOARD_KERNEL_PAGESIZE := 4096
BOARD_KERNEL_SEPARATED_DT := true
-BOARD_MKBOOTIMG_ARGS := --kernel_offset 0x00008000 --ramdisk_offset 0x02200000 --tags_offset 0x02000000 --board SRPPK08B000KU
+BOARD_MKBOOTIMG_ARGS := --kernel_offset 0x00008000 --ramdisk_offset 0x02200000 --tags_offset 0x02000000
TARGET_KERNEL_SOURCE := kernel/samsung/msm8996
BOARD_CUSTOM_BOOTIMG := true
BOARD_CUSTOM_BOOTIMG_MK := hardware/samsung/mkbootimg.mk
TARGET_KERNEL_CROSS_COMPILE_PREFIX := aarch64-linux-android-
TARGET_KERNEL_CONFIG := lineage_gts3llte_defconfig
+TARGET_COMPILE_WITH_MSM_KERNEL := true
+#SELINUX_IGNORE_NEVERALLOWS := true
+
# Platform
TARGET_BOARD_PLATFORM := msm8996
TARGET_BOARD_PLATFORM_GPU := qcom-adreno530
+# Properties
+#BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
+
# ANT+
-BOARD_ANT_WIRELESS_DEVICE := "qualcomm-uart"
+BOARD_ANT_WIRELESS_DEVICE := "qualcomm-hidl"
# Audio
#AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
@@ -84,10 +95,11 @@ AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24 := true
#AUDIO_FEATURE_ENABLED_WMA_OFFLOAD := true
AUDIO_USE_LL_AS_PRIMARY_OUTPUT := true
#BOARD_SUPPORTS_SOUND_TRIGGER := true
-BOARD_USES_ALSA_AUDIO := true
+#BOARD_USES_ALSA_AUDIO := true
#USE_CUSTOM_AUDIO_POLICY := 1
-#AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
+# Bionic
+TARGET_NEEDS_LEGACY_MUTEX_HANDLE := true
# Bluetooth
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth
@@ -97,44 +109,66 @@ BOARD_HAVE_BLUETOOTH_QCOM := true
QCOM_BT_USE_BTNV := true
BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED := false
+# CAF HALs
+TARGET_QCOM_MEDIA_VARIANT := caf-msm8996
+TARGET_QCOM_DISPLAY_VARIANT := caf-msm8996
+
+PRODUCT_SOONG_NAMESPACES += \
+ hardware/qcom/display-$(TARGET_QCOM_DISPLAY_VARIANT) \
+ hardware/qcom/media-$(TARGET_QCOM_MEDIA_VARIANT)
+
# Camera
USE_CAMERA_STUB := true
USE_DEVICE_SPECIFIC_CAMERA := true
TARGET_USES_MEDIA_EXTENSIONS := true
# Charger
-#BOARD_CHARGER_ENABLE_SUSPEND := true
-
-# Dex
-ifeq ($(HOST_OS),linux)
- ifneq ($(TARGET_BUILD_VARIANT),eng)
- WITH_DEXPREOPT ?= true
- endif
-endif
-WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true
+BOARD_CHARGER_ENABLE_SUSPEND := true
# Display
+BOARD_USES_ADRENO := true
+
MAX_VIRTUAL_DISPLAY_DIMENSION := 4096
TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true
-TARGET_USES_C2D_COMPOSITION := true
+
+TARGET_USES_ION := true
+TARGET_USES_NEW_ION_API :=true
TARGET_USES_GRALLOC1 := true
TARGET_USES_HWC2 := true
-TARGET_USES_ION := true
TARGET_USES_OVERLAY := true
-USE_OPENGL_RENDERER := true
MAX_EGL_CACHE_KEY_SIZE := 12*1024
MAX_EGL_CACHE_SIZE := 2048*1024
-OVERRIDE_RS_DRIVER := libRSDriver_adreno.so
-
-VSYNC_EVENT_PHASE_OFFSET_NS := 2000000
+NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
SF_VSYNC_EVENT_PHASE_OFFSET_NS := 6000000
+VSYNC_EVENT_PHASE_OFFSET_NS := 2000000
+
+OVERRIDE_RS_DRIVER:= libRSDriver_adreno.so
+USE_OPENGL_RENDERER := true
+
+# surfaceflinger orientation
+SF_PRIMARY_DISPLAY_ORIENTATION := 270
+
+# DRM
+TARGET_ENABLE_MEDIADRM_64 := true
# Encryption
TARGET_HW_DISK_ENCRYPTION := true
# Filesystem
+TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/config.fs
+
+# HIDL
+DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := $(DEVICE_PATH)/configs/vendor_framework_compatibility_matrix.xml
+#DEVICE_FRAMEWORK_MANIFEST_FILE := $(DEVICE_PATH)/configs/framework_manifest.xml
+DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/configs/manifest.xml
+DEVICE_MATRIX_FILE := $(DEVICE_PATH)/configs/compatibility_matrix.xml
+
+# Lineage Hardware
+JAVA_SOURCE_OVERLAYS := org.lineageos.hardware|$(DEVICE_PATH)/lineagehw|**/*.java
+
+# Partitions
BOARD_BOOTIMAGE_PARTITION_SIZE := 79691776
BOARD_CACHEIMAGE_PARTITION_SIZE := 209715200
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := f2fs
@@ -144,24 +178,17 @@ BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3072000000
#BOARD_SYSTEMIMAGE_PARTITION_SIZE := 4194304000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 26226982912
BOARD_FLASH_BLOCK_SIZE := 131072
-
-# Filesystem
-TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/config.fs
-TARGET_EXFAT_DRIVER := exfat
+TARGET_USES_MKE2FS := true
# Fingerprint
TARGET_SEC_FP_HAL_VARIANT := bauth
-# HIDL
-DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/configs/manifest.xml
-DEVICE_MATRIX_FILE := $(DEVICE_PATH)/configs/compatibility_matrix.xml
-
TARGET_LD_SHIM_LIBS := \
/system/vendor/lib/libbauthserver.so|/vendor/lib/libbauthtzcommon_shim.so \
/system/vendor/lib64/libbauthserver.so|/vendor/lib64/libbauthtzcommon_shim.so
TARGET_LD_SHIM_LIBS += \
- /system/vendor/lib/hw/camera.msm8996.so|/system/vendor/lib/libshims_cameraclient.so \
+ /system/vendor/lib/hw/camera.msm8996.so|/system/vendor/lib/libshims_cameraclient.so
# Init
TARGET_PLATFORM_DEVICE_BASE := /devices/soc/
@@ -169,17 +196,13 @@ TARGET_PLATFORM_DEVICE_BASE := /devices/soc/
# Keymaster
TARGET_PROVIDES_KEYMASTER := true
-# Lineage Hardware
-BOARD_HARDWARE_CLASS += \
- $(DEVICE_PATH)/lineagehw
-
# Power
-#TARGET_HAS_NO_WIFI_STATS := true
-TARGET_POWERHAL_VARIANT := qcom
+TARGET_HAS_NO_WLAN_STATS := true
+TARGET_USES_INTERACTION_BOOST := true
# QCOM
BOARD_USES_QCOM_HARDWARE := true
-TARGET_USE_SDCLANG := true
+#TARGET_USE_SDCLANG := true
# Ramdisk
BOARD_ROOT_EXTRA_FOLDERS := dsp efs firmware firmware-modem persist
@@ -194,12 +217,15 @@ TARGET_USERIMAGES_USE_F2FS := true
# Treble
#PRODUCT_FULL_TREBLE_OVERRIDE := true
-PRODUCT_VENDOR_MOVE_ENABLED := true
+#PRODUCT_VENDOR_MOVE_ENABLED := true
# RIL
PROTOBUF_SUPPORTED := true
TARGET_RIL_VARIANT := caf
+# Security patch level - T825XXU2BRL2
+VENDOR_SECURITY_PATCH := 2018-12-01
+
# SELinux
include device/qcom/sepolicy/sepolicy.mk
BOARD_SEPOLICY_DIRS += $(DEVICE_PATH)/sepolicy
@@ -221,4 +247,4 @@ WPA_SUPPLICANT_VERSION := VER_0_8_X
BOARD_HAVE_SAMSUNG_WIFI := true
# inherit from the proprietary version
--include vendor/samsung/gts3llte/BoardConfigVendor.mk
\ No newline at end of file
+-include vendor/samsung/gts3llte/BoardConfigVendor.mk
diff --git a/config.fs b/config.fs
old mode 100644
new mode 100755
index 5625580..f1949c1
--- a/config.fs
+++ b/config.fs
@@ -1,14 +1,20 @@
-[AID_QCOM_DIAG]
+[AID_VENDOR_QCOM_DIAG]
value:2950
-[AID_QTI_DIAG]
+[AID_VENDOR_QTI_DIAG]
value:2901
-[AID_RFS]
-value:2951
+[AID_VENDOR_QDSS]
+value:2902
-[AID_RFS_SHARED]
-value:2952
+[AID_VENDOR_RFS]
+value:2903
+
+[AID_VENDOR_RFS_SHARED]
+value:2904
+
+[AID_VENDOR_ADPL_ODL]
+value:2905
[vendor/bin/wcnss_filter]
mode: 0755
@@ -16,25 +22,19 @@ user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: BLOCK_SUSPEND
-[system/vendor/bin/wcnss_filter]
-mode: 0755
-user: AID_BLUETOOTH
-group: AID_BLUETOOTH
-caps: BLOCK_SUSPEND
-
[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
caps: BLOCK_SUSPEND NET_ADMIN
-[system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
+[vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: BLOCK_SUSPEND NET_ADMIN
-[system/bin/cnss-daemon]
+[vendor/bin/cnss-daemon]
mode: 0755
user: AID_BLUETOOTH
group: AID_BLUETOOTH
@@ -46,48 +46,18 @@ user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE
-[system/vendor/bin/pm-service]
-mode: 0755
-user: AID_SYSTEM
-group: AID_SYSTEM
-caps: NET_BIND_SERVICE
-
-[system/bin/pm-service]
-mode: 0755
-user: AID_SYSTEM
-group: AID_SYSTEM
-caps: NET_BIND_SERVICE
-
[vendor/bin/pd-mapper]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE
-[system/vendor/bin/pd-mapper]
-mode: 0755
-user: AID_SYSTEM
-group: AID_SYSTEM
-caps: NET_BIND_SERVICE
-
-[system/bin/pd-mapper]
-mode: 0755
-user: AID_SYSTEM
-group: AID_SYSTEM
-caps: NET_BIND_SERVICE
-
[vendor/bin/imsdatadaemon]
mode: 0755
user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE
-[system/vendor/bin/imsdatadaemon]
-mode: 0755
-user: AID_SYSTEM
-group: AID_SYSTEM
-caps: NET_BIND_SERVICE
-
[vendor/bin/ims_rtp_daemon]
mode: 0755
user: AID_SYSTEM
@@ -104,13 +74,7 @@ caps: NET_BIND_SERVICE
mode: 0755
user: AID_SYSTEM
group: AID_RADIO
-caps: WAKE_ALARM
-
-[system/vendor/bin/imsrcsd]
-mode: 0755
-user: AID_SYSTEM
-group: AID_RADIO
-caps: WAKE_ALARM
+caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM
[vendor/bin/cnd]
mode: 0755
@@ -118,23 +82,17 @@ user: AID_SYSTEM
group: AID_SYSTEM
caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
-[system/vendor/bin/cnd]
-mode: 0755
-user: AID_SYSTEM
-group: AID_SYSTEM
-caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN
-
[vendor/bin/slim_daemon]
mode: 0755
user: AID_GPS
group: AID_GPS
caps: NET_BIND_SERVICE
-[system/vendor/bin/slim_daemon]
+[vendor/bin/loc_launcher]
mode: 0755
user: AID_GPS
group: AID_GPS
-caps: NET_BIND_SERVICE
+caps: SETUID SETGID
[vendor/bin/xtwifi-client]
mode: 0755
@@ -164,4 +122,4 @@ caps: 0
mode: 0771
user: AID_MEDIA
group: AID_MEDIA
-caps: 0
\ No newline at end of file
+caps: 0
diff --git a/configs/audio/audio_platform_info.xml b/configs/audio/audio_platform_info.xml
old mode 100644
new mode 100755
diff --git a/configs/audio/mixer_paths_tasha.xml b/configs/audio/mixer_paths_tasha.xml
old mode 100644
new mode 100755
diff --git a/configs/compatibility_matrix.xml b/configs/compatibility_matrix.xml
index 83eca8b..3082485 100644
--- a/configs/compatibility_matrix.xml
+++ b/configs/compatibility_matrix.xml
@@ -7,14 +7,14 @@
default
-
+
android.hidl.allocator
1.0
@@ -55,4 +55,5 @@
default
-
\ No newline at end of file
+
+
diff --git a/configs/data/dsi_config.xml b/configs/data/dsi_config.xml
old mode 100644
new mode 100755
diff --git a/configs/data/netmgr_config.xml b/configs/data/netmgr_config.xml
old mode 100644
new mode 100755
diff --git a/configs/data/qmi_config.xml b/configs/data/qmi_config.xml
old mode 100644
new mode 100755
diff --git a/configs/manifest.xml b/configs/manifest.xml
old mode 100644
new mode 100755
index 0b3863f..aec6b9a
--- a/configs/manifest.xml
+++ b/configs/manifest.xml
@@ -1,3 +1,30 @@
+
android.hardware.biometrics.fingerprint
@@ -19,7 +46,7 @@
android.hardware.audio
- hwbinder
+ passthrough
2.0
IDevicesFactory
@@ -28,14 +55,14 @@
android.hardware.audio.effect
- hwbinder
+ passthrough
2.0
IEffectsFactory
default
-
-
-
- android.hardware.configstore
+
+
+ android.hardware.cas
hwbinder
1.0
+
+ IMediaCasService
+ default
+
+
+
+ android.hardware.configstore
+ hwbinder
+ 1.1
ISurfaceFlingerConfigs
default
@@ -69,17 +105,19 @@
ICryptoFactory
default
- widevine
IDrmFactory
default
- widevine
+ @1.1::ICryptoFactory/clearkey
+ @1.1::IDrmFactory/clearkey
+ @1.1::ICryptoFactory/widevine
+ @1.1::IDrmFactory/widevine
android.hardware.gatekeeper
- hwbinder
+ passthrough
1.0
IGatekeeper
@@ -93,8 +131,9 @@
IGnss
default
- gnss_vendor
+ @1.0::IGnss/default
+ @1.0::IGnss/gnss_vendor
android.hardware.graphics.allocator
@@ -126,7 +165,7 @@
android.hardware.health
hwbinder
- 1.0
+ 2.0
IHealth
default
@@ -141,6 +180,15 @@
default
+
+ android.hardware.light
+ passthrough
+ 2.0
+
+ ILight
+ default
+
+
android.hardware.media.omx
hwbinder
@@ -166,7 +214,7 @@
android.hardware.power
hwbinder
- 1.0
+ 1.1
IPower
default
@@ -179,10 +227,12 @@
IRadio
slot1
+ slot2
ISap
slot1
+ slot2
@@ -192,6 +242,7 @@
IOemHook
slot1
+ slot2
@@ -214,8 +265,8 @@
android.hardware.soundtrigger
- hwbinder
- 2.0
+ passthrough
+ 2.1
ISoundTriggerHw
default
@@ -239,6 +290,15 @@
default
+
+ android.hardware.usb
+ hwbinder
+ 1.0
+
+ IUsb
+ default
+
+
android.hardware.vibrator
hwbinder
@@ -251,7 +311,7 @@
android.hardware.wifi
hwbinder
- 1.1
+ 1.2
IWifi
default
@@ -260,12 +320,21 @@
android.hardware.wifi.supplicant
hwbinder
- 1.0
+ 1.1
ISupplicant
default
+
+ com.qualcomm.qti.ant
+ hwbinder
+ 1.0
+
+ IAntHci
+ default
+
+
com.qualcomm.qti.dpm.api
hwbinder
@@ -296,7 +365,7 @@
com.quicinc.cne.api
hwbinder
- 1.0
+ 1.1
IApiService
cnd
@@ -305,7 +374,7 @@
com.quicinc.cne.server
hwbinder
- 2.0
+ 2.2
IServer
cnd
@@ -340,10 +409,14 @@
vendor.lineage.livedisplay
- hwbinder
- 1.0
+ passthrough
+ 2.0
- IColor
+ IDisplayModes
+ default
+
+
+ IPictureAdjustment
default
@@ -357,13 +430,51 @@
- vendor.qti.gnss
+ vendor.lineage.trust
hwbinder
1.0
+
+ IUsbRestrict
+ default
+
+
+
+ vendor.qti.gnss
+ hwbinder
+ 1.2
ILocHidlGnss
gnss_vendor
+ @1.2::ILocHidlGnss/gnss_vendor
+
+
+ vendor.qti.gnss
+ hwbinder
+ 2.0
+
+ ILocHidlGnss
+ gnss_vendor
+
+ @2.0::ILocHidlGnss/gnss_vendor
+
+
+ vendor.qti.hardware.alarm
+ hwbinder
+ 1.0
+
+ IAlarm
+ default
+
+
+
+ vendor.qti.hardware.data.latency
+ hwbinder
+ 1.0
+
+ ILinkLatency
+ default
+
vendor.qti.hardware.iop
diff --git a/configs/sec_config b/configs/sec_config
index 67fecd6..742092a 100644
--- a/configs/sec_config
+++ b/configs/sec_config
@@ -270,6 +270,10 @@
511:4294967295:1000:1006:1013:1021:1047
/* Allow RCS service to aquire net_raw permission */
18:4294967295:1001:3004
+/* Allow RCS service to communicate to IMS QMI Priv Svc*/
+77:4294967295:1001:3003
+/* Allow cnd to accquire netbind */
+18:4294967295:1000:3003
/* Allow QMID service to aquire net_raw permission */
3:4294967295:1001:1021:3004
2:4294967295:1000:1001:3004
@@ -320,5 +324,3 @@
69:4294967295:1000
/* :: */
57:4294967295:1000
-/* VSS GPS */
-232:4294967295:1001:3004:1021
diff --git a/configs/sec_config_oem b/configs/sec_config_oem
deleted file mode 100644
index 2f44d5e..0000000
--- a/configs/sec_config_oem
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Allow communication to some OEM - QMI services with radio privilages */
-/* Format is ::: */
-/* VSS */
-227:4294967295:1001:3004
-/*COEX*/
-34:4294967295:1001
diff --git a/configs/sensors/hals.conf b/configs/sensors/hals.conf
old mode 100644
new mode 100755
index 5f3a14b..0b323a2
--- a/configs/sensors/hals.conf
+++ b/configs/sensors/hals.conf
@@ -1 +1 @@
-sensors.ssc.so
+sensors.ssc.so
\ No newline at end of file
diff --git a/configs/thermal-engine-8996-lite.conf b/configs/thermal-engine-8996-lite.conf
deleted file mode 100644
index c35a001..0000000
--- a/configs/thermal-engine-8996-lite.conf
+++ /dev/null
@@ -1,150 +0,0 @@
-[SS-CLUSTER1-SP0]
-algo_type ss
-sampling 250
-sensor xo_therm_buf
-device cluster1
-set_point 43000
-set_point_clr 41000
-time_constant 0
-device_perf_floor 1478400
-
-[SS-CLUSTER1-SP1]
-algo_type ss
-sampling 250
-sensor xo_therm_buf
-device cluster1
-set_point 45000
-set_point_clr 43000
-time_constant 0
-device_perf_floor 1113600
-
-[SS-CLUSTER1-SP2]
-algo_type ss
-sampling 250
-sensor xo_therm_buf
-device cluster1
-set_point 48000
-set_point_clr 45000
-time_constant 0
-device_perf_floor 940800
-
-[SS-CLUSTER0-SP0]
-algo_type ss
-sampling 250
-sensor xo_therm_buf
-device cluster0
-set_point 43000
-set_point_clr 41000
-time_constant 0
-device_perf_floor 1128800
-
-[SS-CLUSTER0-SP1]
-algo_type ss
-sampling 250
-sensor xo_therm_buf
-device cluster0
-set_point 45000
-set_point_clr 43000
-time_constant 0
-device_perf_floor 960000
-
-[SS-CLUSTER0-SP2]
-algo_type ss
-sampling 250
-sensor xo_therm_buf
-device cluster0
-set_point 48000
-set_point_clr 45000
-time_constant 0
-device_perf_floor 844800
-
-[SKIN-SS-CPUS-ALL-1]
-algo_type ss
-sampling 250
-sensor xo_therm_buf
-device cpu_voltage
-set_point 50000
-set_point_clr 48000
-time_constant 0
-
-[SS-GPU]
-#algo_type ss
-sampling 250
-sensor xo_therm_buf
-device gpu
-set_point 47000
-set_point_clr 43000
-time_constant 0
-
-[GPU_management]
-algo_type monitor
-sensor xo_therm_buf
-sampling 1000
-thresholds 41000 43000
-thresholds_clr 38000 41000
-actions gpu gpu
-action_info 510000000 401800000
-
-
-[SKIN-BATTERY-MONITOR]
-algo_type monitor
-sampling 1000
-sensor xo_therm_buf
-thresholds 43000 45000 48000 60000
-thresholds_clr 41000 43000 45000 48000
-actions battery battery battery battery
-action_info 0 1 2 3
-
-[CAMERA-CAMCORDER-MONITOR]
-algo_type monitor
-sampling 1000
-sensor xo_therm_buf
-thresholds 42000 45000 50000
-thresholds_clr 40000 42000 45000
-actions camera+camcorder camera+camcorder camera+camcorder
-action_info 1 2 3
-
-[HISTORY-XO]
-algo_type history
-sampling 1000
-sensor xo_therm_buf
-thresholds 31000 41000 46000 51000 56000 61000
-thresholds_clr 30000 40000 45000 50000 55000 60000
-actions history_log history_log history_log history_log history_log history_log
-action_info 0 1 2 3 4 5
-
-[HISTORY-CPU0]
-algo_type history
-sampling 1000
-sensor tsens_tz_sensor3
-thresholds 61000 76000 91000
-thresholds_clr 60000 75000 90000
-actions history_log history_log history_log
-action_info 0 1 2
-
-[HISTORY-CPU4]
-algo_type history
-sampling 1000
-sensor tsens_tz_sensor8
-thresholds 61000 76000 91000
-thresholds_clr 60000 75000 90000
-actions history_log history_log history_log
-action_info 0 1 2
-
-[HISTORY-MODEM-PA0]
-algo_type history
-sampling 1000
-sensor pa_therm0
-thresholds 31000 36000 41000 46000 51000 56000 61000
-thresholds_clr 30000 35000 40000 45000 50000 55000 60000
-actions history_log history_log history_log history_log history_log history_log history_log
-action_info 0 1 2 3 4 5 6
-
-[HISTORY-MODEM-PA1]
-algo_type history
-sampling 1000
-sensor pa_therm1
-thresholds 31000 36000 41000 46000 51000 56000 61000
-thresholds_clr 30000 35000 40000 45000 50000 55000 60000
-actions history_log history_log history_log history_log history_log history_log history_log
-action_info 0 1 2 3 4 5 6
diff --git a/configs/vendor_framework_compatibility_matrix.xml b/configs/vendor_framework_compatibility_matrix.xml
new file mode 100644
index 0000000..4e6dc7d
--- /dev/null
+++ b/configs/vendor_framework_compatibility_matrix.xml
@@ -0,0 +1,262 @@
+
+
+
+ vendor.qti.hardware.perf
+ 1.0
+
+ IPerf
+ default
+
+
+
+ vendor.display.color
+ 1.0-2
+
+ IDisplayColor
+ default
+
+
+
+ vendor.display.postproc
+ 1.0
+
+ IDisplayPostproc
+ default
+
+
+
+ vendor.display.config
+ 1.0-4
+
+ IDisplayConfig
+ default
+
+
+
+ vendor.qti.hardware.qteeconnector
+ 1.0
+
+ IAppConnector
+ default
+
+
+ IGPAppConnector
+ default
+
+
+
+ vendor.qti.hardware.factory
+ 1.0
+
+ IFactory
+ default
+
+
+
+ com.qualcomm.qti.ant
+ 1.0
+
+ IAntHci
+ default
+
+
+
+ com.qualcomm.qti.bluetooth_audio
+ 1.0
+
+ IBluetoothAudio
+ default
+
+
+
+ com.qualcomm.qti.wifidisplayhal
+ 1.0
+
+ IHDCPSession
+ wifidisplayhdcphal
+
+
+ IDSManager
+ wifidisplaydshal
+
+
+
+ android.hardware.gnss
+ 1.0-1
+
+ IGnss
+ default
+
+
+
+ vendor.qti.hardware.alarm
+ 1.0
+
+ IAlarm
+ default
+
+
+
+ vendor.qti.hardware.fm
+ 1.0
+
+ IFmHci
+ default
+
+
+
+ vendor.qti.hardware.iop
+ 2.0
+
+ IIop
+ default
+
+
+
+ vendor.qti.hardware.qdutils_disp
+ 1.0
+
+ IQdutilsDisp
+ default
+
+
+
+ vendor.qti.hardware.sensorscalibrate
+ 1.0
+
+ ISensorsCalibrate
+ default
+
+
+
+ vendor.qti.hardware.soter
+ 1.0
+
+ ISoter
+ default
+
+
+
+ vendor.qti.hardware.tui_comm
+ 1.0
+
+ ITuiComm
+ default
+
+
+
+ vendor.qti.hardware.vpp
+ 1.0-1
+
+ IHidlVppService
+ vppService
+
+
+
+ android.hardware.wifi.supplicant
+ 1.0
+
+ ISupplicant
+ default
+
+
+
+ vendor.qti.hardware.wigig.netperftuner
+ 1.0
+
+ INetPerfTuner
+ default
+
+
+
+ vendor.qti.hardware.wigig.supptunnel
+ 1.0
+
+ ISuppTunnelProvider
+ default
+
+
+
+ vendor.qti.imsrtpservice
+ 1.0
+
+ IRTPService
+ imsrtpservice
+
+
+
+ vendor.qti.voiceprint
+ 1.0
+
+ IQtiVoicePrintService
+ default
+
+
+
+ android.hardware.gnss
+ 1.0
+
+ IGnss
+ gnss_vendor
+
+
+
+ vendor.qti.gnss
+ 1.0-2
+ 2.0
+
+ ILocHidlGnss
+ gnss_vendor
+
+
+
+ vendor.qti.hardware.wifi.supplicant
+ 2.0
+
+ ISupplicantVendor
+ default
+
+
+
+ vendor.qti.hardware.wifi.hostapd
+ 1.0
+
+ IHostapdVendor
+ default
+
+
+
+ vendor.qti.data.factory
+ 1.0
+
+ IFactory
+ default
+
+
+
diff --git a/device.mk b/device.mk
old mode 100644
new mode 100755
index 9b9e0c9..2c4df58
--- a/device.mk
+++ b/device.mk
@@ -1,6 +1,6 @@
#
# Copyright (C) 2016 The CyanogenMod Project
-# Copyright (C) 2017 The LineageOS Project
+# Copyright (C) 2017-2019 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,31 +20,36 @@ $(call inherit-product-if-exists, vendor/samsung/gts3llte/gts3llte-vendor.mk)
LOCAL_PATH := device/samsung/gts3llte
-# Overlay
+# Overlays
DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay
# Screen density
PRODUCT_AAPT_CONFIG := normal
-PRODUCT_AAPT_PREF_CONFIG := xxhdpi
+PRODUCT_AAPT_PREF_CONFIG := xxxhdpi
# Boot animation
TARGET_SCREEN_HEIGHT := 2048
TARGET_SCREEN_WIDTH := 1536
-#TARGET_BOOTANIMATION_HALF_RES := true
+TARGET_BOOTANIMATION_HALF_RES := true
# Device characteristics
PRODUCT_CHARACTERISTICS := tablet
-$(call inherit-product, frameworks/native/build/phone-xxhdpi-3072-dalvik-heap.mk)
-
-$(call inherit-product-if-exists, frameworks/native/build/phone-xxhdpi-3072-hwui-memory.mk)
+# Dalvik
+PRODUCT_PROPERTY_OVERRIDES += \
+ dalvik.vm.heapstartsize=16m \
+ dalvik.vm.heapgrowthlimit=256m \
+ dalvik.vm.heapsize=512m \
+ dalvik.vm.heaptargetutilization=0.75 \
+ dalvik.vm.heapminfree=4m \
+ dalvik.vm.heapmaxfree=16m
# Permissions
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml \
frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml \
- frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
+ frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
@@ -57,20 +62,19 @@ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \
frameworks/native/data/etc/android.hardware.sensor.stepcounter.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepcounter.xml \
frameworks/native/data/etc/android.hardware.sensor.stepdetector.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.stepdetector.xml \
+ frameworks/native/data/etc/android.hardware.telephony.cdma.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.cdma.xml \
+ frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml \
frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
frameworks/native/data/etc/android.hardware.vulkan.compute-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.compute.xml \
frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.level.xml \
- frameworks/native/data/etc/android.hardware.vulkan.version-1_0_3.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \
+ frameworks/native/data/etc/android.hardware.vulkan.version-1_1.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.vulkan.version.xml \
frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
- frameworks/native/data/etc/android.software.freeform_window_management.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.freeform_window_management.xml \
frameworks/native/data/etc/android.software.midi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.midi.xml \
frameworks/native/data/etc/android.software.sip.voip.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.sip.voip.xml \
frameworks/native/data/etc/tablet_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/tablet_core_hardware.xml \
- frameworks/native/data/etc/android.hardware.telephony.cdma.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.cdma.xml \
- frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml
# QMI
PRODUCT_COPY_FILES += \
@@ -81,17 +85,14 @@ PRODUCT_COPY_FILES += \
# ANT+
PRODUCT_PACKAGES += \
AntHalService \
- com.dsi.ant.antradio_library \
- libantradio
+ com.dsi.ant.antradio_library
# Audio
PRODUCT_PACKAGES += \
android.hardware.audio@2.0-impl \
android.hardware.audio@2.0-service \
android.hardware.audio.effect@2.0-impl \
- android.hardware.soundtrigger@2.0-impl \
audio.a2dp.default \
- audio.primary.msm8996 \
audio.r_submix.default \
audio.usb.default \
libaudio-resampler \
@@ -102,33 +103,30 @@ PRODUCT_PACKAGES += \
libvolumelistener \
tinymix
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/configs/audio/audio_effects.conf:system/etc/audio_effects.conf \
- $(LOCAL_PATH)/configs/audio/listen_platform_info.xml:system/etc/listen_platform_info.xml \
- $(LOCAL_PATH)/configs/audio/audio_output_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_output_policy.conf \
- $(LOCAL_PATH)/configs/audio/audio_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info.xml \
- $(LOCAL_PATH)/configs/audio/audio_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy.conf \
- $(LOCAL_PATH)/configs/audio/mixer_paths_tasha.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_tasha.xml
+# audio.primary.msm8996 \
+# android.hardware.soundtrigger@2.0-impl \
-# Bluetooth
-#PRODUCT_PACKAGES += \
-# android.hardware.bluetooth@1.0-impl \
-# android.hardware.bluetooth@1.0-service
+#PRODUCT_COPY_FILES += \
+# $(LOCAL_PATH)/configs/audio/audio_effects.conf:system/etc/audio_effects.conf \
+# $(LOCAL_PATH)/configs/audio/listen_platform_info.xml:system/etc/listen_platform_info.xml \
+# $(LOCAL_PATH)/configs/audio/audio_output_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_output_policy.conf \
+# $(LOCAL_PATH)/configs/audio/audio_platform_info.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info.xml \
+# $(LOCAL_PATH)/configs/audio/audio_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy.conf \
+# $(LOCAL_PATH)/configs/audio/mixer_paths_tasha.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths_tasha.xml
# Camera
PRODUCT_PACKAGES += \
android.hardware.camera.provider@2.4-impl \
- camera.device@3.2-impl \
- libshims_cameraclient
-
-PRODUCT_PACKAGES += \
vendor.qti.hardware.camera.device@1.0 \
vendor.qti.hardware.camera.device@1.0_vendor
+PRODUCT_PACKAGES += \
+ libshims_cameraclient
+
PRODUCT_PACKAGES += \
Snap
-# CNE
+# Connectivity Engine support (CNE)
PRODUCT_PACKAGES += \
libcnefeatureconfig
@@ -139,6 +137,7 @@ PRODUCT_PACKAGES += \
android.hardware.graphics.composer@2.1-impl \
android.hardware.graphics.composer@2.1-service \
android.hardware.graphics.mapper@2.0-impl \
+ android.hardware.configstore@1.1-service \
android.hardware.memtrack@1.0-impl \
android.hardware.memtrack@1.0-service \
copybit.msm8996 \
@@ -146,9 +145,12 @@ PRODUCT_PACKAGES += \
hwcomposer.msm8996 \
memtrack.msm8996 \
libdisplayconfig \
+ libhwc2on1adapter \
+ libgenlock \
liboverlay \
- libqdMetaData.system \
- libtinyxml
+ libtinyxml \
+ libqdMetaData \
+ libqdMetaData.system
# Display
PRODUCT_COPY_FILES += \
@@ -162,12 +164,12 @@ PRODUCT_PACKAGES += \
# DRM
PRODUCT_PACKAGES += \
android.hardware.drm@1.0-impl \
- android.hardware.drm@1.0-service
+ android.hardware.drm@1.0-service \
+ android.hardware.drm@1.1-service.clearkey
# Fingerprint
PRODUCT_PACKAGES += \
android.hardware.biometrics.fingerprint@2.1-service \
- fingerprint.msm8996 \
libbauthtzcommon_shim
# For config.fs
@@ -184,7 +186,8 @@ PRODUCT_PACKAGES += \
android.hardware.gnss@1.0-impl-qti \
libcurl \
libgnss \
- libgnsspps
+ libgnsspps \
+ libsensorndkbridge
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/gps/etc/flp.conf:$(TARGET_COPY_OUT_VENDOR)/etc/flp.conf \
@@ -196,22 +199,29 @@ PRODUCT_COPY_FILES += \
# Healthd
PRODUCT_PACKAGES += \
- android.hardware.health@1.0-impl \
- android.hardware.health@1.0-service
+ android.hardware.health@2.0-impl \
+ android.hardware.health@2.0-service \
+ charger_res_images
# HIDL
PRODUCT_PACKAGES += \
android.hidl.base@1.0 \
- android.hidl.manager@1.0
+ android.hidl.base@1.0_system \
+ android.hidl.manager@1.0 \
+ android.hidl.manager@1.0_system
# IMS
PRODUCT_PACKAGES += \
ims-ext-common
+# IPA Manager
+PRODUCT_PACKAGES += \
+ ipacm \
+ IPACM_cfg.xml
+
# IPC router config
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/configs/sec_config:$(TARGET_COPY_OUT_VENDOR)/etc/sec_config \
- $(LOCAL_PATH)/configs/sec_config_oem:$(TARGET_COPY_OUT_VENDOR)/etc/sec_config_oem
+ $(LOCAL_PATH)/configs/sec_config:$(TARGET_COPY_OUT_VENDOR)/etc/sec_config
# IPv6
PRODUCT_PACKAGES += \
@@ -246,9 +256,9 @@ PRODUCT_PACKAGES += \
android.hardware.light@2.0-impl \
lights.MSM8996
-# LiveDisplay native
+# LiveDisplay
PRODUCT_PACKAGES += \
- vendor.lineage.livedisplay@1.0-service-sdm
+ vendor.lineage.livedisplay@2.0-service-sdm
# Media
PRODUCT_COPY_FILES += \
@@ -266,28 +276,19 @@ PRODUCT_PACKAGES += \
android.system.net.netd@1.0 \
libandroid_net \
netutils-wrapper-1.0
-
+
# OMX
PRODUCT_PACKAGES += \
libc2dcolorconvert \
- libdashplayer \
- libdivxdrmdecrypt \
- libhypv_intercept \
- libmm-omxcore \
libextmedia_jni \
libOmxAacEnc \
libOmxAmrEnc \
libOmxCore \
libOmxEvrcEnc \
libOmxQcelp13Enc \
- libOmxSwVencMpeg4 \
- libOmxSwVencHevc \
libOmxVdec \
- libOmxVdecHevc \
libOmxVenc \
- libOmxVidcCommon \
- libstagefrighthw \
- libstagefright_soft_flacdec
+ libstagefrighthw
# Power
PRODUCT_PACKAGES += \
@@ -296,6 +297,10 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/powerhint.xml:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.xml
+# QMI
+PRODUCT_PACKAGES += \
+ libjson
+
# RCS
PRODUCT_PACKAGES += \
rcs_service_aidl \
@@ -310,7 +315,6 @@ PRODUCT_PACKAGES += \
init.qcom.power.rc \
init.qcom.usb.rc \
init.samsung.rc \
- init.target.rc \
ueventd.qcom.rc \
init.qcom.sh
@@ -320,6 +324,8 @@ PRODUCT_PACKAGES += \
# RIL
PRODUCT_PACKAGES += \
+ android.hardware.radio@1.2 \
+ android.hardware.radio.config@1.0 \
libprotobuf-cpp-full \
librmnetctl \
libxml2
@@ -328,11 +334,12 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/seccomp_policy/mediacodec.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediacodec.policy \
$(LOCAL_PATH)/seccomp_policy/mediaextractor.policy:$(TARGET_COPY_OUT_VENDOR)/etc/seccomp_policy/mediaextractor.policy
-
+
# Sensors
PRODUCT_PACKAGES += \
- android.hardware.sensors@1.0-impl
-
+ android.hardware.sensors@1.0-impl \
+ android.hardware.sensors@1.0-service
+
# Sensors
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/sensors/hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf \
@@ -340,17 +347,7 @@ PRODUCT_COPY_FILES += \
# Thermal engine
PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/configs/thermal-engine-8996-lite.conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermal-engine-8996-lite.conf \
$(LOCAL_PATH)/configs/thermal-engine-8996.conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermal-engine-8996.conf
-
-# USB
-PRODUCT_PACKAGES += \
- android.hardware.usb@1.0-service
-
-# Vibrator
-PRODUCT_PACKAGES += \
- android.hardware.vibrator@1.0-impl \
- android.hardware.vibrator@1.0-service
# Telephony
PRODUCT_PACKAGES += \
@@ -361,19 +358,30 @@ PRODUCT_BOOT_JARS += \
# TextClassifier
PRODUCT_PACKAGES += \
- textclassifier.smartselection.bundle1
+ textclassifier.bundle1
+
+# Trust HAL
+PRODUCT_PACKAGES += \
+ vendor.lineage.trust@1.0-service
+
+# USB
+PRODUCT_PACKAGES += \
+ android.hardware.usb@1.0-service.basic
# VNDK
PRODUCT_PACKAGES += \
vndk-sp
-# WCNSS
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/wifi/WCNSS_cfg.dat:system/etc/firmware/wlan/qca_cld/WCNSS_cfg.dat \
- $(LOCAL_PATH)/wifi/WCNSS_qcom_cfg.ini:system/etc/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini \
- $(LOCAL_PATH)/wifi/grippower.info:system/etc/firmware/wlan/qca_cld/grippower.info
+# Vibrator
+PRODUCT_PACKAGES += \
+ android.hardware.vibrator@1.0-impl \
+ android.hardware.vibrator@1.0-service
+
+# USB
+PRODUCT_PACKAGES += \
+ android.hardware.usb@1.0-service
-# Wifi
+# WiFi
PRODUCT_PACKAGES += \
android.hardware.wifi@1.0-service \
libqsap_sdk \
@@ -391,10 +399,14 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/wifi/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf \
$(LOCAL_PATH)/wifi/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/wifi/WCNSS_qcom_cfg.ini:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/WCNSS_qcom_cfg.ini
+
# ADB
-PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
persist.sys.usb.config=adb \
- ro.adb.secure=0
+ ro.adb.secure=0 \
+ ro.secure=0
# Root
PRODUCT_PACKAGES += \
diff --git a/doze/Android.mk b/doze/Android.mk
old mode 100644
new mode 100755
index 5eb8c1d..585b3dd
--- a/doze/Android.mk
+++ b/doze/Android.mk
@@ -7,6 +7,7 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := SamsungDoze
LOCAL_CERTIFICATE := platform
+LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_PRIVILEGED_MODULE := true
LOCAL_USE_AAPT2 := true
@@ -17,10 +18,7 @@ LOCAL_STATIC_ANDROID_LIBRARIES := \
android-support-v7-recyclerview \
android-support-v7-preference \
android-support-v7-appcompat \
- android-support-v14-preference \
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
- org.lineageos.platform.internal
+ android-support-v14-preference
LOCAL_RESOURCE_DIR := \
$(LOCAL_PATH)/res \
diff --git a/doze/AndroidManifest.xml b/doze/AndroidManifest.xml
old mode 100644
new mode 100755
index 3dbb0e0..9f60893
--- a/doze/AndroidManifest.xml
+++ b/doze/AndroidManifest.xml
@@ -27,14 +27,14 @@
+ android:minSdkVersion="24"
+ android:targetSdkVersion="24"/>
-
+
diff --git a/doze/res/color/switch_bar_bg.xml b/doze/res/color/switch_bar_bg.xml
new file mode 100644
index 0000000..ba2dae1
--- /dev/null
+++ b/doze/res/color/switch_bar_bg.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
diff --git a/doze/res/color/switchbar_switch_thumb_tint.xml b/doze/res/color/switchbar_switch_thumb_tint.xml
new file mode 100644
index 0000000..d4bf9b3
--- /dev/null
+++ b/doze/res/color/switchbar_switch_thumb_tint.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
diff --git a/doze/res/color/switchbar_switch_track_tint.xml b/doze/res/color/switchbar_switch_track_tint.xml
new file mode 100644
index 0000000..ae45c7a
--- /dev/null
+++ b/doze/res/color/switchbar_switch_track_tint.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
diff --git a/doze/res/drawable/switchbar_background.xml b/doze/res/drawable/switchbar_background.xml
index 314ed12..f210707 100644
--- a/doze/res/drawable/switchbar_background.xml
+++ b/doze/res/drawable/switchbar_background.xml
@@ -1,5 +1,5 @@
-
-
-
-
+
+
+
diff --git a/doze/res/layout/switch_bar.xml b/doze/res/layout/switch_bar.xml
index 7199174..9e11a0a 100644
--- a/doze/res/layout/switch_bar.xml
+++ b/doze/res/layout/switch_bar.xml
@@ -29,11 +29,12 @@
android:layout_width="0dp"
android:layout_weight="1"
android:layout_gravity="center_vertical"
- android:paddingStart="48dp"
+ android:paddingStart="56dp"
android:maxLines="2"
android:ellipsize="end"
android:textAppearance="@android:style/TextAppearance.Material.Title"
- android:textColor="?android:attr/textColorPrimary"
+ android:textColor="@android:color/white"
+ android:textSize="18sp"
android:textAlignment="viewStart" />
+ android:theme="@style/Theme.Main.SwitchBar.Switch" />
diff --git a/doze/res/values/styles.xml b/doze/res/values/styles.xml
index 082e53c..3443c0b 100644
--- a/doze/res/values/styles.xml
+++ b/doze/res/values/styles.xml
@@ -54,4 +54,9 @@
+
+
diff --git a/doze/res/xml/doze_settings.xml b/doze/res/xml/doze_settings.xml
index 005c6ae..e00d61a 100644
--- a/doze/res/xml/doze_settings.xml
+++ b/doze/res/xml/doze_settings.xml
@@ -1,6 +1,7 @@
+
+
diff --git a/doze/src/org/lineageos/settings/doze/BootCompletedReceiver.java b/doze/src/org/lineageos/settings/doze/BootCompletedReceiver.java
old mode 100644
new mode 100755
index 7a19669..cfd2fa0
--- a/doze/src/org/lineageos/settings/doze/BootCompletedReceiver.java
+++ b/doze/src/org/lineageos/settings/doze/BootCompletedReceiver.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The CyanogenMod Project
- * 2017 The LineageOS Project
+ * 2017-2019 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,10 +29,7 @@ public class BootCompletedReceiver extends BroadcastReceiver {
@Override
public void onReceive(final Context context, Intent intent) {
- if (Utils.isDozeEnabled(context) && Utils.sensorsEnabled(context)) {
- if (DEBUG) Log.d(TAG, "Starting service");
- Utils.startService(context);
- }
+ if (DEBUG) Log.d(TAG, "Received boot completed intent");
+ Utils.checkDozeService(context);
}
-
}
diff --git a/doze/src/org/lineageos/settings/doze/DozeService.java b/doze/src/org/lineageos/settings/doze/DozeService.java
index 2c88a83..5b161e2 100644
--- a/doze/src/org/lineageos/settings/doze/DozeService.java
+++ b/doze/src/org/lineageos/settings/doze/DozeService.java
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2015 The CyanogenMod Project
- * 2017 The LineageOS Project
+ * Copyright (C) 2015 The CyanogenMod Project
+ * 2017-2018 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,22 +25,18 @@ import android.content.IntentFilter;
import android.os.IBinder;
import android.util.Log;
-public class DozeService extends Service
-{
+public class DozeService extends Service {
private static final String TAG = "DozeService";
private static final boolean DEBUG = false;
private ProximitySensor mProximitySensor;
private TiltSensor mTiltSensor;
- private SignificantSensor mSignificantSensor;
@Override
- public void onCreate()
- {
+ public void onCreate() {
if (DEBUG) Log.d(TAG, "Creating service");
mProximitySensor = new ProximitySensor(this);
mTiltSensor = new TiltSensor(this);
- mSignificantSensor = new SignificantSensor(this);
IntentFilter screenStateFilter = new IntentFilter(Intent.ACTION_SCREEN_ON);
screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF);
@@ -48,62 +44,55 @@ public class DozeService extends Service
}
@Override
- public int onStartCommand(Intent intent, int flags, int startId)
- {
+ public int onStartCommand(Intent intent, int flags, int startId) {
if (DEBUG) Log.d(TAG, "Starting service");
return START_STICKY;
}
@Override
- public void onDestroy()
- {
+ public void onDestroy() {
if (DEBUG) Log.d(TAG, "Destroying service");
super.onDestroy();
this.unregisterReceiver(mScreenStateReceiver);
mProximitySensor.disable();
mTiltSensor.disable();
- mSignificantSensor.disable();
}
@Override
- public IBinder onBind(Intent intent)
- {
+ public IBinder onBind(Intent intent) {
return null;
}
- private void onDisplayOn()
- {
+ private void onDisplayOn() {
if (DEBUG) Log.d(TAG, "Display on");
- if (Utils.pickUpEnabled(this))
- {
+ if (Utils.isPickUpEnabled(this)) {
mTiltSensor.disable();
- mSignificantSensor.disable();
}
- if (Utils.handwaveGestureEnabled(this) || Utils.pocketGestureEnabled(this))
+ if (Utils.isHandwaveGestureEnabled(this) ||
+ Utils.isPocketGestureEnabled(this)) {
mProximitySensor.disable();
- }
-
- private void onDisplayOff()
- {
- if (DEBUG) Log.d(TAG, "Display off");
- if (Utils.pickUpEnabled(this))
- {
- mTiltSensor.enable();
- mSignificantSensor.enable();
}
- if (Utils.handwaveGestureEnabled(this) || Utils.pocketGestureEnabled(this))
- mProximitySensor.enable();
}
- private BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver()
- {
+ private void onDisplayOff() {
+ if (DEBUG) Log.d(TAG, "Display off");
+ if (Utils.isPickUpEnabled(this)) {
+ mTiltSensor.enable();
+ }
+ if (Utils.isHandwaveGestureEnabled(this) ||
+ Utils.isPocketGestureEnabled(this)) {
+ mProximitySensor.enable();
+ }
+ }
+
+ private BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver() {
@Override
- public void onReceive(Context context, Intent intent)
- {
- if (intent.getAction().equals(Intent.ACTION_SCREEN_ON))
+ public void onReceive(Context context, Intent intent) {
+ if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
onDisplayOn();
- else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF))
+ } else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
onDisplayOff();
+ }
}
};
}
diff --git a/doze/src/org/lineageos/settings/doze/DozeSettingsFragment.java b/doze/src/org/lineageos/settings/doze/DozeSettingsFragment.java
index 1798c10..e836de9 100644
--- a/doze/src/org/lineageos/settings/doze/DozeSettingsFragment.java
+++ b/doze/src/org/lineageos/settings/doze/DozeSettingsFragment.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2015 The CyanogenMod Project
- * 2017-2018 The LineageOS Project
+ * 2017-2019 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
+import android.os.Handler;
import android.support.v14.preference.PreferenceFragment;
import android.support.v14.preference.SwitchPreference;
import android.support.v7.preference.Preference;
@@ -43,11 +44,16 @@ public class DozeSettingsFragment extends PreferenceFragment implements OnPrefer
CompoundButton.OnCheckedChangeListener {
private TextView mTextView;
+ private View mSwitchBar;
+
+ private SwitchPreference mAlwaysOnDisplayPreference;
private SwitchPreference mPickUpPreference;
private SwitchPreference mHandwavePreference;
private SwitchPreference mPocketPreference;
+ private Handler mHandler = new Handler();
+
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
addPreferencesFromResource(R.xml.doze_settings);
@@ -62,22 +68,40 @@ public class DozeSettingsFragment extends PreferenceFragment implements OnPrefer
boolean dozeEnabled = Utils.isDozeEnabled(getActivity());
+ mAlwaysOnDisplayPreference = (SwitchPreference) findPreference(Utils.ALWAYS_ON_DISPLAY);
+ mAlwaysOnDisplayPreference.setEnabled(dozeEnabled);
+ mAlwaysOnDisplayPreference.setChecked(Utils.isAlwaysOnEnabled(getActivity()));
+ mAlwaysOnDisplayPreference.setOnPreferenceChangeListener(this);
+
+ PreferenceCategory tiltSensorCategory =
+ (PreferenceCategory) getPreferenceScreen().findPreference(Utils.CATEG_TILT_SENSOR);
PreferenceCategory proximitySensorCategory =
(PreferenceCategory) getPreferenceScreen().findPreference(Utils.CATEG_PROX_SENSOR);
mPickUpPreference = (SwitchPreference) findPreference(Utils.GESTURE_PICK_UP_KEY);
mPickUpPreference.setEnabled(dozeEnabled);
+ mPickUpPreference.setOnPreferenceChangeListener(this);
mHandwavePreference = (SwitchPreference) findPreference(Utils.GESTURE_HAND_WAVE_KEY);
mHandwavePreference.setEnabled(dozeEnabled);
+ mHandwavePreference.setOnPreferenceChangeListener(this);
mPocketPreference = (SwitchPreference) findPreference(Utils.GESTURE_POCKET_KEY);
mPocketPreference.setEnabled(dozeEnabled);
+ mPocketPreference.setOnPreferenceChangeListener(this);
// Hide proximity sensor related features if the device doesn't support them
if (!Utils.getProxCheckBeforePulse(getActivity())) {
getPreferenceScreen().removePreference(proximitySensorCategory);
}
+
+ // Hide AOD if not supported and set all its dependents otherwise
+ if (!Utils.alwaysOnDisplayAvailable(getActivity())) {
+ getPreferenceScreen().removePreference(mAlwaysOnDisplayPreference);
+ } else {
+ tiltSensorCategory.setDependency(Utils.ALWAYS_ON_DISPLAY);
+ proximitySensorCategory.setDependency(Utils.ALWAYS_ON_DISPLAY);
+ }
}
@Override
@@ -98,29 +122,45 @@ public class DozeSettingsFragment extends PreferenceFragment implements OnPrefer
mTextView.setText(getString(dozeEnabled ?
R.string.switch_bar_on : R.string.switch_bar_off));
- View switchBar = view.findViewById(R.id.switch_bar);
- Switch switchWidget = switchBar.findViewById(android.R.id.switch_widget);
+ mSwitchBar = view.findViewById(R.id.switch_bar);
+ Switch switchWidget = mSwitchBar.findViewById(android.R.id.switch_widget);
switchWidget.setChecked(dozeEnabled);
switchWidget.setOnCheckedChangeListener(this);
- switchBar.setOnClickListener(v -> switchWidget.setChecked(!switchWidget.isChecked()));
+ mSwitchBar.setActivated(dozeEnabled);
+ mSwitchBar.setOnClickListener(v -> {
+ switchWidget.setChecked(!switchWidget.isChecked());
+ mSwitchBar.setActivated(switchWidget.isChecked());
+ });
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
- Utils.checkDozeService(getActivity());
+ if (Utils.ALWAYS_ON_DISPLAY.equals(preference.getKey())) {
+ Utils.enableAlwaysOn(getActivity(), (Boolean) newValue);
+ }
+
+ mHandler.post(() -> Utils.checkDozeService(getActivity()));
+
return true;
}
@Override
- public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
- Utils.enableDoze(b, getActivity());
+ public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
+ Utils.enableDoze(getActivity(), isChecked);
Utils.checkDozeService(getActivity());
- mTextView.setText(getString(b ? R.string.switch_bar_on : R.string.switch_bar_off));
+ mTextView.setText(getString(isChecked ? R.string.switch_bar_on : R.string.switch_bar_off));
+ mSwitchBar.setActivated(isChecked);
- mPickUpPreference.setEnabled(b);
- mHandwavePreference.setEnabled(b);
- mPocketPreference.setEnabled(b);
+ if (!isChecked) {
+ Utils.enableAlwaysOn(getActivity(), false);
+ mAlwaysOnDisplayPreference.setChecked(false);
+ }
+ mAlwaysOnDisplayPreference.setEnabled(isChecked);
+
+ mPickUpPreference.setEnabled(isChecked);
+ mHandwavePreference.setEnabled(isChecked);
+ mPocketPreference.setEnabled(isChecked);
}
@Override
diff --git a/doze/src/org/lineageos/settings/doze/ProximitySensor.java b/doze/src/org/lineageos/settings/doze/ProximitySensor.java
index a036304..71594ff 100644
--- a/doze/src/org/lineageos/settings/doze/ProximitySensor.java
+++ b/doze/src/org/lineageos/settings/doze/ProximitySensor.java
@@ -24,6 +24,10 @@ import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.util.Log;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
public class ProximitySensor implements SensorEventListener {
private static final boolean DEBUG = false;
@@ -38,6 +42,7 @@ public class ProximitySensor implements SensorEventListener {
private SensorManager mSensorManager;
private Sensor mSensor;
private Context mContext;
+ private ExecutorService mExecutorService;
private boolean mSawNear = false;
private long mInPocketTime = 0;
@@ -46,11 +51,16 @@ public class ProximitySensor implements SensorEventListener {
mContext = context;
mSensorManager = mContext.getSystemService(SensorManager.class);
mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY, false);
+ mExecutorService = Executors.newSingleThreadExecutor();
+ }
+
+ private Future> submit(Runnable runnable) {
+ return mExecutorService.submit(runnable);
}
@Override
public void onSensorChanged(SensorEvent event) {
-/* boolean isNear = event.values[0] < mSensor.getMaximumRange();
+ boolean isNear = event.values[0] < mSensor.getMaximumRange();
if (mSawNear && !isNear) {
if (shouldPulse(event.timestamp)) {
Utils.launchDozePulse(mContext);
@@ -58,17 +68,17 @@ public class ProximitySensor implements SensorEventListener {
} else {
mInPocketTime = event.timestamp;
}
- mSawNear = isNear;*/
+ mSawNear = isNear;
}
private boolean shouldPulse(long timestamp) {
long delta = timestamp - mInPocketTime;
- if (Utils.handwaveGestureEnabled(mContext) && Utils.pocketGestureEnabled(mContext)) {
+ if (Utils.isHandwaveGestureEnabled(mContext) && Utils.isPocketGestureEnabled(mContext)) {
return true;
- } else if (Utils.handwaveGestureEnabled(mContext)) {
+ } else if (Utils.isHandwaveGestureEnabled(mContext)) {
return delta < HANDWAVE_MAX_DELTA_NS;
- } else if (Utils.pocketGestureEnabled(mContext)) {
+ } else if (Utils.isPocketGestureEnabled(mContext)) {
return delta >= POCKET_MIN_DELTA_NS;
}
return false;
@@ -81,11 +91,16 @@ public class ProximitySensor implements SensorEventListener {
protected void enable() {
if (DEBUG) Log.d(TAG, "Enabling");
- mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);
+ submit(() -> {
+ mSensorManager.registerListener(this, mSensor,
+ SensorManager.SENSOR_DELAY_NORMAL);
+ });
}
protected void disable() {
if (DEBUG) Log.d(TAG, "Disabling");
- mSensorManager.unregisterListener(this, mSensor);
+ submit(() -> {
+ mSensorManager.unregisterListener(this, mSensor);
+ });
}
}
diff --git a/doze/src/org/lineageos/settings/doze/SignificantSensor.java b/doze/src/org/lineageos/settings/doze/SignificantSensor.java
deleted file mode 100644
index ab4e14c..0000000
--- a/doze/src/org/lineageos/settings/doze/SignificantSensor.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2015 The CyanogenMod Project
- * 2017-2018 The LineageOS Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.lineageos.settings.doze;
-
-import android.content.Context;
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
-import android.os.SystemClock;
-import android.util.Log;
-
-public class SignificantSensor implements SensorEventListener
-{
- private static final boolean DEBUG = false;
- private static final String TAG = "SignificantSensor";
-
- private static final int BATCH_LATENCY_IN_MS = 100;
- private static final int MIN_PULSE_INTERVAL_MS = 2500;
-
- private SensorManager mSensorManager;
- private Sensor mSensor;
- private Context mContext;
-
- private long mEntryTimestamp;
-
- public SignificantSensor(Context context)
- {
- mContext = context;
- mSensorManager = mContext.getSystemService(SensorManager.class);
- mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_SIGNIFICANT_MOTION);
- }
-
- @Override
- public void onSensorChanged(SensorEvent event)
- {
- if (DEBUG) Log.d(TAG, "Got sensor event: " + event.values[0]);
-
-/* long delta = SystemClock.elapsedRealtime() - mEntryTimestamp;
- if (delta < MIN_PULSE_INTERVAL_MS)
- return;
-
- mEntryTimestamp = SystemClock.elapsedRealtime();
-
- if (event.values[0] == 1)
- Utils.launchDozePulse(mContext);*/
- }
-
- @Override
- public void onAccuracyChanged(Sensor sensor, int accuracy)
- {
- /* Empty */
- }
-
- protected void enable()
- {
- if (DEBUG) Log.d(TAG, "Enabling");
- mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL, BATCH_LATENCY_IN_MS * 1000);
- mEntryTimestamp = SystemClock.elapsedRealtime();
- }
-
- protected void disable()
- {
- if (DEBUG) Log.d(TAG, "Disabling");
- mSensorManager.unregisterListener(this, mSensor);
- }
-}
diff --git a/doze/src/org/lineageos/settings/doze/TiltSensor.java b/doze/src/org/lineageos/settings/doze/TiltSensor.java
index 8741ccc..6598127 100644
--- a/doze/src/org/lineageos/settings/doze/TiltSensor.java
+++ b/doze/src/org/lineageos/settings/doze/TiltSensor.java
@@ -25,8 +25,12 @@ import android.hardware.SensorManager;
import android.os.SystemClock;
import android.util.Log;
-public class TiltSensor implements SensorEventListener
-{
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+public class TiltSensor implements SensorEventListener {
+
private static final boolean DEBUG = false;
private static final String TAG = "TiltSensor";
@@ -36,47 +40,55 @@ public class TiltSensor implements SensorEventListener
private SensorManager mSensorManager;
private Sensor mSensor;
private Context mContext;
+ private ExecutorService mExecutorService;
private long mEntryTimestamp;
- public TiltSensor(Context context)
- {
+ public TiltSensor(Context context) {
mContext = context;
mSensorManager = mContext.getSystemService(SensorManager.class);
mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_TILT_DETECTOR);
+ mExecutorService = Executors.newSingleThreadExecutor();
+ }
+
+ private Future> submit(Runnable runnable) {
+ return mExecutorService.submit(runnable);
}
@Override
- public void onSensorChanged(SensorEvent event)
- {
+ public void onSensorChanged(SensorEvent event) {
if (DEBUG) Log.d(TAG, "Got sensor event: " + event.values[0]);
-/* long delta = SystemClock.elapsedRealtime() - mEntryTimestamp;
- if (delta < MIN_PULSE_INTERVAL_MS)
+ long delta = SystemClock.elapsedRealtime() - mEntryTimestamp;
+ if (delta < MIN_PULSE_INTERVAL_MS) {
return;
+ } else {
+ mEntryTimestamp = SystemClock.elapsedRealtime();
+ }
- mEntryTimestamp = SystemClock.elapsedRealtime();
-
- if (event.values[0] == 1)
- Utils.launchDozePulse(mContext);*/
+ if (event.values[0] == 1) {
+ Utils.launchDozePulse(mContext);
+ }
}
@Override
- public void onAccuracyChanged(Sensor sensor, int accuracy)
- {
+ public void onAccuracyChanged(Sensor sensor, int accuracy) {
/* Empty */
}
- protected void enable()
- {
+ protected void enable() {
if (DEBUG) Log.d(TAG, "Enabling");
- mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL, BATCH_LATENCY_IN_MS * 1000);
- mEntryTimestamp = SystemClock.elapsedRealtime();
+ submit(() -> {
+ mSensorManager.registerListener(this, mSensor,
+ SensorManager.SENSOR_DELAY_NORMAL, BATCH_LATENCY_IN_MS * 1000);
+ mEntryTimestamp = SystemClock.elapsedRealtime();
+ });
}
- protected void disable()
- {
+ protected void disable() {
if (DEBUG) Log.d(TAG, "Disabling");
- mSensorManager.unregisterListener(this, mSensor);
+ submit(() -> {
+ mSensorManager.unregisterListener(this, mSensor);
+ });
}
}
diff --git a/doze/src/org/lineageos/settings/doze/Utils.java b/doze/src/org/lineageos/settings/doze/Utils.java
index 2abec57..edcb60e 100644
--- a/doze/src/org/lineageos/settings/doze/Utils.java
+++ b/doze/src/org/lineageos/settings/doze/Utils.java
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2015 The CyanogenMod Project
- * 2017 The LineageOS Project
+ * Copyright (C) 2015 The CyanogenMod Project
+ * 2017-2019 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,9 @@ import android.support.v7.preference.PreferenceManager;
import android.provider.Settings;
import android.util.Log;
+import com.android.internal.hardware.AmbientDisplayConfiguration;
+
+import static android.provider.Settings.Secure.DOZE_ALWAYS_ON;
import static android.provider.Settings.Secure.DOZE_ENABLED;
public final class Utils {
@@ -34,6 +37,9 @@ public final class Utils {
private static final String DOZE_INTENT = "com.android.systemui.doze.pulse";
+ protected static final String ALWAYS_ON_DISPLAY = "always_on_display";
+
+ protected static final String CATEG_TILT_SENSOR = "tilt_sensor";
protected static final String CATEG_PROX_SENSOR = "proximity_sensor";
protected static final String GESTURE_PICK_UP_KEY = "gesture_pick_up";
@@ -53,7 +59,7 @@ public final class Utils {
}
protected static void checkDozeService(Context context) {
- if (isDozeEnabled(context) && sensorsEnabled(context)) {
+ if (isDozeEnabled(context) && !isAlwaysOnEnabled(context) && sensorsEnabled(context)) {
startService(context);
} else {
stopService(context);
@@ -76,7 +82,7 @@ public final class Utils {
DOZE_ENABLED, 1) != 0;
}
- protected static boolean enableDoze(boolean enable, Context context) {
+ protected static boolean enableDoze(Context context, boolean enable) {
return Settings.Secure.putInt(context.getContentResolver(),
DOZE_ENABLED, enable ? 1 : 0);
}
@@ -87,23 +93,43 @@ public final class Utils {
new UserHandle(UserHandle.USER_CURRENT));
}
- protected static boolean pickUpEnabled(Context context) {
- return PreferenceManager.getDefaultSharedPreferences(context)
- .getBoolean(GESTURE_PICK_UP_KEY, false);
+ protected static boolean enableAlwaysOn(Context context, boolean enable) {
+ return Settings.Secure.putIntForUser(context.getContentResolver(),
+ DOZE_ALWAYS_ON, enable ? 1 : 0, UserHandle.USER_CURRENT);
}
- protected static boolean handwaveGestureEnabled(Context context) {
- return PreferenceManager.getDefaultSharedPreferences(context)
- .getBoolean(GESTURE_HAND_WAVE_KEY, false);
+ protected static boolean isAlwaysOnEnabled(Context context) {
+ final boolean enabledByDefault = context.getResources()
+ .getBoolean(com.android.internal.R.bool.config_dozeAlwaysOnEnabled);
+
+ return Settings.Secure.getIntForUser(context.getContentResolver(),
+ DOZE_ALWAYS_ON, alwaysOnDisplayAvailable(context) && enabledByDefault ? 1 : 0,
+ UserHandle.USER_CURRENT) != 0;
}
- protected static boolean pocketGestureEnabled(Context context) {
+ protected static boolean alwaysOnDisplayAvailable(Context context) {
+ return new AmbientDisplayConfiguration(context).alwaysOnAvailable();
+ }
+
+ protected static boolean isGestureEnabled(Context context, String gesture) {
return PreferenceManager.getDefaultSharedPreferences(context)
- .getBoolean(GESTURE_POCKET_KEY, false);
+ .getBoolean(gesture, false);
+ }
+
+ protected static boolean isPickUpEnabled(Context context) {
+ return isGestureEnabled(context, GESTURE_PICK_UP_KEY);
+ }
+
+ protected static boolean isHandwaveGestureEnabled(Context context) {
+ return isGestureEnabled(context, GESTURE_HAND_WAVE_KEY);
+ }
+
+ protected static boolean isPocketGestureEnabled(Context context) {
+ return isGestureEnabled(context, GESTURE_POCKET_KEY);
}
protected static boolean sensorsEnabled(Context context) {
- return pickUpEnabled(context) || handwaveGestureEnabled(context)
- || pocketGestureEnabled(context);
+ return isPickUpEnabled(context) || isHandwaveGestureEnabled(context)
+ || isPocketGestureEnabled(context);
}
}
diff --git a/full_gts3llte.mk b/full_gts3llte.mk
deleted file mode 100644
index 960e595..0000000
--- a/full_gts3llte.mk
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# Copyright (C) 2016 The CyanogenMod Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Inherit from those products. Most specific first.
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
-
-# Inherit from gts3llte device
-$(call inherit-product, device/samsung/gts3llte/device.mk)
-
-# Device identifier. This must come after all inclusions
-PRODUCT_DEVICE := gts3llte
-PRODUCT_NAME := full_gts3llte
-PRODUCT_BRAND := samsung
-PRODUCT_MODEL := gts3llte
-PRODUCT_MANUFACTURER := samsung
diff --git a/gps/Android.mk b/gps/Android.mk
old mode 100644
new mode 100755
index 3be1512..86d8174
--- a/gps/Android.mk
+++ b/gps/Android.mk
@@ -15,4 +15,7 @@
# limitations under the License.
#
-include $(call first-makefiles-under,$(call my-dir))
+LOCAL_PATH := $(call my-dir)
+include $(LOCAL_PATH)/build/target_specific_features.mk
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/gps/android/AGnss.cpp b/gps/android/AGnss.cpp
old mode 100644
new mode 100755
index 3602e85..faaf75e
--- a/gps/android/AGnss.cpp
+++ b/gps/android/AGnss.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
diff --git a/gps/android/AGnss.h b/gps/android/AGnss.h
old mode 100644
new mode 100755
index ead6416..cdd5931
--- a/gps/android/AGnss.h
+++ b/gps/android/AGnss.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
@@ -18,8 +18,8 @@
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
-#define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
+#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
+#define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
#include
#include
@@ -76,4 +76,4 @@ struct AGnss : public IAGnss {
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H
+#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H
diff --git a/gps/android/AGnssRil.cpp b/gps/android/AGnssRil.cpp
old mode 100644
new mode 100755
index d790bae..f4b9849
--- a/gps/android/AGnssRil.cpp
+++ b/gps/android/AGnssRil.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
diff --git a/gps/android/AGnssRil.h b/gps/android/AGnssRil.h
old mode 100644
new mode 100755
index 61216d8..7f18c57
--- a/gps/android/AGnssRil.h
+++ b/gps/android/AGnssRil.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
diff --git a/gps/android/Android.mk b/gps/android/Android.mk
old mode 100644
new mode 100755
index 5f17415..dc721db
--- a/gps/android/Android.mk
+++ b/gps/android/Android.mk
@@ -2,8 +2,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti
-LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
-LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
+LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := \
AGnss.cpp \
@@ -36,6 +35,7 @@ LOCAL_SHARED_LIBRARIES := \
libhidlbase \
libhidltransport \
libhwbinder \
+ libcutils \
libutils \
android.hardware.gnss@1.0 \
@@ -43,7 +43,6 @@ LOCAL_SHARED_LIBRARIES += \
libloc_core \
libgps.utils \
libdl \
- libloc_pla \
liblocation_api \
LOCAL_CFLAGS += $(GNSS_CFLAGS)
@@ -52,19 +51,15 @@ include $(BUILD_SHARED_LIBRARY)
BUILD_GNSS_HIDL_SERVICE := true
ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true)
ifneq ($(LW_FEATURE_SET),true)
-ifneq ($(TARGET_HAS_LOW_RAM),true)
BUILD_GNSS_HIDL_SERVICE := false
-endif # TARGET_HAS_LOW_RAM
endif # LW_FEATURE_SET
endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET
ifeq ($(BUILD_GNSS_HIDL_SERVICE), true)
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.gnss@1.0-service-qti
-LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
-LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_VENDOR_MODULE := true
-LOCAL_MODULE_OWNER := qti
+LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc
LOCAL_SRC_FILES := \
service.cpp \
diff --git a/gps/android/Gnss.cpp b/gps/android/Gnss.cpp
old mode 100644
new mode 100755
index e3fd64e..c844118
--- a/gps/android/Gnss.cpp
+++ b/gps/android/Gnss.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
@@ -20,9 +20,13 @@
#define LOG_TAG "LocSvc_GnssInterface"
+#include
#include
#include
+#include
#include "Gnss.h"
+#include
+
typedef void* (getLocationInterface)();
namespace android {
@@ -107,7 +111,7 @@ GnssInterface* Gnss::getGnssInterface() {
return mGnssInterface;
}
-Return Gnss::setCallback(const sp& callback) {
+Return Gnss::setCallback(const sp& callback) {
ENTRY_LOG_CALLFLOW();
if (mGnssCbIface != nullptr) {
mGnssCbIface->unlinkToDeath(mGnssDeathRecipient);
@@ -251,7 +255,7 @@ Return Gnss::injectTime(int64_t timeMs, int64_t timeReferenceMs,
}
}
-Return Gnss::deleteAidingData(IGnss::GnssAidingData aidingDataFlags) {
+Return Gnss::deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) {
ENTRY_LOG_CALLFLOW();
GnssAPIClient* api = getApi();
if (api) {
@@ -260,8 +264,8 @@ Return Gnss::deleteAidingData(IGnss::GnssAidingData aidingDataFlags) {
return Void();
}
-Return Gnss::setPositionMode(IGnss::GnssPositionMode mode,
- IGnss::GnssPositionRecurrence recurrence,
+Return Gnss::setPositionMode(V1_0::IGnss::GnssPositionMode mode,
+ V1_0::IGnss::GnssPositionRecurrence recurrence,
uint32_t minIntervalMs,
uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs) {
@@ -275,48 +279,49 @@ Return Gnss::setPositionMode(IGnss::GnssPositionMode mode,
return retVal;
}
-Return> Gnss::getExtensionAGnss() {
+Return> Gnss::getExtensionAGnss() {
ENTRY_LOG_CALLFLOW();
mAGnssIface = new AGnss(this);
return mAGnssIface;
}
-Return> Gnss::getExtensionGnssNi() {
+Return> Gnss::getExtensionGnssNi() {
ENTRY_LOG_CALLFLOW();
mGnssNi = new GnssNi(this);
return mGnssNi;
}
-Return> Gnss::getExtensionGnssMeasurement() {
+Return> Gnss::getExtensionGnssMeasurement() {
ENTRY_LOG_CALLFLOW();
- mGnssMeasurement = new GnssMeasurement();
+ if (mGnssMeasurement == nullptr)
+ mGnssMeasurement = new GnssMeasurement();
return mGnssMeasurement;
}
-Return> Gnss::getExtensionGnssConfiguration() {
+Return> Gnss::getExtensionGnssConfiguration() {
ENTRY_LOG_CALLFLOW();
mGnssConfig = new GnssConfiguration(this);
return mGnssConfig;
}
-Return> Gnss::getExtensionGnssGeofencing() {
+Return> Gnss::getExtensionGnssGeofencing() {
ENTRY_LOG_CALLFLOW();
mGnssGeofencingIface = new GnssGeofencing();
return mGnssGeofencingIface;
}
-Return> Gnss::getExtensionGnssBatching() {
+Return> Gnss::getExtensionGnssBatching() {
mGnssBatching = new GnssBatching();
return mGnssBatching;
}
-Return> Gnss::getExtensionGnssDebug() {
+Return> Gnss::getExtensionGnssDebug() {
ENTRY_LOG_CALLFLOW();
mGnssDebug = new GnssDebug(this);
return mGnssDebug;
}
-Return> Gnss::getExtensionAGnssRil() {
+Return> Gnss::getExtensionAGnssRil() {
mGnssRil = new AGnssRil(this);
return mGnssRil;
}
diff --git a/gps/android/Gnss.h b/gps/android/Gnss.h
old mode 100644
new mode 100755
index e4589d6..03ef170
--- a/gps/android/Gnss.h
+++ b/gps/android/Gnss.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018-2018-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
@@ -18,8 +18,8 @@
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
-#define ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
+#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
+#define ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
#include
#include
@@ -31,6 +31,7 @@
#include
#include
+#include
#include
#include
@@ -42,34 +43,24 @@ namespace gnss {
namespace V1_0 {
namespace implementation {
+using ::android::hardware::hidl_array;
+using ::android::hardware::hidl_memory;
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
-using ::android::hardware::hidl_vec;
-using ::android::hardware::hidl_string;
using ::android::sp;
+using ::android::hardware::gnss::V1_0::GnssLocation;
struct Gnss : public IGnss {
Gnss();
~Gnss();
- // registerAsService will call interfaceChain to determine the version of service
- /* comment this out until we know really how to manipulate hidl version
- using interfaceChain_cb = std::function<
- void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& descriptors)>;
- virtual ::android::hardware::Return interfaceChain(interfaceChain_cb _hidl_cb) override {
- _hidl_cb({
- "android.hardware.gnss@1.1::IGnss",
- ::android::hidl::base::V1_0::IBase::descriptor,
- });
- return ::android::hardware::Void();
- }
- */
-
/*
* Methods from ::android::hardware::gnss::V1_0::IGnss follow.
* These declarations were generated from Gnss.hal.
*/
- Return setCallback(const sp& callback) override;
+ Return setCallback(const sp& callback) override;
Return start() override;
Return stop() override;
Return cleanup() override;
@@ -79,30 +70,30 @@ struct Gnss : public IGnss {
Return injectTime(int64_t timeMs,
int64_t timeReferenceMs,
int32_t uncertaintyMs) override;
- Return deleteAidingData(IGnss::GnssAidingData aidingDataFlags) override;
- Return setPositionMode(IGnss::GnssPositionMode mode,
- IGnss::GnssPositionRecurrence recurrence,
+ Return deleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags) override;
+ Return setPositionMode(V1_0::IGnss::GnssPositionMode mode,
+ V1_0::IGnss::GnssPositionRecurrence recurrence,
uint32_t minIntervalMs,
uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs) override;
- Return> getExtensionAGnss() override;
- Return> getExtensionGnssNi() override;
- Return> getExtensionGnssMeasurement() override;
- Return> getExtensionGnssConfiguration() override;
- Return> getExtensionGnssGeofencing() override;
- Return> getExtensionGnssBatching() override;
+ Return> getExtensionAGnss() override;
+ Return> getExtensionGnssNi() override;
+ Return> getExtensionGnssMeasurement() override;
+ Return> getExtensionGnssConfiguration() override;
+ Return> getExtensionGnssGeofencing() override;
+ Return> getExtensionGnssBatching() override;
- Return> getExtensionAGnssRil() override;
+ Return> getExtensionAGnssRil() override;
- inline Return> getExtensionGnssNavigationMessage() override {
+ inline Return> getExtensionGnssNavigationMessage() override {
return nullptr;
}
- inline Return> getExtensionXtra() override {
+ inline Return> getExtensionXtra() override {
return nullptr;
}
- Return> getExtensionGnssDebug() override;
+ Return> getExtensionGnssDebug() override;
// These methods are not part of the IGnss base class.
GnssAPIClient* getApi();
@@ -110,6 +101,9 @@ struct Gnss : public IGnss {
Return updateConfiguration(GnssConfig& gnssConfig);
GnssInterface* getGnssInterface();
+ // Callback for ODCPI request
+ void odcpiRequestCb(const OdcpiRequestInfo& request);
+
private:
struct GnssDeathRecipient : hidl_death_recipient {
GnssDeathRecipient(sp gnss) : mGnss(gnss) {
@@ -132,8 +126,8 @@ struct Gnss : public IGnss {
sp mGnssRil = nullptr;
GnssAPIClient* mApi = nullptr;
- sp mGnssCbIface = nullptr;
- sp mGnssNiCbIface = nullptr;
+ sp mGnssCbIface = nullptr;
+ sp mGnssNiCbIface = nullptr;
GnssConfig mPendingConfig;
GnssInterface* mGnssInterface = nullptr;
};
@@ -146,4 +140,4 @@ extern "C" IGnss* HIDL_FETCH_IGnss(const char* name);
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSS_H
+#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSS_H
diff --git a/gps/android/GnssBatching.cpp b/gps/android/GnssBatching.cpp
old mode 100644
new mode 100755
index 6ffadc9..3e5a9f4
--- a/gps/android/GnssBatching.cpp
+++ b/gps/android/GnssBatching.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
diff --git a/gps/android/GnssBatching.h b/gps/android/GnssBatching.h
old mode 100644
new mode 100755
index de5d5c3..8fab857
--- a/gps/android/GnssBatching.h
+++ b/gps/android/GnssBatching.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
@@ -18,8 +18,8 @@
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
-#define ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
+#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
+#define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
#include
#include
@@ -77,4 +77,4 @@ struct GnssBatching : public IGnssBatching {
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H
+#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H
diff --git a/gps/android/GnssConfiguration.cpp b/gps/android/GnssConfiguration.cpp
old mode 100644
new mode 100755
index 51ee892..15153dd
--- a/gps/android/GnssConfiguration.cpp
+++ b/gps/android/GnssConfiguration.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
diff --git a/gps/android/GnssConfiguration.h b/gps/android/GnssConfiguration.h
old mode 100644
new mode 100755
index f9ea423..1629e06
--- a/gps/android/GnssConfiguration.h
+++ b/gps/android/GnssConfiguration.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
@@ -19,8 +19,8 @@
*/
-#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
-#define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
+#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
+#define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
#include
#include
@@ -68,4 +68,4 @@ struct GnssConfiguration : public IGnssConfiguration {
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H
+#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H
diff --git a/gps/android/GnssDebug.cpp b/gps/android/GnssDebug.cpp
old mode 100644
new mode 100755
index ff467d3..3d8e055
--- a/gps/android/GnssDebug.cpp
+++ b/gps/android/GnssDebug.cpp
@@ -30,8 +30,14 @@ namespace implementation {
using ::android::hardware::hidl_vec;
-#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000ULL) // 1/1/2017 00:00 GMT
-#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns
+#define GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS (20000000)
+#define GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS (20000)
+#define GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC (500)
+#define GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG (180)
+
+#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000LL) // 1/1/2017 00:00 GMT
+#define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns
+#define GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC (2.0e5) // ppm
GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss)
{
@@ -91,6 +97,40 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb)
data.position.valid = false;
}
+ if (data.position.horizontalAccuracyMeters <= 0 ||
+ data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) {
+ data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS;
+ }
+ if (data.position.verticalAccuracyMeters <= 0 ||
+ data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) {
+ data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS;
+ }
+ if (data.position.speedAccuracyMetersPerSecond <= 0 ||
+ data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) {
+ data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC;
+ }
+ if (data.position.bearingAccuracyDegrees <= 0 ||
+ data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) {
+ data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG;
+ }
+
+ if (data.position.horizontalAccuracyMeters <= 0 ||
+ data.position.horizontalAccuracyMeters > GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS) {
+ data.position.horizontalAccuracyMeters = GNSS_DEBUG_UNKNOWN_HORIZONTAL_ACCURACY_METERS;
+ }
+ if (data.position.verticalAccuracyMeters <= 0 ||
+ data.position.verticalAccuracyMeters > GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS) {
+ data.position.verticalAccuracyMeters = GNSS_DEBUG_UNKNOWN_VERTICAL_ACCURACY_METERS;
+ }
+ if (data.position.speedAccuracyMetersPerSecond <= 0 ||
+ data.position.speedAccuracyMetersPerSecond > GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC) {
+ data.position.speedAccuracyMetersPerSecond = GNSS_DEBUG_UNKNOWN_SPEED_ACCURACY_PER_SEC;
+ }
+ if (data.position.bearingAccuracyDegrees <= 0 ||
+ data.position.bearingAccuracyDegrees > GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG) {
+ data.position.bearingAccuracyDegrees = GNSS_DEBUG_UNKNOWN_BEARING_ACCURACY_DEG;
+ }
+
// time block
if (reports.mTime.mValid) {
data.time.timeEstimate = reports.mTime.timeEstimate;
@@ -98,10 +138,17 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb)
data.time.frequencyUncertaintyNsPerSec =
reports.mTime.frequencyUncertaintyNsPerSec;
}
- else {
+
+ if (data.time.timeEstimate < GNSS_DEBUG_UNKNOWN_UTC_TIME) {
data.time.timeEstimate = GNSS_DEBUG_UNKNOWN_UTC_TIME;
- data.time.timeUncertaintyNs = (float)(GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC);
- data.time.frequencyUncertaintyNsPerSec = 0;
+ }
+ if (data.time.timeUncertaintyNs <= 0 ||
+ data.time.timeUncertaintyNs > (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC) {
+ data.time.timeUncertaintyNs = (float)GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC;
+ }
+ if (data.time.frequencyUncertaintyNsPerSec <= 0 ||
+ data.time.frequencyUncertaintyNsPerSec > (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC) {
+ data.time.frequencyUncertaintyNsPerSec = (float)GNSS_DEBUG_UNKNOWN_FREQ_UNC_NS_PER_SEC;
}
// satellite data block
diff --git a/gps/android/GnssDebug.h b/gps/android/GnssDebug.h
old mode 100644
new mode 100755
index 7d29131..a7116cb
--- a/gps/android/GnssDebug.h
+++ b/gps/android/GnssDebug.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
-#define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
+#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
+#define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
#include
@@ -56,4 +56,4 @@ private:
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H
+#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H
diff --git a/gps/android/GnssGeofencing.cpp b/gps/android/GnssGeofencing.cpp
old mode 100644
new mode 100755
index 035a092..2a8ff88
--- a/gps/android/GnssGeofencing.cpp
+++ b/gps/android/GnssGeofencing.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
diff --git a/gps/android/GnssGeofencing.h b/gps/android/GnssGeofencing.h
old mode 100644
new mode 100755
index 7af5f91..db5f9d2
--- a/gps/android/GnssGeofencing.h
+++ b/gps/android/GnssGeofencing.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
@@ -18,8 +18,8 @@
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
-#define ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
+#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
+#define ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
#include
#include
@@ -88,4 +88,4 @@ struct GnssGeofencing : public IGnssGeofencing {
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H
+#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H
diff --git a/gps/android/GnssMeasurement.cpp b/gps/android/GnssMeasurement.cpp
old mode 100644
new mode 100755
index 8cbfabd..1c65bd6
--- a/gps/android/GnssMeasurement.cpp
+++ b/gps/android/GnssMeasurement.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
@@ -52,8 +52,9 @@ GnssMeasurement::~GnssMeasurement() {
}
// Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
+
Return GnssMeasurement::setCallback(
- const sp& callback) {
+ const sp& callback) {
Return ret =
IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC;
@@ -72,9 +73,10 @@ Return GnssMeasurement::setCallback(
}
mGnssMeasurementCbIface = callback;
- mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0 /*cookie*/);
+ mGnssMeasurementCbIface->linkToDeath(mGnssMeasurementDeathRecipient, 0);
return mApi->measurementSetCallback(callback);
+
}
Return GnssMeasurement::close() {
diff --git a/gps/android/GnssMeasurement.h b/gps/android/GnssMeasurement.h
old mode 100644
new mode 100755
index 5073169..4247dbf
--- a/gps/android/GnssMeasurement.h
+++ b/gps/android/GnssMeasurement.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
@@ -18,10 +18,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
-#define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
+#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
+#define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
#include
+#include
#include
namespace android {
@@ -47,8 +48,8 @@ struct GnssMeasurement : public IGnssMeasurement {
* Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
* These declarations were generated from IGnssMeasurement.hal.
*/
- Return setCallback(
- const sp& callback) override;
+ Return setCallback(
+ const sp& callback) override;
Return close() override;
private:
@@ -63,7 +64,7 @@ struct GnssMeasurement : public IGnssMeasurement {
private:
sp mGnssMeasurementDeathRecipient = nullptr;
- sp mGnssMeasurementCbIface = nullptr;
+ sp mGnssMeasurementCbIface = nullptr;
MeasurementAPIClient* mApi;
};
@@ -73,4 +74,4 @@ struct GnssMeasurement : public IGnssMeasurement {
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
+#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H
diff --git a/gps/android/GnssNi.cpp b/gps/android/GnssNi.cpp
old mode 100644
new mode 100755
index 4437932..d06cc20
--- a/gps/android/GnssNi.cpp
+++ b/gps/android/GnssNi.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
diff --git a/gps/android/GnssNi.h b/gps/android/GnssNi.h
old mode 100644
new mode 100755
index f6fe0bb..90f62d5
--- a/gps/android/GnssNi.h
+++ b/gps/android/GnssNi.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
@@ -18,8 +18,8 @@
* limitations under the License.
*/
-#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
-#define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
+#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
+#define ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
#include
#include
@@ -72,4 +72,4 @@ struct GnssNi : public IGnssNi {
} // namespace hardware
} // namespace android
-#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H
+#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H
diff --git a/gps/android/android.hardware.gnss@1.0-service-qti.rc b/gps/android/android.hardware.gnss@1.1-service-qti.rc
old mode 100644
new mode 100755
similarity index 88%
rename from gps/android/android.hardware.gnss@1.0-service-qti.rc
rename to gps/android/android.hardware.gnss@1.1-service-qti.rc
index d4d40fa..b5da6f9
--- a/gps/android/android.hardware.gnss@1.0-service-qti.rc
+++ b/gps/android/android.hardware.gnss@1.1-service-qti.rc
@@ -1,4 +1,4 @@
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti
- class main
+ class hal
user gps
group system gps radio
diff --git a/gps/android/location_api/BatchingAPIClient.cpp b/gps/android/location_api/BatchingAPIClient.cpp
old mode 100644
new mode 100755
index 0b66d38..264ab83
--- a/gps/android/location_api/BatchingAPIClient.cpp
+++ b/gps/android/location_api/BatchingAPIClient.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -45,6 +45,10 @@ namespace gnss {
namespace V1_0 {
namespace implementation {
+using ::android::hardware::gnss::V1_0::IGnssBatching;
+using ::android::hardware::gnss::V1_0::IGnssBatchingCallback;
+using ::android::hardware::gnss::V1_0::GnssLocation;
+
static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions& out,
LocationCapabilitiesMask mask);
@@ -153,7 +157,8 @@ void BatchingAPIClient::onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMa
mLocationCapabilitiesMask = capabilitiesMask;
}
-void BatchingAPIClient::onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions)
+void BatchingAPIClient::onBatchingCb(size_t count, Location* location,
+ BatchingOptions /*batchOptions*/)
{
LOC_LOGD("%s]: (count: %zu)", __FUNCTION__, count);
if (mGnssBatchingCbIface != nullptr && count > 0) {
diff --git a/gps/android/location_api/BatchingAPIClient.h b/gps/android/location_api/BatchingAPIClient.h
old mode 100644
new mode 100755
index c951a83..5d64df3
--- a/gps/android/location_api/BatchingAPIClient.h
+++ b/gps/android/location_api/BatchingAPIClient.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -45,11 +45,11 @@ namespace implementation {
class BatchingAPIClient : public LocationAPIClientBase
{
public:
- BatchingAPIClient(const sp& callback);
+ BatchingAPIClient(const sp& callback);
~BatchingAPIClient();
int getBatchSize();
- int startSession(const IGnssBatching::Options& options);
- int updateSessionOptions(const IGnssBatching::Options& options);
+ int startSession(const V1_0::IGnssBatching::Options& options);
+ int updateSessionOptions(const V1_0::IGnssBatching::Options& options);
int stopSession();
void getBatchedLocation(int last_n_locations);
void flushBatchedLocations();
@@ -61,9 +61,8 @@ public:
void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final;
private:
- sp mGnssBatchingCbIface;
+ sp mGnssBatchingCbIface;
uint32_t mDefaultId;
- int mBatchSize;
LocationCapabilitiesMask mLocationCapabilitiesMask;
};
diff --git a/gps/android/location_api/GeofenceAPIClient.cpp b/gps/android/location_api/GeofenceAPIClient.cpp
old mode 100644
new mode 100755
index 6167177..774a049
--- a/gps/android/location_api/GeofenceAPIClient.cpp
+++ b/gps/android/location_api/GeofenceAPIClient.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -42,6 +42,8 @@ namespace gnss {
namespace V1_0 {
namespace implementation {
+using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback;
+using ::android::hardware::gnss::V1_0::GnssLocation;
GeofenceAPIClient::GeofenceAPIClient(const sp& callback) :
LocationAPIClientBase(),
@@ -158,7 +160,7 @@ void GeofenceAPIClient::onGeofenceBreachCb(GeofenceBreachNotification geofenceBr
auto r = mGnssGeofencingCbIface->gnssGeofenceTransitionCb(
geofenceBreachNotification.ids[i], gnssLocation, transition,
- static_cast(geofenceBreachNotification.timestamp));
+ static_cast(geofenceBreachNotification.timestamp));
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssGeofenceTransitionCb description=%s",
__func__, r.description().c_str());
diff --git a/gps/android/location_api/GeofenceAPIClient.h b/gps/android/location_api/GeofenceAPIClient.h
old mode 100644
new mode 100755
index f779bcb..dc99ddd
--- a/gps/android/location_api/GeofenceAPIClient.h
+++ b/gps/android/location_api/GeofenceAPIClient.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -45,7 +45,7 @@ using ::android::sp;
class GeofenceAPIClient : public LocationAPIClientBase
{
public:
- GeofenceAPIClient(const sp& callback);
+ GeofenceAPIClient(const sp& callback);
virtual ~GeofenceAPIClient() = default;
void geofenceAdd(uint32_t geofence_id, double latitude, double longitude,
@@ -65,7 +65,7 @@ public:
void onResumeGeofencesCb(size_t count, LocationError* errors, uint32_t* ids) final;
private:
- sp mGnssGeofencingCbIface;
+ sp mGnssGeofencingCbIface;
};
} // namespace implementation
diff --git a/gps/android/location_api/GnssAPIClient.cpp b/gps/android/location_api/GnssAPIClient.cpp
old mode 100644
new mode 100755
index 2e44c2e..320ae15
--- a/gps/android/location_api/GnssAPIClient.cpp
+++ b/gps/android/location_api/GnssAPIClient.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -43,6 +43,11 @@ namespace gnss {
namespace V1_0 {
namespace implementation {
+using ::android::hardware::gnss::V1_0::IGnss;
+using ::android::hardware::gnss::V1_0::IGnssCallback;
+using ::android::hardware::gnss::V1_0::IGnssNiCallback;
+using ::android::hardware::gnss::V1_0::GnssLocation;
+
static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvStatus& out);
GnssAPIClient::GnssAPIClient(const sp& gpsCb,
@@ -160,6 +165,10 @@ bool GnssAPIClient::gnssSetPositionMode(IGnss::GnssPositionMode mode,
mLocationOptions.size = sizeof(LocationOptions);
mLocationOptions.minInterval = minIntervalMs;
mLocationOptions.minDistance = preferredAccuracyMeters;
+ if (IGnss::GnssPositionRecurrence::RECURRENCE_SINGLE == recurrence) {
+ mLocationOptions.minInterval =
+ std::numeric_limits::max();
+ }
if (mode == IGnss::GnssPositionMode::STANDALONE)
mLocationOptions.mode = GNSS_SUPL_MODE_STANDALONE;
else if (mode == IGnss::GnssPositionMode::MS_BASED)
@@ -445,7 +454,7 @@ void GnssAPIClient::onGnssNmeaCb(GnssNmeaNotification gnssNmeaNotification)
android::hardware::hidl_string nmeaString;
nmeaString.setToExternal(gnssNmeaNotification.nmea, gnssNmeaNotification.length);
auto r = gnssCbIface->gnssNmeaCb(
- static_cast(gnssNmeaNotification.timestamp), nmeaString);
+ static_cast(gnssNmeaNotification.timestamp), nmeaString);
if (!r.isOk()) {
LOC_LOGE("%s] Error from gnssNmeaCb nmea=%s length=%zu description=%s", __func__,
gnssNmeaNotification.nmea, gnssNmeaNotification.length, r.description().c_str());
@@ -499,10 +508,10 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta
{
memset(&out, 0, sizeof(IGnssCallback::GnssSvStatus));
out.numSvs = in.count;
- if (out.numSvs > static_cast(GnssMax::SVS_COUNT)) {
- LOC_LOGW("%s]: Too many satellites %zd. Clamps to %d.",
- __FUNCTION__, out.numSvs, GnssMax::SVS_COUNT);
- out.numSvs = static_cast(GnssMax::SVS_COUNT);
+ if (out.numSvs > static_cast(V1_0::GnssMax::SVS_COUNT)) {
+ LOC_LOGW("%s]: Too many satellites %u. Clamps to %d.",
+ __FUNCTION__, out.numSvs, V1_0::GnssMax::SVS_COUNT);
+ out.numSvs = static_cast(V1_0::GnssMax::SVS_COUNT);
}
for (size_t i = 0; i < out.numSvs; i++) {
IGnssCallback::GnssSvInfo& info = out.gnssSvList[i];
diff --git a/gps/android/location_api/GnssAPIClient.h b/gps/android/location_api/GnssAPIClient.h
old mode 100644
new mode 100755
index b5cffb1..923cb48
--- a/gps/android/location_api/GnssAPIClient.h
+++ b/gps/android/location_api/GnssAPIClient.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -30,6 +30,7 @@
#ifndef GNSS_API_CLINET_H
#define GNSS_API_CLINET_H
+
#include
#include
#include
@@ -47,28 +48,28 @@ using ::android::sp;
class GnssAPIClient : public LocationAPIClientBase
{
public:
- GnssAPIClient(const sp& gpsCb,
- const sp& niCb);
+ GnssAPIClient(const sp& gpsCb,
+ const sp& niCb);
virtual ~GnssAPIClient();
GnssAPIClient(const GnssAPIClient&) = delete;
GnssAPIClient& operator=(const GnssAPIClient&) = delete;
// for GpsInterface
- void gnssUpdateCallbacks(const sp& gpsCb,
- const sp& niCb);
+ void gnssUpdateCallbacks(const sp& gpsCb,
+ const sp& niCb);
bool gnssStart();
bool gnssStop();
- bool gnssSetPositionMode(IGnss::GnssPositionMode mode,
- IGnss::GnssPositionRecurrence recurrence,
+ bool gnssSetPositionMode(V1_0::IGnss::GnssPositionMode mode,
+ V1_0::IGnss::GnssPositionRecurrence recurrence,
uint32_t minIntervalMs,
uint32_t preferredAccuracyMeters,
uint32_t preferredTimeMs);
// for GpsNiInterface
- void gnssNiRespond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse);
+ void gnssNiRespond(int32_t notifId, V1_0::IGnssNiCallback::GnssUserResponseType userResponse);
// these apis using LocationAPIControlClient
- void gnssDeleteAidingData(IGnss::GnssAidingData aidingDataFlags);
+ void gnssDeleteAidingData(V1_0::IGnss::GnssAidingData aidingDataFlags);
void gnssEnable(LocationTechnologyType techType);
void gnssDisable();
void gnssConfigurationUpdate(const GnssConfig& gnssConfig);
@@ -89,12 +90,13 @@ public:
void onStopTrackingCb(LocationError error) final;
private:
- sp mGnssCbIface;
- sp mGnssNiCbIface;
+ sp mGnssCbIface;
+ sp mGnssNiCbIface;
std::mutex mMutex;
LocationAPIControlClient* mControlClient;
LocationCapabilitiesMask mLocationCapabilitiesMask;
bool mLocationCapabilitiesCached;
+
LocationOptions mLocationOptions;
};
diff --git a/gps/android/location_api/LocationUtil.cpp b/gps/android/location_api/LocationUtil.cpp
old mode 100644
new mode 100755
index 311c0b2..89681f2
--- a/gps/android/location_api/LocationUtil.cpp
+++ b/gps/android/location_api/LocationUtil.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -35,6 +35,10 @@ namespace gnss {
namespace V1_0 {
namespace implementation {
+using ::android::hardware::gnss::V1_0::GnssLocation;
+using ::android::hardware::gnss::V1_0::GnssConstellationType;
+using ::android::hardware::gnss::V1_0::GnssLocationFlags;
+
void convertGnssLocation(Location& in, GnssLocation& out)
{
memset(&out, 0, sizeof(GnssLocation));
@@ -63,7 +67,38 @@ void convertGnssLocation(Location& in, GnssLocation& out)
out.verticalAccuracyMeters = in.verticalAccuracy;
out.speedAccuracyMetersPerSecond = in.speedAccuracy;
out.bearingAccuracyDegrees = in.bearingAccuracy;
- out.timestamp = static_cast(in.timestamp);
+ out.timestamp = static_cast(in.timestamp);
+}
+
+void convertGnssLocation(const GnssLocation& in, Location& out)
+{
+ memset(&out, 0, sizeof(out));
+ if (in.gnssLocationFlags & GnssLocationFlags::HAS_LAT_LONG)
+ out.flags |= LOCATION_HAS_LAT_LONG_BIT;
+ if (in.gnssLocationFlags & GnssLocationFlags::HAS_ALTITUDE)
+ out.flags |= LOCATION_HAS_ALTITUDE_BIT;
+ if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED)
+ out.flags |= LOCATION_HAS_SPEED_BIT;
+ if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING)
+ out.flags |= LOCATION_HAS_BEARING_BIT;
+ if (in.gnssLocationFlags & GnssLocationFlags::HAS_HORIZONTAL_ACCURACY)
+ out.flags |= LOCATION_HAS_ACCURACY_BIT;
+ if (in.gnssLocationFlags & GnssLocationFlags::HAS_VERTICAL_ACCURACY)
+ out.flags |= LOCATION_HAS_VERTICAL_ACCURACY_BIT;
+ if (in.gnssLocationFlags & GnssLocationFlags::HAS_SPEED_ACCURACY)
+ out.flags |= LOCATION_HAS_SPEED_ACCURACY_BIT;
+ if (in.gnssLocationFlags & GnssLocationFlags::HAS_BEARING_ACCURACY)
+ out.flags |= LOCATION_HAS_BEARING_ACCURACY_BIT;
+ out.latitude = in.latitudeDegrees;
+ out.longitude = in.longitudeDegrees;
+ out.altitude = in.altitudeMeters;
+ out.speed = in.speedMetersPerSec;
+ out.bearing = in.bearingDegrees;
+ out.accuracy = in.horizontalAccuracyMeters;
+ out.verticalAccuracy = in.verticalAccuracyMeters;
+ out.speedAccuracy = in.speedAccuracyMetersPerSecond;
+ out.bearingAccuracy = in.bearingAccuracyDegrees;
+ out.timestamp = static_cast(in.timestamp);
}
void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out)
diff --git a/gps/android/location_api/LocationUtil.h b/gps/android/location_api/LocationUtil.h
old mode 100644
new mode 100755
index 44d5e02..9e0cd36
--- a/gps/android/location_api/LocationUtil.h
+++ b/gps/android/location_api/LocationUtil.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -40,8 +40,9 @@ namespace gnss {
namespace V1_0 {
namespace implementation {
-void convertGnssLocation(Location& in, GnssLocation& out);
-void convertGnssConstellationType(GnssSvType& in, GnssConstellationType& out);
+void convertGnssLocation(Location& in, V1_0::GnssLocation& out);
+void convertGnssLocation(const V1_0::GnssLocation& in, Location& out);
+void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out);
void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out);
void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out);
void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out);
diff --git a/gps/android/location_api/MeasurementAPIClient.cpp b/gps/android/location_api/MeasurementAPIClient.cpp
old mode 100644
new mode 100755
index 731c7ed..823851d
--- a/gps/android/location_api/MeasurementAPIClient.cpp
+++ b/gps/android/location_api/MeasurementAPIClient.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -42,10 +42,13 @@ namespace gnss {
namespace V1_0 {
namespace implementation {
+using ::android::hardware::gnss::V1_0::IGnssMeasurement;
+using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback;
+
static void convertGnssData(GnssMeasurementsNotification& in,
- IGnssMeasurementCallback::GnssData& out);
+ V1_0::IGnssMeasurementCallback::GnssData& out);
static void convertGnssMeasurement(GnssMeasurementsData& in,
- IGnssMeasurementCallback::GnssMeasurement& out);
+ V1_0::IGnssMeasurementCallback::GnssMeasurement& out);
static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out);
MeasurementAPIClient::MeasurementAPIClient() :
@@ -62,7 +65,7 @@ MeasurementAPIClient::~MeasurementAPIClient()
// for GpsInterface
Return
-MeasurementAPIClient::measurementSetCallback(const sp& callback)
+MeasurementAPIClient::measurementSetCallback(const sp& callback)
{
LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback);
@@ -70,6 +73,12 @@ MeasurementAPIClient::measurementSetCallback(const sp&
mGnssMeasurementCbIface = callback;
mMutex.unlock();
+ return startTracking();
+}
+
+Return
+MeasurementAPIClient::startTracking()
+{
LocationCallbacks locationCallbacks;
memset(&locationCallbacks, 0, sizeof(LocationCallbacks));
locationCallbacks.size = sizeof(LocationCallbacks);
@@ -115,15 +124,18 @@ void MeasurementAPIClient::measurementClose() {
void MeasurementAPIClient::onGnssMeasurementsCb(
GnssMeasurementsNotification gnssMeasurementsNotification)
{
- LOC_LOGD("%s]: (count: %zu active: %zu)",
+ LOC_LOGD("%s]: (count: %zu active: %d)",
__FUNCTION__, gnssMeasurementsNotification.count, mTracking);
if (mTracking) {
mMutex.lock();
- auto gnssMeasurementCbIface(mGnssMeasurementCbIface);
+ sp gnssMeasurementCbIface = nullptr;
+ if (mGnssMeasurementCbIface != nullptr) {
+ gnssMeasurementCbIface = mGnssMeasurementCbIface;
+ }
mMutex.unlock();
if (gnssMeasurementCbIface != nullptr) {
- IGnssMeasurementCallback::GnssData gnssData;
+ V1_0::IGnssMeasurementCallback::GnssData gnssData;
convertGnssData(gnssMeasurementsNotification, gnssData);
auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData);
if (!r.isOk()) {
@@ -135,7 +147,7 @@ void MeasurementAPIClient::onGnssMeasurementsCb(
}
static void convertGnssMeasurement(GnssMeasurementsData& in,
- IGnssMeasurementCallback::GnssMeasurement& out)
+ V1_0::IGnssMeasurementCallback::GnssMeasurement& out)
{
memset(&out, 0, sizeof(IGnssMeasurementCallback::GnssMeasurement));
if (in.flags & GNSS_MEASUREMENTS_DATA_SIGNAL_TO_NOISE_RATIO_BIT)
@@ -242,13 +254,13 @@ static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback
}
static void convertGnssData(GnssMeasurementsNotification& in,
- IGnssMeasurementCallback::GnssData& out)
+ V1_0::IGnssMeasurementCallback::GnssData& out)
{
out.measurementCount = in.count;
- if (out.measurementCount > static_cast(GnssMax::SVS_COUNT)) {
- LOC_LOGW("%s]: Too many measurement %zd. Clamps to %d.",
- __FUNCTION__, out.measurementCount, GnssMax::SVS_COUNT);
- out.measurementCount = static_cast(GnssMax::SVS_COUNT);
+ if (out.measurementCount > static_cast(V1_0::GnssMax::SVS_COUNT)) {
+ LOC_LOGW("%s]: Too many measurement %u. Clamps to %d.",
+ __FUNCTION__, out.measurementCount, V1_0::GnssMax::SVS_COUNT);
+ out.measurementCount = static_cast(V1_0::GnssMax::SVS_COUNT);
}
for (size_t i = 0; i < out.measurementCount; i++) {
convertGnssMeasurement(in.measurements[i], out.measurements[i]);
diff --git a/gps/android/location_api/MeasurementAPIClient.h b/gps/android/location_api/MeasurementAPIClient.h
old mode 100644
new mode 100755
index 8de1326..08b4811
--- a/gps/android/location_api/MeasurementAPIClient.h
+++ b/gps/android/location_api/MeasurementAPIClient.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -42,7 +42,6 @@ namespace gnss {
namespace V1_0 {
namespace implementation {
-using ::android::hardware::gnss::V1_0::IGnssMeasurement;
using ::android::sp;
class MeasurementAPIClient : public LocationAPIClientBase
@@ -54,16 +53,18 @@ public:
MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete;
// for GpsMeasurementInterface
- Return measurementSetCallback(
- const sp& callback);
+ Return measurementSetCallback(
+ const sp& callback);
void measurementClose();
+ Return startTracking();
// callbacks we are interested in
void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final;
private:
- sp mGnssMeasurementCbIface;
std::mutex mMutex;
+ sp mGnssMeasurementCbIface;
+
bool mTracking;
};
diff --git a/gps/android/service.cpp b/gps/android/service.cpp
old mode 100644
new mode 100755
index 5779e67..c03b7ea
--- a/gps/android/service.cpp
+++ b/gps/android/service.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution
*/
/*
@@ -18,9 +18,9 @@
* limitations under the License.
*/
-#define LOG_TAG "android.hardware.gnss@1.0-service-qti"
+#define LOG_TAG "android.hardware.gnss@1.1-service-qti"
-#include
+#include
#include
using android::hardware::gnss::V1_0::IGnss;
diff --git a/gps/build/target_specific_features.mk b/gps/build/target_specific_features.mk
new file mode 100755
index 0000000..943e231
--- /dev/null
+++ b/gps/build/target_specific_features.mk
@@ -0,0 +1,17 @@
+GNSS_CFLAGS := \
+ -Werror \
+ -Wno-error=unused-parameter \
+ -Wno-error=format \
+ -Wno-error=macro-redefined \
+ -Wno-error=reorder \
+ -Wno-error=missing-braces \
+ -Wno-error=self-assign \
+ -Wno-error=enum-conversion \
+ -Wno-error=logical-op-parentheses \
+ -Wno-error=null-arithmetic \
+ -Wno-error=null-conversion \
+ -Wno-error=parentheses-equality \
+ -Wno-error=undefined-bool-conversion \
+ -Wno-error=tautological-compare \
+ -Wno-error=switch \
+ -Wno-error=date-time
diff --git a/gps/core/Android.mk b/gps/core/Android.mk
old mode 100644
new mode 100755
index df16535..928edd4
--- a/gps/core/Android.mk
+++ b/gps/core/Android.mk
@@ -3,8 +3,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libloc_core
-LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
-LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
+LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_TAGS := optional
ifeq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET),true)
@@ -17,8 +16,7 @@ LOCAL_SHARED_LIBRARIES := \
libcutils \
libgps.utils \
libdl \
- liblog \
- libloc_pla
+ liblog
LOCAL_SRC_FILES += \
LocApiBase.cpp \
@@ -27,9 +25,6 @@ LOCAL_SRC_FILES += \
LocDualContext.cpp \
loc_core_log.cpp \
data-items/DataItemsFactoryProxy.cpp \
- data-items/common/ClientIndex.cpp \
- data-items/common/DataItemIndex.cpp \
- data-items/common/IndexFactory.cpp \
SystemStatusOsObserver.cpp \
SystemStatus.cpp
@@ -43,6 +38,7 @@ LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/observer \
LOCAL_HEADER_LIBRARIES := \
+ libutils_headers \
libgps.utils_headers \
libloc_pla_headers \
liblocation_api_headers
diff --git a/gps/core/ContextBase.cpp b/gps/core/ContextBase.cpp
old mode 100644
new mode 100755
index 8af48fc..35e6585
--- a/gps/core/ContextBase.cpp
+++ b/gps/core/ContextBase.cpp
@@ -35,7 +35,7 @@
#include
#include
#include
-#include
+#include
#include
namespace loc_core {
@@ -65,6 +65,8 @@ const loc_param_s_type ContextBase::mGps_conf_table[] =
{"USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL", &mGps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL, NULL, 'n'},
{"AGPS_CONFIG_INJECT", &mGps_conf.AGPS_CONFIG_INJECT, NULL, 'n'},
{"EXTERNAL_DR_ENABLED", &mGps_conf.EXTERNAL_DR_ENABLED, NULL, 'n'},
+ {"SUPL_HOST", &mGps_conf.SUPL_HOST, NULL, 's'},
+ {"SUPL_PORT", &mGps_conf.SUPL_PORT, NULL, 'n'},
};
const loc_param_s_type ContextBase::mSap_conf_table[] =
@@ -98,6 +100,8 @@ void ContextBase::readConfig()
mGps_conf.SUPL_VER = 0x10000;
mGps_conf.SUPL_MODE = 0x1;
mGps_conf.SUPL_ES = 0;
+ mGps_conf.SUPL_HOST[0] = 0;
+ mGps_conf.SUPL_PORT = 0;
mGps_conf.CAPABILITIES = 0x7;
/* LTE Positioning Profile configuration is disable by default*/
mGps_conf.LPP_PROFILE = 0;
diff --git a/gps/core/ContextBase.h b/gps/core/ContextBase.h
old mode 100644
new mode 100755
index 83de999..dc64b6a
--- a/gps/core/ContextBase.h
+++ b/gps/core/ContextBase.h
@@ -36,7 +36,8 @@
#include
#include
-#define MAX_XTRA_SERVER_URL_LENGTH 256
+#define MAX_XTRA_SERVER_URL_LENGTH (256)
+#define MAX_SUPL_SERVER_URL_LENGTH (256)
/* GPS.conf support */
/* NOTE: the implementaiton of the parser casts number
@@ -64,6 +65,8 @@ typedef struct loc_gps_cfg_s
uint32_t LPPE_CP_TECHNOLOGY;
uint32_t LPPE_UP_TECHNOLOGY;
uint32_t EXTERNAL_DR_ENABLED;
+ char SUPL_HOST[MAX_SUPL_SERVER_URL_LENGTH];
+ uint32_t SUPL_PORT;
} loc_gps_cfg_s_type;
/* NOTE: the implementaiton of the parser casts number
diff --git a/gps/core/LBSProxyBase.h b/gps/core/LBSProxyBase.h
old mode 100644
new mode 100755
diff --git a/gps/core/LocAdapterBase.cpp b/gps/core/LocAdapterBase.cpp
old mode 100644
new mode 100755
index 3943819..d0da3da
--- a/gps/core/LocAdapterBase.cpp
+++ b/gps/core/LocAdapterBase.cpp
@@ -32,7 +32,7 @@
#include
#include
#include
-#include
+#include
#include
namespace loc_core {
@@ -161,4 +161,8 @@ bool LocAdapterBase::
reportWwanZppFix(LocGpsLocation &/*zppLoc*/)
DEFAULT_IMPL(false)
+bool LocAdapterBase::
+ reportOdcpiRequestEvent(OdcpiRequestInfo& /*request*/)
+DEFAULT_IMPL(false)
+
} // namespace loc_core
diff --git a/gps/core/LocAdapterBase.h b/gps/core/LocAdapterBase.h
old mode 100644
new mode 100755
index e7beca8..35fc48e
--- a/gps/core/LocAdapterBase.h
+++ b/gps/core/LocAdapterBase.h
@@ -153,6 +153,7 @@ public:
virtual void reportGnssMeasurementDataEvent(const GnssMeasurementsNotification& measurements,
int msInWeek);
virtual bool reportWwanZppFix(LocGpsLocation &zppLoc);
+ virtual bool reportOdcpiRequestEvent(OdcpiRequestInfo& request);
};
} // namespace loc_core
diff --git a/gps/core/LocAdapterProxyBase.h b/gps/core/LocAdapterProxyBase.h
old mode 100644
new mode 100755
diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp
old mode 100644
new mode 100755
index e0845de..426335d
--- a/gps/core/LocApiBase.cpp
+++ b/gps/core/LocApiBase.cpp
@@ -33,7 +33,7 @@
#include
#include
#include
-#include
+#include
#include
namespace loc_core {
@@ -107,19 +107,16 @@ struct LocSsrMsg : public LocMsg {
struct LocOpenMsg : public LocMsg {
LocApiBase* mLocApi;
- LOC_API_ADAPTER_EVENT_MASK_T mMask;
- inline LocOpenMsg(LocApiBase* locApi,
- LOC_API_ADAPTER_EVENT_MASK_T mask) :
- LocMsg(), mLocApi(locApi), mMask(mask)
+ inline LocOpenMsg(LocApiBase* locApi) :
+ LocMsg(), mLocApi(locApi)
{
locallog();
}
inline virtual void proc() const {
- mLocApi->open(mMask);
+ mLocApi->open(mLocApi->getEvtMask());
}
inline void locallog() const {
- LOC_LOGV("%s:%d]: LocOpen Mask: %x\n",
- __func__, __LINE__, mMask);
+ LOC_LOGv("LocOpen Mask: %" PRIx64 "\n", mLocApi->getEvtMask());
}
inline virtual void log() const {
locallog();
@@ -163,8 +160,7 @@ void LocApiBase::addAdapter(LocAdapterBase* adapter)
for (int i = 0; i < MAX_ADAPTERS && mLocAdapters[i] != adapter; i++) {
if (mLocAdapters[i] == NULL) {
mLocAdapters[i] = adapter;
- mMsgTask->sendMsg(new LocOpenMsg(this,
- (adapter->getEvtMask())));
+ mMsgTask->sendMsg(new LocOpenMsg(this));
break;
}
}
@@ -200,7 +196,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter)
close();
} else {
// else we need to remove the bit
- mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask()));
+ mMsgTask->sendMsg(new LocOpenMsg(this));
}
}
}
@@ -208,7 +204,7 @@ void LocApiBase::removeAdapter(LocAdapterBase* adapter)
void LocApiBase::updateEvtMask()
{
- mMsgTask->sendMsg(new LocOpenMsg(this, getEvtMask()));
+ open(getEvtMask());
}
void LocApiBase::handleEngineUpEvent()
@@ -264,6 +260,12 @@ void LocApiBase::reportWwanZppFix(LocGpsLocation &zppLoc)
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc));
}
+void LocApiBase::reportOdcpiRequest(OdcpiRequestInfo& request)
+{
+ // loop through adapters, and deliver to the first handling adapter.
+ TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportOdcpiRequestEvent(request));
+}
+
void LocApiBase::reportSv(GnssSvNotification& svNotify)
{
const char* constellationString[] = { "Unknown", "GPS", "SBAS", "GLONASS",
@@ -440,6 +442,10 @@ enum loc_api_adapter_err LocApiBase::
injectPosition(double /*latitude*/, double /*longitude*/, float /*accuracy*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+enum loc_api_adapter_err LocApiBase::
+ injectPosition(const Location& /*location*/)
+DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
+
enum loc_api_adapter_err LocApiBase::
setTime(LocGpsUtcTime /*time*/, int64_t /*timeReference*/, int /*uncertainty*/)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
diff --git a/gps/core/LocApiBase.h b/gps/core/LocApiBase.h
old mode 100644
new mode 100755
index f66bfe1..6563dea
--- a/gps/core/LocApiBase.h
+++ b/gps/core/LocApiBase.h
@@ -34,7 +34,7 @@
#include
#include
#include
-#include
+#include
namespace loc_core {
class ContextBase;
@@ -134,6 +134,7 @@ public:
void reportGnssMeasurementData(GnssMeasurementsNotification& measurements, int msInWeek);
void saveSupportedFeatureList(uint8_t *featureList);
void reportWwanZppFix(LocGpsLocation &zppLoc);
+ void reportOdcpiRequest(OdcpiRequestInfo& request);
// downward calls
// All below functions are to be defined by adapter specific modules:
@@ -153,6 +154,8 @@ public:
setAPN(char* apn, int len);
virtual enum loc_api_adapter_err
injectPosition(double latitude, double longitude, float accuracy);
+ virtual enum loc_api_adapter_err
+ injectPosition(const Location& location);
virtual enum loc_api_adapter_err
setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty);
virtual enum loc_api_adapter_err
diff --git a/gps/core/LocDualContext.cpp b/gps/core/LocDualContext.cpp
old mode 100644
new mode 100755
index fd3450d..180d9dc
--- a/gps/core/LocDualContext.cpp
+++ b/gps/core/LocDualContext.cpp
@@ -33,7 +33,7 @@
#include
#include
#include
-#include
+#include
#include
namespace loc_core {
diff --git a/gps/core/LocDualContext.h b/gps/core/LocDualContext.h
old mode 100644
new mode 100755
diff --git a/gps/core/SystemStatus.cpp b/gps/core/SystemStatus.cpp
old mode 100644
new mode 100755
index 92ddeed..f4316ca
--- a/gps/core/SystemStatus.cpp
+++ b/gps/core/SystemStatus.cpp
@@ -34,8 +34,8 @@
#include
#include
#include
-#include
-#include
+#include
+#include
#include
#include
#include
@@ -120,6 +120,12 @@ public:
double mAgcGal; // x16
int32_t mLeapSeconds;// x17
int32_t mLeapSecUnc; // x18
+ uint32_t mGloBpAmpI; // x19
+ uint32_t mGloBpAmpQ; // x1A
+ uint32_t mBdsBpAmpI; // x1B
+ uint32_t mBdsBpAmpQ; // x1C
+ uint32_t mGalBpAmpI; // x1D
+ uint32_t mGalBpAmpQ; // x1E
};
// parser
@@ -154,6 +160,12 @@ private:
eMax0 = eAgcGal,
eLeapSeconds = 23,
eLeapSecUnc = 24,
+ eGloBpAmpI = 25,
+ eGloBpAmpQ = 26,
+ eBdsBpAmpI = 27,
+ eBdsBpAmpQ = 28,
+ eGalBpAmpI = 29,
+ eGalBpAmpQ = 30,
eMax
};
SystemStatusPQWM1 mM1;
@@ -183,6 +195,12 @@ public:
inline uint32_t getRecErrorRecovery() { return mM1.mRecErrorRecovery; }
inline int32_t getLeapSeconds(){ return mM1.mLeapSeconds; }
inline int32_t getLeapSecUnc() { return mM1.mLeapSecUnc; }
+ inline uint32_t getGloBpAmpI() { return mM1.mGloBpAmpI; }
+ inline uint32_t getGloBpAmpQ() { return mM1.mGloBpAmpQ; }
+ inline uint32_t getBdsBpAmpI() { return mM1.mBdsBpAmpI; }
+ inline uint32_t getBdsBpAmpQ() { return mM1.mBdsBpAmpQ; }
+ inline uint32_t getGalBpAmpI() { return mM1.mGalBpAmpI; }
+ inline uint32_t getGalBpAmpQ() { return mM1.mGalBpAmpQ; }
SystemStatusPQWM1parser(const char *str_in, uint32_t len_in)
: SystemStatusNmeaBase(str_in, len_in)
@@ -219,6 +237,14 @@ public:
mM1.mLeapSeconds = atoi(mField[eLeapSeconds].c_str());
mM1.mLeapSecUnc = atoi(mField[eLeapSecUnc].c_str());
}
+ if (mField.size() > eGalBpAmpQ) {
+ mM1.mGloBpAmpI = atoi(mField[eGloBpAmpI].c_str());
+ mM1.mGloBpAmpQ = atoi(mField[eGloBpAmpQ].c_str());
+ mM1.mBdsBpAmpI = atoi(mField[eBdsBpAmpI].c_str());
+ mM1.mBdsBpAmpQ = atoi(mField[eBdsBpAmpQ].c_str());
+ mM1.mGalBpAmpI = atoi(mField[eGalBpAmpI].c_str());
+ mM1.mGalBpAmpQ = atoi(mField[eGalBpAmpQ].c_str());
+ }
}
inline SystemStatusPQWM1& get() { return mM1;} //getparser
@@ -765,7 +791,13 @@ SystemStatusRfAndParams::SystemStatusRfAndParams(const SystemStatusPQWM1& nmea)
mAgcGps(nmea.mAgcGps),
mAgcGlo(nmea.mAgcGlo),
mAgcBds(nmea.mAgcBds),
- mAgcGal(nmea.mAgcGal)
+ mAgcGal(nmea.mAgcGal),
+ mGloBpAmpI(nmea.mGloBpAmpI),
+ mGloBpAmpQ(nmea.mGloBpAmpQ),
+ mBdsBpAmpI(nmea.mBdsBpAmpI),
+ mBdsBpAmpQ(nmea.mBdsBpAmpQ),
+ mGalBpAmpI(nmea.mGalBpAmpI),
+ mGalBpAmpQ(nmea.mGalBpAmpQ)
{
}
@@ -783,7 +815,13 @@ bool SystemStatusRfAndParams::equals(const SystemStatusRfAndParams& peer)
(mAgcGps != peer.mAgcGps) ||
(mAgcGlo != peer.mAgcGlo) ||
(mAgcBds != peer.mAgcBds) ||
- (mAgcGal != peer.mAgcGal)) {
+ (mAgcGal != peer.mAgcGal) ||
+ (mGloBpAmpI != peer.mGloBpAmpI) ||
+ (mGloBpAmpQ != peer.mGloBpAmpQ) ||
+ (mBdsBpAmpI != peer.mBdsBpAmpI) ||
+ (mBdsBpAmpQ != peer.mBdsBpAmpQ) ||
+ (mGalBpAmpI != peer.mGalBpAmpI) ||
+ (mGalBpAmpQ != peer.mGalBpAmpQ)) {
return false;
}
return true;
@@ -1217,8 +1255,7 @@ IOsObserver* SystemStatus::getOsObserver()
}
SystemStatus::SystemStatus(const MsgTask* msgTask) :
- mSysStatusObsvr(this, msgTask),
- mConnected(false)
+ mSysStatusObsvr(this, msgTask)
{
int result = 0;
ENTRY_LOG ();
@@ -1268,17 +1305,10 @@ SystemStatus::SystemStatus(const MsgTask* msgTask) :
/******************************************************************************
SystemStatus - storing dataitems
******************************************************************************/
-template
-bool SystemStatus::setItemBaseinReport(TYPE_REPORT& report, const TYPE_ITEMBASE& s)
-{
- TYPE_SYSTEMSTATUS_ITEM sout(s);
- return setIteminReport(report, sout);
-}
-
template
-bool SystemStatus::setIteminReport(TYPE_REPORT& report, const TYPE_ITEM& s)
+bool SystemStatus::setIteminReport(TYPE_REPORT& report, TYPE_ITEM&& s)
{
- if (!report.empty() && report.back().equals(s)) {
+ if (!report.empty() && report.back().equals(static_cast(s.collate(report.back())))) {
// there is no change - just update reported timestamp
report.back().mUtcReported = s.mUtcReported;
return false;
@@ -1317,11 +1347,10 @@ void SystemStatus::getIteminReport(TYPE_REPORT& reportout, const TYPE_ITEM& c) c
@param[In] data pointer to the NMEA string
@param[In] len length of the NMEA string
-@return true when successfully done
+@return true when the NMEA is consumed by the method.
******************************************************************************/
bool SystemStatus::setNmeaString(const char *data, uint32_t len)
{
- bool ret = false;
if (!loc_nmea_is_debug(data, len)) {
return false;
}
@@ -1332,43 +1361,43 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len)
pthread_mutex_lock(&mMutexSystemStatus);
// parse the received nmea strings here
- if (0 == strncmp(data, "$PQWM1", SystemStatusNmeaBase::NMEA_MINSIZE)) {
+ if (0 == strncmp(data, "$PQWM1", SystemStatusNmeaBase::NMEA_MINSIZE)) {
SystemStatusPQWM1 s = SystemStatusPQWM1parser(buf, len).get();
- ret |= setIteminReport(mCache.mTimeAndClock, SystemStatusTimeAndClock(s));
- ret |= setIteminReport(mCache.mXoState, SystemStatusXoState(s));
- ret |= setIteminReport(mCache.mRfAndParams, SystemStatusRfAndParams(s));
- ret |= setIteminReport(mCache.mErrRecovery, SystemStatusErrRecovery(s));
+ setIteminReport(mCache.mTimeAndClock, SystemStatusTimeAndClock(s));
+ setIteminReport(mCache.mXoState, SystemStatusXoState(s));
+ setIteminReport(mCache.mRfAndParams, SystemStatusRfAndParams(s));
+ setIteminReport(mCache.mErrRecovery, SystemStatusErrRecovery(s));
}
else if (0 == strncmp(data, "$PQWP1", SystemStatusNmeaBase::NMEA_MINSIZE)) {
- ret = setIteminReport(mCache.mInjectedPosition,
+ setIteminReport(mCache.mInjectedPosition,
SystemStatusInjectedPosition(SystemStatusPQWP1parser(buf, len).get()));
}
else if (0 == strncmp(data, "$PQWP2", SystemStatusNmeaBase::NMEA_MINSIZE)) {
- ret = setIteminReport(mCache.mBestPosition,
+ setIteminReport(mCache.mBestPosition,
SystemStatusBestPosition(SystemStatusPQWP2parser(buf, len).get()));
}
else if (0 == strncmp(data, "$PQWP3", SystemStatusNmeaBase::NMEA_MINSIZE)) {
- ret = setIteminReport(mCache.mXtra,
+ setIteminReport(mCache.mXtra,
SystemStatusXtra(SystemStatusPQWP3parser(buf, len).get()));
}
else if (0 == strncmp(data, "$PQWP4", SystemStatusNmeaBase::NMEA_MINSIZE)) {
- ret = setIteminReport(mCache.mEphemeris,
+ setIteminReport(mCache.mEphemeris,
SystemStatusEphemeris(SystemStatusPQWP4parser(buf, len).get()));
}
else if (0 == strncmp(data, "$PQWP5", SystemStatusNmeaBase::NMEA_MINSIZE)) {
- ret = setIteminReport(mCache.mSvHealth,
+ setIteminReport(mCache.mSvHealth,
SystemStatusSvHealth(SystemStatusPQWP5parser(buf, len).get()));
}
else if (0 == strncmp(data, "$PQWP6", SystemStatusNmeaBase::NMEA_MINSIZE)) {
- ret = setIteminReport(mCache.mPdr,
+ setIteminReport(mCache.mPdr,
SystemStatusPdr(SystemStatusPQWP6parser(buf, len).get()));
}
else if (0 == strncmp(data, "$PQWP7", SystemStatusNmeaBase::NMEA_MINSIZE)) {
- ret = setIteminReport(mCache.mNavData,
+ setIteminReport(mCache.mNavData,
SystemStatusNavData(SystemStatusPQWP7parser(buf, len).get()));
}
else if (0 == strncmp(data, "$PQWS1", SystemStatusNmeaBase::NMEA_MINSIZE)) {
- ret = setIteminReport(mCache.mPositionFailure,
+ setIteminReport(mCache.mPositionFailure,
SystemStatusPositionFailure(SystemStatusPQWS1parser(buf, len).get()));
}
else {
@@ -1376,7 +1405,7 @@ bool SystemStatus::setNmeaString(const char *data, uint32_t len)
}
pthread_mutex_unlock(&mMutexSystemStatus);
- return ret;
+ return true;
}
/******************************************************************************
@@ -1417,94 +1446,92 @@ bool SystemStatus::eventDataItemNotify(IDataItemCore* dataitem)
switch(dataitem->getId())
{
case AIRPLANEMODE_DATA_ITEM_ID:
- ret = setItemBaseinReport(mCache.mAirplaneMode,
- *(static_cast(dataitem)));
+ ret = setIteminReport(mCache.mAirplaneMode,
+ SystemStatusAirplaneMode(*(static_cast(dataitem))));
break;
case ENH_DATA_ITEM_ID:
- ret = setItemBaseinReport(mCache.mENH,
- *(static_cast(dataitem)));
+ ret = setIteminReport(mCache.mENH,
+ SystemStatusENH(*(static_cast(dataitem))));
break;
case GPSSTATE_DATA_ITEM_ID:
- ret = setItemBaseinReport(mCache.mGPSState,
- *(static_cast(dataitem)));
+ ret = setIteminReport(mCache.mGPSState,
+ SystemStatusGpsState(*(static_cast(dataitem))));
break;
case NLPSTATUS_DATA_ITEM_ID:
- ret = setItemBaseinReport(mCache.mNLPStatus,
- *(static_cast(dataitem)));
+ ret = setIteminReport(mCache.mNLPStatus,
+ SystemStatusNLPStatus(*(static_cast(dataitem))));
break;
case WIFIHARDWARESTATE_DATA_ITEM_ID:
- ret = setItemBaseinReport(mCache.mWifiHardwareState,
- *(static_cast(dataitem)));
+ ret = setIteminReport(mCache.mWifiHardwareState,
+ SystemStatusWifiHardwareState(*(static_cast(dataitem))));
break;
case NETWORKINFO_DATA_ITEM_ID:
- ret = setItemBaseinReport(mCache.mNetworkInfo,
- *(static_cast(dataitem)));
+ ret = setIteminReport(mCache.mNetworkInfo,
+ SystemStatusNetworkInfo(*(static_cast(dataitem))));
break;
case RILSERVICEINFO_DATA_ITEM_ID:
- ret = setItemBaseinReport(mCache.mRilServiceInfo,
- *(static_cast(dataitem)));
+ ret = setIteminReport(mCache.mRilServiceInfo,
+ SystemStatusServiceInfo(*(static_cast(dataitem))));
break;
case RILCELLINFO_DATA_ITEM_ID:
- ret = setItemBaseinReport(mCache.mRilCellInfo,
- *(static_cast(dataitem)));
+ ret = setIteminReport(mCache.mRilCellInfo,
+ SystemStatusRilCellInfo(*(static_cast