├── .clang-format ├── Android.bp ├── Android.mk ├── BoardConfigCommon.mk ├── README.md ├── audio ├── audio_effects.xml ├── audio_output_policy.conf ├── audio_policy_configuration.xml ├── audio_policy_configuration_a2dp_offload_disabled.xml ├── audio_tuning_mixer.txt ├── bluetooth_hearing_aid_audio_policy_configuration.xml ├── graphite_ipc_platform_info.xml └── listen_platform_info.xml ├── compatibility_matrix.xml ├── config.fs ├── configs ├── component-overrides.xml ├── media_codecs.xml ├── media_codecs_performance.xml ├── media_profiles_V1_0.xml ├── msm_irqbalance.conf ├── powerhint.json ├── powerhint_636.json ├── public.libraries.txt ├── qti_whitelist.xml ├── sec_config └── system_ext-privapp-permissions-qti.xml ├── doze ├── Android.bp ├── AndroidManifest.xml ├── proguard.flags ├── res │ ├── drawable │ │ ├── ic_hand.xml │ │ ├── ic_pickup.xml │ │ └── ic_pocket.xml │ └── xml │ │ └── doze_settings.xml └── src │ └── org │ └── lineageos │ └── settings │ └── doze │ ├── BootCompletedReceiver.java │ ├── DozeService.java │ ├── DozeSettingsActivity.java │ ├── DozeSettingsFragment.java │ ├── ProximitySensor.java │ ├── TiltSensor.java │ └── Utils.java ├── extract-files.sh ├── framework_manifest.xml ├── gps ├── Android.mk ├── CleanSpec.mk ├── Makefile.am ├── android │ ├── 1.0 │ │ ├── AGnss.cpp │ │ ├── AGnss.h │ │ ├── AGnssRil.cpp │ │ ├── AGnssRil.h │ │ ├── Android.mk │ │ ├── Gnss.cpp │ │ ├── Gnss.h │ │ ├── GnssBatching.cpp │ │ ├── GnssBatching.h │ │ ├── GnssConfiguration.cpp │ │ ├── GnssConfiguration.h │ │ ├── GnssDebug.cpp │ │ ├── GnssDebug.h │ │ ├── GnssGeofencing.cpp │ │ ├── GnssGeofencing.h │ │ ├── GnssMeasurement.cpp │ │ ├── GnssMeasurement.h │ │ ├── GnssNi.cpp │ │ ├── GnssNi.h │ │ ├── android.hardware.gnss@1.0-service-qti.rc │ │ ├── android.hardware.gnss@1.0-service-qti.xml │ │ ├── location_api │ │ │ ├── BatchingAPIClient.cpp │ │ │ ├── BatchingAPIClient.h │ │ │ ├── GeofenceAPIClient.cpp │ │ │ ├── GeofenceAPIClient.h │ │ │ ├── GnssAPIClient.cpp │ │ │ ├── GnssAPIClient.h │ │ │ ├── LocationUtil.cpp │ │ │ ├── LocationUtil.h │ │ │ ├── MeasurementAPIClient.cpp │ │ │ └── MeasurementAPIClient.h │ │ └── service.cpp │ ├── 1.1 │ │ ├── AGnss.cpp │ │ ├── AGnss.h │ │ ├── AGnssRil.cpp │ │ ├── AGnssRil.h │ │ ├── Android.mk │ │ ├── Gnss.cpp │ │ ├── Gnss.h │ │ ├── GnssBatching.cpp │ │ ├── GnssBatching.h │ │ ├── GnssConfiguration.cpp │ │ ├── GnssConfiguration.h │ │ ├── GnssDebug.cpp │ │ ├── GnssDebug.h │ │ ├── GnssGeofencing.cpp │ │ ├── GnssGeofencing.h │ │ ├── GnssMeasurement.cpp │ │ ├── GnssMeasurement.h │ │ ├── GnssNi.cpp │ │ ├── GnssNi.h │ │ ├── android.hardware.gnss@1.1-service-qti.rc │ │ ├── android.hardware.gnss@1.1-service-qti.xml │ │ ├── location_api │ │ │ ├── BatchingAPIClient.cpp │ │ │ ├── BatchingAPIClient.h │ │ │ ├── GeofenceAPIClient.cpp │ │ │ ├── GeofenceAPIClient.h │ │ │ ├── GnssAPIClient.cpp │ │ │ ├── GnssAPIClient.h │ │ │ ├── LocationUtil.cpp │ │ │ ├── LocationUtil.h │ │ │ ├── MeasurementAPIClient.cpp │ │ │ └── MeasurementAPIClient.h │ │ └── service.cpp │ ├── 2.0 │ │ ├── AGnss.cpp │ │ ├── AGnss.h │ │ ├── AGnssRil.cpp │ │ ├── AGnssRil.h │ │ ├── Android.mk │ │ ├── Gnss.cpp │ │ ├── Gnss.h │ │ ├── GnssBatching.cpp │ │ ├── GnssBatching.h │ │ ├── GnssConfiguration.cpp │ │ ├── GnssConfiguration.h │ │ ├── GnssDebug.cpp │ │ ├── GnssDebug.h │ │ ├── GnssGeofencing.cpp │ │ ├── GnssGeofencing.h │ │ ├── GnssMeasurement.cpp │ │ ├── GnssMeasurement.h │ │ ├── GnssNi.cpp │ │ ├── GnssNi.h │ │ ├── android.hardware.gnss@2.0-service-qti.rc │ │ ├── android.hardware.gnss@2.0-service-qti.xml │ │ ├── location_api │ │ │ ├── BatchingAPIClient.cpp │ │ │ ├── BatchingAPIClient.h │ │ │ ├── GeofenceAPIClient.cpp │ │ │ ├── GeofenceAPIClient.h │ │ │ ├── GnssAPIClient.cpp │ │ │ ├── GnssAPIClient.h │ │ │ ├── LocationUtil.cpp │ │ │ ├── LocationUtil.h │ │ │ ├── MeasurementAPIClient.cpp │ │ │ └── MeasurementAPIClient.h │ │ └── service.cpp │ ├── Android.mk │ ├── measurement_corrections │ │ └── 1.0 │ │ │ ├── MeasurementCorrections.cpp │ │ │ └── MeasurementCorrections.h │ ├── utils │ │ ├── Android.mk │ │ ├── battery_listener.cpp │ │ └── battery_listener.h │ └── visibility_control │ │ └── 1.0 │ │ ├── GnssVisibilityControl.cpp │ │ └── GnssVisibilityControl.h ├── batching │ ├── Android.mk │ ├── BatchingAdapter.cpp │ ├── BatchingAdapter.h │ ├── Makefile.am │ ├── configure.ac │ ├── location-batching.pc.in │ └── location_batching.cpp ├── build │ └── target_specific_features.mk ├── configure.ac ├── core │ ├── Android.mk │ ├── ContextBase.cpp │ ├── ContextBase.h │ ├── EngineHubProxyBase.h │ ├── LBSProxyBase.h │ ├── LocAdapterBase.cpp │ ├── LocAdapterBase.h │ ├── LocAdapterProxyBase.h │ ├── LocApiBase.cpp │ ├── LocApiBase.h │ ├── LocContext.cpp │ ├── LocContext.h │ ├── Makefile.am │ ├── SystemStatus.cpp │ ├── SystemStatus.h │ ├── SystemStatusOsObserver.cpp │ ├── SystemStatusOsObserver.h │ ├── configure.ac │ ├── data-items │ │ ├── DataItemConcreteTypesBase.h │ │ ├── DataItemId.h │ │ ├── DataItemsFactoryProxy.cpp │ │ ├── DataItemsFactoryProxy.h │ │ └── IDataItemCore.h │ ├── loc-core.pc.in │ ├── loc_core_log.cpp │ ├── loc_core_log.h │ └── observer │ │ ├── IDataItemObserver.h │ │ ├── IDataItemSubscription.h │ │ ├── IFrameworkActionReq.h │ │ └── IOsObserver.h ├── etc │ ├── flp.conf │ ├── gps.conf │ ├── izat.conf │ ├── lowi.conf │ ├── sap.conf │ └── xtwifi.conf ├── geofence │ ├── Android.mk │ ├── GeofenceAdapter.cpp │ ├── GeofenceAdapter.h │ ├── Makefile.am │ ├── configure.ac │ ├── location-geofence.pc.in │ └── location_geofence.cpp ├── gnss │ ├── Agps.cpp │ ├── Agps.h │ ├── Android.mk │ ├── GnssAdapter.cpp │ ├── GnssAdapter.h │ ├── Makefile.am │ ├── XtraSystemStatusObserver.cpp │ ├── XtraSystemStatusObserver.h │ └── location_gnss.cpp ├── gps_vendor_board.mk ├── gps_vendor_product.mk ├── loc-hal.pc.in ├── location │ ├── Android.mk │ ├── ILocationAPI.h │ ├── LocationAPI.cpp │ ├── LocationAPI.h │ ├── LocationAPIClientBase.cpp │ ├── LocationAPIClientBase.h │ ├── LocationDataTypes.h │ ├── Makefile.am │ ├── configure.ac │ ├── location-api.pc.in │ └── location_interface.h ├── pla │ ├── Android.mk │ ├── android │ │ └── loc_pla.h │ └── oe │ │ └── loc_pla.h └── utils │ ├── Android.mk │ ├── LocHeap.cpp │ ├── LocHeap.h │ ├── LocIpc.cpp │ ├── LocIpc.h │ ├── LocSharedLock.h │ ├── LocThread.cpp │ ├── LocThread.h │ ├── LocTimer.cpp │ ├── LocTimer.h │ ├── LocUnorderedSetMap.h │ ├── Makefile.am │ ├── MsgTask.cpp │ ├── MsgTask.h │ ├── configure.ac │ ├── gps-utils.pc.in │ ├── gps_extended.h │ ├── gps_extended_c.h │ ├── linked_list.c │ ├── linked_list.h │ ├── loc_cfg.cpp │ ├── loc_cfg.h │ ├── loc_gps.h │ ├── loc_log.cpp │ ├── loc_log.h │ ├── loc_misc_utils.cpp │ ├── loc_misc_utils.h │ ├── loc_nmea.cpp │ ├── loc_nmea.h │ ├── loc_target.cpp │ ├── loc_target.h │ ├── loc_timer.h │ ├── log_util.h │ ├── msg_q.c │ └── msg_q.h ├── idc ├── uinput-fpc.idc └── uinput-goodix.idc ├── init ├── Android.bp └── init_sdm660.cpp ├── ir ├── Android.bp ├── ConsumerIr.cpp ├── ConsumerIr.h ├── android.hardware.ir@1.0-service.xiaomi_sdm660.rc ├── android.hardware.ir@1.0-service.xiaomi_sdm660.xml └── service.cpp ├── keylayout ├── uinput-fpc.kl └── uinput-goodix.kl ├── libqti-perfd-client ├── Android.bp └── client.c ├── libshims ├── Android.bp └── camera_sdm660_shim.cpp ├── lineage.dependencies ├── manifest.xml ├── odm.prop ├── overlay-lineage ├── lineage-sdk │ └── lineage │ │ └── res │ │ └── res │ │ └── values │ │ └── config.xml └── packages │ └── apps │ └── Dialer │ └── java │ └── com │ └── android │ └── dialer │ └── callrecord │ └── res │ └── values │ └── config.xml ├── overlay ├── frameworks │ └── base │ │ ├── core │ │ └── res │ │ │ └── res │ │ │ ├── values-mcc234-mnc15-en-rGB │ │ │ └── config.xml │ │ │ ├── values-mcc234-mnc15-en-rIN │ │ │ └── config.xml │ │ │ ├── values-mcc234-mnc15 │ │ │ └── config.xml │ │ │ ├── values-mcc262-mnc02-en-rGB │ │ │ └── config.xml │ │ │ ├── values-mcc262-mnc02-en-rIN │ │ │ └── config.xml │ │ │ ├── values-mcc262-mnc02 │ │ │ └── config.xml │ │ │ ├── values-mcc262-mnc04-en-rGB │ │ │ └── config.xml │ │ │ ├── values-mcc262-mnc04-en-rIN │ │ │ └── config.xml │ │ │ ├── values-mcc262-mnc04 │ │ │ └── config.xml │ │ │ ├── values-mcc262-mnc09-en-rGB │ │ │ └── config.xml │ │ │ ├── values-mcc262-mnc09-en-rIN │ │ │ └── config.xml │ │ │ ├── values-mcc262-mnc09 │ │ │ └── config.xml │ │ │ ├── values-mcc310-mnc004 │ │ │ └── config.xml │ │ │ ├── values-mcc310-mnc120 │ │ │ └── config.xml │ │ │ ├── values-mcc310-mnc260 │ │ │ └── config.xml │ │ │ ├── values-mcc310-mnc410 │ │ │ └── config.xml │ │ │ ├── values-mcc311-mnc480 │ │ │ └── config.xml │ │ │ ├── values-mcc312-mnc530 │ │ │ └── config.xml │ │ │ ├── values-mcc460-mnc03 │ │ │ └── config.xml │ │ │ ├── values-mcc460-mnc11 │ │ │ └── config.xml │ │ │ └── values │ │ │ └── config.xml │ │ └── packages │ │ ├── SettingsProvider │ │ └── res │ │ │ └── values │ │ │ └── defaults.xml │ │ └── SystemUI │ │ └── res │ │ └── values │ │ └── config.xml └── packages │ ├── apps │ ├── CarrierConfig │ │ └── res │ │ │ └── xml │ │ │ └── vendor.xml │ ├── CellBroadcastReceiver │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ └── Settings │ │ └── res │ │ └── values │ │ └── arrays.xml │ └── services │ └── Telephony │ └── res │ └── values │ └── config.xml ├── product.prop ├── proprietary-files-fm.txt ├── proprietary-files-ir.txt ├── proprietary-files.txt ├── rootdir ├── Android.bp ├── Android.mk ├── bin │ ├── init.class_main.sh │ ├── init.qcom.early_boot.sh │ ├── init.qcom.post_boot.sh │ └── init.qcom.sh └── etc │ ├── init.fingerprint.rc │ ├── init.qcom.power.rc │ ├── init.qcom.rc │ ├── init.recovery.qcom.rc │ ├── init.target.rc │ └── ueventd.qcom.rc ├── rro_overlays └── WifiOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ └── values │ └── config.xml ├── sdm660.mk ├── seccomp ├── mediacodec-seccomp.policy └── mediaextractor-seccomp.policy ├── sepolicy ├── private │ └── system_app.te ├── public │ └── attributes └── vendor │ ├── app.te │ ├── device.te │ ├── file.te │ ├── file_contexts │ ├── genfs_contexts │ ├── hal_audio_default.te │ ├── hal_camera_default.te │ ├── hal_fingerprint_default.te │ ├── hal_ir_default.te │ ├── hal_mlipay.te │ ├── hal_power_default.te │ ├── hal_sensors_default.te │ ├── hwservice.te │ ├── hwservice_contexts │ ├── kernel.te │ ├── property.te │ ├── property_contexts │ ├── radio.te │ ├── rild.te │ ├── tee.te │ ├── thermal-engine.te │ └── vendor_init.te ├── setup-makefiles.sh ├── system.prop ├── update-sha1sums.py ├── vendor.prop └── wifi ├── WCNSS_qcom_cfg.ini ├── p2p_supplicant_overlay.conf └── wpa_supplicant_overlay.conf /.clang-format: -------------------------------------------------------------------------------- 1 | ../../../build/soong/scripts/system-clang-format -------------------------------------------------------------------------------- /Android.bp: -------------------------------------------------------------------------------- 1 | soong_namespace { 2 | } 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository contains common device configuration for Xiaomi sdm660-based devices 2 | 3 | ## Copyright 4 | 5 | ``` 6 | # 7 | # Copyright (C) 2018 The LineageOS Project 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | # 21 | -------------------------------------------------------------------------------- /audio/audio_tuning_mixer.txt: -------------------------------------------------------------------------------- 1 | #RAS_TEST_SPKR_PHONE_SPKR_STEREO 2 | acdb_dev_id:136 3 | !Playback 4 | Rxdevice:0 5 | 6 | enable 7 | INT4_MI2S_RX Channels:Two 8 | RX4 MIX1 INP1:RX4 9 | RX5 MIX1 INP1:RX5 10 | COMP1 Switch:1 11 | COMP2 Switch:1 12 | SpkrLeft COMP Switch:1 13 | SpkrLeft BOOST Switch:1 14 | SpkrLeft VISENSE Switch:1 15 | SpkrLeft SWR DAC_Port Switch:1 16 | SpkrRight COMP Switch:1 17 | SpkrRight BOOST Switch:1 18 | SpkrRight VISENSE Switch:1 19 | SpkrRight SWR DAC_Port Switch:1 20 | SpkrLeft WSA PA Mute:0 21 | SpkrRight WSA PA Mute:0 22 | INT4_MI2S_RX Audio Mixer MultiMedia1:1 23 | 24 | disable 25 | INT4_MI2S_RX Channels:One 26 | RX4 MIX1 INP1:ZERO 27 | RX5 MIX1 INP1:ZERO 28 | COMP1 Switch:0 29 | COMP2 Switch:0 30 | SpkrLeft COMP Switch:0 31 | SpkrLeft BOOST Switch:0 32 | SpkrLeft VISENSE Switch:0 33 | SpkrLeft SWR DAC_Port Switch:0 34 | SpkrRight COMP Switch:0 35 | SpkrRight BOOST Switch:0 36 | SpkrRight VISENSE Switch:0 37 | SpkrRight SWR DAC_Port Switch:0 38 | SpkrLeft WSA PA Mute:0 39 | SpkrRight WSA PA Mute:0 40 | INT4_MI2S_RX Audio Mixer MultiMedia1:0 41 | 42 | -------------------------------------------------------------------------------- /audio/bluetooth_hearing_aid_audio_policy_configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /compatibility_matrix.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.frameworks.schedulerservice 4 | 1.0 5 | 6 | ISchedulingPolicyService 7 | default 8 | 9 | 10 | 11 | android.frameworks.sensorservice 12 | 1.0 13 | 14 | ISensorManager 15 | default 16 | 17 | 18 | 19 | android.hidl.allocator 20 | 1.0 21 | 22 | IAllocator 23 | ashmem 24 | 25 | 26 | 27 | android.hidl.manager 28 | 1.0 29 | 30 | IServiceManager 31 | default 32 | 33 | 34 | 35 | android.hidl.memory 36 | 1.0 37 | 38 | IMapper 39 | ashmem 40 | 41 | 42 | 43 | android.hidl.token 44 | 1.0 45 | 46 | ITokenManager 47 | default 48 | 49 | 50 | 51 | android.system.wifi.keystore 52 | 1.0 53 | 54 | IKeystore 55 | default 56 | 57 | 58 | 59 | netutils-wrapper 60 | 69 | 1.0 70 | 71 | 72 | -------------------------------------------------------------------------------- /configs/component-overrides.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /configs/msm_irqbalance.conf: -------------------------------------------------------------------------------- 1 | PRIO=1,1,0,0,0,0,0,0 2 | #arch_timer, arm-pmu, arch_mem_timer, glink-smem-rpm, mpm irqs 3 | IGNORED_IRQ=19,22,39,200,203 4 | #WLAN irqs 5 | BLACKLIST_IRQ=446,455,456 6 | -------------------------------------------------------------------------------- /configs/public.libraries.txt: -------------------------------------------------------------------------------- 1 | libadsprpc.so 2 | libcdsprpc.so 3 | libsdsprpc.so 4 | libfastcvopt.so 5 | libOpenCL.so 6 | libprotobuf-cpp-full.so 7 | libprotobuf-cpp-lite.so 8 | -------------------------------------------------------------------------------- /configs/system_ext-privapp-permissions-qti.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /doze/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2020-2021 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | android_app { 8 | name: "XiaomiDoze", 9 | 10 | srcs: ["src/**/*.java"], 11 | resource_dirs: ["res"], 12 | certificate: "platform", 13 | platform_apis: true, 14 | privileged: true, 15 | 16 | static_libs: [ 17 | "org.lineageos.settings.resources", 18 | ], 19 | 20 | optimize: { 21 | proguard_flags_files: ["proguard.flags"], 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /doze/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 47 | 48 | 49 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /doze/proguard.flags: -------------------------------------------------------------------------------- 1 | -keep class org.lineageos.settings.doze.* { 2 | *; 3 | } 4 | -------------------------------------------------------------------------------- /doze/res/drawable/ic_hand.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doze/res/drawable/ic_pickup.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doze/res/drawable/ic_pocket.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doze/res/xml/doze_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 21 | 22 | 25 | 26 | 30 | 31 | 36 | 37 | 40 | 41 | 47 | 48 | 49 | 50 | 53 | 54 | 60 | 61 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/BootCompletedReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The CyanogenMod Project 3 | * 2017 The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.lineageos.settings.doze; 19 | 20 | import android.content.BroadcastReceiver; 21 | import android.content.Context; 22 | import android.content.Intent; 23 | import android.util.Log; 24 | 25 | public class BootCompletedReceiver extends BroadcastReceiver { 26 | 27 | private static final boolean DEBUG = false; 28 | private static final String TAG = "XiaomiDoze"; 29 | 30 | @Override 31 | public void onReceive(final Context context, Intent intent) { 32 | if (Utils.isDozeEnabled(context) && Utils.sensorsEnabled(context)) { 33 | if (DEBUG) Log.d(TAG, "Starting service"); 34 | Utils.startService(context); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2016 The CyanogenMod Project 3 | * 2017,2022 The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.lineageos.settings.doze; 19 | 20 | import android.os.Bundle; 21 | 22 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; 23 | import com.android.settingslib.widget.R; 24 | 25 | public class DozeSettingsActivity extends CollapsingToolbarBaseActivity { 26 | 27 | private static final String TAG_DOZE = "doze"; 28 | 29 | @Override 30 | protected void onCreate(Bundle savedInstanceState) { 31 | super.onCreate(savedInstanceState); 32 | 33 | getFragmentManager().beginTransaction().replace(R.id.content_frame, 34 | new DozeSettingsFragment(), TAG_DOZE).commit(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /framework_manifest.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | 31 | vendor.qti.diaghal 32 | hwbinder 33 | 1.0 34 | 35 | Idiag 36 | default 37 | 38 | 39 | 40 | 41 | vendor.qti.hardware.sigma_miracast 42 | hwbinder 43 | 1.0 44 | 45 | Isigma_miracast 46 | sigmahal 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /gps/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | LOCAL_PATH := $(call my-dir) 3 | include $(LOCAL_PATH)/build/target_specific_features.mk 4 | include $(call all-makefiles-under,$(LOCAL_PATH)) 5 | endif 6 | -------------------------------------------------------------------------------- /gps/CleanSpec.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # If you don't need to do a full clean build but would like to touch 17 | # a file or delete some intermediate files, add a clean step to the end 18 | # of the list. These steps will only be run once, if they haven't been 19 | # run before. 20 | # 21 | # E.g.: 22 | # $(call add-clean-step, touch -c external/sqlite/sqlite3.h) 23 | # $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) 24 | # 25 | # Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with 26 | # files that are missing or have been moved. 27 | # 28 | # Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. 29 | # Use $(OUT_DIR) to refer to the "out" directory. 30 | # 31 | # If you need to re-do something that's already mentioned, just copy 32 | # the command and add it to the bottom of the list. E.g., if a change 33 | # that you made last week required touching a file and a change you 34 | # made today requires touching the same file, just copy the old 35 | # touch step and add it to the end of the list. 36 | # 37 | # ************************************************ 38 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 39 | # ************************************************ 40 | 41 | # For example: 42 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) 43 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) 44 | #$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) 45 | #$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) 46 | 47 | # ************************************************ 48 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 49 | # ************************************************ 50 | $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc_api*) 51 | -------------------------------------------------------------------------------- /gps/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile.am - Automake script for gps loc_api 2 | # 3 | 4 | ACLOCAL_AMFLAGS = -I m4 5 | 6 | SUBDIRS = gnss 7 | 8 | pkgconfigdir = $(libdir)/pkgconfig 9 | pkgconfig_DATA = loc-hal.pc 10 | EXTRA_DIST = $(pkgconfig_DATA) 11 | -------------------------------------------------------------------------------- /gps/android/1.0/AGnss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IAGnss; 35 | using ::android::hardware::gnss::V1_0::IAGnssCallback; 36 | using ::android::hardware::Return; 37 | using ::android::hardware::Void; 38 | using ::android::hardware::hidl_vec; 39 | using ::android::hardware::hidl_string; 40 | using ::android::sp; 41 | 42 | struct Gnss; 43 | struct AGnss : public IAGnss { 44 | 45 | AGnss(Gnss* gnss); 46 | ~AGnss(); 47 | /* 48 | * Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow. 49 | * These declarations were generated from IAGnss.hal. 50 | */ 51 | Return setCallback(const sp& callback) override; 52 | 53 | Return dataConnClosed() override; 54 | 55 | Return dataConnFailed() override; 56 | 57 | Return dataConnOpen(const hidl_string& apn, 58 | IAGnss::ApnIpType apnIpType) override; 59 | 60 | Return setServer(IAGnssCallback::AGnssType type, 61 | const hidl_string& hostname, int32_t port) override; 62 | 63 | void statusIpV4Cb(AGnssExtStatusIpV4 status); 64 | 65 | /* Data call setup callback passed down to GNSS HAL implementation */ 66 | static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); 67 | 68 | private: 69 | Gnss* mGnss = nullptr; 70 | sp mAGnssCbIface = nullptr; 71 | }; 72 | 73 | } // namespace implementation 74 | } // namespace V1_0 75 | } // namespace gnss 76 | } // namespace hardware 77 | } // namespace android 78 | 79 | #endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H 80 | -------------------------------------------------------------------------------- /gps/android/1.0/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti 5 | LOCAL_VENDOR_MODULE := true 6 | LOCAL_MODULE_RELATIVE_PATH := hw 7 | LOCAL_SRC_FILES := \ 8 | AGnss.cpp \ 9 | Gnss.cpp \ 10 | GnssBatching.cpp \ 11 | GnssGeofencing.cpp \ 12 | GnssMeasurement.cpp \ 13 | GnssNi.cpp \ 14 | GnssConfiguration.cpp \ 15 | GnssDebug.cpp \ 16 | AGnssRil.cpp 17 | 18 | LOCAL_SRC_FILES += \ 19 | location_api/LocationUtil.cpp \ 20 | location_api/GnssAPIClient.cpp \ 21 | location_api/GeofenceAPIClient.cpp \ 22 | location_api/BatchingAPIClient.cpp \ 23 | location_api/MeasurementAPIClient.cpp \ 24 | 25 | LOCAL_C_INCLUDES:= \ 26 | $(LOCAL_PATH)/location_api 27 | LOCAL_HEADER_LIBRARIES := \ 28 | libgps.utils_headers \ 29 | libloc_core_headers \ 30 | libloc_pla_headers \ 31 | liblocation_api_headers \ 32 | liblocbatterylistener_headers 33 | 34 | LOCAL_SHARED_LIBRARIES := \ 35 | liblog \ 36 | libhidlbase \ 37 | libcutils \ 38 | libutils \ 39 | android.hardware.gnss@1.0 \ 40 | android.hardware.health@1.0 \ 41 | android.hardware.health@2.0 \ 42 | android.hardware.power@1.2 \ 43 | libbase 44 | 45 | LOCAL_SHARED_LIBRARIES += \ 46 | libloc_core \ 47 | libgps.utils \ 48 | libdl \ 49 | liblocation_api \ 50 | 51 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 52 | LOCAL_STATIC_LIBRARIES := liblocbatterylistener 53 | LOCAL_STATIC_LIBRARIES += libhealthhalutils 54 | include $(BUILD_SHARED_LIBRARY) 55 | 56 | include $(CLEAR_VARS) 57 | LOCAL_MODULE := android.hardware.gnss@1.0-service-qti 58 | LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.0-service-qti.xml 59 | LOCAL_VENDOR_MODULE := true 60 | LOCAL_MODULE_RELATIVE_PATH := hw 61 | LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc 62 | LOCAL_SRC_FILES := \ 63 | service.cpp \ 64 | 65 | LOCAL_C_INCLUDES:= \ 66 | $(LOCAL_PATH)/location_api 67 | LOCAL_HEADER_LIBRARIES := \ 68 | libgps.utils_headers \ 69 | libloc_core_headers \ 70 | libloc_pla_headers \ 71 | liblocation_api_headers 72 | 73 | 74 | LOCAL_SHARED_LIBRARIES := \ 75 | liblog \ 76 | libcutils \ 77 | libdl \ 78 | libbase \ 79 | libutils \ 80 | libgps.utils \ 81 | libqti_vndfwk_detect \ 82 | 83 | LOCAL_SHARED_LIBRARIES += \ 84 | libhidlbase \ 85 | android.hardware.gnss@1.0 \ 86 | 87 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 88 | 89 | ifneq ($(LOC_HIDL_VERSION),) 90 | LOCAL_CFLAGS += -DLOC_HIDL_VERSION='"$(LOC_HIDL_VERSION)"' 91 | endif 92 | 93 | include $(BUILD_EXECUTABLE) 94 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssBatching.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H 23 | 24 | #include 25 | #include 26 | 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssBatching; 35 | using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; 36 | using ::android::hidl::base::V1_0::IBase; 37 | using ::android::hardware::hidl_array; 38 | using ::android::hardware::hidl_memory; 39 | using ::android::hardware::hidl_string; 40 | using ::android::hardware::hidl_vec; 41 | using ::android::hardware::Return; 42 | using ::android::hardware::Void; 43 | using ::android::sp; 44 | 45 | class BatchingAPIClient; 46 | struct GnssBatching : public IGnssBatching { 47 | GnssBatching(); 48 | ~GnssBatching(); 49 | 50 | // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. 51 | Return init(const sp& callback) override; 52 | Return getBatchSize() override; 53 | Return start(const IGnssBatching::Options& options ) override; 54 | Return flush() override; 55 | Return stop() override; 56 | Return cleanup() override; 57 | 58 | private: 59 | struct GnssBatchingDeathRecipient : hidl_death_recipient { 60 | GnssBatchingDeathRecipient(sp gnssBatching) : 61 | mGnssBatching(gnssBatching) { 62 | } 63 | ~GnssBatchingDeathRecipient() = default; 64 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 65 | sp mGnssBatching; 66 | }; 67 | 68 | private: 69 | sp mGnssBatchingDeathRecipient = nullptr; 70 | sp mGnssBatchingCbIface = nullptr; 71 | BatchingAPIClient* mApi = nullptr; 72 | }; 73 | 74 | } // namespace implementation 75 | } // namespace V1_0 76 | } // namespace gnss 77 | } // namespace hardware 78 | } // namespace android 79 | 80 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H 81 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssConfiguration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | 6 | /* Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | 22 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 23 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssConfiguration; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* 42 | * Interface for passing GNSS configuration info from platform to HAL. 43 | */ 44 | struct Gnss; 45 | struct GnssConfiguration : public IGnssConfiguration { 46 | GnssConfiguration(Gnss* gnss); 47 | ~GnssConfiguration() = default; 48 | 49 | /* 50 | * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow. 51 | * These declarations were generated from IGnssConfiguration.hal. 52 | */ 53 | Return setSuplVersion(uint32_t version) override; 54 | Return setSuplMode(uint8_t mode) override; 55 | Return setSuplEs(bool enabled) override; 56 | Return setLppProfile(uint8_t lppProfile) override; 57 | Return setGlonassPositioningProtocol(uint8_t protocol) override; 58 | Return setEmergencySuplPdn(bool enable) override; 59 | Return setGpsLock(uint8_t lock) override; 60 | 61 | private: 62 | Gnss* mGnss = nullptr; 63 | }; 64 | 65 | } // namespace implementation 66 | } // namespace V1_0 67 | } // namespace gnss 68 | } // namespace hardware 69 | } // namespace android 70 | 71 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 72 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 18 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 19 | 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace gnss { 27 | namespace V1_0 { 28 | namespace implementation { 29 | 30 | using ::android::hardware::gnss::V1_0::IGnssDebug; 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | using ::android::hardware::hidl_vec; 34 | using ::android::hardware::hidl_string; 35 | using ::android::sp; 36 | 37 | /* Interface for GNSS Debug support. */ 38 | struct Gnss; 39 | struct GnssDebug : public IGnssDebug { 40 | GnssDebug(Gnss* gnss); 41 | ~GnssDebug() {}; 42 | 43 | /* 44 | * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. 45 | * These declarations were generated from IGnssDebug.hal. 46 | */ 47 | Return getDebugData(getDebugData_cb _hidl_cb) override; 48 | 49 | private: 50 | Gnss* mGnss = nullptr; 51 | }; 52 | 53 | } // namespace implementation 54 | } // namespace V1_0 55 | } // namespace gnss 56 | } // namespace hardware 57 | } // namespace android 58 | 59 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 60 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssMeasurement.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssMeasurement; 35 | using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback; 36 | using ::android::hardware::Return; 37 | using ::android::hardware::Void; 38 | using ::android::hardware::hidl_vec; 39 | using ::android::hardware::hidl_string; 40 | using ::android::sp; 41 | 42 | class MeasurementAPIClient; 43 | struct GnssMeasurement : public IGnssMeasurement { 44 | GnssMeasurement(); 45 | ~GnssMeasurement(); 46 | 47 | /* 48 | * Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. 49 | * These declarations were generated from IGnssMeasurement.hal. 50 | */ 51 | Return setCallback( 52 | const sp& callback) override; 53 | Return close() override; 54 | 55 | private: 56 | struct GnssMeasurementDeathRecipient : hidl_death_recipient { 57 | GnssMeasurementDeathRecipient(sp gnssMeasurement) : 58 | mGnssMeasurement(gnssMeasurement) { 59 | } 60 | ~GnssMeasurementDeathRecipient() = default; 61 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 62 | sp mGnssMeasurement; 63 | }; 64 | 65 | private: 66 | sp mGnssMeasurementDeathRecipient = nullptr; 67 | sp mGnssMeasurementCbIface = nullptr; 68 | MeasurementAPIClient* mApi; 69 | }; 70 | 71 | } // namespace implementation 72 | } // namespace V1_0 73 | } // namespace gnss 74 | } // namespace hardware 75 | } // namespace android 76 | 77 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H 78 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssNi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "LocSvc_GnssNiInterface" 22 | 23 | #include 24 | #include "Gnss.h" 25 | #include "GnssNi.h" 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_0 { 31 | namespace implementation { 32 | 33 | void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { 34 | LOC_LOGE("%s] service died. cookie: %llu, who: %p", 35 | __FUNCTION__, static_cast(cookie), &who); 36 | // we do nothing here 37 | // Gnss::GnssDeathRecipient will stop the session 38 | } 39 | 40 | GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { 41 | mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); 42 | } 43 | 44 | // Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 45 | Return GnssNi::setCallback(const sp& callback) { 46 | if (mGnss == nullptr) { 47 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 48 | return Void(); 49 | } 50 | 51 | mGnss->setGnssNiCb(callback); 52 | 53 | if (mGnssNiCbIface != nullptr) { 54 | mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); 55 | } 56 | mGnssNiCbIface = callback; 57 | if (mGnssNiCbIface != nullptr) { 58 | mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); 59 | } 60 | 61 | return Void(); 62 | } 63 | 64 | Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { 65 | if (mGnss == nullptr) { 66 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 67 | return Void(); 68 | } 69 | 70 | GnssAPIClient* api = mGnss->getApi(); 71 | if (api == nullptr) { 72 | LOC_LOGE("%s]: api is nullptr", __FUNCTION__); 73 | return Void(); 74 | } 75 | 76 | api->gnssNiRespond(notifId, userResponse); 77 | 78 | return Void(); 79 | } 80 | 81 | } // namespace implementation 82 | } // namespace V1_0 83 | } // namespace gnss 84 | } // namespace hardware 85 | } // namespace android 86 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_0 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V1_0 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/1.0/android.hardware.gnss@1.0-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /gps/android/1.0/android.hardware.gnss@1.0-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.0::IGnss/default 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /gps/android/1.0/location_api/LocationUtil.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOCATION_UTIL_H 31 | #define LOCATION_UTIL_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace android { 38 | namespace hardware { 39 | namespace gnss { 40 | namespace V1_0 { 41 | namespace implementation { 42 | 43 | void convertGnssLocation(Location& in, V1_0::GnssLocation& out); 44 | void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); 45 | void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); 46 | void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); 47 | void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); 48 | void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); 49 | 50 | } // namespace implementation 51 | } // namespace V1_0 52 | } // namespace gnss 53 | } // namespace hardware 54 | } // namespace android 55 | #endif // LOCATION_UTIL_H 56 | -------------------------------------------------------------------------------- /gps/android/1.0/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "android.hardware.gnss@1.0-service-qti" 22 | 23 | #include 24 | #include 25 | #include "loc_cfg.h" 26 | #include "loc_misc_utils.h" 27 | 28 | extern "C" { 29 | #include "vndfwk-detect.h" 30 | } 31 | 32 | #ifdef ARCH_ARM_32 33 | #define DEFAULT_HW_BINDER_MEM_SIZE 65536 34 | #endif 35 | 36 | using android::hardware::gnss::V1_0::IGnss; 37 | 38 | using android::hardware::configureRpcThreadpool; 39 | using android::hardware::registerPassthroughServiceImplementation; 40 | using android::hardware::joinRpcThreadpool; 41 | 42 | using android::status_t; 43 | using android::OK; 44 | 45 | typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); 46 | 47 | int main() { 48 | 49 | ALOGI("%s", __FUNCTION__); 50 | 51 | int vendorInfo = getVendorEnhancedInfo(); 52 | bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); 53 | setVendorEnhanced(vendorEnhanced); 54 | 55 | #ifdef ARCH_ARM_32 56 | android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); 57 | #endif 58 | configureRpcThreadpool(1, true); 59 | status_t status; 60 | 61 | status = registerPassthroughServiceImplementation(); 62 | if (status == OK) { 63 | if (vendorEnhanced) { 64 | #ifdef LOC_HIDL_VERSION 65 | #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" 66 | 67 | void* libHandle = NULL; 68 | vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) 69 | dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); 70 | if (NULL != vendorEnhancedMainMethod) { 71 | (*vendorEnhancedMainMethod)(0, NULL); 72 | } 73 | #else 74 | ALOGE("LOC_HIDL_VERSION not defined."); 75 | #endif 76 | } 77 | 78 | joinRpcThreadpool(); 79 | 80 | } else { 81 | ALOGE("Error while registering IGnss 1.0 service: %d", status); 82 | } 83 | 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /gps/android/1.1/AGnss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H 22 | #define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IAGnss; 35 | using ::android::hardware::gnss::V1_0::IAGnssCallback; 36 | using ::android::hardware::Return; 37 | using ::android::hardware::Void; 38 | using ::android::hardware::hidl_vec; 39 | using ::android::hardware::hidl_string; 40 | using ::android::sp; 41 | 42 | struct Gnss; 43 | struct AGnss : public IAGnss { 44 | 45 | AGnss(Gnss* gnss); 46 | ~AGnss(); 47 | /* 48 | * Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow. 49 | * These declarations were generated from IAGnss.hal. 50 | */ 51 | Return setCallback(const sp& callback) override; 52 | 53 | Return dataConnClosed() override; 54 | 55 | Return dataConnFailed() override; 56 | 57 | Return dataConnOpen(const hidl_string& apn, 58 | IAGnss::ApnIpType apnIpType) override; 59 | 60 | Return setServer(IAGnssCallback::AGnssType type, 61 | const hidl_string& hostname, int32_t port) override; 62 | 63 | void statusIpV4Cb(AGnssExtStatusIpV4 status); 64 | 65 | /* Data call setup callback passed down to GNSS HAL implementation */ 66 | static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); 67 | 68 | private: 69 | Gnss* mGnss = nullptr; 70 | sp mAGnssCbIface = nullptr; 71 | }; 72 | 73 | } // namespace implementation 74 | } // namespace V1_1 75 | } // namespace gnss 76 | } // namespace hardware 77 | } // namespace android 78 | 79 | #endif // ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H 80 | -------------------------------------------------------------------------------- /gps/android/1.1/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti 5 | LOCAL_VENDOR_MODULE := true 6 | LOCAL_MODULE_RELATIVE_PATH := hw 7 | LOCAL_SRC_FILES := \ 8 | AGnss.cpp \ 9 | Gnss.cpp \ 10 | GnssBatching.cpp \ 11 | GnssGeofencing.cpp \ 12 | GnssMeasurement.cpp \ 13 | GnssNi.cpp \ 14 | GnssConfiguration.cpp \ 15 | GnssDebug.cpp \ 16 | AGnssRil.cpp 17 | 18 | LOCAL_SRC_FILES += \ 19 | location_api/LocationUtil.cpp \ 20 | location_api/GnssAPIClient.cpp \ 21 | location_api/GeofenceAPIClient.cpp \ 22 | location_api/BatchingAPIClient.cpp \ 23 | location_api/MeasurementAPIClient.cpp \ 24 | 25 | LOCAL_C_INCLUDES:= \ 26 | $(LOCAL_PATH)/location_api 27 | LOCAL_HEADER_LIBRARIES := \ 28 | libgps.utils_headers \ 29 | libloc_core_headers \ 30 | libloc_pla_headers \ 31 | liblocation_api_headers \ 32 | liblocbatterylistener_headers 33 | 34 | LOCAL_SHARED_LIBRARIES := \ 35 | liblog \ 36 | libhidlbase \ 37 | libcutils \ 38 | libutils \ 39 | android.hardware.gnss@1.0 \ 40 | android.hardware.gnss@1.1 \ 41 | android.hardware.health@1.0 \ 42 | android.hardware.health@2.0 \ 43 | android.hardware.power@1.2 \ 44 | libbase 45 | 46 | LOCAL_SHARED_LIBRARIES += \ 47 | libloc_core \ 48 | libgps.utils \ 49 | libdl \ 50 | liblocation_api \ 51 | 52 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 53 | LOCAL_STATIC_LIBRARIES := liblocbatterylistener 54 | LOCAL_STATIC_LIBRARIES += libhealthhalutils 55 | include $(BUILD_SHARED_LIBRARY) 56 | 57 | include $(CLEAR_VARS) 58 | LOCAL_MODULE := android.hardware.gnss@1.1-service-qti 59 | LOCAL_VINTF_FRAGMENTS := android.hardware.gnss@1.1-service-qti.xml 60 | LOCAL_VENDOR_MODULE := true 61 | LOCAL_MODULE_RELATIVE_PATH := hw 62 | LOCAL_INIT_RC := android.hardware.gnss@1.1-service-qti.rc 63 | LOCAL_SRC_FILES := \ 64 | service.cpp \ 65 | 66 | LOCAL_C_INCLUDES:= \ 67 | $(LOCAL_PATH)/location_api 68 | LOCAL_HEADER_LIBRARIES := \ 69 | libgps.utils_headers \ 70 | libloc_core_headers \ 71 | libloc_pla_headers \ 72 | liblocation_api_headers 73 | 74 | 75 | LOCAL_SHARED_LIBRARIES := \ 76 | liblog \ 77 | libcutils \ 78 | libdl \ 79 | libbase \ 80 | libutils \ 81 | libgps.utils \ 82 | libqti_vndfwk_detect \ 83 | 84 | LOCAL_SHARED_LIBRARIES += \ 85 | libhidlbase \ 86 | android.hardware.gnss@1.0 \ 87 | android.hardware.gnss@1.1 \ 88 | 89 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 90 | 91 | ifneq ($(LOC_HIDL_VERSION),) 92 | LOCAL_CFLAGS += -DLOC_HIDL_VERSION='"$(LOC_HIDL_VERSION)"' 93 | endif 94 | 95 | include $(BUILD_EXECUTABLE) 96 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssBatching.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H 22 | #define ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H 23 | 24 | #include 25 | #include 26 | 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssBatching; 35 | using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; 36 | using ::android::hidl::base::V1_0::IBase; 37 | using ::android::hardware::hidl_array; 38 | using ::android::hardware::hidl_memory; 39 | using ::android::hardware::hidl_string; 40 | using ::android::hardware::hidl_vec; 41 | using ::android::hardware::Return; 42 | using ::android::hardware::Void; 43 | using ::android::sp; 44 | 45 | class BatchingAPIClient; 46 | struct GnssBatching : public IGnssBatching { 47 | GnssBatching(); 48 | ~GnssBatching(); 49 | 50 | // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. 51 | Return init(const sp& callback) override; 52 | Return getBatchSize() override; 53 | Return start(const IGnssBatching::Options& options ) override; 54 | Return flush() override; 55 | Return stop() override; 56 | Return cleanup() override; 57 | 58 | private: 59 | struct GnssBatchingDeathRecipient : hidl_death_recipient { 60 | GnssBatchingDeathRecipient(sp gnssBatching) : 61 | mGnssBatching(gnssBatching) { 62 | } 63 | ~GnssBatchingDeathRecipient() = default; 64 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 65 | sp mGnssBatching; 66 | }; 67 | 68 | private: 69 | sp mGnssBatchingDeathRecipient = nullptr; 70 | sp mGnssBatchingCbIface = nullptr; 71 | BatchingAPIClient* mApi = nullptr; 72 | }; 73 | 74 | } // namespace implementation 75 | } // namespace V1_1 76 | } // namespace gnss 77 | } // namespace hardware 78 | } // namespace android 79 | 80 | #endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H 81 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssConfiguration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | 6 | /* Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | 22 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H 23 | #define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_1::IGnssConfiguration; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* 42 | * Interface for passing GNSS configuration info from platform to HAL. 43 | */ 44 | struct Gnss; 45 | struct GnssConfiguration : public IGnssConfiguration { 46 | GnssConfiguration(Gnss* gnss); 47 | ~GnssConfiguration() = default; 48 | 49 | /* 50 | * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow. 51 | * These declarations were generated from IGnssConfiguration.hal. 52 | */ 53 | Return setSuplVersion(uint32_t version) override; 54 | Return setSuplMode(uint8_t mode) override; 55 | Return setSuplEs(bool enabled) override; 56 | Return setLppProfile(uint8_t lppProfile) override; 57 | Return setGlonassPositioningProtocol(uint8_t protocol) override; 58 | Return setEmergencySuplPdn(bool enable) override; 59 | Return setGpsLock(uint8_t lock) override; 60 | 61 | // Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow. 62 | Return setBlacklist( 63 | const hidl_vec& blacklist) override; 64 | 65 | private: 66 | Gnss* mGnss = nullptr; 67 | bool setBlacklistedSource( 68 | GnssSvIdSource& copyToSource, 69 | const GnssConfiguration::BlacklistedSource& copyFromSource); 70 | }; 71 | 72 | } // namespace implementation 73 | } // namespace V1_1 74 | } // namespace gnss 75 | } // namespace hardware 76 | } // namespace android 77 | 78 | #endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H 79 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 18 | #define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 19 | 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace gnss { 27 | namespace V1_1 { 28 | namespace implementation { 29 | 30 | using ::android::hardware::gnss::V1_0::IGnssDebug; 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | using ::android::hardware::hidl_vec; 34 | using ::android::hardware::hidl_string; 35 | using ::android::sp; 36 | 37 | /* Interface for GNSS Debug support. */ 38 | struct Gnss; 39 | struct GnssDebug : public IGnssDebug { 40 | GnssDebug(Gnss* gnss); 41 | ~GnssDebug() {}; 42 | 43 | /* 44 | * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. 45 | * These declarations were generated from IGnssDebug.hal. 46 | */ 47 | Return getDebugData(getDebugData_cb _hidl_cb) override; 48 | 49 | private: 50 | Gnss* mGnss = nullptr; 51 | }; 52 | 53 | } // namespace implementation 54 | } // namespace V1_1 55 | } // namespace gnss 56 | } // namespace hardware 57 | } // namespace android 58 | 59 | #endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 60 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssNi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "LocSvc_GnssNiInterface" 22 | 23 | #include 24 | #include "Gnss.h" 25 | #include "GnssNi.h" 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_1 { 31 | namespace implementation { 32 | 33 | void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { 34 | LOC_LOGE("%s] service died. cookie: %llu, who: %p", 35 | __FUNCTION__, static_cast(cookie), &who); 36 | // we do nothing here 37 | // Gnss::GnssDeathRecipient will stop the session 38 | } 39 | 40 | GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { 41 | mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); 42 | } 43 | 44 | // Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 45 | Return GnssNi::setCallback(const sp& callback) { 46 | if (mGnss == nullptr) { 47 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 48 | return Void(); 49 | } 50 | 51 | mGnss->setGnssNiCb(callback); 52 | 53 | if (mGnssNiCbIface != nullptr) { 54 | mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); 55 | } 56 | mGnssNiCbIface = callback; 57 | if (mGnssNiCbIface != nullptr) { 58 | mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); 59 | } 60 | 61 | return Void(); 62 | } 63 | 64 | Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { 65 | if (mGnss == nullptr) { 66 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 67 | return Void(); 68 | } 69 | 70 | GnssAPIClient* api = mGnss->getApi(); 71 | if (api == nullptr) { 72 | LOC_LOGE("%s]: api is nullptr", __FUNCTION__); 73 | return Void(); 74 | } 75 | 76 | api->gnssNiRespond(notifId, userResponse); 77 | 78 | return Void(); 79 | } 80 | 81 | } // namespace implementation 82 | } // namespace V1_1 83 | } // namespace gnss 84 | } // namespace hardware 85 | } // namespace android 86 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_1 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V1_1 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/1.1/android.hardware.gnss@1.1-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /gps/android/1.1/android.hardware.gnss@1.1-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /gps/android/1.1/location_api/LocationUtil.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOCATION_UTIL_H 31 | #define LOCATION_UTIL_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace android { 38 | namespace hardware { 39 | namespace gnss { 40 | namespace V1_1 { 41 | namespace implementation { 42 | 43 | void convertGnssLocation(Location& in, V1_0::GnssLocation& out); 44 | void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); 45 | void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); 46 | void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); 47 | void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); 48 | void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); 49 | 50 | } // namespace implementation 51 | } // namespace V1_1 52 | } // namespace gnss 53 | } // namespace hardware 54 | } // namespace android 55 | #endif // LOCATION_UTIL_H 56 | -------------------------------------------------------------------------------- /gps/android/1.1/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "android.hardware.gnss@1.1-service-qti" 22 | 23 | #include 24 | #include 25 | #include "loc_cfg.h" 26 | #include "loc_misc_utils.h" 27 | 28 | extern "C" { 29 | #include "vndfwk-detect.h" 30 | } 31 | 32 | #ifdef ARCH_ARM_32 33 | #define DEFAULT_HW_BINDER_MEM_SIZE 65536 34 | #endif 35 | 36 | using android::hardware::gnss::V1_1::IGnss; 37 | 38 | using android::hardware::configureRpcThreadpool; 39 | using android::hardware::registerPassthroughServiceImplementation; 40 | using android::hardware::joinRpcThreadpool; 41 | 42 | using android::status_t; 43 | using android::OK; 44 | 45 | typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); 46 | 47 | int main() { 48 | 49 | ALOGI("%s", __FUNCTION__); 50 | 51 | int vendorInfo = getVendorEnhancedInfo(); 52 | bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); 53 | setVendorEnhanced(vendorEnhanced); 54 | 55 | #ifdef ARCH_ARM_32 56 | android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); 57 | #endif 58 | configureRpcThreadpool(1, true); 59 | status_t status; 60 | 61 | status = registerPassthroughServiceImplementation(); 62 | if (status == OK) { 63 | if (vendorEnhanced) { 64 | #ifdef LOC_HIDL_VERSION 65 | #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" 66 | 67 | void* libHandle = NULL; 68 | vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) 69 | dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); 70 | if (NULL != vendorEnhancedMainMethod) { 71 | (*vendorEnhancedMainMethod)(0, NULL); 72 | } 73 | #else 74 | ALOGE("LOC_HIDL_VERSION not defined."); 75 | #endif 76 | } 77 | 78 | joinRpcThreadpool(); 79 | 80 | } else { 81 | ALOGE("Error while registering IGnss 1.1 service: %d", status); 82 | } 83 | 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /gps/android/2.0/AGnss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::Return; 35 | using ::android::hardware::Void; 36 | using ::android::hardware::hidl_vec; 37 | using ::android::hardware::hidl_string; 38 | using ::android::sp; 39 | 40 | struct Gnss; 41 | struct AGnss : public V2_0::IAGnss { 42 | 43 | AGnss(Gnss* gnss); 44 | ~AGnss(); 45 | /* 46 | * Methods from ::android::hardware::gnss::V2_0::IAGnss interface follow. 47 | * These declarations were generated from IAGnss.hal. 48 | */ 49 | Return setCallback(const sp& callback) override; 50 | 51 | Return dataConnClosed() override; 52 | 53 | Return dataConnFailed() override; 54 | 55 | Return dataConnOpen(uint64_t networkHandle, const hidl_string& apn, 56 | V2_0::IAGnss::ApnIpType apnIpType) override; 57 | 58 | Return setServer(V2_0::IAGnssCallback::AGnssType type, 59 | const hidl_string& hostname, int32_t port) override; 60 | 61 | void statusCb(AGpsExtType type, LocAGpsStatusValue status); 62 | 63 | /* Data call setup callback passed down to GNSS HAL implementation */ 64 | static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); 65 | 66 | private: 67 | Gnss* mGnss = nullptr; 68 | sp mAGnssCbIface = nullptr; 69 | }; 70 | 71 | } // namespace implementation 72 | } // namespace V2_0 73 | } // namespace gnss 74 | } // namespace hardware 75 | } // namespace android 76 | 77 | #endif // ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 78 | -------------------------------------------------------------------------------- /gps/android/2.0/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 23 | 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V2_0::IGnssDebug; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* Interface for GNSS Debug support. */ 42 | struct Gnss; 43 | struct GnssDebug : public IGnssDebug { 44 | GnssDebug(Gnss* gnss); 45 | ~GnssDebug() {}; 46 | 47 | // Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow 48 | Return getDebugData(getDebugData_cb _hidl_cb) override; 49 | // Methods from ::android::hardware::gnss::V2_0::IGnssDebug follow. 50 | Return getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) override; 51 | 52 | private: 53 | Gnss* mGnss = nullptr; 54 | }; 55 | 56 | } // namespace implementation 57 | } // namespace V2_0 58 | } // namespace gnss 59 | } // namespace hardware 60 | } // namespace android 61 | 62 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 63 | -------------------------------------------------------------------------------- /gps/android/2.0/GnssNi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "LocSvc_GnssNiInterface" 22 | 23 | #include 24 | #include "Gnss.h" 25 | #include "GnssNi.h" 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V2_0 { 31 | namespace implementation { 32 | 33 | void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { 34 | LOC_LOGE("%s] service died. cookie: %llu, who: %p", 35 | __FUNCTION__, static_cast(cookie), &who); 36 | // we do nothing here 37 | // Gnss::GnssDeathRecipient will stop the session 38 | } 39 | 40 | GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { 41 | mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); 42 | } 43 | 44 | // Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 45 | Return GnssNi::setCallback(const sp& callback) { 46 | if (mGnss == nullptr) { 47 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 48 | return Void(); 49 | } 50 | 51 | mGnss->setGnssNiCb(callback); 52 | 53 | if (mGnssNiCbIface != nullptr) { 54 | mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); 55 | } 56 | mGnssNiCbIface = callback; 57 | if (mGnssNiCbIface != nullptr) { 58 | mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); 59 | } 60 | 61 | return Void(); 62 | } 63 | 64 | Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { 65 | if (mGnss == nullptr) { 66 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 67 | return Void(); 68 | } 69 | 70 | GnssAPIClient* api = mGnss->getApi(); 71 | if (api == nullptr) { 72 | LOC_LOGE("%s]: api is nullptr", __FUNCTION__); 73 | return Void(); 74 | } 75 | 76 | api->gnssNiRespond(notifId, userResponse); 77 | 78 | return Void(); 79 | } 80 | 81 | } // namespace implementation 82 | } // namespace V2_0 83 | } // namespace gnss 84 | } // namespace hardware 85 | } // namespace android 86 | -------------------------------------------------------------------------------- /gps/android/2.0/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V2_0 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V2_0 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/2.0/android.hardware.gnss@2.0-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@2.0-service-qti 2 | class hal 3 | user gps 4 | group system gps radio 5 | -------------------------------------------------------------------------------- /gps/android/2.0/android.hardware.gnss@2.0-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | @2.0::IGnss/default 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /gps/android/2.0/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "android.hardware.gnss@2.0-service-qti" 22 | 23 | #include 24 | #include 25 | #include "loc_cfg.h" 26 | #include "loc_misc_utils.h" 27 | 28 | extern "C" { 29 | #include "vndfwk-detect.h" 30 | } 31 | 32 | #ifdef ARCH_ARM_32 33 | #define DEFAULT_HW_BINDER_MEM_SIZE 65536 34 | #endif 35 | 36 | using android::hardware::gnss::V2_0::IGnss; 37 | 38 | using android::hardware::configureRpcThreadpool; 39 | using android::hardware::registerPassthroughServiceImplementation; 40 | using android::hardware::joinRpcThreadpool; 41 | 42 | using android::status_t; 43 | using android::OK; 44 | 45 | typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); 46 | 47 | int main() { 48 | 49 | ALOGI("%s", __FUNCTION__); 50 | 51 | int vendorInfo = getVendorEnhancedInfo(); 52 | bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); 53 | setVendorEnhanced(vendorEnhanced); 54 | 55 | #ifdef ARCH_ARM_32 56 | android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); 57 | #endif 58 | configureRpcThreadpool(1, true); 59 | status_t status; 60 | 61 | status = registerPassthroughServiceImplementation(); 62 | if (status == OK) { 63 | if (vendorEnhanced) { 64 | #ifdef LOC_HIDL_VERSION 65 | #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" 66 | 67 | void* libHandle = NULL; 68 | vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) 69 | dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); 70 | if (NULL != vendorEnhancedMainMethod) { 71 | (*vendorEnhancedMainMethod)(0, NULL); 72 | } 73 | #else 74 | ALOGE("LOC_HIDL_VERSION not defined."); 75 | #endif 76 | } 77 | 78 | joinRpcThreadpool(); 79 | 80 | } else { 81 | ALOGE("Error while registering IGnss 2.0 service: %d", status); 82 | } 83 | 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /gps/android/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 3 | include $(CLEAR_VARS) 4 | DIR_LIST := $(LOCAL_PATH) 5 | include $(DIR_LIST)/utils/Android.mk 6 | ifeq ($(GNSS_HIDL_VERSION),2.0) 7 | include $(DIR_LIST)/2.0/Android.mk 8 | else 9 | ifeq ($(GNSS_HIDL_VERSION),1.1) 10 | include $(DIR_LIST)/1.1/Android.mk 11 | else 12 | include $(DIR_LIST)/1.0/Android.mk 13 | endif #GNSS HIDL 1.1 14 | endif #GNSS HIDL 2.0 15 | endif #BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 16 | -------------------------------------------------------------------------------- /gps/android/utils/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_MODULE := liblocbatterylistener 5 | LOCAL_VENDOR_MODULE := true 6 | 7 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 8 | 9 | LOCAL_C_INCLUDES += \ 10 | $(LOCAL_PATH) \ 11 | 12 | LOCAL_SRC_FILES:= \ 13 | battery_listener.cpp 14 | LOCAL_SHARED_LIBRARIES := \ 15 | liblog \ 16 | libhidlbase \ 17 | libcutils \ 18 | libutils \ 19 | android.hardware.health@1.0 \ 20 | android.hardware.health@2.0 \ 21 | android.hardware.power@1.2 \ 22 | libbase 23 | 24 | LOCAL_STATIC_LIBRARIES := libhealthhalutils 25 | LOCAL_CFLAGS += -DBATTERY_LISTENER_ENABLED 26 | 27 | include $(BUILD_STATIC_LIBRARY) 28 | 29 | include $(CLEAR_VARS) 30 | LOCAL_MODULE := liblocbatterylistener_headers 31 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 32 | 33 | include $(BUILD_HEADER_LIBRARY) 34 | 35 | 36 | -------------------------------------------------------------------------------- /gps/android/utils/battery_listener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, The Linux Foundation. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above 10 | * copyright notice, this list of conditions and the following 11 | * disclaimer in the documentation and/or other materials provided 12 | * with the distribution. 13 | * * Neither the name of The Linux Foundation nor the names of its 14 | * contributors may be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | typedef void (* battery_status_change_fn_t)(bool); 30 | void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn); 31 | void loc_extn_battery_properties_listener_deinit(); 32 | bool loc_extn_battery_properties_is_charging(); 33 | -------------------------------------------------------------------------------- /gps/batching/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | ifneq ($(BUILD_TINY_ANDROID),true) 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_MODULE := libbatching 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | libutils \ 14 | libcutils \ 15 | liblog \ 16 | libloc_core \ 17 | libgps.utils \ 18 | libdl 19 | 20 | LOCAL_SRC_FILES += \ 21 | location_batching.cpp \ 22 | BatchingAdapter.cpp 23 | 24 | LOCAL_HEADER_LIBRARIES := \ 25 | libgps.utils_headers \ 26 | libloc_core_headers \ 27 | libloc_pla_headers \ 28 | liblocation_api_headers 29 | 30 | LOCAL_PRELINK_MODULE := false 31 | 32 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 33 | include $(BUILD_SHARED_LIBRARY) 34 | 35 | endif # not BUILD_TINY_ANDROID 36 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 37 | -------------------------------------------------------------------------------- /gps/batching/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | $(GPSUTILS_CFLAGS) \ 3 | $(LOCCORE_CFLAGS) \ 4 | -I./ \ 5 | -std=c++1y \ 6 | -D__func__=__PRETTY_FUNCTION__ \ 7 | -fno-short-enums 8 | 9 | ACLOCAL_AMFLAGS = -I m4 10 | 11 | requiredlibs = \ 12 | $(GPSUTILS_LIBS) \ 13 | $(LOCCORE_LIBS) \ 14 | -llog 15 | 16 | h_sources = \ 17 | BatchingAdapter.h 18 | 19 | libbatching_la_SOURCES = \ 20 | location_batching.cpp \ 21 | BatchingAdapter.cpp 22 | 23 | if USE_GLIB 24 | libbatching_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 25 | #libbatching_la_LDFLAGS = -lstdc++ -g -Wl,-z,defs -lpthread $(requiredlibs) @GLIB_LIBS@ -shared -avoid-version 26 | libbatching_la_LDFLAGS = -lstdc++ -g -Wl,-z,defs -lpthread $(requiredlibs) @GLIB_LIBS@ -avoid-version 27 | libbatching_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 28 | else 29 | libbatching_la_CFLAGS = $(AM_CFLAGS) 30 | libbatching_la_LDFLAGS = -Wl,-z,defs -lpthread $(requiredlibs) -shared -version-info 1:0:0 31 | libbatching_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 32 | endif 33 | 34 | library_include_HEADERS = $(h_sources) 35 | 36 | library_includedir = $(pkgincludedir) 37 | 38 | #Create and Install libraries 39 | lib_LTLIBRARIES = libbatching.la 40 | 41 | pkgconfigdir = $(libdir)/pkgconfig 42 | pkgconfig_DATA = location-batching.pc 43 | sysconf_DATA = $(WORKSPACE)/hardware/qcom/gps/etc/flp.conf 44 | EXTRA_DIST = $(pkgconfig_DATA) 45 | 46 | -------------------------------------------------------------------------------- /gps/batching/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps location-batching 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps location-batching package version 1.0.0 8 | AC_INIT([location-batching],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([Makefile.am]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 37 | AC_SUBST([LOCCORE_CFLAGS]) 38 | AC_SUBST([LOCCORE_LIBS]) 39 | 40 | PKG_CHECK_MODULES([GEOFENCE], [location-geofence]) 41 | AC_SUBST([GEOFENCE_CFLAGS]) 42 | AC_SUBST([GEOFENCE_LIBS]) 43 | 44 | AC_ARG_WITH([locpla_includes], 45 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 46 | [specify the path to locpla-includes in loc-pla_git.bb]), 47 | [locpla_incdir=$withval], 48 | with_locpla_includes=no) 49 | 50 | if test "x$with_locpla_includes" != "xno"; then 51 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 52 | fi 53 | 54 | AC_ARG_WITH([glib], 55 | AC_HELP_STRING([--with-glib], 56 | [enable glib, building HLOS systems which use glib])) 57 | 58 | if (test "x${with_glib}" = "xyes"); then 59 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 60 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 61 | AC_MSG_ERROR(GThread >= 2.16 is required)) 62 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 63 | AC_MSG_ERROR(GLib >= 2.16 is required)) 64 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 65 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 66 | 67 | AC_SUBST(GLIB_CFLAGS) 68 | AC_SUBST(GLIB_LIBS) 69 | fi 70 | 71 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 72 | 73 | AC_CONFIG_FILES([ \ 74 | Makefile \ 75 | location-batching.pc 76 | ]) 77 | 78 | AC_OUTPUT 79 | -------------------------------------------------------------------------------- /gps/batching/location-batching.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-batching 7 | Description: QTI GPS Batching 8 | Version: @VERSION 9 | Libs: -L${libdir} -lbatching 10 | Cflags: -I${includedir}/location-batching 11 | -------------------------------------------------------------------------------- /gps/build/target_specific_features.mk: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS := \ 2 | -Werror \ 3 | -Wno-undefined-bool-conversion 4 | 5 | LOCAL_SANITIZE := signed-integer-overflow, unsigned-integer-overflow 6 | 7 | # GPS-HIDL 8 | GNSS_HIDL_1_0_TARGET_LIST := msm8960 9 | GNSS_HIDL_1_0_TARGET_LIST += msm8974 10 | GNSS_HIDL_1_0_TARGET_LIST += msm8226 11 | GNSS_HIDL_1_0_TARGET_LIST += msm8610 12 | GNSS_HIDL_1_0_TARGET_LIST += apq8084 13 | GNSS_HIDL_1_0_TARGET_LIST += msm8916 14 | GNSS_HIDL_1_0_TARGET_LIST += msm8994 15 | GNSS_HIDL_1_0_TARGET_LIST += msm8909 16 | GNSS_HIDL_1_0_TARGET_LIST += msm8952 17 | GNSS_HIDL_1_0_TARGET_LIST += msm8992 18 | GNSS_HIDL_1_0_TARGET_LIST += msm8996 19 | GNSS_HIDL_2_0_TARGET_LIST := msm8937 20 | GNSS_HIDL_2_0_TARGET_LIST += msm8953 21 | GNSS_HIDL_2_0_TARGET_LIST += msm8998 22 | GNSS_HIDL_2_0_TARGET_LIST += apq8098_latv 23 | GNSS_HIDL_2_0_TARGET_LIST += sdm710 24 | GNSS_HIDL_2_0_TARGET_LIST += qcs605 25 | GNSS_HIDL_2_0_TARGET_LIST += sdm845 26 | GNSS_HIDL_2_0_TARGET_LIST += sdm660 27 | GNSS_HIDL_2_0_TARGET_LIST += msmnile 28 | GNSS_HIDL_2_0_TARGET_LIST += $(MSMSTEPPE) 29 | GNSS_HIDL_2_0_TARGET_LIST += $(TRINKET) 30 | GNSS_HIDL_2_0_TARGET_LIST += kona 31 | GNSS_HIDL_2_0_TARGET_LIST += atoll 32 | GNSS_HIDL_2_0_TARGET_LIST += lito 33 | GNSS_HIDL_2_0_TARGET_LIST += bengal 34 | 35 | ifneq (,$(filter $(GNSS_HIDL_2_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) 36 | GNSS_HIDL_VERSION = 2.0 37 | endif 38 | ifneq (,$(filter $(GNSS_HIDL_1_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) 39 | GNSS_HIDL_VERSION = 1.0 40 | endif 41 | ifneq (,$(filter $(GNSS_HIDL_1_1_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) 42 | GNSS_HIDL_VERSION = 1.1 43 | endif 44 | 45 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST := msm8937 46 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8953 47 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8998 48 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += apq8098_latv 49 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm710 50 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += qcs605 51 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm845 52 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm660 53 | 54 | ifneq (,$(filter $(GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) 55 | GNSS_HIDL_LEGACY_MEASURMENTS = true 56 | endif 57 | -------------------------------------------------------------------------------- /gps/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps loc_hal 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps loc-hal package version 1.0.0 8 | AC_INIT([loc-hal],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([Makefile.am]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 37 | AC_SUBST([LOCCORE_CFLAGS]) 38 | AC_SUBST([LOCCORE_LIBS]) 39 | 40 | AC_ARG_WITH([core_includes], 41 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], 42 | [Specify the location of the core headers]), 43 | [core_incdir=$withval], 44 | with_core_includes=no) 45 | 46 | if test "x$with_core_includes" != "xno"; then 47 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 48 | fi 49 | 50 | AC_ARG_WITH([locpla_includes], 51 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 52 | [specify the path to locpla-includes in loc-pla_git.bb]), 53 | [locpla_incdir=$withval], 54 | with_locpla_includes=no) 55 | 56 | if test "x$with_locpla_includes" != "xno"; then 57 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 58 | fi 59 | 60 | AC_SUBST([CPPFLAGS]) 61 | 62 | AC_ARG_WITH([glib], 63 | AC_HELP_STRING([--with-glib], 64 | [enable glib, building HLOS systems which use glib])) 65 | 66 | if (test "x${with_glib}" = "xyes"); then 67 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 68 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 69 | AC_MSG_ERROR(GThread >= 2.16 is required)) 70 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 71 | AC_MSG_ERROR(GLib >= 2.16 is required)) 72 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 73 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 74 | 75 | AC_SUBST(GLIB_CFLAGS) 76 | AC_SUBST(GLIB_LIBS) 77 | fi 78 | 79 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 80 | 81 | AC_CONFIG_FILES([ \ 82 | Makefile \ 83 | gnss/Makefile \ 84 | loc-hal.pc \ 85 | ]) 86 | 87 | AC_OUTPUT 88 | -------------------------------------------------------------------------------- /gps/core/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | ifneq ($(BUILD_TINY_ANDROID),true) 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_MODULE := libloc_core 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | liblog \ 14 | libutils \ 15 | libcutils \ 16 | libgps.utils \ 17 | libdl \ 18 | liblog 19 | 20 | LOCAL_SRC_FILES += \ 21 | LocApiBase.cpp \ 22 | LocAdapterBase.cpp \ 23 | ContextBase.cpp \ 24 | LocContext.cpp \ 25 | loc_core_log.cpp \ 26 | data-items/DataItemsFactoryProxy.cpp \ 27 | SystemStatusOsObserver.cpp \ 28 | SystemStatus.cpp 29 | 30 | LOCAL_CFLAGS += \ 31 | -fno-short-enums \ 32 | -D_ANDROID_ 33 | 34 | LOCAL_C_INCLUDES:= \ 35 | $(LOCAL_PATH)/data-items \ 36 | $(LOCAL_PATH)/data-items/common \ 37 | $(LOCAL_PATH)/observer \ 38 | 39 | LOCAL_HEADER_LIBRARIES := \ 40 | libutils_headers \ 41 | libgps.utils_headers \ 42 | libloc_pla_headers \ 43 | liblocation_api_headers 44 | 45 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 46 | 47 | include $(BUILD_SHARED_LIBRARY) 48 | 49 | include $(CLEAR_VARS) 50 | LOCAL_MODULE := libloc_core_headers 51 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ 52 | $(LOCAL_PATH) \ 53 | $(LOCAL_PATH)/data-items \ 54 | $(LOCAL_PATH)/data-items/common \ 55 | $(LOCAL_PATH)/observer 56 | include $(BUILD_HEADER_LIBRARY) 57 | 58 | endif # not BUILD_TINY_ANDROID 59 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 60 | -------------------------------------------------------------------------------- /gps/core/LBSProxyBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef IZAT_PROXY_BASE_H 30 | #define IZAT_PROXY_BASE_H 31 | #include 32 | 33 | namespace loc_core { 34 | 35 | class LocApiBase; 36 | class LocAdapterBase; 37 | class ContextBase; 38 | 39 | class LBSProxyBase { 40 | friend class ContextBase; 41 | inline virtual LocApiBase* 42 | getLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask, 43 | ContextBase* context) const { 44 | 45 | (void)exMask; 46 | (void)context; 47 | return NULL; 48 | } 49 | protected: 50 | inline LBSProxyBase() {} 51 | public: 52 | inline virtual ~LBSProxyBase() {} 53 | inline virtual bool hasAgpsExtendedCapabilities() const { return false; } 54 | inline virtual void modemPowerVote(bool power) const { 55 | 56 | (void)power; 57 | } 58 | virtual void injectFeatureConfig(ContextBase* context) const { 59 | 60 | (void)context; 61 | } 62 | inline virtual bool hasNativeXtraClient() const { return false; } 63 | inline virtual IzatDevId_t getIzatDevId() const { return 0; } 64 | }; 65 | 66 | typedef LBSProxyBase* (getLBSProxy_t)(); 67 | 68 | } // namespace loc_core 69 | 70 | #endif // IZAT_PROXY_BASE_H 71 | -------------------------------------------------------------------------------- /gps/core/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = -I./ \ 4 | $(LOCPLA_CFLAGS) \ 5 | $(GPSUTILS_CFLAGS) \ 6 | -I./data-items/ \ 7 | -I./data-items/common \ 8 | -I./observer \ 9 | -I$(WORKSPACE)/gps-noship/flp \ 10 | -D__func__=__PRETTY_FUNCTION__ \ 11 | -fno-short-enums \ 12 | -std=c++11 13 | 14 | libloc_core_la_h_sources = \ 15 | LocApiBase.h \ 16 | LocAdapterBase.h \ 17 | ContextBase.h \ 18 | LocContext.h \ 19 | LBSProxyBase.h \ 20 | loc_core_log.h \ 21 | LocAdapterProxyBase.h \ 22 | EngineHubProxyBase.h \ 23 | data-items/DataItemId.h \ 24 | data-items/IDataItemCore.h \ 25 | data-items/DataItemConcreteTypesBase.h \ 26 | observer/IDataItemObserver.h \ 27 | observer/IDataItemSubscription.h \ 28 | observer/IFrameworkActionReq.h \ 29 | observer/IOsObserver.h \ 30 | SystemStatusOsObserver.h \ 31 | SystemStatus.h 32 | 33 | libloc_core_la_c_sources = \ 34 | LocApiBase.cpp \ 35 | LocAdapterBase.cpp \ 36 | ContextBase.cpp \ 37 | LocContext.cpp \ 38 | loc_core_log.cpp \ 39 | data-items/DataItemsFactoryProxy.cpp \ 40 | SystemStatusOsObserver.cpp \ 41 | SystemStatus.cpp 42 | 43 | library_includedir = $(pkgincludedir) 44 | 45 | library_include_HEADERS = $(libloc_core_la_h_sources) 46 | 47 | libloc_core_la_SOURCES = $(libloc_core_la_c_sources) 48 | 49 | if USE_GLIB 50 | libloc_core_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 51 | libloc_core_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 52 | libloc_core_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 53 | else 54 | libloc_core_la_CFLAGS = $(AM_CFLAGS) 55 | libloc_core_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 56 | libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 57 | endif 58 | 59 | libloc_core_la_LIBADD = -ldl $(GPSUTILS_LIBS) 60 | 61 | #Create and Install libraries 62 | lib_LTLIBRARIES = libloc_core.la 63 | 64 | pkgconfigdir = $(libdir)/pkgconfig 65 | pkgconfig_DATA = loc-core.pc 66 | EXTRA_DIST = $(pkgconfig_DATA) 67 | -------------------------------------------------------------------------------- /gps/core/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps loc-core 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps loc-hal package version 1.0.0 8 | AC_INIT([loc-core],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([loc-core.pc.in]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | AC_ARG_WITH([core_includes], 37 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], 38 | [Specify the location of the core headers]), 39 | [core_incdir=$withval], 40 | with_core_includes=no) 41 | 42 | if test "x$with_core_includes" != "xno"; then 43 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 44 | fi 45 | 46 | AC_ARG_WITH([locpla_includes], 47 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 48 | [specify the path to locpla-includes in loc-pla_git.bb]), 49 | [locpla_incdir=$withval], 50 | with_locpla_includes=no) 51 | 52 | if test "x$with_locpla_includes" != "xno"; then 53 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 54 | fi 55 | 56 | AC_SUBST([CPPFLAGS]) 57 | 58 | AC_ARG_WITH([glib], 59 | AC_HELP_STRING([--with-glib], 60 | [enable glib, building HLOS systems which use glib])) 61 | 62 | if (test "x${with_glib}" = "xyes"); then 63 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 64 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 65 | AC_MSG_ERROR(GThread >= 2.16 is required)) 66 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 67 | AC_MSG_ERROR(GLib >= 2.16 is required)) 68 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 69 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 70 | 71 | AC_SUBST(GLIB_CFLAGS) 72 | AC_SUBST(GLIB_LIBS) 73 | fi 74 | 75 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 76 | 77 | AC_CONFIG_FILES([ \ 78 | Makefile \ 79 | loc-core.pc \ 80 | ]) 81 | 82 | AC_OUTPUT 83 | -------------------------------------------------------------------------------- /gps/core/data-items/DataItemsFactoryProxy.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __DATAITEMFACTORYBASE__ 31 | #define __DATAITEMFACTORYBASE__ 32 | 33 | #include 34 | #include 35 | 36 | namespace loc_core 37 | { 38 | 39 | #define DATA_ITEMS_LIB_NAME "libdataitems.so" 40 | #define DATA_ITEMS_GET_CONCRETE_DI "getConcreteDataItem" 41 | 42 | typedef IDataItemCore * (get_concrete_data_item_fn)(DataItemId); 43 | 44 | class DataItemsFactoryProxy { 45 | public: 46 | static IDataItemCore* createNewDataItem(DataItemId id); 47 | static void closeDataItemLibraryHandle(); 48 | static void *dataItemLibHandle; 49 | static get_concrete_data_item_fn *getConcreteDIFunc; 50 | }; 51 | 52 | } // namespace loc_core 53 | 54 | #endif //__DATAITEMFACTORYBASE__ 55 | 56 | -------------------------------------------------------------------------------- /gps/core/loc-core.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: loc-core 7 | Description: QTI GPS Loc Core 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lloc_core 10 | Cflags: -I${includedir}/loc-core 11 | -------------------------------------------------------------------------------- /gps/core/loc_core_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, 2016-2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_CORE_LOG_H 31 | #define LOC_CORE_LOG_H 32 | 33 | #include 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" 38 | { 39 | #endif 40 | 41 | const char* loc_get_gps_status_name(LocGpsStatusValue gps_status); 42 | const char* loc_get_position_mode_name(LocGpsPositionMode mode); 43 | const char* loc_get_position_recurrence_name(LocGpsPositionRecurrence recur); 44 | const char* loc_get_aiding_data_mask_names(LocGpsAidingData data); 45 | const char* loc_get_agps_type_name(LocAGpsType type); 46 | const char* loc_get_ni_type_name(LocGpsNiType type); 47 | const char* loc_get_ni_response_name(LocGpsUserResponseType response); 48 | const char* loc_get_ni_encoding_name(LocGpsNiEncodingType encoding); 49 | const char* loc_get_agps_bear_name(AGpsBearerType bear); 50 | const char* loc_get_server_type_name(LocServerType type); 51 | const char* loc_get_position_sess_status_name(enum loc_sess_status status); 52 | const char* loc_get_agps_status_name(LocAGpsStatusValue status); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* LOC_CORE_LOG_H */ 59 | -------------------------------------------------------------------------------- /gps/etc/flp.conf: -------------------------------------------------------------------------------- 1 | ################################### 2 | ##### FLP settings ##### 3 | ################################### 4 | 5 | ################################### 6 | # FLP BATCH SIZE 7 | ################################### 8 | # The number of batched locations 9 | # requested to modem. The desired number 10 | # defined below may not be satisfied, as 11 | # the modem can only return the number 12 | # of batched locations that can be allocated, 13 | # which is limited by memory. The default 14 | # batch size defined as 20 as below. 15 | BATCH_SIZE=40 16 | 17 | ################################### 18 | # FLP OUTDOOR TRIP BATCH SIZE 19 | ################################### 20 | # The number of batched locations 21 | # requested to modem for outdoor 22 | # trip batching. The desired number 23 | # defined below may not be satisfied, as 24 | # the modem can only return the number 25 | # of batched locations that can be allocated, 26 | # which is limited by memory. The default 27 | # trip batch size defined as 600 as below. 28 | OUTDOOR_TRIP_BATCH_SIZE=600 29 | 30 | ################################### 31 | # FLP BATCHING SESSION TIMEOUT 32 | ################################### 33 | # Duration with which batch session timeout 34 | # happens in milliseconds. If not specified 35 | # or set to zero, batching session timeout 36 | # defaults to 20 seconds by the modem. 37 | # BATCH_SESSION_TIMEOUT=20000 38 | 39 | ################################### 40 | # FLP BATCHING ACCURACY 41 | ################################### 42 | # Set to one of the defined values below 43 | # to define the accuracy of batching. 44 | # If not specified, accuracy defaults 45 | # to LOW. 46 | # FLP BATCHING ACCURACY values: 47 | # Low accuracy = 0 48 | # Medium accuracy = 1 49 | # High accuracy = 2 50 | ACCURACY=1 51 | 52 | #################################### 53 | # By default if network fixes are not sensor assisted 54 | # these fixes must be dropped. This parameter adds an exception 55 | # for targets where there is no PDR and we still want to 56 | # report out network fixes 57 | # 0: MUST NOT ALLOW NETWORK FIXES 58 | # 1: ALLOW NETWORK FIXES 59 | #################################### 60 | ALLOW_NETWORK_FIXES = 0 61 | -------------------------------------------------------------------------------- /gps/etc/lowi.conf: -------------------------------------------------------------------------------- 1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* 2 | # 3 | # LOWI Config file 4 | # 5 | # GENERAL DESCRIPTION 6 | # This file contains the config params for LOWI 7 | # 8 | # Copyright (c) 2019 Qualcomm Technologies, Inc. 9 | # All Rights Reserved. 10 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 11 | # 12 | # 2012-2013 Qualcomm Atheros, Inc. 13 | # All Rights Reserved. 14 | # Qualcomm Atheros Confidential and Proprietary. 15 | # 16 | # Export of this technology or software is regulated by the U.S. Government. 17 | # Diversion contrary to U.S. law prohibited. 18 | #=============================================================================*/ 19 | 20 | # X86 ONLY - UBUNTU: 21 | # Copy this file in the same directory where the executable is 22 | 23 | # Log level 24 | # EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100 25 | LOWI_LOG_LEVEL = 2 26 | LOWI_USE_LOWI_LP = 0 27 | 28 | -------------------------------------------------------------------------------- /gps/geofence/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | ifneq ($(BUILD_TINY_ANDROID),true) 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_MODULE := libgeofencing 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SRC_FILES:= \ 13 | GeofenceAdapter.cpp \ 14 | location_geofence.cpp 15 | 16 | LOCAL_SHARED_LIBRARIES := \ 17 | libutils \ 18 | libcutils \ 19 | libgps.utils \ 20 | liblog \ 21 | libloc_core 22 | 23 | LOCAL_HEADER_LIBRARIES := \ 24 | libgps.utils_headers \ 25 | libloc_core_headers \ 26 | libloc_pla_headers \ 27 | liblocation_api_headers 28 | 29 | LOCAL_PRELINK_MODULE := false 30 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 31 | include $(BUILD_SHARED_LIBRARY) 32 | 33 | endif # not BUILD_TINY_ANDROID 34 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 35 | 36 | -------------------------------------------------------------------------------- /gps/geofence/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = -Wundef \ 2 | -Wno-trigraphs \ 3 | -g -O0 \ 4 | -fno-inline \ 5 | -fno-short-enums \ 6 | -fpic \ 7 | ${GPSUTILS_CFLAGS} \ 8 | ${LOCCORE_CFLAGS} \ 9 | $(LOCPLA_CFLAGS) \ 10 | -D__func__=__PRETTY_FUNCTION__ \ 11 | -std=c++1y 12 | 13 | AM_CPPFLAGS = $(AM_CFLAGS) 14 | 15 | ACLOCAL_AMFLAGS = -I m4 16 | 17 | requiredlibs = \ 18 | ${LOCCORE_LIBS} \ 19 | $(GPSUTILS_LIBS) \ 20 | -llog 21 | 22 | h_sources = \ 23 | GeofenceAdapter.h 24 | 25 | c_sources = \ 26 | GeofenceAdapter.cpp \ 27 | location_geofence.cpp 28 | 29 | libgeofencing_la_SOURCES = $(c_sources) 30 | if USE_GLIB 31 | libgeofencing_la_CFLAGS = -DUSE_GLIB @GLIB_CFLAGS@ $(AM_CFLAGS) 32 | libgeofencing_la_CPPFLAGS = -DUSE_GLIB @GLIB_CFLAGS@ $(AM_CFLAGS) $(AM_CPPFLAGS) 33 | libgeofencing_la_LDFLAGS = -lstdc++ -Wl,-z,defs @GLIB_LIBS@ $(requiredlibs) -shared -version-info 1:0:0 34 | libgeofencing_la_LIBDADD = $(requiredlibs) -lstdc++ @GLIB_LIBS@ 35 | else 36 | libgeofencing_la_CFLAGS = $(AM_CFLAGS) 37 | libgeofencing_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 38 | libgeofencing_la_LDFLAGS = -lstdc++ -Wl,-z,defs $(requiredlibs) -shared -version-info 1:0:0 39 | libgeofencing_la_LIBDADD = $(requiredlibs) -lstdc++ 40 | endif 41 | 42 | library_include_HEADERS = $(h_sources) 43 | 44 | library_includedir = $(pkgincludedir) 45 | 46 | lib_LTLIBRARIES = libgeofencing.la 47 | 48 | pkgconfigdir = $(libdir)/pkgconfig 49 | pkgconfig_DATA = location-geofence.pc 50 | EXTRA_DIST = $(pkgconfig_DATA) 51 | -------------------------------------------------------------------------------- /gps/geofence/configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ(2.61) 2 | AC_INIT([location-geofence], 1.0.0) 3 | AM_INIT_AUTOMAKE([foreign]) 4 | AC_CONFIG_SRCDIR([Makefile.am]) 5 | AC_CONFIG_HEADERS([config.h]) 6 | AC_CONFIG_MACRO_DIR([m4]) 7 | 8 | # Check for programs 9 | AC_PROG_LIBTOOL 10 | AC_PROG_CXX 11 | AC_PROG_CC 12 | AM_PROG_CC_C_O 13 | AC_PROG_AWK 14 | AC_PROG_CPP 15 | AC_PROG_INSTALL 16 | AC_PROG_LN_S 17 | AC_PROG_MAKE_SET 18 | PKG_PROG_PKG_CONFIG 19 | 20 | # Check for libraries 21 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 22 | AC_SUBST([GPSUTILS_CFLAGS]) 23 | AC_SUBST([GPSUTILS_LIBS]) 24 | 25 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 26 | AC_SUBST([LOCCORE_CFLAGS]) 27 | AC_SUBST([LOCCORE_LIBS]) 28 | 29 | AS_CASE([$host], 30 | [arm*], [ARM=yes], 31 | [ARM=no] 32 | ) 33 | 34 | AC_ARG_WITH([locpla_includes], 35 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 36 | [specify the path to locpla-includes in loc-pla_git.bb]), 37 | [locpla_incdir=$withval], 38 | with_locpla_includes=no) 39 | 40 | if test "x$with_locpla_includes" != "xno"; then 41 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 42 | fi 43 | 44 | AC_ARG_WITH([glib], 45 | AC_HELP_STRING([--with-glib], 46 | [enable glib, building HLOS systems which use glib])) 47 | 48 | if (test "x${with_glib}" = "xyes"); then 49 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 50 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 51 | AC_MSG_ERROR(GThread >= 2.16 is required)) 52 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 53 | AC_MSG_ERROR(GLib >= 2.16 is required)) 54 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 55 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 56 | 57 | AC_SUBST(GLIB_CFLAGS) 58 | AC_SUBST(GLIB_LIBS) 59 | fi 60 | 61 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 62 | 63 | AC_SUBST([CFLAGS]) 64 | AC_SUBST([CPPFLAGS]) 65 | AC_SUBST([LIBS]) 66 | 67 | AC_CONFIG_FILES([ \ 68 | Makefile \ 69 | location-geofence.pc 70 | ]) 71 | 72 | AC_OUTPUT 73 | -------------------------------------------------------------------------------- /gps/geofence/location-geofence.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-geofence 7 | Description: QTI GPS Geofence 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgeofencing 10 | Cflags: -I${includedir}/location-geofence 11 | -------------------------------------------------------------------------------- /gps/gnss/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | ifneq ($(BUILD_TINY_ANDROID),true) 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_MODULE := libgnss 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | libutils \ 14 | libcutils \ 15 | libdl \ 16 | liblog \ 17 | libloc_core \ 18 | libgps.utils 19 | 20 | LOCAL_SRC_FILES += \ 21 | location_gnss.cpp \ 22 | GnssAdapter.cpp \ 23 | Agps.cpp \ 24 | XtraSystemStatusObserver.cpp 25 | 26 | LOCAL_CFLAGS += \ 27 | -fno-short-enums \ 28 | 29 | ifeq ($(TARGET_BUILD_VARIANT),user) 30 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER 31 | endif 32 | 33 | LOCAL_HEADER_LIBRARIES := \ 34 | libgps.utils_headers \ 35 | libloc_core_headers \ 36 | libloc_pla_headers \ 37 | liblocation_api_headers 38 | 39 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 40 | 41 | LOCAL_PRELINK_MODULE := false 42 | 43 | include $(BUILD_SHARED_LIBRARY) 44 | 45 | endif # not BUILD_TINY_ANDROID 46 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 47 | -------------------------------------------------------------------------------- /gps/gnss/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | $(LOCPLA_CFLAGS) \ 3 | $(LOCHAL_CFLAGS) \ 4 | $(GPSUTILS_CFLAGS) \ 5 | $(LOCCORE_CFLAGS) \ 6 | -I./ \ 7 | -I../utils \ 8 | -I$(WORKSPACE)/hardware/qcom/gps/core/data-items \ 9 | -I../location \ 10 | -std=c++1y 11 | 12 | libgnss_la_SOURCES = \ 13 | location_gnss.cpp \ 14 | GnssAdapter.cpp \ 15 | XtraSystemStatusObserver.cpp \ 16 | Agps.cpp 17 | 18 | if USE_GLIB 19 | libgnss_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 20 | libgnss_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -avoid-version 21 | libgnss_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 22 | else 23 | libgnss_la_CFLAGS = $(AM_CFLAGS) 24 | libgnss_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 25 | libgnss_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 26 | endif 27 | 28 | libgnss_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) $(LOCCORE_LIBS) 29 | 30 | #Create and Install libraries 31 | lib_LTLIBRARIES = libgnss.la 32 | -------------------------------------------------------------------------------- /gps/gps_vendor_board.mk: -------------------------------------------------------------------------------- 1 | # Flags from BoardConfigVendor.mk 2 | ifneq ($(TARGET_USES_QMAA),true) 3 | BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default 4 | else ifneq ($(TARGET_USES_QMAA_OVERRIDE_GPS),false) 5 | BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default 6 | endif 7 | 8 | -------------------------------------------------------------------------------- /gps/gps_vendor_product.mk: -------------------------------------------------------------------------------- 1 | # HAL packages 2 | PRODUCT_PACKAGES += android.hardware.gnss@1.0-impl-qti 3 | PRODUCT_PACKAGES += android.hardware.gnss@1.0-service-qti 4 | PRODUCT_PACKAGES += android.hardware.gnss@1.1-impl-qti 5 | PRODUCT_PACKAGES += android.hardware.gnss@1.1-service-qti 6 | PRODUCT_PACKAGES += android.hardware.gnss@2.0-impl-qti 7 | PRODUCT_PACKAGES += android.hardware.gnss@2.0-service-qti 8 | PRODUCT_PACKAGES += gps.conf 9 | PRODUCT_PACKAGES += libloc_core 10 | PRODUCT_PACKAGES += libgnss 11 | PRODUCT_PACKAGES += liblocation_api 12 | PRODUCT_PACKAGES += libgps.utils 13 | PRODUCT_PACKAGES += libbatching 14 | PRODUCT_PACKAGES += libgeofencing 15 | -------------------------------------------------------------------------------- /gps/loc-hal.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: loc-hal 7 | Description: QTI GPS Loc HAL 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgnss 10 | Cflags: -I${includedir} -I${includedir}/utils -I${includedir}/core -I${includedir}/loc-hal 11 | -------------------------------------------------------------------------------- /gps/location/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | ifneq ($(BUILD_TINY_ANDROID),true) 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_MODULE := liblocation_api 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | libutils \ 14 | libcutils \ 15 | libgps.utils \ 16 | libdl \ 17 | liblog 18 | 19 | LOCAL_SRC_FILES += \ 20 | LocationAPI.cpp \ 21 | LocationAPIClientBase.cpp 22 | 23 | LOCAL_CFLAGS += \ 24 | -fno-short-enums 25 | 26 | LOCAL_HEADER_LIBRARIES := \ 27 | libloc_pla_headers \ 28 | libgps.utils_headers 29 | 30 | LOCAL_PRELINK_MODULE := false 31 | 32 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 33 | include $(BUILD_SHARED_LIBRARY) 34 | 35 | include $(CLEAR_VARS) 36 | LOCAL_MODULE := liblocation_api_headers 37 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 38 | include $(BUILD_HEADER_LIBRARY) 39 | 40 | endif # not BUILD_TINY_ANDROID 41 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 42 | -------------------------------------------------------------------------------- /gps/location/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = \ 4 | -I./ \ 5 | -I../utils \ 6 | $(LOCPLA_CFLAGS) \ 7 | $(GPSUTILS_CFLAGS) \ 8 | -std=c++11 9 | 10 | liblocation_api_la_SOURCES = \ 11 | LocationAPI.cpp \ 12 | LocationAPIClientBase.cpp 13 | 14 | if USE_GLIB 15 | liblocation_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 16 | liblocation_api_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 17 | liblocation_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 18 | else 19 | liblocation_api_la_CFLAGS = $(AM_CFLAGS) 20 | liblocation_api_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 21 | liblocation_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 22 | endif 23 | 24 | liblocation_api_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) 25 | 26 | library_include_HEADERS = \ 27 | LocationAPI.h \ 28 | LocationAPIClientBase.h \ 29 | location_interface.h \ 30 | LocationDataTypes.h \ 31 | ILocationAPI.h 32 | 33 | #Create and Install libraries 34 | lib_LTLIBRARIES = liblocation_api.la 35 | 36 | library_includedir = $(pkgincludedir) 37 | 38 | pkgconfigdir = $(libdir)/pkgconfig 39 | pkgconfig_DATA = location-api.pc 40 | EXTRA_DIST = $(pkgconfig_DATA) 41 | -------------------------------------------------------------------------------- /gps/location/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps location-api-iface 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps location-api-iface package version 1.0.0 8 | AC_INIT([location-api-iface],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([location-api.pc.in]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | AC_ARG_WITH([core_includes], 37 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], 38 | [Specify the location of the core headers]), 39 | [core_incdir=$withval], 40 | with_core_includes=no) 41 | 42 | if test "x$with_core_includes" != "xno"; then 43 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 44 | fi 45 | 46 | AC_ARG_WITH([locpla_includes], 47 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 48 | [Specify the path to locpla-includes in loc-pla_git.bb]), 49 | [locpla_incdir=$withval], 50 | with_locpla_includes=no) 51 | 52 | if test "x${with_locpla_includes}" != "xno"; then 53 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 54 | fi 55 | 56 | AC_SUBST([CPPFLAGS]) 57 | 58 | AC_ARG_WITH([glib], 59 | AC_HELP_STRING([--with-glib], 60 | [enable glib, building HLOS systems which use glib])) 61 | 62 | if (test "x${with_glib}" = "xyes"); then 63 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 64 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 65 | AC_MSG_ERROR(GThread >= 2.16 is required)) 66 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 67 | AC_MSG_ERROR(GLib >= 2.16 is required)) 68 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 69 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 70 | 71 | AC_SUBST(GLIB_CFLAGS) 72 | AC_SUBST(GLIB_LIBS) 73 | fi 74 | 75 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 76 | 77 | AC_CONFIG_FILES([ \ 78 | Makefile \ 79 | location-api.pc \ 80 | ]) 81 | 82 | AC_OUTPUT 83 | -------------------------------------------------------------------------------- /gps/location/location-api.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-api 7 | Description: Location API 8 | Version: @VERSION 9 | Libs: -L${libdir} -llocation_api 10 | Cflags: -I${includedir}/location-api 11 | -------------------------------------------------------------------------------- /gps/pla/Android.mk: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS := \ 2 | -Werror \ 3 | -Wno-undefined-bool-conversion 4 | 5 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 6 | ifneq ($(BUILD_TINY_ANDROID),true) 7 | 8 | LOCAL_PATH := $(call my-dir) 9 | 10 | include $(CLEAR_VARS) 11 | LOCAL_MODULE := libloc_pla_headers 12 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/android 13 | include $(BUILD_HEADER_LIBRARY) 14 | 15 | endif # not BUILD_TINY_ANDROID 16 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 17 | -------------------------------------------------------------------------------- /gps/pla/android/loc_pla.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef __LOC_PLA__ 30 | #define __LOC_PLA__ 31 | 32 | #ifdef __cplusplus 33 | #include 34 | #define uptimeMillis android::uptimeMillis 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #define UID_GPS (AID_GPS) 49 | #define GID_GPS (AID_GPS) 50 | #define UID_LOCCLIENT (4021) 51 | #define GID_LOCCLIENT (4021) 52 | 53 | #define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" 54 | #define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" 55 | #define LOC_PATH_FLP_CONF_STR "/vendor/etc/flp.conf" 56 | #define LOC_PATH_LOWI_CONF_STR "/vendor/etc/lowi.conf" 57 | #define LOC_PATH_SAP_CONF_STR "/vendor/etc/sap.conf" 58 | #define LOC_PATH_APDR_CONF_STR "/vendor/etc/apdr.conf" 59 | #define LOC_PATH_XTWIFI_CONF_STR "/vendor/etc/xtwifi.conf" 60 | #define LOC_PATH_QUIPC_CONF_STR "/vendor/etc/quipc.conf" 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif /*__cplusplus */ 65 | 66 | #endif /* __LOC_PLA__ */ 67 | -------------------------------------------------------------------------------- /gps/utils/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | ifneq ($(BUILD_TINY_ANDROID),true) 3 | #Compile this library only for builds with the latest modem image 4 | 5 | LOCAL_PATH := $(call my-dir) 6 | 7 | include $(CLEAR_VARS) 8 | 9 | 10 | ## Libs 11 | LOCAL_SHARED_LIBRARIES := \ 12 | libdl \ 13 | libutils \ 14 | libcutils \ 15 | liblog \ 16 | libprocessgroup 17 | 18 | LOCAL_SRC_FILES += \ 19 | loc_log.cpp \ 20 | loc_cfg.cpp \ 21 | msg_q.c \ 22 | linked_list.c \ 23 | loc_target.cpp \ 24 | LocHeap.cpp \ 25 | LocTimer.cpp \ 26 | LocThread.cpp \ 27 | MsgTask.cpp \ 28 | loc_misc_utils.cpp \ 29 | loc_nmea.cpp \ 30 | LocIpc.cpp 31 | 32 | # Flag -std=c++11 is not accepted by compiler when LOCAL_CLANG is set to true 33 | LOCAL_CFLAGS += \ 34 | -fno-short-enums \ 35 | -D_ANDROID_ 36 | 37 | ifeq ($(TARGET_BUILD_VARIANT),user) 38 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER 39 | endif 40 | 41 | LOCAL_LDFLAGS += -Wl,--export-dynamic 42 | 43 | ## Includes 44 | LOCAL_HEADER_LIBRARIES := \ 45 | libutils_headers \ 46 | libloc_pla_headers \ 47 | liblocation_api_headers 48 | 49 | LOCAL_MODULE := libgps.utils 50 | LOCAL_VENDOR_MODULE := true 51 | LOCAL_MODULE_TAGS := optional 52 | 53 | LOCAL_PRELINK_MODULE := false 54 | 55 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 56 | 57 | include $(BUILD_SHARED_LIBRARY) 58 | 59 | include $(CLEAR_VARS) 60 | LOCAL_MODULE := libgps.utils_headers 61 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 62 | include $(BUILD_HEADER_LIBRARY) 63 | 64 | endif # not BUILD_TINY_ANDROID 65 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 66 | -------------------------------------------------------------------------------- /gps/utils/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = -Wundef \ 4 | -MD \ 5 | -Wno-trigraphs \ 6 | -g -O0 \ 7 | -fno-inline \ 8 | -fno-short-enums \ 9 | -fpic \ 10 | -I./ \ 11 | -std=c++14 \ 12 | $(LOCPLA_CFLAGS) 13 | 14 | libgps_utils_la_h_sources = \ 15 | msg_q.h \ 16 | linked_list.h \ 17 | loc_cfg.h \ 18 | loc_log.h \ 19 | loc_target.h \ 20 | loc_timer.h \ 21 | MsgTask.h \ 22 | LocHeap.h \ 23 | LocThread.h \ 24 | LocTimer.h \ 25 | LocIpc.h \ 26 | loc_misc_utils.h \ 27 | loc_nmea.h \ 28 | gps_extended_c.h \ 29 | gps_extended.h \ 30 | loc_gps.h \ 31 | log_util.h \ 32 | LocSharedLock.h \ 33 | LocUnorderedSetMap.h 34 | 35 | libgps_utils_la_c_sources = \ 36 | linked_list.c \ 37 | msg_q.c \ 38 | loc_cfg.cpp \ 39 | loc_log.cpp \ 40 | loc_target.cpp \ 41 | LocHeap.cpp \ 42 | LocTimer.cpp \ 43 | LocThread.cpp \ 44 | LocIpc.cpp \ 45 | MsgTask.cpp \ 46 | loc_misc_utils.cpp \ 47 | loc_nmea.cpp 48 | 49 | library_includedir = $(pkgincludedir) 50 | 51 | library_include_HEADERS = $(libgps_utils_la_h_sources) 52 | 53 | libgps_utils_la_SOURCES = $(libgps_utils_la_c_sources) 54 | 55 | if USE_GLIB 56 | libgps_utils_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 57 | libgps_utils_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 58 | libgps_utils_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 59 | else 60 | libgps_utils_la_CFLAGS = $(AM_CFLAGS) 61 | libgps_utils_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 62 | libgps_utils_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 63 | endif 64 | 65 | libgps_utils_la_LIBADD = $(CUTILS_LIBS) -ldl 66 | 67 | #Create and Install libraries 68 | lib_LTLIBRARIES = libgps_utils.la 69 | 70 | pkgconfigdir = $(libdir)/pkgconfig 71 | pkgconfig_DATA = gps-utils.pc 72 | EXTRA_DIST = $(pkgconfig_DATA) 73 | -------------------------------------------------------------------------------- /gps/utils/MsgTask.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013,2015 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __MSG_TASK__ 30 | #define __MSG_TASK__ 31 | 32 | #include 33 | 34 | struct LocMsg { 35 | inline LocMsg() {} 36 | inline virtual ~LocMsg() {} 37 | virtual void proc() const = 0; 38 | inline virtual void log() const {} 39 | }; 40 | 41 | class MsgTask : public LocRunnable { 42 | const void* mQ; 43 | LocThread* mThread; 44 | friend class LocThreadDelegate; 45 | protected: 46 | virtual ~MsgTask(); 47 | public: 48 | MsgTask(LocThread::tCreate tCreator, const char* threadName = NULL, bool joinable = true); 49 | MsgTask(const char* threadName = NULL, bool joinable = true); 50 | // this obj will be deleted once thread is deleted 51 | void destroy(); 52 | void sendMsg(const LocMsg* msg) const; 53 | // Overrides of LocRunnable methods 54 | // This method will be repeated called until it returns false; or 55 | // until thread is stopped. 56 | virtual bool run(); 57 | 58 | // The method to be run before thread loop (conditionally repeatedly) 59 | // calls run() 60 | virtual void prerun(); 61 | 62 | // The method to be run after thread loop (conditionally repeatedly) 63 | // calls run() 64 | inline virtual void postrun() {} 65 | }; 66 | 67 | #endif //__MSG_TASK__ 68 | -------------------------------------------------------------------------------- /gps/utils/gps-utils.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: gps-utils 7 | Description: QTI GPS Location utils 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgps_utils 10 | Cflags: -I${includedir}/gps-utils 11 | -------------------------------------------------------------------------------- /gps/utils/loc_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2012, 2015 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_LOG_H 31 | #define LOC_LOG_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif 37 | 38 | #include 39 | #include 40 | #include "loc_target.h" 41 | 42 | typedef struct 43 | { 44 | const char *name; 45 | long val; 46 | } loc_name_val_s_type; 47 | 48 | #define NAME_VAL(x) {"" #x "", x } 49 | 50 | #define UNKNOWN_STR "UNKNOWN" 51 | 52 | #define CHECK_MASK(type, value, mask_var, mask) \ 53 | (((mask_var) & (mask)) ? (type) (value) : (type) (-1)) 54 | 55 | #define LOC_TABLE_SIZE(table) (sizeof(table)/sizeof((table)[0])) 56 | 57 | /* Get names from value */ 58 | const char* loc_get_name_from_mask(const loc_name_val_s_type table[], size_t table_size, long mask); 59 | const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t table_size, long value); 60 | const char* loc_get_msg_q_status(int status); 61 | const char* loc_get_target_name(unsigned int target); 62 | 63 | extern const char* log_succ_fail_string(int is_succ); 64 | 65 | extern char *loc_get_time(char *time_string, size_t buf_size); 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif /* LOC_LOG_H */ 72 | -------------------------------------------------------------------------------- /idc/uinput-fpc.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-fpc 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | -------------------------------------------------------------------------------- /idc/uinput-goodix.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-goodix 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | -------------------------------------------------------------------------------- /init/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2019-2020,2022 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_static { 8 | name: "libinit_sdm660", 9 | recovery_available: true, 10 | srcs: ["init_sdm660.cpp"], 11 | include_dirs: [ 12 | "system/core/init" 13 | ], 14 | shared_libs: [ 15 | "libbase", 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /ir/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2016 The Android Open Source Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_binary { 8 | name: "android.hardware.ir@1.0-service.xiaomi_sdm660", 9 | defaults: ["hidl_defaults"], 10 | relative_install_path: "hw", 11 | init_rc: ["android.hardware.ir@1.0-service.xiaomi_sdm660.rc"], 12 | vintf_fragments: ["android.hardware.ir@1.0-service.xiaomi_sdm660.xml"], 13 | srcs: [ 14 | "ConsumerIr.cpp", 15 | "service.cpp", 16 | ], 17 | shared_libs: [ 18 | "libbase", 19 | "libhardware", 20 | "libhidlbase", 21 | "libutils", 22 | "android.hardware.ir@1.0", 23 | ], 24 | vendor: true, 25 | } 26 | -------------------------------------------------------------------------------- /ir/ConsumerIr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #ifndef ANDROID_HARDWARE_IR_V1_0_IR_H 8 | #define ANDROID_HARDWARE_IR_V1_0_IR_H 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace android { 16 | namespace hardware { 17 | namespace ir { 18 | namespace V1_0 { 19 | namespace implementation { 20 | 21 | using ::android::hardware::ir::V1_0::ConsumerIrFreqRange; 22 | using ::android::hardware::ir::V1_0::IConsumerIr; 23 | using ::android::hardware::hidl_array; 24 | using ::android::hardware::hidl_string; 25 | using ::android::hardware::hidl_vec; 26 | using ::android::hardware::Return; 27 | using ::android::hardware::Void; 28 | using ::android::sp; 29 | 30 | struct ConsumerIr : public IConsumerIr { 31 | ConsumerIr(); 32 | ~ConsumerIr(); 33 | // Methods from ::android::hardware::ir::V1_0::IConsumerIr follow. 34 | Return transmit(int32_t carrierFreq, const hidl_vec& pattern) override; 35 | Return getCarrierFreqs(getCarrierFreqs_cb _hidl_cb) override; 36 | private: 37 | consumerir_device_t *mDevice; 38 | }; 39 | 40 | } // namespace implementation 41 | } // namespace V1_0 42 | } // namespace ir 43 | } // namespace hardware 44 | } // namespace android 45 | 46 | #endif // ANDROID_HARDWARE_IR_V1_0_IR_H 47 | -------------------------------------------------------------------------------- /ir/android.hardware.ir@1.0-service.xiaomi_sdm660.rc: -------------------------------------------------------------------------------- 1 | service vendor.ir-hal-1-0 /vendor/bin/hw/android.hardware.ir@1.0-service.xiaomi_sdm660 2 | interface android.hardware.ir@1.0::IConsumerIr default 3 | class hal 4 | user system 5 | group system 6 | -------------------------------------------------------------------------------- /ir/android.hardware.ir@1.0-service.xiaomi_sdm660.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.ir 4 | hwbinder 5 | @1.0::IConsumerIr/default 6 | 7 | 8 | -------------------------------------------------------------------------------- /ir/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The Android Open Source Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #define LOG_TAG "android.hardware.ir@1.0-service.xiaomi_sdm660" 8 | 9 | #include 10 | #include 11 | #include "ConsumerIr.h" 12 | 13 | using android::hardware::ir::V1_0::IConsumerIr; 14 | using android::hardware::ir::V1_0::implementation::ConsumerIr; 15 | using android::hardware::configureRpcThreadpool; 16 | using android::hardware::joinRpcThreadpool; 17 | 18 | int main() { 19 | android::sp service = new ConsumerIr(); 20 | 21 | configureRpcThreadpool(1, true /*callerWillJoin*/); 22 | 23 | android::status_t status = service->registerAsService(); 24 | if (status != android::OK) { 25 | LOG(ERROR) << "Cannot register ConsumerIr service"; 26 | return 1; 27 | } 28 | 29 | joinRpcThreadpool(); 30 | 31 | return 1; // should never get here 32 | } 33 | -------------------------------------------------------------------------------- /keylayout/uinput-fpc.kl: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | key 102 HOME VIRTUAL 12 | 13 | key 103 SYSTEM_NAVIGATION_UP 14 | key 105 SYSTEM_NAVIGATION_LEFT 15 | key 106 SYSTEM_NAVIGATION_RIGHT 16 | key 108 SYSTEM_NAVIGATION_DOWN 17 | -------------------------------------------------------------------------------- /keylayout/uinput-goodix.kl: -------------------------------------------------------------------------------- 1 | # 2 | # Goodix fingerprint sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | key 102 HOME VIRTUAL 12 | 13 | key 103 SYSTEM_NAVIGATION_UP 14 | key 105 SYSTEM_NAVIGATION_LEFT 15 | key 106 SYSTEM_NAVIGATION_RIGHT 16 | key 108 SYSTEM_NAVIGATION_DOWN 17 | -------------------------------------------------------------------------------- /libqti-perfd-client/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021-2022 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_shared { 8 | name: "libqti-perfd-client", 9 | vendor: true, 10 | srcs: ["client.c"], 11 | shared_libs: [ 12 | "liblog", 13 | "libutils", 14 | ], 15 | } 16 | -------------------------------------------------------------------------------- /libqti-perfd-client/client.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #define LOG_TAG "libqti-perfd-client" 8 | 9 | #include 10 | #include 11 | 12 | void perf_get_feedback() {} 13 | void perf_hint() {} 14 | int perf_lock_acq(int handle, int duration, int arg3[], int arg4) { 15 | ALOGI("perf_lock_acq: handle: %d, duration: %d, arg3[0]: %d, arg4: %d", 16 | handle, duration, arg3[0], arg4); 17 | if (handle > 0) 18 | return handle; 19 | 20 | return 233; 21 | } 22 | void perf_lock_cmd() {} 23 | int perf_lock_rel(int handle) { 24 | ALOGI("perf_lock_rel: handle: %d", handle); 25 | if (handle > 0) 26 | return handle; 27 | 28 | return 233; 29 | } 30 | void perf_lock_use_profile() {} 31 | -------------------------------------------------------------------------------- /libshims/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_shared { 8 | name: "libcamera_sdm660_shim", 9 | srcs: ["camera_sdm660_shim.cpp"], 10 | shared_libs: [ 11 | "libui", 12 | "libutils", 13 | ], 14 | vendor: true, 15 | } 16 | -------------------------------------------------------------------------------- /libshims/camera_sdm660_shim.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace android { 4 | extern "C" void _ZN7android13GraphicBuffer4lockEjPPvPiS3_(void* thisptr, uint32_t inUsage, 5 | void** vaddr, int32_t* outBytesPerPixel, int32_t* outBytesPerStride); 6 | 7 | extern "C" void _ZN7android13GraphicBuffer4lockEjPPv(void* thisptr, uint32_t inUsage, 8 | void** vaddr) { 9 | _ZN7android13GraphicBuffer4lockEjPPvPiS3_(thisptr, inUsage, vaddr, nullptr, nullptr); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lineage.dependencies: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "repository": "android_hardware_xiaomi", 4 | "target_path": "hardware/xiaomi" 5 | }, 6 | { 7 | "repository": "android_kernel_xiaomi_sdm660", 8 | "target_path": "kernel/xiaomi/sdm660" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /odm.prop: -------------------------------------------------------------------------------- 1 | # Fwk detect 2 | ro.vendor.qti.va_odm.support=1 3 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | true 19 | 4 20 | 21 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc310-mnc004/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 6 36 | 37 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc310-mnc120/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 6 36 | 37 | 38 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc310-mnc260/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 3 36 | 37 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc310-mnc410/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 3 36 | 37 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc311-mnc480/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | true 38 | 39 | 42 | 6 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc312-mnc530/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 32 | 33 | "0" 34 | "00" 35 | "*2" 36 | 37 | 38 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc460-mnc03/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 6 36 | 37 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc460-mnc11/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 6 36 | 37 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | true 23 | 24 | 25 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 32 | 33 | 34 | true 35 | 36 | -------------------------------------------------------------------------------- /overlay/packages/apps/CellBroadcastReceiver/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | true 23 | 24 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 24 | 25 | 0 26 | -1 27 | -1 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /overlay/packages/services/Telephony/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 21 | 22 | 24 | 1 25 | 26 | 27 | true 28 | 29 | 30 | true 31 | 32 | 35 | true 36 | 37 | 41 | true 42 | 43 | 44 | true 45 | 46 | 47 | org.codeaurora.ims 48 | 49 | 50 | org.codeaurora.ims 51 | 52 | -------------------------------------------------------------------------------- /product.prop: -------------------------------------------------------------------------------- 1 | # Charger 2 | ro.charger.disable_init_blank=true 3 | ro.charger.enable_suspend=true 4 | 5 | # Radio 6 | ro.telephony.block_binder_thread_on_incoming_calls=false 7 | -------------------------------------------------------------------------------- /proprietary-files-fm.txt: -------------------------------------------------------------------------------- 1 | # FM - from S62Pro 2 | lib64/fm_helium.so:system_ext/lib64/fm_helium.so|b2440e4feaae8a7f5e2269525520f9774b6962fc 3 | lib64/libfm-hci.so:system_ext/lib64/libfm-hci.so|758c6e7cfafc964b5cd9d71806ec5455e0d78716 4 | product/lib64/vendor.qti.hardware.fm@1.0.so:system_ext/lib64/vendor.qti.hardware.fm@1.0.so|5eaf6d5d67361ff6236c1ec4f5225c6185a904a6 5 | vendor/lib64/hw/vendor.qti.hardware.fm@1.0-impl.so|05931b5d088bd7000b0b002ee650b0953e272cd7 6 | -------------------------------------------------------------------------------- /proprietary-files-ir.txt: -------------------------------------------------------------------------------- 1 | # ConsumerIR (lirc) - from jason V12.0.1.0.PCHCNXM 2 | vendor/lib64/hw/consumerir.default.so:vendor/lib64/hw/consumerir.lirc.sdm660.so|8c614f98e2a42b5ba9e148c01b3d69e7fb59ce1d 3 | 4 | # ConsumerIR (spi) - from jasmine V11.0.28.0.QDIMIXM 5 | vendor/lib64/hw/consumerir.default.so:vendor/lib64/hw/consumerir.spi.sdm660.so|d1f275a91557dfab52e82906986c5094fe078722 6 | -------------------------------------------------------------------------------- /rootdir/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2022 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | // Init scripts 8 | sh_binary { 9 | name: "init.class_main.sh", 10 | src: "bin/init.class_main.sh", 11 | vendor: true, 12 | } 13 | 14 | sh_binary { 15 | name: "init.qcom.early_boot.sh", 16 | src: "bin/init.qcom.early_boot.sh", 17 | vendor: true, 18 | } 19 | 20 | sh_binary { 21 | name: "init.qcom.post_boot.sh", 22 | src: "bin/init.qcom.post_boot.sh", 23 | vendor: true, 24 | } 25 | 26 | sh_binary { 27 | name: "init.qcom.sh", 28 | src: "bin/init.qcom.sh", 29 | vendor: true, 30 | } 31 | 32 | // Init configuration files 33 | prebuilt_etc { 34 | name: "init.fingerprint.rc", 35 | src: "etc/init.fingerprint.rc", 36 | sub_dir: "init/hw", 37 | vendor: true, 38 | } 39 | 40 | prebuilt_etc { 41 | name: "init.qcom.power.rc", 42 | src: "etc/init.qcom.power.rc", 43 | sub_dir: "init/hw", 44 | vendor: true, 45 | } 46 | 47 | prebuilt_etc { 48 | name: "init.qcom.rc", 49 | src: "etc/init.qcom.rc", 50 | sub_dir: "init/hw", 51 | vendor: true, 52 | } 53 | 54 | prebuilt_etc { 55 | name: "init.target.rc", 56 | src: "etc/init.target.rc", 57 | sub_dir: "init/hw", 58 | vendor: true, 59 | } 60 | 61 | prebuilt_etc { 62 | name: "ueventd.qcom.rc", 63 | filename: "ueventd.rc", 64 | src: "etc/ueventd.qcom.rc", 65 | vendor: true, 66 | } 67 | -------------------------------------------------------------------------------- /rootdir/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE := init.recovery.qcom.rc 5 | LOCAL_MODULE_TAGS := optional 6 | LOCAL_MODULE_CLASS := ETC 7 | LOCAL_SRC_FILES := etc/init.recovery.qcom.rc 8 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) 9 | include $(BUILD_PREBUILT) 10 | -------------------------------------------------------------------------------- /rootdir/etc/init.fingerprint.rc: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2022 The LineageOS Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | on init 8 | chown system system /dev/goodix_fp 9 | chmod 0644 /dev/goodix_fp 10 | 11 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/irq 12 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/irq_enable 13 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/wakeup_enable 14 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/hw_reset 15 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/device_prepare 16 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/fingerdown_wait 17 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/vendor 18 | chown system system /sys/bus/platform/devices/soc:fingerprint_fpc/proximity_state 19 | chown system system /sys/bus/platform/devices/soc:fingerprint_goodix/proximity_state 20 | chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/irq 21 | chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/wakeup_enable 22 | chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/hw_reset 23 | chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/device_prepare 24 | chmod 0700 /sys/bus/platform/devices/soc:fingerprint_fpc/vendor 25 | 26 | chown system system /sys/bus/platform/devices/soc:fpc1020/irq 27 | chown system system /sys/bus/platform/devices/soc:fpc1020/irq_enable 28 | chown system system /sys/bus/platform/devices/soc:fpc1020/wakeup_enable 29 | chown system system /sys/bus/platform/devices/soc:fpc1020/hw_reset 30 | chown system system /sys/bus/platform/devices/soc:fpc1020/device_prepare 31 | chown system system /sys/bus/platform/devices/soc:fpc1020/fingerdown_wait 32 | chown system system /sys/bus/platform/devices/soc:fpc1020/vendor 33 | chown system system /sys/bus/platform/devices/soc:fpc1020/proximity_state 34 | chown system system /sys/bus/platform/devices/soc:goodix_fp/proximity_state 35 | chmod 0700 /sys/bus/platform/devices/soc:fpc1020/irq 36 | chmod 0700 /sys/bus/platform/devices/soc:fpc1020/wakeup_enable 37 | chmod 0700 /sys/bus/platform/devices/soc:fpc1020/hw_reset 38 | chmod 0700 /sys/bus/platform/devices/soc:fpc1020/device_prepare 39 | chmod 0700 /sys/bus/platform/devices/soc:fpc1020/vendor 40 | 41 | on post-fs-data 42 | mkdir /data/vendor/fpc 0770 system system 43 | mkdir /data/vendor/goodix 0770 system system 44 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "WifiOverlay", 3 | theme: "WifiOverlay", 4 | sdk_version: "current", 5 | product_specific: true 6 | } 7 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 21 | 22 | 27 | 28 | -------------------------------------------------------------------------------- /seccomp/mediacodec-seccomp.policy: -------------------------------------------------------------------------------- 1 | # device specific syscalls 2 | # extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy 3 | pselect6: 1 4 | eventfd2: 1 5 | sendto: 1 6 | recvfrom: 1 7 | _llseek: 1 8 | sysinfo: 1 9 | getcwd: 1 10 | getdents64: 1 11 | inotify_init1: 1 12 | inotify_add_watch: 1 13 | -------------------------------------------------------------------------------- /seccomp/mediaextractor-seccomp.policy: -------------------------------------------------------------------------------- 1 | # device specific syscalls. 2 | # extension of services/mediaextractor/minijail/seccomp_policy/mediaextractor-seccomp-arm.policy 3 | readlinkat: 1 4 | pread64: 1 5 | mremap: 1 6 | -------------------------------------------------------------------------------- /sepolicy/private/system_app.te: -------------------------------------------------------------------------------- 1 | hal_client_domain(system_app, hal_mlipay) 2 | -------------------------------------------------------------------------------- /sepolicy/public/attributes: -------------------------------------------------------------------------------- 1 | hal_attribute_lineage(mlipay) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/app.te: -------------------------------------------------------------------------------- 1 | get_prop({ appdomain -isolated_app }, hal_fingerprint_prop) 2 | get_prop({ appdomain -isolated_app }, mlipay_prop) 3 | 4 | allow { appdomain -isolated_app } adsprpcd_file:dir r_dir_perms; 5 | allow { appdomain -isolated_app } public_adsprpcd_file:file r_file_perms; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/device.te: -------------------------------------------------------------------------------- 1 | type fingerprint_device, dev_type; 2 | type spidev_device, dev_type; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/file.te: -------------------------------------------------------------------------------- 1 | type ir_dev_file, file_type; 2 | type proc_sysctl_schedboost, proc_type, fs_type; 3 | type public_adsprpcd_file, file_type; 4 | type sysfs_fingerprint, fs_type, sysfs_type; 5 | type sysfs_msm_subsys, sysfs_type, fs_type; 6 | type sysfs_rpm, sysfs_type, fs_type; 7 | type sysfs_system_sleep_stats, sysfs_type, fs_type; 8 | type sysfs_touchpanel, fs_type, sysfs_type; 9 | type thermal_data_file, file_type, data_file_type; 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/file_contexts: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | /(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.3-service\.xiaomi u:object_r:hal_fingerprint_default_exec:s0 3 | /data/gf_data(/.*)? u:object_r:fingerprintd_data_file:s0 4 | /data/vendor/fpc(/.*)? u:object_r:fingerprint_vendor_data_file:s0 5 | /data/vendor/gf_data(/.*)? u:object_r:fingerprint_vendor_data_file:s0 6 | /data/vendor/goodix(/.*)? u:object_r:fingerprint_vendor_data_file:s0 7 | /dev/goodix_fp u:object_r:fingerprint_device:s0 8 | 9 | # Firmware 10 | /firmware u:object_r:firmware_file:s0 11 | /bt_firmware u:object_r:bt_firmware_file:s0 12 | 13 | # Hexagon DSP-side executable needed for Halide operation 14 | # This is labeled as public_adsprpcd_file as it needs to be read by apps 15 | # (e.g. Google Camera App) 16 | /mnt/vendor/dsp/fastrpc_shell_3 u:object_r:public_adsprpcd_file:s0 17 | 18 | # IR 19 | /dev/lirc0 u:object_r:spidev_device:s0 20 | /dev/spidev7.1 u:object_r:spidev_device:s0 21 | 22 | # IR HAL 23 | /(vendor|system/vendor)/bin/hw/android\.hardware\.ir@1\.0-service\.xiaomi_sdm660 u:object_r:hal_ir_default_exec:s0 24 | 25 | # Lights 26 | /(vendor|system/vendor)/bin/hw/android\.hardware\.light-service\.xiaomi u:object_r:hal_light_default_exec:s0 27 | 28 | # Mlipay 29 | /(vendor|system/vendor)/bin/mlipayd@1.1 u:object_r:hal_mlipay_default_exec:s0 30 | 31 | # Power 32 | /(vendor|system/vendor)/bin/hw/android\.hardware\.power-service\.xiaomi-libperfmgr u:object_r:hal_power_default_exec:s0 33 | 34 | # Root files 35 | /persist(/.*)? u:object_r:mnt_vendor_file:s0 36 | 37 | # Thermal 38 | /data/vendor/thermal(/.*)? u:object_r:thermal_data_file:s0 39 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | allow hal_audio_default sysfs:dir r_dir_perms; 2 | 3 | get_prop(hal_audio_default, boot_status_prop) 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | hal_client_domain(hal_camera_default, hal_configstore) 2 | hal_client_domain(hal_camera_default, hal_graphics_allocator) 3 | 4 | allow hal_camera_default sysfs_kgsl:file r_file_perms; 5 | 6 | get_prop(hal_camera_default, vendor_video_prop) 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint_default.te: -------------------------------------------------------------------------------- 1 | allow hal_fingerprint_default { 2 | fingerprint_device 3 | tee_device 4 | uhid_device 5 | }:chr_file rw_file_perms; 6 | 7 | # TODO(b/36644492): Remove data_between_core_and_vendor_violators once 8 | # hal_fingerprint no longer directly accesses fingerprintd_data_file. 9 | typeattribute hal_fingerprint_default data_between_core_and_vendor_violators; 10 | # access to /data/system/users/[0-9]+/fpdata 11 | allow hal_fingerprint_default fingerprintd_data_file:dir rw_dir_perms; 12 | allow hal_fingerprint_default fingerprintd_data_file:file create_file_perms; 13 | 14 | allow hal_fingerprint_default sysfs_fingerprint:dir r_dir_perms; 15 | allow hal_fingerprint_default sysfs_fingerprint:file rw_file_perms; 16 | allow hal_fingerprint_default sysfs_wakeup:file rw_file_perms; 17 | 18 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl; 19 | 20 | allow hal_fingerprint_default hal_perf_hwservice:hwservice_manager find; 21 | binder_call(hal_fingerprint_default, hal_perf_default) 22 | 23 | r_dir_file(hal_fingerprint_default, firmware_file) 24 | set_prop(hal_fingerprint_default, hal_fingerprint_prop) 25 | 26 | dontaudit hal_fingerprint_default storage_file:dir search; 27 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_ir_default.te: -------------------------------------------------------------------------------- 1 | allow hal_ir_default spidev_device:chr_file rw_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_mlipay.te: -------------------------------------------------------------------------------- 1 | type hal_mlipay_default, domain; 2 | hal_server_domain(hal_mlipay_default, hal_mlipay) 3 | 4 | type hal_mlipay_default_exec, exec_type, vendor_file_type, file_type; 5 | init_daemon_domain(hal_mlipay_default) 6 | 7 | # Allow hwbinder call from hal client to server 8 | binder_call(hal_mlipay_client, hal_mlipay_server) 9 | 10 | # Add hwservice related rules 11 | add_hwservice(hal_mlipay_server, hal_mlipay_hwservice) 12 | allow hal_mlipay_client hal_mlipay_hwservice:hwservice_manager find; 13 | 14 | allow hal_mlipay_default tee_device:chr_file rw_file_perms; 15 | allow hal_mlipay_default ion_device:chr_file r_file_perms; 16 | 17 | r_dir_file(hal_mlipay_default, firmware_file) 18 | set_prop(hal_mlipay_default, mlipay_prop); 19 | 20 | get_prop(hal_mlipay_default, hal_fingerprint_prop); 21 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | allow hal_power_default sysfs_touchpanel:dir search; 2 | allow hal_power_default sysfs_touchpanel:file rw_file_perms; 3 | 4 | allow hal_power_default input_device:dir r_dir_perms; 5 | allow hal_power_default input_device:chr_file rw_file_perms; 6 | 7 | allow hal_power_default sysfs_graphics:dir search; 8 | allow hal_power_default sysfs_graphics:file r_file_perms; 9 | 10 | allow hal_power_default sysfs_rpm:file r_file_perms; 11 | allow hal_power_default sysfs_system_sleep_stats:file r_file_perms; 12 | 13 | # To do powerhint on nodes defined in powerhint.json 14 | allow hal_power_default sysfs_devfreq:dir search; 15 | allow hal_power_default sysfs_devfreq:lnk_file read; 16 | allow hal_power_default sysfs_devfreq:file rw_file_perms; 17 | allow hal_power_default sysfs_kgsl:lnk_file read; 18 | allow hal_power_default sysfs_kgsl:file rw_file_perms; 19 | allow hal_power_default sysfs_msm_subsys:dir search; 20 | allow hal_power_default sysfs_msm_subsys:file rw_file_perms; 21 | allow hal_power_default sysfs_devices_system_cpu:file rw_file_perms; 22 | allow hal_power_default device_latency:chr_file rw_file_perms; 23 | allow hal_power_default cgroup:dir search; 24 | allow hal_power_default cgroup:file rw_file_perms; 25 | allow hal_power_default proc_sysctl_schedboost:file rw_file_perms; 26 | 27 | # To get/set powerhal state property 28 | set_prop(hal_power_default, vendor_power_prop) 29 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_sensors_default.te: -------------------------------------------------------------------------------- 1 | set_prop(hal_sensors_default, camera_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice.te: -------------------------------------------------------------------------------- 1 | type hal_mlipay_hwservice, hwservice_manager_type; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | com.fingerprints.extension::IFingerprintCalibration u:object_r:hal_fingerprint_hwservice:s0 2 | com.fingerprints.extension::IFingerprintEngineering u:object_r:hal_fingerprint_hwservice:s0 3 | com.fingerprints.extension::IFingerprintNavigation u:object_r:hal_fingerprint_hwservice:s0 4 | com.fingerprints.extension::IFingerprintSenseTouch u:object_r:hal_fingerprint_hwservice:s0 5 | com.fingerprints.extension::IFingerprintSensorTest u:object_r:hal_fingerprint_hwservice:s0 6 | vendor.goodix.hardware.fingerprint::IGoodixBiometricsFingerprint u:object_r:hal_fingerprint_hwservice:s0 7 | vendor.xiaomi.hardware.mlipay::IMlipayService u:object_r:hal_mlipay_hwservice:s0 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/kernel.te: -------------------------------------------------------------------------------- 1 | allow kernel kernel:capability { kill }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | vendor_public_prop(hal_fingerprint_prop) 2 | vendor_public_prop(mlipay_prop) 3 | vendor_internal_prop(thermal_engine_prop) 4 | vendor_internal_prop(vendor_power_prop) 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | # Audio 2 | audio.sys.noisy.broadcast.delay u:object_r:vendor_default_prop:s0 3 | audio.sys.offload.pstimeout.secs u:object_r:vendor_default_prop:s0 4 | audio_hal.in_period_size u:object_r:vendor_default_prop:s0 5 | audio_hal.period_multiplier u:object_r:vendor_default_prop:s0 6 | persist.audio.fluence.voicecomm u:object_r:vendor_default_prop:s0 7 | 8 | # Camera 9 | camera.clientname u:object_r:camera_prop:s0 10 | camera.debug. u:object_r:camera_prop:s0 11 | camera.facebeauty.version u:object_r:camera_prop:s0 12 | camera.llvd.preview.disable u:object_r:camera_prop:s0 13 | camera.sensor. u:object_r:camera_prop:s0 14 | camera.test.novtsgsi u:object_r:camera_prop:s0 15 | cameradaemon.SaveMemAtBoot u:object_r:vendor_default_prop:s0 16 | cpp.set.clock u:object_r:vendor_default_prop:s0 17 | disable.cpp.power.collapse u:object_r:vendor_default_prop:s0 18 | persist.camera. u:object_r:vendor_default_prop:s0 19 | persist.vendor.camera. u:object_r:camera_prop:s0 20 | vendor.camera.eis.gyro_name u:object_r:camera_prop:s0 21 | vidc.enc.dcvs.extra-buff-count u:object_r:vendor_default_prop:s0 22 | 23 | # Fingerprint 24 | fpc_kpi u:object_r:vendor_default_prop:s0 25 | gf.debug.dump_data u:object_r:vendor_default_prop:s0 26 | persist.sys.fp. u:object_r:hal_fingerprint_prop:s0 27 | persist.vendor.sys.fp. u:object_r:hal_fingerprint_prop:s0 28 | ro.boot.fp. u:object_r:hal_fingerprint_prop:s0 29 | ro.boot.fpsensor u:object_r:hal_fingerprint_prop:s0 30 | sys.fp. u:object_r:hal_fingerprint_prop:s0 31 | 32 | # Media 33 | gpu.stats.debug.level u:object_r:vendor_default_prop:s0 34 | 35 | # Mlipay 36 | persist.vendor.sys.pay. u:object_r:mlipay_prop:s0 37 | persist.vendor.sys.provision.status u:object_r:mlipay_prop:s0 38 | 39 | # Power 40 | vendor.powerhal. u:object_r:vendor_power_prop:s0 41 | 42 | # RIL 43 | ro.build.software.version u:object_r:telephony_status_prop:s0 44 | ro.fota.oem u:object_r:telephony_status_prop:s0 45 | ro.miui. u:object_r:telephony_status_prop:s0 46 | ro.product.mod_device u:object_r:telephony_status_prop:s0 47 | 48 | # Thermal engine 49 | persist.sys.thermal. u:object_r:thermal_engine_prop:s0 50 | sys.thermal. u:object_r:thermal_engine_prop:s0 51 | 52 | # Wlan 53 | persist.vendor.wigig.npt.enable u:object_r:vendor_default_prop:s0 54 | -------------------------------------------------------------------------------- /sepolicy/vendor/radio.te: -------------------------------------------------------------------------------- 1 | binder_call(radio, cnd) 2 | 3 | allow radio hal_datafactory_hwservice:hwservice_manager find; 4 | allow radio hal_iwlan_hwservice:hwservice_manager find; 5 | 6 | get_prop(radio, vendor_qcom_ims_prop) 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/rild.te: -------------------------------------------------------------------------------- 1 | # Allow binder communication with qtidataservices_app 2 | binder_call(rild, qtidataservices_app) 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | # TODO(b/36644492): Remove data_between_core_and_vendor_violators once 2 | # tee no longer directly accesses /data owned by the frameworks. 3 | typeattribute tee data_between_core_and_vendor_violators; 4 | allow tee system_data_file:dir r_dir_perms; 5 | allow tee fingerprintd_data_file:dir rw_dir_perms; 6 | allow tee fingerprintd_data_file:file create_file_perms; 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/thermal-engine.te: -------------------------------------------------------------------------------- 1 | allow thermal-engine thermal_data_file:dir rw_dir_perms; 2 | allow thermal-engine thermal_data_file:file create_file_perms; 3 | allow thermal-engine sysfs:dir r_dir_perms; 4 | allow thermal-engine self:capability { chown fowner }; 5 | dontaudit thermal-engine self:capability dac_override; 6 | 7 | set_prop(thermal-engine, thermal_engine_prop); 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | typeattribute vendor_init data_between_core_and_vendor_violators; 2 | 3 | allow vendor_init { 4 | system_data_file 5 | tombstone_data_file 6 | }:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom }; 7 | 8 | allow init adsprpcd_file:file mounton; 9 | 10 | set_prop(vendor_init, camera_prop) 11 | set_prop(vendor_init, vendor_power_prop) 12 | -------------------------------------------------------------------------------- /setup-makefiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # SPDX-License-Identifier: Apache-2.0 7 | # 8 | 9 | set -e 10 | 11 | # Load extract_utils and do some sanity checks 12 | MY_DIR="${BASH_SOURCE%/*}" 13 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 14 | 15 | ANDROID_ROOT="${MY_DIR}/../../.." 16 | 17 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 18 | if [ ! -f "${HELPER}" ]; then 19 | echo "Unable to find helper script at ${HELPER}" 20 | exit 1 21 | fi 22 | source "${HELPER}" 23 | 24 | # Initialize the helper for common 25 | setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true 26 | 27 | # Warning headers and guards 28 | write_headers "jasmine_sprout jason lavender platina twolip wayne whyred" 29 | 30 | # The standard common blobs 31 | write_makefiles "${MY_DIR}/proprietary-files.txt" true 32 | 33 | printf "\n%s\n" "ifeq (\$(BOARD_HAVE_QCOM_FM),true)" >> "${PRODUCTMK}" 34 | write_makefiles "${MY_DIR}/proprietary-files-fm.txt" true 35 | echo "endif" >> "${PRODUCTMK}" 36 | 37 | printf "\n%s\n" "ifeq (\$(BOARD_HAVE_IR),true)" >> "${PRODUCTMK}" 38 | write_makefiles "${MY_DIR}/proprietary-files-ir.txt" true 39 | echo "endif" >> "${PRODUCTMK}" 40 | 41 | # Finish 42 | write_footers 43 | 44 | if [ -s "${MY_DIR}/../$DEVICE_SPECIFIED_COMMON/proprietary-files.txt" ]; then 45 | DEVICE_COMMON="${DEVICE_SPECIFIED_COMMON}" 46 | 47 | # Reinitialize the helper for device specified common 48 | setup_vendor "${DEVICE_SPECIFIED_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true 49 | 50 | # Warning headers and guards 51 | write_headers "${DEVICE_SPECIFIED_COMMON_DEVICE}" 52 | 53 | # The standard device specified common blobs 54 | write_makefiles "${MY_DIR}/../${DEVICE_SPECIFIED_COMMON}/proprietary-files.txt" true 55 | 56 | # Finish 57 | write_footers 58 | 59 | DEVICE_COMMON="sdm660-common" 60 | fi 61 | 62 | if [ -s "${MY_DIR}/../${DEVICE}/proprietary-files.txt" ]; then 63 | # Reinitialize the helper for device 64 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false 65 | 66 | # Warning headers and guards 67 | write_headers 68 | 69 | # The standard device blobs 70 | write_makefiles "${MY_DIR}/../${DEVICE}/proprietary-files.txt" true 71 | 72 | # Finish 73 | write_footers 74 | fi 75 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | # CNE 2 | persist.vendor.cne.feature=1 3 | 4 | # Netflix 5 | ro.netflix.bsp_rev=Q660-13149-1 6 | 7 | # Radio 8 | DEVICE_PROVISIONED=1 9 | persist.sys.fflag.override.settings_network_and_internet_v2=true 10 | ril.subscription.types=NV,RUIM 11 | telephony.lteOnCdmaDevice=1 12 | -------------------------------------------------------------------------------- /update-sha1sums.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | import os 20 | import sys 21 | from hashlib import sha1 22 | 23 | DEVICE = 'sdm660-common' 24 | VENDOR = 'xiaomi' 25 | VENDOR_PATH = os.path.join( 26 | *['..', '..', '..', 'vendor', VENDOR, DEVICE, 'proprietary']) 27 | 28 | 29 | class Updater: 30 | def __init__(self, filename): 31 | self.filename = filename 32 | with open(self.filename, 'r') as f: 33 | self.lines = f.read().splitlines() 34 | 35 | def write(self): 36 | with open(self.filename, 'w') as f: 37 | f.write('\n'.join(self.lines) + '\n') 38 | 39 | def cleanup(self): 40 | for index, line in enumerate(self.lines): 41 | # Skip empty or commented lines 42 | if len(line) == 0 or line[0] == '#' or '|' not in line: 43 | continue 44 | 45 | # Drop SHA1 hash, if existing 46 | self.lines[index] = line.split('|')[0] 47 | 48 | self.write() 49 | 50 | def update(self): 51 | need_sha1 = False 52 | for index, line in enumerate(self.lines): 53 | # Skip empty lines 54 | if len(line) == 0: 55 | continue 56 | 57 | # Check if we need to set SHA1 hash for the next files 58 | if line[0] == '#': 59 | need_sha1 = (' - from' in line) 60 | continue 61 | 62 | if need_sha1: 63 | # Remove existing SHA1 hash 64 | line = line.split('|')[0] 65 | 66 | file_path = line.split(';')[0].split(':')[-1] 67 | if file_path[0] == '-': 68 | file_path = file_path[1:] 69 | 70 | with open(os.path.join(VENDOR_PATH, file_path), 'rb') as f: 71 | hash = sha1(f.read()).hexdigest() 72 | 73 | self.lines[index] = '{}|{}'.format(line, hash) 74 | 75 | self.write() 76 | 77 | 78 | for file in ['proprietary-files.txt', 'proprietary-files-fm.txt']: 79 | updater = Updater(file) 80 | if len(sys.argv) == 2 and sys.argv[1] == '-c': 81 | updater.cleanup() 82 | else: 83 | updater.update() 84 | -------------------------------------------------------------------------------- /wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_no_group_iface=1 3 | persistent_reconnect=1 4 | p2p_go_intent=15 5 | -------------------------------------------------------------------------------- /wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_disabled=1 3 | tdls_external_control=1 4 | bss_max_count=512 5 | interworking=1 6 | hs20=1 7 | auto_interworking=0 8 | bss_no_flush_when_down=1 9 | driver_param=use_p2p_group_interface=1 10 | wowlan_triggers=magic_pkt 11 | --------------------------------------------------------------------------------