├── Android.bp ├── Android.mk ├── BoardConfigCommon.mk ├── README.md ├── audio ├── audio_effects.xml ├── audio_output_policy.conf ├── audio_policy_configuration.xml ├── audio_tuning_mixer.txt ├── sound_trigger_mixer_paths.xml └── sound_trigger_platform_info.xml ├── biometrics ├── Android.bp ├── BiometricsFingerprint.cpp ├── BiometricsFingerprint.h ├── android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953-32.rc ├── android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953-32.xml ├── android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953.rc ├── android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953.xml └── service.cpp ├── compatibility_matrix.xml ├── config.fs ├── configs ├── powerhint.xml ├── privapp-permissions-qti.xml ├── qti_whitelist.xml ├── telephony_system-ext_privapp-permissions-qti.xml └── thermal-engine.conf ├── extract-files.sh ├── 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 ├── init ├── Android.bp └── init_msm8953.cpp ├── keylayout ├── ft5435_ts.kl ├── gf3208.kl ├── goodix-ts.kl ├── gpio-keys.kl ├── ist30xx_ts_input.kl ├── msm8953-snd-card-mtp_Button_Jack.kl ├── uinput-fpc.kl └── uinput-goodix.kl ├── lineage.dependencies ├── manifest.xml ├── media ├── media_codecs.xml ├── media_codecs_performance.xml └── media_profiles_V1_0.xml ├── msm8953.mk ├── 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 │ │ │ └── config.xml │ │ └── packages │ │ └── SystemUI │ │ └── res │ │ └── values │ │ └── config.xml └── packages │ ├── apps │ ├── CarrierConfig │ │ └── res │ │ │ └── xml │ │ │ └── vendor.xml │ └── Settings │ │ └── res │ │ └── values │ │ └── arrays.xml │ └── services │ └── Telephony │ └── res │ └── values │ └── config.xml ├── parts ├── Android.bp ├── AndroidManifest.xml ├── proguard.flags ├── res │ ├── drawable │ │ ├── ic_display.xml │ │ ├── ic_hand.xml │ │ ├── ic_headphone.xml │ │ ├── ic_pickup.xml │ │ ├── ic_pocket.xml │ │ └── ic_preset.xml │ ├── values │ │ ├── arrays.xml │ │ └── strings.xml │ └── xml │ │ ├── dirac_settings.xml │ │ └── doze_settings.xml └── src │ └── org │ └── lineageos │ └── settings │ ├── BootCompletedReceiver.java │ ├── dirac │ ├── DiracActivity.java │ ├── DiracSettingsFragment.java │ ├── DiracSound.java │ └── DiracUtils.java │ └── doze │ ├── DozeService.java │ ├── DozeSettingsActivity.java │ ├── DozeSettingsFragment.java │ ├── DozeUtils.java │ ├── ProximitySensor.java │ └── TiltSensor.java ├── product.prop ├── proprietary-files.txt ├── rootdir ├── Android.mk ├── bin │ ├── init.qcom.post_boot.sh │ └── init.qcom.sh └── etc │ ├── fstab.qcom │ ├── fstab_AB.qcom │ ├── init.msm.usb.configfs.rc │ ├── init.qcom.rc │ ├── init.qcom.usb.rc │ ├── init.target.rc │ └── ueventd.qcom.rc ├── rro_overlays ├── TetheringOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml └── WifiOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ └── values │ └── config.xml ├── sepolicy └── vendor │ ├── device.te │ ├── file.te │ ├── file_contexts │ ├── genfs_contexts │ ├── hal_audio_default.te │ ├── hal_bluetooth_default.te │ ├── hal_camera_default.te │ ├── hal_cas_default.te │ ├── hal_fingerprint_default.te │ ├── hal_ir_default.te │ ├── hal_lineage_touch_default.te │ ├── hal_power_default.te │ ├── hwservice_contexts │ ├── init.te │ ├── init_fingerprint.te │ ├── kernel.te │ ├── mm-qcamerad.te │ ├── netmgrd.te │ ├── property.te │ ├── property_contexts │ ├── qti_init_shell.te │ ├── radio.te │ ├── rild.te │ ├── rmt_storage.te │ ├── system_app.te │ ├── system_server.te │ ├── tee.te │ ├── ueventd.te │ ├── vendor_init.te │ ├── vndservice.te │ ├── vndservice_contexts │ └── vold.te ├── setup-makefiles.sh ├── system.prop ├── system_ext.prop ├── touch ├── Android.bp ├── KeyDisabler.cpp ├── KeyDisabler.h ├── service.cpp ├── vendor.lineage.touch@1.0-service.xiaomi_8953.rc └── vendor.lineage.touch@1.0-service.xiaomi_8953.xml ├── update-sha1sums.py ├── vendor.prop └── wifi ├── WCNSS_cfg.dat ├── WCNSS_qcom_cfg.ini ├── p2p_supplicant_overlay.conf └── wpa_supplicant_overlay.conf /Android.bp: -------------------------------------------------------------------------------- 1 | soong_namespace { 2 | } 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Common device tree for Xiaomi MSM8953 devices 2 | 3 | ``` 4 | # 5 | # Copyright (C) 2017-2021 The LineageOS Project 6 | # 7 | # SPDX-License-Identifier: Apache-2.0 8 | # 9 | ``` 10 | -------------------------------------------------------------------------------- /audio/audio_output_policy.conf: -------------------------------------------------------------------------------- 1 | # List of profiles for the output device session where stream is routed. 2 | # A stream opened with the inputs attributes which match the "flags" and 3 | # "formats" as specified in the profile is routed to a device at 4 | # sample rate specified under "sampling_rates" and bit width under 5 | # "bit_width" and the topology extracted from the acdb data against 6 | # the "app_type". 7 | # 8 | # the flags and formats are specified using the strings corresponding to 9 | # enums in audio.h and audio_policy.h. They are concatenated with "|" 10 | # without space or "\n". 11 | # the flags and formats should match the ones in "audio_policy.conf" 12 | 13 | outputs { 14 | default { 15 | flags AUDIO_OUTPUT_FLAG_PRIMARY 16 | formats AUDIO_FORMAT_PCM_16_BIT 17 | sampling_rates 48000 18 | bit_width 16 19 | app_type 69937 20 | } 21 | deep_buffer { 22 | flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER 23 | formats AUDIO_FORMAT_PCM_16_BIT 24 | sampling_rates 48000 25 | bit_width 16 26 | app_type 69936 27 | } 28 | direct_pcm_16 { 29 | flags AUDIO_OUTPUT_FLAG_DIRECT 30 | formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT 31 | sampling_rates 44100|48000|96000|192000 32 | bit_width 16 33 | app_type 69936 34 | } 35 | direct_pcm_24 { 36 | flags AUDIO_OUTPUT_FLAG_DIRECT 37 | formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT 38 | sampling_rates 44100|48000|96000|192000 39 | bit_width 24 40 | app_type 69940 41 | } 42 | compress_offload_16 { 43 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING 44 | formats AUDIO_FORMAT_MP3|AUDIO_FORMAT_AC3|AUDIO_FORMAT_E_AC3|AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_AAC_LC|AUDIO_FORMAT_AAC_HE_V1|AUDIO_FORMAT_AAC_HE_V2|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_AAC_ADTS_LC|AUDIO_FORMAT_AAC_ADTS_HE_V1|AUDIO_FORMAT_AAC_ADTS_HE_V2 45 | sampling_rates 44100|48000|96000|192000 46 | bit_width 16 47 | app_type 69936 48 | } 49 | compress_offload_24 { 50 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING 51 | formats AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_VORBIS 52 | sampling_rates 44100|48000|96000|192000 53 | bit_width 24 54 | app_type 69940 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /biometrics/Android.bp: -------------------------------------------------------------------------------- 1 | cc_defaults { 2 | name: "fingerprint_service_xiaomi_msm8953_defaults", 3 | defaults: ["hidl_defaults"], 4 | relative_install_path: "hw", 5 | srcs: [ 6 | "BiometricsFingerprint.cpp", 7 | "service.cpp", 8 | ], 9 | shared_libs: [ 10 | "libcutils", 11 | "liblog", 12 | "libhidlbase", 13 | "libhardware", 14 | "libutils", 15 | "android.hardware.biometrics.fingerprint@2.1", 16 | ], 17 | vendor: true, 18 | } 19 | 20 | cc_binary { 21 | name: "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953", 22 | defaults: ["fingerprint_service_xiaomi_msm8953_defaults"], 23 | init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953.rc"], 24 | vintf_fragments: ["android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953.xml"], 25 | } 26 | 27 | cc_binary { 28 | name: "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953-32", 29 | defaults: ["fingerprint_service_xiaomi_msm8953_defaults"], 30 | compile_multilib: "32", 31 | init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953-32.rc"], 32 | vintf_fragments: ["android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953-32.xml"], 33 | } 34 | -------------------------------------------------------------------------------- /biometrics/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953-32.rc: -------------------------------------------------------------------------------- 1 | service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953-32 2 | # "class hal" causes a race condition on some devices due to files created 3 | # in /data. As a workaround, postpone startup until later in boot once 4 | # /data is mounted. 5 | class late_start 6 | user system 7 | group system input uhid 8 | writepid /dev/cpuset/system-background/tasks 9 | -------------------------------------------------------------------------------- /biometrics/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953-32.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.biometrics.fingerprint 4 | hwbinder 5 | 2.1 6 | 7 | IBiometricsFingerprint 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /biometrics/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953.rc: -------------------------------------------------------------------------------- 1 | service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953 2 | # "class hal" causes a race condition on some devices due to files created 3 | # in /data. As a workaround, postpone startup until later in boot once 4 | # /data is mounted. 5 | class late_start 6 | user system 7 | group system input uhid 8 | writepid /dev/cpuset/system-background/tasks 9 | -------------------------------------------------------------------------------- /biometrics/android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.biometrics.fingerprint 4 | hwbinder 5 | 2.1 6 | 7 | IBiometricsFingerprint 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /biometrics/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 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 | #define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.xiaomi_msm8953" 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include "BiometricsFingerprint.h" 25 | 26 | using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint; 27 | using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint; 28 | using android::hardware::configureRpcThreadpool; 29 | using android::hardware::joinRpcThreadpool; 30 | using android::sp; 31 | 32 | int main() { 33 | android::sp bio = BiometricsFingerprint::getInstance(); 34 | 35 | configureRpcThreadpool(1, true /*callerWillJoin*/); 36 | 37 | if (bio != nullptr) { 38 | if (::android::OK != bio->registerAsService()) { 39 | return 1; 40 | } 41 | } else { 42 | ALOGE("Can't create instance of BiometricsFingerprint, nullptr"); 43 | } 44 | 45 | joinRpcThreadpool(); 46 | 47 | return 0; // should never get here 48 | } 49 | -------------------------------------------------------------------------------- /compatibility_matrix.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.frameworks.displayservice 4 | 1.0 5 | 6 | IDisplayService 7 | default 8 | 9 | 10 | 11 | android.frameworks.schedulerservice 12 | 1.0 13 | 14 | ISchedulingPolicyService 15 | default 16 | 17 | 18 | 19 | android.frameworks.sensorservice 20 | 1.0 21 | 22 | ISensorManager 23 | default 24 | 25 | 26 | 27 | android.hidl.allocator 28 | 1.0 29 | 30 | IAllocator 31 | ashmem 32 | 33 | 34 | 35 | android.hidl.manager 36 | 1.0 37 | 38 | IServiceManager 39 | default 40 | 41 | 42 | 43 | android.hidl.memory 44 | 1.0 45 | 46 | IMapper 47 | ashmem 48 | 49 | 50 | 51 | android.hidl.token 52 | 1.0 53 | 54 | ITokenManager 55 | default 56 | 57 | 58 | 59 | android.system.net.netd 60 | 1.0 61 | 62 | INetd 63 | default 64 | 65 | 66 | 67 | android.system.wifi.keystore 68 | 1.0 69 | 70 | IKeystore 71 | default 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /configs/privapp-permissions-qti.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /configs/telephony_system-ext_privapp-permissions-qti.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 29 | 30 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /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/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/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 vendor_qti_diag 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/location_api/LocationUtil.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2019, 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 V2_0 { 41 | namespace implementation { 42 | 43 | void convertGnssLocation(Location& in, V1_0::GnssLocation& out); 44 | void convertGnssLocation(Location& in, V2_0::GnssLocation& out); 45 | void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); 46 | void convertGnssLocation(const V2_0::GnssLocation& in, Location& out); 47 | void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); 48 | void convertGnssConstellationType(GnssSvType& in, V2_0::GnssConstellationType& out); 49 | void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); 50 | void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); 51 | void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); 52 | 53 | } // namespace implementation 54 | } // namespace V2_0 55 | } // namespace gnss 56 | } // namespace hardware 57 | } // namespace android 58 | #endif // LOCATION_UTIL_H 59 | -------------------------------------------------------------------------------- /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_SANITIZE += $(GNSS_SANITIZE) 6 | # activate the following line for debug purposes only, comment out for production 7 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 8 | LOCAL_VENDOR_MODULE := true 9 | 10 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 11 | 12 | LOCAL_C_INCLUDES += \ 13 | $(LOCAL_PATH) \ 14 | 15 | LOCAL_SRC_FILES:= \ 16 | battery_listener.cpp 17 | LOCAL_SHARED_LIBRARIES := \ 18 | liblog \ 19 | libhidlbase \ 20 | libhidltransport \ 21 | libhwbinder \ 22 | libcutils \ 23 | libutils \ 24 | android.hardware.health@1.0 \ 25 | android.hardware.health@2.0 \ 26 | android.hardware.power@1.2 \ 27 | libbase 28 | 29 | LOCAL_STATIC_LIBRARIES := libhealthhalutils 30 | LOCAL_CFLAGS += -DBATTERY_LISTENER_ENABLED 31 | 32 | include $(BUILD_STATIC_LIBRARY) 33 | 34 | include $(CLEAR_VARS) 35 | LOCAL_MODULE := liblocbatterylistener_headers 36 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 37 | 38 | include $(BUILD_HEADER_LIBRARY) 39 | 40 | 41 | -------------------------------------------------------------------------------- /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_SANITIZE += $(GNSS_SANITIZE) 10 | # activate the following line for debug purposes only, comment out for production 11 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 12 | LOCAL_VENDOR_MODULE := true 13 | LOCAL_MODULE_TAGS := optional 14 | 15 | LOCAL_SHARED_LIBRARIES := \ 16 | libutils \ 17 | libcutils \ 18 | liblog \ 19 | libloc_core \ 20 | libgps.utils \ 21 | libdl 22 | 23 | LOCAL_SRC_FILES += \ 24 | location_batching.cpp \ 25 | BatchingAdapter.cpp 26 | 27 | LOCAL_HEADER_LIBRARIES := \ 28 | libgps.utils_headers \ 29 | libloc_core_headers \ 30 | libloc_pla_headers \ 31 | liblocation_api_headers 32 | 33 | LOCAL_PRELINK_MODULE := false 34 | 35 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 36 | include $(BUILD_SHARED_LIBRARY) 37 | 38 | endif # not BUILD_TINY_ANDROID 39 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 40 | -------------------------------------------------------------------------------- /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 | # GPS-HIDL 6 | GNSS_HIDL_1_0_TARGET_LIST := msm8960 7 | GNSS_HIDL_1_0_TARGET_LIST += msm8974 8 | GNSS_HIDL_1_0_TARGET_LIST += msm8226 9 | GNSS_HIDL_1_0_TARGET_LIST += msm8610 10 | GNSS_HIDL_1_0_TARGET_LIST += apq8084 11 | GNSS_HIDL_1_0_TARGET_LIST += msm8916 12 | GNSS_HIDL_1_0_TARGET_LIST += msm8994 13 | GNSS_HIDL_1_0_TARGET_LIST += msm8909 14 | GNSS_HIDL_1_0_TARGET_LIST += msm8952 15 | GNSS_HIDL_1_0_TARGET_LIST += msm8992 16 | GNSS_HIDL_1_0_TARGET_LIST += msm8996 17 | GNSS_HIDL_2_0_TARGET_LIST := msm8937 18 | GNSS_HIDL_2_0_TARGET_LIST += msm8953 19 | GNSS_HIDL_2_0_TARGET_LIST += msm8998 20 | GNSS_HIDL_2_0_TARGET_LIST += apq8098_latv 21 | GNSS_HIDL_2_0_TARGET_LIST += sdm710 22 | GNSS_HIDL_2_0_TARGET_LIST += qcs605 23 | GNSS_HIDL_2_0_TARGET_LIST += sdm845 24 | GNSS_HIDL_2_0_TARGET_LIST += sdm660 25 | GNSS_HIDL_2_0_TARGET_LIST += msmnile 26 | GNSS_HIDL_2_0_TARGET_LIST += sdmshrike 27 | GNSS_HIDL_2_0_TARGET_LIST += $(MSMSTEPPE) 28 | GNSS_HIDL_2_0_TARGET_LIST += $(TRINKET) 29 | GNSS_HIDL_2_0_TARGET_LIST += kona 30 | GNSS_HIDL_2_0_TARGET_LIST += atoll 31 | GNSS_HIDL_2_0_TARGET_LIST += lito 32 | GNSS_HIDL_2_0_TARGET_LIST += bengal 33 | 34 | ifneq (,$(filter $(GNSS_HIDL_2_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) 35 | GNSS_HIDL_VERSION = 2.0 36 | endif 37 | ifneq (,$(filter $(GNSS_HIDL_1_0_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) 38 | GNSS_HIDL_VERSION = 1.0 39 | endif 40 | ifneq (,$(filter $(GNSS_HIDL_1_1_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) 41 | GNSS_HIDL_VERSION = 1.1 42 | endif 43 | 44 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST := msm8937 45 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8953 46 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8998 47 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += apq8098_latv 48 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm710 49 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += qcs605 50 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm845 51 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm660 52 | 53 | ifneq (,$(filter $(GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) 54 | GNSS_HIDL_LEGACY_MEASURMENTS = true 55 | endif 56 | 57 | # Activate the following two lines for regression testing 58 | #GNSS_SANITIZE := address cfi alignment bounds null unreachable integer 59 | #GNSS_SANITIZE_DIAG := address cfi alignment bounds null unreachable integer 60 | -------------------------------------------------------------------------------- /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 subdir-objects]) 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_SANITIZE += $(GNSS_SANITIZE) 10 | # activate the following line for debug purposes only, comment out for production 11 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 12 | LOCAL_VENDOR_MODULE := true 13 | LOCAL_MODULE_TAGS := optional 14 | 15 | LOCAL_SHARED_LIBRARIES := \ 16 | liblog \ 17 | libutils \ 18 | libcutils \ 19 | libgps.utils \ 20 | libdl \ 21 | liblog 22 | 23 | LOCAL_SRC_FILES += \ 24 | LocApiBase.cpp \ 25 | LocAdapterBase.cpp \ 26 | ContextBase.cpp \ 27 | LocContext.cpp \ 28 | loc_core_log.cpp \ 29 | data-items/DataItemsFactoryProxy.cpp \ 30 | SystemStatusOsObserver.cpp \ 31 | SystemStatus.cpp 32 | 33 | LOCAL_CFLAGS += \ 34 | -fno-short-enums \ 35 | -D_ANDROID_ 36 | 37 | LOCAL_C_INCLUDES:= \ 38 | $(LOCAL_PATH)/data-items \ 39 | $(LOCAL_PATH)/data-items/common \ 40 | $(LOCAL_PATH)/observer \ 41 | 42 | LOCAL_HEADER_LIBRARIES := \ 43 | libutils_headers \ 44 | libgps.utils_headers \ 45 | libloc_pla_headers \ 46 | liblocation_api_headers 47 | 48 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 49 | 50 | include $(BUILD_SHARED_LIBRARY) 51 | 52 | include $(CLEAR_VARS) 53 | LOCAL_MODULE := libloc_core_headers 54 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ 55 | $(LOCAL_PATH) \ 56 | $(LOCAL_PATH)/data-items \ 57 | $(LOCAL_PATH)/data-items/common \ 58 | $(LOCAL_PATH)/observer 59 | include $(BUILD_HEADER_LIBRARY) 60 | 61 | endif # not BUILD_TINY_ANDROID 62 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 63 | -------------------------------------------------------------------------------- /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 | if USE_FEATURE_AUTOMOTIVE 60 | AM_CFLAGS += -DFEATURE_AUTOMOTIVE 61 | endif 62 | 63 | libloc_core_la_LIBADD = -ldl $(GPSUTILS_LIBS) 64 | 65 | #Create and Install libraries 66 | lib_LTLIBRARIES = libloc_core.la 67 | 68 | pkgconfigdir = $(libdir)/pkgconfig 69 | pkgconfig_DATA = loc-core.pc 70 | EXTRA_DIST = $(pkgconfig_DATA) 71 | -------------------------------------------------------------------------------- /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/core/observer/IDataItemObserver.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, 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 __IDATAITEMOBSERVER_H__ 31 | #define __IDATAITEMOBSERVER_H__ 32 | 33 | #include 34 | #include 35 | 36 | using namespace std; 37 | 38 | namespace loc_core 39 | { 40 | class IDataItemCore; 41 | 42 | /** 43 | * @brief IDataItemObserver interface 44 | * @details IDataItemObserver interface; 45 | * In OS dependent code this type serves as a handle to an OS independent instance of this interface. 46 | */ 47 | class IDataItemObserver { 48 | 49 | public: 50 | 51 | /** 52 | * @brief Gets name of Data Item Observer 53 | * @details Gets name of Data Item Observer 54 | * 55 | * @param name reference to name of Data Item Observer 56 | */ 57 | virtual void getName (string & name) = 0; 58 | 59 | /** 60 | * @brief Notify updated values of Data Items 61 | * @details Notifys updated values of Data items 62 | * 63 | * @param dlist List of updated data items 64 | */ 65 | virtual void notify (const std :: list & dlist) = 0; 66 | 67 | /** 68 | * @brief Destructor 69 | * @details Destructor 70 | */ 71 | virtual ~IDataItemObserver () {} 72 | }; 73 | 74 | } // namespace loc_core 75 | 76 | #endif // #ifndef __IDATAITEMOBSERVER_H__ 77 | -------------------------------------------------------------------------------- /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_SANITIZE += $(GNSS_SANITIZE) 10 | # activate the following line for debug purposes only, comment out for production 11 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 12 | LOCAL_VENDOR_MODULE := true 13 | LOCAL_MODULE_TAGS := optional 14 | 15 | LOCAL_SRC_FILES:= \ 16 | GeofenceAdapter.cpp \ 17 | location_geofence.cpp 18 | 19 | LOCAL_SHARED_LIBRARIES := \ 20 | libutils \ 21 | libcutils \ 22 | libgps.utils \ 23 | liblog \ 24 | libloc_core 25 | 26 | LOCAL_HEADER_LIBRARIES := \ 27 | libgps.utils_headers \ 28 | libloc_core_headers \ 29 | libloc_pla_headers \ 30 | liblocation_api_headers 31 | 32 | LOCAL_PRELINK_MODULE := false 33 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 34 | include $(BUILD_SHARED_LIBRARY) 35 | 36 | endif # not BUILD_TINY_ANDROID 37 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 38 | 39 | -------------------------------------------------------------------------------- /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_SANITIZE += $(GNSS_SANITIZE) 10 | # activate the following line for debug purposes only, comment out for production 11 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 12 | LOCAL_VENDOR_MODULE := true 13 | LOCAL_MODULE_TAGS := optional 14 | 15 | LOCAL_SHARED_LIBRARIES := \ 16 | libutils \ 17 | libcutils \ 18 | libdl \ 19 | liblog \ 20 | libloc_core \ 21 | libgps.utils 22 | 23 | LOCAL_SRC_FILES += \ 24 | location_gnss.cpp \ 25 | GnssAdapter.cpp \ 26 | Agps.cpp \ 27 | XtraSystemStatusObserver.cpp 28 | 29 | LOCAL_CFLAGS += \ 30 | -fno-short-enums \ 31 | 32 | ifeq ($(TARGET_BUILD_VARIANT),user) 33 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER 34 | endif 35 | 36 | LOCAL_HEADER_LIBRARIES := \ 37 | libgps.utils_headers \ 38 | libloc_core_headers \ 39 | libloc_pla_headers \ 40 | liblocation_api_headers 41 | 42 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 43 | 44 | LOCAL_PRELINK_MODULE := false 45 | 46 | include $(BUILD_SHARED_LIBRARY) 47 | 48 | endif # not BUILD_TINY_ANDROID 49 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 50 | -------------------------------------------------------------------------------- /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_SANITIZE += $(GNSS_SANITIZE) 10 | # activate the following line for debug purposes only, comment out for production 11 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 12 | LOCAL_VENDOR_MODULE := true 13 | LOCAL_MODULE_TAGS := optional 14 | 15 | LOCAL_SHARED_LIBRARIES := \ 16 | libutils \ 17 | libcutils \ 18 | libgps.utils \ 19 | libdl \ 20 | liblog 21 | 22 | LOCAL_SRC_FILES += \ 23 | LocationAPI.cpp \ 24 | LocationAPIClientBase.cpp 25 | 26 | LOCAL_CFLAGS += \ 27 | -fno-short-enums 28 | 29 | LOCAL_HEADER_LIBRARIES := \ 30 | libloc_pla_headers \ 31 | libgps.utils_headers 32 | 33 | LOCAL_PRELINK_MODULE := false 34 | 35 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 36 | include $(BUILD_SHARED_LIBRARY) 37 | 38 | include $(CLEAR_VARS) 39 | LOCAL_MODULE := liblocation_api_headers 40 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 41 | include $(BUILD_HEADER_LIBRARY) 42 | 43 | endif # not BUILD_TINY_ANDROID 44 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 45 | -------------------------------------------------------------------------------- /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 subdir-objects]) 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_SANITIZE += $(GNSS_SANITIZE) 51 | # activate the following line for debug purposes only, comment out for production 52 | #LOCAL_SANITIZE_DIAG += $(GNSS_SANITIZE_DIAG) 53 | LOCAL_VENDOR_MODULE := true 54 | LOCAL_MODULE_TAGS := optional 55 | 56 | LOCAL_PRELINK_MODULE := false 57 | 58 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 59 | 60 | include $(BUILD_SHARED_LIBRARY) 61 | 62 | include $(CLEAR_VARS) 63 | LOCAL_MODULE := libgps.utils_headers 64 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 65 | include $(BUILD_HEADER_LIBRARY) 66 | 67 | endif # not BUILD_TINY_ANDROID 68 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 69 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /init/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2019-2021,2022 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_static { 8 | name: "libinit_msm8953", 9 | recovery_available: true, 10 | srcs: ["init_msm8953.cpp"], 11 | include_dirs: [ 12 | "system/core/init" 13 | ], 14 | shared_libs: [ 15 | "libbase", 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /keylayout/ft5435_ts.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 158 BACK VIRTUAL 29 | key 139 APP_SWITCH VIRTUAL 30 | key 172 HOME VIRTUAL 31 | key 217 SEARCH VIRTUAL 32 | key 143 WAKEUP 33 | -------------------------------------------------------------------------------- /keylayout/gf3208.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 195 SYSTEM_NAVIGATION_UP 12 | key 196 SYSTEM_NAVIGATION_DOWN 13 | key 197 SYSTEM_NAVIGATION_LEFT 14 | key 198 SYSTEM_NAVIGATION_RIGHT 15 | #key 353 CAMERA 16 | -------------------------------------------------------------------------------- /keylayout/goodix-ts.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 158 BACK VIRTUAL 29 | key 139 APP_SWITCH VIRTUAL 30 | key 172 HOME VIRTUAL 31 | key 217 SEARCH VIRTUAL 32 | key 143 WAKEUP 33 | -------------------------------------------------------------------------------- /keylayout/gpio-keys.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 115 VOLUME_UP 29 | key 114 VOLUME_DOWN 30 | key 102 HOME 31 | key 528 FOCUS 32 | key 766 CAMERA 33 | -------------------------------------------------------------------------------- /keylayout/ist30xx_ts_input.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 158 BACK VIRTUAL 29 | key 139 APP_SWITCH VIRTUAL 30 | key 172 HOME VIRTUAL 31 | key 143 WAKEUP 32 | -------------------------------------------------------------------------------- /keylayout/msm8953-snd-card-mtp_Button_Jack.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 226 HEADSETHOOK 29 | key 257 VOLUME_UP 30 | key 258 VOLUME_DOWN 31 | -------------------------------------------------------------------------------- /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 195 SYSTEM_NAVIGATION_UP 12 | key 196 SYSTEM_NAVIGATION_DOWN 13 | key 197 SYSTEM_NAVIGATION_LEFT 14 | key 198 SYSTEM_NAVIGATION_RIGHT 15 | #key 353 CAMERA 16 | -------------------------------------------------------------------------------- /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 195 SYSTEM_NAVIGATION_UP 12 | key 196 SYSTEM_NAVIGATION_DOWN 13 | key 197 SYSTEM_NAVIGATION_LEFT 14 | key 198 SYSTEM_NAVIGATION_RIGHT 15 | #key 353 CAMERA 16 | -------------------------------------------------------------------------------- /lineage.dependencies: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "repository": "android_hardware_xiaomi", 4 | "target_path": "hardware/xiaomi" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /odm.prop: -------------------------------------------------------------------------------- 1 | # Fwk detect 2 | ro.vendor.qti.va_odm.support=1 3 | -------------------------------------------------------------------------------- /overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 17 | true 18 | true 19 | 20 | 32 | 83 33 | 34 | 48 | 1 49 | 50 | 52 | true 53 | 54 | 59 | 1 60 | 61 | 62 | -------------------------------------------------------------------------------- /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/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | true 25 | 26 | 28 | true 29 | 30 | 31 | -------------------------------------------------------------------------------- /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 | 16 | 17 | 21 | 22 | 24 | 25 | 27 | 1 28 | 29 | 33 | 34 | true 35 | 36 | 37 | false 38 | 39 | 40 | org.codeaurora.ims 41 | 42 | 43 | org.codeaurora.ims 44 | 45 | -------------------------------------------------------------------------------- /parts/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2017-2022 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | android_app { 8 | name: "XiaomiParts", 9 | 10 | srcs: ["src/**/*.java"], 11 | resource_dirs: ["res"], 12 | certificate: "platform", 13 | platform_apis: true, 14 | privileged: true, 15 | system_ext_specific: true, 16 | 17 | static_libs: [ 18 | "org.lineageos.settings.resources", 19 | ], 20 | 21 | optimize: { 22 | proguard_flags_files: ["proguard.flags"], 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /parts/proguard.flags: -------------------------------------------------------------------------------- 1 | -keep class org.lineageos.settings.dirac.* { 2 | *; 3 | } 4 | 5 | -keep class org.lineageos.settings.doze.* { 6 | *; 7 | } 8 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_display.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_hand.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_headphone.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_pickup.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_pocket.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_preset.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /parts/res/xml/dirac_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 25 | 26 | 34 | 35 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /parts/res/xml/doze_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 21 | 22 | 26 | 27 | 34 | 35 | 38 | 39 | 45 | 46 | 47 | 48 | 51 | 52 | 58 | 59 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /parts/src/org/lineageos/settings/BootCompletedReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The CyanogenMod Project 3 | * 2017-2019 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; 19 | 20 | import android.content.BroadcastReceiver; 21 | import android.content.Context; 22 | import android.content.Intent; 23 | import android.util.Log; 24 | 25 | import org.lineageos.settings.dirac.DiracUtils; 26 | import org.lineageos.settings.doze.DozeUtils; 27 | 28 | public class BootCompletedReceiver extends BroadcastReceiver { 29 | 30 | private static final boolean DEBUG = false; 31 | private static final String TAG = "XiaomiParts"; 32 | 33 | @Override 34 | public void onReceive(final Context context, Intent intent) { 35 | if (DozeUtils.isDozeEnabled(context) && DozeUtils.sensorsEnabled(context)) { 36 | if (DEBUG) Log.d(TAG, "Starting Doze service"); 37 | DozeUtils.startService(context); 38 | } 39 | new DiracUtils(context).onBootCompleted(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /parts/src/org/lineageos/settings/dirac/DiracActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018,2021-2022 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.lineageos.settings.dirac; 18 | 19 | import android.os.Bundle; 20 | 21 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; 22 | import com.android.settingslib.widget.R; 23 | 24 | public class DiracActivity extends CollapsingToolbarBaseActivity { 25 | 26 | private static final String TAG_DIRAC = "dirac"; 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | 32 | getFragmentManager().beginTransaction().replace(R.id.content_frame, 33 | new DiracSettingsFragment(), TAG_DIRAC).commit(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /parts/src/org/lineageos/settings/doze/DozeSettingsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2016 The CyanogenMod Project 3 | * 2017,2021-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 | private static final String TAG_DOZE = "doze"; 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | 32 | getFragmentManager().beginTransaction().replace(R.id.content_frame, 33 | new DozeSettingsFragment(), TAG_DOZE).commit(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /product.prop: -------------------------------------------------------------------------------- 1 | # IMS 2 | ro.telephony.block_binder_thread_on_incoming_calls=false 3 | -------------------------------------------------------------------------------- /rootdir/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | # Init scripts 4 | 5 | include $(CLEAR_VARS) 6 | LOCAL_MODULE := fstab.qcom 7 | LOCAL_MODULE_TAGS := optional 8 | LOCAL_MODULE_CLASS := ETC 9 | ifeq ($(AB_OTA_UPDATER), true) 10 | LOCAL_SRC_FILES := etc/fstab_AB.qcom 11 | else 12 | LOCAL_SRC_FILES := etc/fstab.qcom 13 | endif 14 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) 15 | include $(BUILD_PREBUILT) 16 | 17 | ifeq ($(TARGET_KERNEL_VERSION),4.9) 18 | include $(CLEAR_VARS) 19 | LOCAL_MODULE := init.msm.usb.configfs.rc 20 | LOCAL_MODULE_TAGS := optional 21 | LOCAL_MODULE_CLASS := ETC 22 | LOCAL_SRC_FILES := etc/init.msm.usb.configfs.rc 23 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 24 | include $(BUILD_PREBUILT) 25 | endif 26 | 27 | include $(CLEAR_VARS) 28 | LOCAL_MODULE := init.qcom.rc 29 | LOCAL_MODULE_TAGS := optional 30 | LOCAL_MODULE_CLASS := ETC 31 | LOCAL_SRC_FILES := etc/init.qcom.rc 32 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 33 | include $(BUILD_PREBUILT) 34 | 35 | include $(CLEAR_VARS) 36 | LOCAL_MODULE := init.qcom.usb.rc 37 | LOCAL_MODULE_TAGS := optional 38 | LOCAL_MODULE_CLASS := ETC 39 | LOCAL_SRC_FILES := etc/init.qcom.usb.rc 40 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 41 | include $(BUILD_PREBUILT) 42 | 43 | include $(CLEAR_VARS) 44 | LOCAL_MODULE := init.target.rc 45 | LOCAL_MODULE_TAGS := optional 46 | LOCAL_MODULE_CLASS := ETC 47 | LOCAL_SRC_FILES := etc/init.target.rc 48 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 49 | include $(BUILD_PREBUILT) 50 | 51 | include $(CLEAR_VARS) 52 | LOCAL_MODULE := ueventd.qcom.rc 53 | LOCAL_MODULE_STEM := ueventd.rc 54 | LOCAL_MODULE_TAGS := optional 55 | LOCAL_MODULE_CLASS := ETC 56 | LOCAL_SRC_FILES := etc/ueventd.qcom.rc 57 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) 58 | include $(BUILD_PREBUILT) 59 | 60 | # Configuration scripts 61 | 62 | include $(CLEAR_VARS) 63 | LOCAL_MODULE := init.qcom.sh 64 | LOCAL_MODULE_TAGS := optional 65 | LOCAL_MODULE_CLASS := ETC 66 | LOCAL_SRC_FILES := bin/init.qcom.sh 67 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 68 | include $(BUILD_PREBUILT) 69 | 70 | include $(CLEAR_VARS) 71 | LOCAL_MODULE := init.qcom.post_boot.sh 72 | LOCAL_MODULE_TAGS := optional 73 | LOCAL_MODULE_CLASS := ETC 74 | LOCAL_SRC_FILES := bin/init.qcom.post_boot.sh 75 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 76 | include $(BUILD_PREBUILT) 77 | -------------------------------------------------------------------------------- /rootdir/etc/fstab.qcom: -------------------------------------------------------------------------------- 1 | # Android fstab file. 2 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 3 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 4 | 5 | # 6 | /dev/block/bootdevice/by-name/boot /boot emmc defaults defaults 7 | /dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults 8 | 9 | /dev/block/bootdevice/by-name/system /system ext4 ro wait,recoveryonly 10 | /dev/block/bootdevice/by-name/cust /vendor ext4 ro wait,recoveryonly 11 | /dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,discard,fsync_mode=nobarrier wait,check,fileencryption=ice,quota 12 | /dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,noatime,noauto_da_alloc wait,check,fileencryption=ice,quota,formattable 13 | /dev/block/bootdevice/by-name/cache /cache f2fs nosuid,nodev,noatime,inline_xattr,flush_merge,data_flush wait,formattable,check 14 | /dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime wait,formattable,check 15 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 nosuid,nodev,noatime wait,check 16 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev wait 17 | /dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,context=u:object_r:firmware_file:s0,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 wait 18 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults 19 | /dev/block/bootdevice/by-name/config /frp emmc defaults defaults 20 | 21 | # msm-3.18 22 | /devices/soc/7864900.sdhci/mmc_host* auto auto defaults wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=userdata 23 | /devices/soc/7000000.ssusb/7000000.dwc3/xhci-hcd.0.auto* auto auto defaults wait,voldmanaged=usb:auto 24 | 25 | # msm-4.9 26 | /devices/platform/soc/7864900.sdhci/mmc_host* auto auto defaults wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=userdata 27 | /devices/platform/soc/7000000.ssusb/7000000.dwc3/xhci-hcd.0.auto* auto auto defaults wait,voldmanaged=usb:auto 28 | -------------------------------------------------------------------------------- /rootdir/etc/fstab_AB.qcom: -------------------------------------------------------------------------------- 1 | # Android fstab file. 2 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 3 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 4 | 5 | # 6 | /dev/block/bootdevice/by-name/system / ext4 ro,barrier=1,discard wait,slotselect 7 | /dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,discard,fsync_mode=nobarrier wait,check,fileencryption=ice,quota 8 | /dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,noatime,noauto_da_alloc wait,check,fileencryption=ice,quota,formattable 9 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 nosuid,nodev,noatime wait,check 10 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev wait 11 | /dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect 12 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults 13 | /dev/block/bootdevice/by-name/config /frp emmc defaults defaults 14 | 15 | # msm-3.18 16 | /devices/soc/7864900.sdhci/mmc_host* auto auto defaults wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=userdata 17 | /devices/soc/7000000.ssusb/7000000.dwc3/xhci-hcd.0.auto* auto auto defaults wait,voldmanaged=usb:auto 18 | 19 | # msm-4.9 20 | /devices/platform/soc/7864900.sdhci/mmc_host* auto auto defaults wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=userdata 21 | /devices/platform/soc/7000000.ssusb/7000000.dwc3/xhci-hcd.0.auto* auto auto defaults wait,voldmanaged=usb:auto 22 | -------------------------------------------------------------------------------- /rro_overlays/TetheringOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "TetheringConfigOverlay", 3 | theme: "TetheringConfigOverlay", 4 | sdk_version: "current", 5 | product_specific: true 6 | } 7 | -------------------------------------------------------------------------------- /rro_overlays/TetheringOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /rro_overlays/TetheringOverlay/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 192.168.42.2 25 | 192.168.42.254 26 | 192.168.43.2 27 | 192.168.43.254 28 | 192.168.44.2 29 | 192.168.44.254 30 | 192.168.45.2 31 | 192.168.45.254 32 | 192.168.46.2 33 | 192.168.46.254 34 | 192.168.47.2 35 | 192.168.47.254 36 | 192.168.48.2 37 | 192.168.48.254 38 | 192.168.49.2 39 | 192.168.49.254 40 | 192.168.50.2 41 | 192.168.50.254 42 | 192.168.51.2 43 | 192.168.51.254 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /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 | 13 | 14 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | true 22 | 23 | 24 | true 25 | 26 | 27 | true 28 | 29 | 31 | 524288,2097152,4194304,262144,524288,1048576 32 | 33 | 34 | true 35 | 36 | 37 | true 38 | 39 | 40 | 32 41 | 42 | 43 | false 44 | 45 | 46 | true 47 | 48 | 49 | true 50 | 51 | -------------------------------------------------------------------------------- /sepolicy/vendor/device.te: -------------------------------------------------------------------------------- 1 | type lirc_device, dev_type; 2 | type gx_fpd_device, dev_type; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/file.te: -------------------------------------------------------------------------------- 1 | # Boot reason 2 | type proc_boot_reason, fs_type, proc_type; 3 | 4 | # Camera 5 | type camera_socket, file_type, data_file_type; 6 | 7 | # Fingerprint 8 | type fpc_data_file, file_type, core_data_file_type, data_file_type; 9 | type fpce_socket, file_type; 10 | type fpc_sysfs, fs_type, sysfs_type; 11 | type gx_fpd_data_file, file_type, core_data_file_type, data_file_type; 12 | 13 | # Rild 14 | type rild_file, file_type, vendor_file_type; 15 | 16 | # Rmt 17 | type debugfs_rmt, debugfs_type, fs_type; 18 | 19 | # Touchscreen 20 | type proc_touchpanel, fs_type, sysfs_type, proc_type; 21 | 22 | -------------------------------------------------------------------------------- /sepolicy/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | # Boot reason 2 | genfscon proc /sys/kernel/boot_reason u:object_r:proc_boot_reason:s0 3 | 4 | # Leds 5 | genfscon sysfs /devices/platform/soc/200f000.qcom,spmi/spmi-0/spmi0-00/200f000.qcom,spmi:qcom,pm8953@0:qcom,leds@a100 u:object_r:sysfs_leds:s0 6 | genfscon sysfs /devices/platform/soc/78b6000.i2c/i2c-2/2-0045/leds/ u:object_r:sysfs_leds:s0 7 | 8 | # Power 9 | genfscon sysfs /devices/soc/soc:qcom,bcl/power_supply u:object_r:sysfs_batteryinfo:s0 10 | genfscon sysfs /devices/soc/msm-bcl-21/power_supply u:object_r:sysfs_batteryinfo:s0 11 | genfscon sysfs /devices/soc/qpnp-typec-9/power_supply u:object_r:sysfs_batteryinfo:s0 12 | genfscon sysfs /devices/platform/soc/200f000.qcom,spmi/spmi-0/spmi0-02/200f000.qcom,spmi:qcom,pmi8950@2:vadc@3100 u:object_r:sysfs_battery_supply:s0 13 | 14 | # Rmt 15 | genfscon debugfs /rmt_storage u:object_r:debugfs_rmt:s0 16 | 17 | # Touchscreen 18 | genfscon proc /touchpanel u:object_r:proc_touchpanel:s0 19 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | # Dirac 2 | get_prop(hal_audio_default, dirac_prop) 3 | set_prop(hal_audio_default, dirac_prop) 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bluetooth_default.te: -------------------------------------------------------------------------------- 1 | typeattribute hal_bluetooth_default data_between_core_and_vendor_violators; 2 | 3 | allow hal_bluetooth_default bluetooth_data_file:dir search; 4 | allow hal_bluetooth_default bluetooth_data_file:file r_file_perms; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | allow hal_camera_default camera_data_file:sock_file write; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_cas_default.te: -------------------------------------------------------------------------------- 1 | vndbinder_use(hal_cas_default); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint_default.te: -------------------------------------------------------------------------------- 1 | typeattribute hal_fingerprint_default data_between_core_and_vendor_violators; 2 | 3 | type_transition hal_fingerprint_default system_data_file:{ dir file } gx_fpd_data_file; 4 | 5 | add_service(hal_fingerprint_default, goodix_fingerprint_vndservice); 6 | binder_use(hal_fingerprint_default); 7 | r_dir_file(hal_fingerprint_default, firmware_file); 8 | set_prop(hal_fingerprint_default, vendor_fp_prop) 9 | vndbinder_use(hal_fingerprint_default); 10 | 11 | allow hal_fingerprint_default gx_fpd_device:chr_file rw_file_perms; 12 | allow hal_fingerprint_default fpc_sysfs:dir r_dir_perms; 13 | allow hal_fingerprint_default fpc_sysfs:file rw_file_perms; 14 | allow hal_fingerprint_default fingerprintd_data_file:file create_file_perms; 15 | allow hal_fingerprint_default fingerprintd_data_file:dir rw_dir_perms; 16 | allow hal_fingerprint_default fpc_data_file:dir rw_dir_perms; 17 | allow hal_fingerprint_default tee_device:chr_file rw_file_perms; 18 | allow hal_fingerprint_default property_socket:sock_file write; 19 | allow hal_fingerprint_default init:unix_stream_socket connectto; 20 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl; 21 | allow hal_fingerprint_default vndbinder_device:chr_file rw_file_perms; 22 | allow hal_fingerprint_default uhid_device:chr_file rw_file_perms; 23 | 24 | allow hal_fingerprint_default gx_fpd_data_file:dir create_dir_perms; 25 | allow hal_fingerprint_default system_data_file:dir create_dir_perms; 26 | allow hal_fingerprint_default gx_fpd_data_file:file create_file_perms; 27 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_ir_default.te: -------------------------------------------------------------------------------- 1 | allow hal_ir_default lirc_device:chr_file rw_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_lineage_touch_default.te: -------------------------------------------------------------------------------- 1 | allow hal_lineage_touch_default proc_touchpanel:dir search; 2 | allow hal_lineage_touch_default proc_touchpanel:file rw_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | # Allow writing to files in /proc/touchpanel 2 | allow hal_power_default proc_touchpanel:dir search; 3 | allow hal_power_default proc_touchpanel:file rw_file_perms; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | vendor.goodix.hardware.fingerprint::IGoodixBiometricsFingerprint u:object_r:hal_fingerprint_hwservice:s0 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/init.te: -------------------------------------------------------------------------------- 1 | allow init proc_boot_reason:file r_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/init_fingerprint.te: -------------------------------------------------------------------------------- 1 | type init_fingerprint, domain; 2 | type init_fingerprint_exec, exec_type, vendor_file_type, file_type; 3 | typeattribute init_fingerprint data_between_core_and_vendor_violators; 4 | 5 | # Allow for transition from init domain to init_fingerprint 6 | init_daemon_domain(init_fingerprint) 7 | 8 | # Shell script needs to execute /vendor/bin/sh 9 | allow init_fingerprint vendor_shell_exec:file rx_file_perms; 10 | allow init_fingerprint vendor_toolbox_exec:file rx_file_perms; 11 | 12 | # Allow to delete file 13 | allow init_fingerprint mnt_vendor_file:dir search; 14 | allow init_fingerprint persist_drm_file:dir { read search open write remove_name }; 15 | allow init_fingerprint persist_drm_file:file { getattr unlink }; 16 | allow init_fingerprint system_data_file:file r_file_perms; 17 | -------------------------------------------------------------------------------- /sepolicy/vendor/kernel.te: -------------------------------------------------------------------------------- 1 | allow kernel kernel:capability { kill }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/mm-qcamerad.te: -------------------------------------------------------------------------------- 1 | typeattribute mm-qcamerad data_between_core_and_vendor_violators; 2 | 3 | type_transition mm-qcamerad camera_data_file:sock_file camera_socket "cam_socket1"; 4 | type_transition mm-qcamerad camera_data_file:sock_file camera_socket "cam_socket2"; 5 | allow mm-qcamerad camera_socket:dir w_dir_perms; 6 | allow mm-qcamerad camera_socket:sock_file { create unlink write }; 7 | allow mm-qcamerad sysfs_graphics:file r_file_perms; 8 | allow mm-qcamerad camera_data_file:file create_file_perms; 9 | allow mm-qcamerad camera_data_file:dir w_dir_perms; 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/netmgrd.te: -------------------------------------------------------------------------------- 1 | set_prop(netmgrd, vendor_xlat_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | # Dirac 2 | system_public_prop(dirac_prop) 3 | 4 | # Fingerprint 5 | system_public_prop(vendor_fp_prop) 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | sys.listeners.registered u:object_r:vendor_tee_listener_prop:s0 2 | sys.post_boot.parsed u:object_r:vendor_mpctl_prop:s0 3 | persist.net.doxlat u:object_r:vendor_xlat_prop:s0 4 | camera.dual.mode u:object_r:camera_prop:s0 5 | persist.camera. u:object_r:camera_prop:s0 6 | ctl.vendor.imsrcsd u:object_r:vendor_ctl_vendor_imsrcsservice_prop:s0 7 | sys.fp.goodix u:object_r:vendor_fp_prop:s0 8 | sys.fp.vendor u:object_r:vendor_fp_prop:s0 9 | 10 | # Dirac 11 | persist.audio.dirac. u:object_r:dirac_prop:s0 12 | -------------------------------------------------------------------------------- /sepolicy/vendor/qti_init_shell.te: -------------------------------------------------------------------------------- 1 | typeattribute qti_init_shell data_between_core_and_vendor_violators; 2 | 3 | allow qti_init_shell proc_touchpanel:dir { r_dir_perms setattr }; 4 | allow qti_init_shell proc_touchpanel:file { getattr setattr }; 5 | allow qti_init_shell bluetooth_data_file:file r_file_perms; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/radio.te: -------------------------------------------------------------------------------- 1 | binder_call(radio, cnd) 2 | allow radio hal_datafactory_hwservice:hwservice_manager find; 3 | allow radio hal_iwlan_hwservice:hwservice_manager find; 4 | 5 | get_prop(radio, vendor_qcom_ims_prop) 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/rild.te: -------------------------------------------------------------------------------- 1 | allow rild rild_file:file r_file_perms; 2 | allow rild qtidataservices_app:binder call; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/rmt_storage.te: -------------------------------------------------------------------------------- 1 | # debugfs access 2 | userdebug_or_eng(` 3 | allow rmt_storage debugfs_rmt:dir search; 4 | allow rmt_storage debugfs_rmt:file rw_file_perms; 5 | ') 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app fm_radio_device:chr_file r_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_server.te: -------------------------------------------------------------------------------- 1 | # Input devices 2 | r_dir_file(system_server, vendor_idc_file); 3 | r_dir_file(system_server, vendor_keylayout_file); 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | typeattribute tee data_between_core_and_vendor_violators; 2 | 3 | # /data/goodix labeling 4 | type_transition tee system_data_file:{ dir file } gx_fpd_data_file; 5 | 6 | allow tee gx_fpd_data_file:dir create_dir_perms; 7 | allow tee gx_fpd_data_file:file create_file_perms; 8 | allow tee system_data_file:dir create_dir_perms; 9 | 10 | allow tee fingerprintd_data_file:dir rw_dir_perms; 11 | allow tee fingerprintd_data_file:file create_file_perms; 12 | -------------------------------------------------------------------------------- /sepolicy/vendor/ueventd.te: -------------------------------------------------------------------------------- 1 | typeattribute ueventd data_between_core_and_vendor_violators; 2 | 3 | allow ueventd fpc_sysfs:file rw_file_perms; 4 | allow ueventd wifi_vendor_data_file:dir r_dir_perms; 5 | allow ueventd wifi_vendor_data_file:file r_file_perms; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | typeattribute vendor_init data_between_core_and_vendor_violators; 2 | 3 | allow vendor_init { 4 | bluetooth_data_file 5 | camera_data_file 6 | media_rw_data_file 7 | nfc_data_file 8 | system_data_file 9 | wifi_data_file 10 | wpa_socket 11 | }:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom }; 12 | -------------------------------------------------------------------------------- /sepolicy/vendor/vndservice.te: -------------------------------------------------------------------------------- 1 | type goodix_fingerprint_vndservice, vndservice_manager_type; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vndservice_contexts: -------------------------------------------------------------------------------- 1 | android.hardware.fingerprint.IGoodixFingerprintDaemon u:object_r:goodix_fingerprint_vndservice:s0 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vold.te: -------------------------------------------------------------------------------- 1 | allow vold proc_touchpanel:dir r_dir_perms; 2 | -------------------------------------------------------------------------------- /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 "daisy mido sakura tissot vince ysl" 29 | 30 | # The standard common blobs 31 | write_makefiles "${MY_DIR}/proprietary-files.txt" true 32 | 33 | # Finish 34 | write_footers 35 | 36 | if [ -s "${MY_DIR}/../${DEVICE}/proprietary-files.txt" ]; then 37 | # Reinitialize the helper for device 38 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false 39 | 40 | # Warning headers and guards 41 | write_headers 42 | 43 | # The standard device blobs 44 | write_makefiles "${MY_DIR}/../${DEVICE}/proprietary-files.txt" true 45 | 46 | # Finish 47 | write_footers 48 | fi 49 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | # Fwk detect 2 | ro.vendor.qti.va_aosp.support=1 3 | -------------------------------------------------------------------------------- /system_ext.prop: -------------------------------------------------------------------------------- 1 | # DPM 2 | persist.vendor.dpm.feature=1 3 | persist.vendor.dpm.loglevel=0 4 | -------------------------------------------------------------------------------- /touch/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2019-2021 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_binary { 8 | name: "vendor.lineage.touch@1.0-service.xiaomi_8953", 9 | init_rc: ["vendor.lineage.touch@1.0-service.xiaomi_8953.rc"], 10 | defaults: ["hidl_defaults"], 11 | vintf_fragments: ["vendor.lineage.touch@1.0-service.xiaomi_8953.xml"], 12 | relative_install_path: "hw", 13 | vendor: true, 14 | srcs: [ 15 | "KeyDisabler.cpp", 16 | "service.cpp" 17 | ], 18 | shared_libs: [ 19 | "libbase", 20 | "libhidlbase", 21 | "libutils", 22 | "vendor.lineage.touch@1.0", 23 | ], 24 | } 25 | -------------------------------------------------------------------------------- /touch/KeyDisabler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include "KeyDisabler.h" 22 | 23 | namespace vendor { 24 | namespace lineage { 25 | namespace touch { 26 | namespace V1_0 { 27 | namespace implementation { 28 | 29 | constexpr const char kControlPath[] = "/proc/touchpanel/capacitive_keys_disable"; 30 | 31 | KeyDisabler::KeyDisabler() { 32 | mHasKeyDisabler = !access(kControlPath, F_OK); 33 | } 34 | 35 | // Methods from ::vendor::lineage::touch::V1_0::IKeyDisabler follow. 36 | Return KeyDisabler::isEnabled() { 37 | std::string buf; 38 | 39 | if (!mHasKeyDisabler) return false; 40 | 41 | if (!android::base::ReadFileToString(kControlPath, &buf, true)) { 42 | LOG(ERROR) << "Failed to read " << kControlPath; 43 | return false; 44 | } 45 | 46 | return std::stoi(android::base::Trim(buf)) == 1; 47 | } 48 | 49 | Return KeyDisabler::setEnabled(bool enabled) { 50 | if (!mHasKeyDisabler) return false; 51 | 52 | if (!android::base::WriteStringToFile((enabled ? "1" : "0"), kControlPath, true)) { 53 | LOG(ERROR) << "Failed to write " << kControlPath; 54 | return false; 55 | } 56 | 57 | return true; 58 | } 59 | 60 | } // namespace implementation 61 | } // namespace V1_0 62 | } // namespace touch 63 | } // namespace lineage 64 | } // namespace vendor 65 | -------------------------------------------------------------------------------- /touch/KeyDisabler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef VENDOR_LINEAGE_TOUCH_V1_0_KEYDISABLER_H 18 | #define VENDOR_LINEAGE_TOUCH_V1_0_KEYDISABLER_H 19 | 20 | #include 21 | 22 | namespace vendor { 23 | namespace lineage { 24 | namespace touch { 25 | namespace V1_0 { 26 | namespace implementation { 27 | 28 | using ::android::hardware::Return; 29 | 30 | class KeyDisabler : public IKeyDisabler { 31 | public: 32 | KeyDisabler(); 33 | 34 | // Methods from ::vendor::lineage::touch::V1_0::IKeyDisabler follow. 35 | Return isEnabled() override; 36 | Return setEnabled(bool enabled) override; 37 | 38 | private: 39 | bool mHasKeyDisabler; 40 | }; 41 | 42 | } // namespace implementation 43 | } // namespace V1_0 44 | } // namespace touch 45 | } // namespace lineage 46 | } // namespace vendor 47 | 48 | #endif // VENDOR_LINEAGE_TOUCH_V1_0_KEYDISABLER_H 49 | -------------------------------------------------------------------------------- /touch/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #define LOG_TAG "vendor.lineage.touch@1.0-service.xiaomi_8953" 18 | 19 | #include 20 | #include 21 | 22 | #include "KeyDisabler.h" 23 | 24 | using android::OK; 25 | using android::sp; 26 | using android::status_t; 27 | using android::hardware::configureRpcThreadpool; 28 | using android::hardware::joinRpcThreadpool; 29 | 30 | using ::vendor::lineage::touch::V1_0::IKeyDisabler; 31 | using ::vendor::lineage::touch::V1_0::implementation::KeyDisabler; 32 | 33 | int main() { 34 | sp keyDisabler; 35 | status_t status; 36 | 37 | LOG(INFO) << "Touch HAL service is starting."; 38 | 39 | keyDisabler = new KeyDisabler(); 40 | if (keyDisabler == nullptr) { 41 | LOG(ERROR) << "Can not create an instance of Touch HAL KeyDisabler Iface, exiting."; 42 | goto shutdown; 43 | } 44 | 45 | configureRpcThreadpool(1, true /*callerWillJoin*/); 46 | 47 | status = keyDisabler->registerAsService(); 48 | if (status != OK) { 49 | LOG(ERROR) << "Could not register service for Touch HAL KeyDisabler Iface (" 50 | << status << ")"; 51 | goto shutdown; 52 | } 53 | 54 | LOG(INFO) << "Touch HAL service is ready."; 55 | joinRpcThreadpool(); 56 | // Should not pass this line 57 | 58 | shutdown: 59 | // In normal operation, we don't expect the thread pool to shutdown 60 | LOG(ERROR) << "Touch HAL service is shutting down."; 61 | return 1; 62 | } 63 | -------------------------------------------------------------------------------- /touch/vendor.lineage.touch@1.0-service.xiaomi_8953.rc: -------------------------------------------------------------------------------- 1 | service vendor.touch-hal-1-0-xiaomi_8953 /vendor/bin/hw/vendor.lineage.touch@1.0-service.xiaomi_8953 2 | class hal 3 | user system 4 | group system 5 | -------------------------------------------------------------------------------- /touch/vendor.lineage.touch@1.0-service.xiaomi_8953.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | vendor.lineage.touch 4 | hwbinder 5 | 1.0 6 | 7 | IKeyDisabler 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /update-sha1sums.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2018 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 | from hashlib import sha1 20 | import sys 21 | 22 | device='msm8953-common' 23 | vendor='xiaomi' 24 | 25 | lines = [ line for line in open('proprietary-files.txt', 'r') ] 26 | vendorPath = '../../../vendor/' + vendor + '/' + device + '/proprietary' 27 | needSHA1 = False 28 | 29 | def cleanup(): 30 | for index, line in enumerate(lines): 31 | # Remove '\n' character 32 | line = line[:-1] 33 | 34 | # Skip empty or commented lines 35 | if len(line) == 0 or line[0] == '#': 36 | continue 37 | 38 | # Drop SHA1 hash, if existing 39 | if '|' in line: 40 | line = line.split('|')[0] 41 | lines[index] = '%s\n' % (line) 42 | 43 | def update(): 44 | for index, line in enumerate(lines): 45 | # Remove '\n' character 46 | line = line[:-1] 47 | 48 | # Skip empty lines 49 | if len(line) == 0: 50 | continue 51 | 52 | # Check if we need to set SHA1 hash for the next files 53 | if line[0] == '#': 54 | needSHA1 = (' - from' in line) 55 | continue 56 | 57 | if needSHA1: 58 | # Remove existing SHA1 hash 59 | line = line.split('|')[0] 60 | filePath = line.split(':')[1] if len(line.split(':')) == 2 else line 61 | 62 | if filePath[0] == '-': 63 | file = open('%s/%s' % (vendorPath, filePath[1:]), 'rb').read() 64 | else: 65 | file = open('%s/%s' % (vendorPath, filePath), 'rb').read() 66 | 67 | hash = sha1(file).hexdigest() 68 | lines[index] = '%s|%s\n' % (line, hash) 69 | 70 | if len(sys.argv) == 2 and sys.argv[1] == '-c': 71 | cleanup() 72 | else: 73 | update() 74 | 75 | with open('proprietary-files.txt', 'w') as file: 76 | for line in lines: 77 | file.write(line) 78 | 79 | file.close() 80 | -------------------------------------------------------------------------------- /wifi/WCNSS_cfg.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LineageOS/android_device_xiaomi_msm8953-common/5767b85b14a1ee51ff0b43640e08971e3489acac/wifi/WCNSS_cfg.dat -------------------------------------------------------------------------------- /wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_no_group_iface=1 3 | persistent_reconnect=1 4 | -------------------------------------------------------------------------------- /wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_disabled=1 3 | tdls_external_control=1 4 | wowlan_triggers=magic_pkt 5 | driver_param=use_p2p_group_interface=1 6 | --------------------------------------------------------------------------------