├── .clang-format ├── Android.bp ├── Android.mk ├── AndroidProducts.mk ├── BoardConfig.mk ├── README.md ├── audio ├── audio_effects.xml ├── audio_output_policy.conf ├── audio_platform_info.xml ├── audio_policy_configuration.xml ├── listen_platform_info.xml ├── mixer_paths_tasha.xml ├── sound_trigger_mixer_paths.xml ├── sound_trigger_mixer_paths_wcd9330.xml └── sound_trigger_platform_info.xml ├── bluetooth └── bdroid_buildcfg.h ├── board-info.txt ├── config.fs ├── configs ├── compatibility_matrix.xml ├── framework_manifest.xml ├── manifest.xml ├── media_codecs.xml ├── media_codecs_performance.xml ├── media_profiles_V1_0.xml ├── nfc │ ├── libnfc-mtp_default.conf │ ├── libnfc-nci.conf │ └── libnfc-nxp_RF.conf ├── powerhint.xml ├── privapp-permissions-qti.xml ├── public.libraries.txt ├── qti_whitelist.xml ├── sec_config ├── thermal-engine-vr.conf └── thermal-engine.conf ├── device.mk ├── display ├── Android.mk ├── FOSSConfig.xml ├── qdcm_calib_data_samsung_s6e3fa3_1080p_cmd_mode_dsi_panel.xml └── qdcm_calib_data_samsung_s6e3fa5_1080p_cmd_mode_dsi_panel.xml ├── doze ├── Android.mk ├── AndroidManifest.xml ├── proguard.flags ├── res │ ├── color │ │ └── switch_bar_bg.xml │ ├── drawable │ │ ├── ic_hand.xml │ │ ├── ic_pickup.xml │ │ ├── ic_pocket.xml │ │ └── switchbar_background.xml │ ├── layout │ │ ├── doze.xml │ │ └── switch_bar.xml │ ├── values-night │ │ └── colors.xml │ ├── values │ │ ├── colors.xml │ │ └── styles.xml │ └── xml │ │ └── doze_settings.xml └── src │ └── org │ └── lineageos │ └── settings │ └── doze │ ├── BootCompletedReceiver.java │ ├── DozeService.java │ ├── DozeSettingsActivity.java │ ├── DozeSettingsFragment.java │ ├── PickupSensor.java │ ├── PocketSensor.java │ └── Utils.java ├── extract-files.sh ├── gps ├── Android.mk ├── CleanSpec.mk ├── Makefile.am ├── android │ ├── 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 │ ├── location_api │ │ ├── BatchingAPIClient.cpp │ │ ├── BatchingAPIClient.h │ │ ├── GeofenceAPIClient.cpp │ │ ├── GeofenceAPIClient.h │ │ ├── GnssAPIClient.cpp │ │ ├── GnssAPIClient.h │ │ ├── LocationUtil.cpp │ │ ├── LocationUtil.h │ │ ├── MeasurementAPIClient.cpp │ │ └── MeasurementAPIClient.h │ └── service.cpp ├── build │ └── target_specific_features.mk ├── configure.ac ├── core │ ├── Android.mk │ ├── ContextBase.cpp │ ├── ContextBase.h │ ├── LBSProxyBase.h │ ├── LocAdapterBase.cpp │ ├── LocAdapterBase.h │ ├── LocAdapterProxyBase.h │ ├── LocApiBase.cpp │ ├── LocApiBase.h │ ├── LocDualContext.cpp │ ├── LocDualContext.h │ ├── Makefile.am │ ├── SystemStatus.cpp │ ├── SystemStatus.h │ ├── SystemStatusOsObserver.cpp │ ├── SystemStatusOsObserver.h │ ├── UlpProxyBase.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 ├── gnss │ ├── Agps.cpp │ ├── Agps.h │ ├── Android.mk │ ├── GnssAdapter.cpp │ ├── GnssAdapter.h │ ├── Makefile.am │ ├── XtraSystemStatusObserver.cpp │ ├── XtraSystemStatusObserver.h │ └── location_gnss.cpp ├── gnsspps │ ├── Android.mk │ ├── Makefile.am │ ├── configure.ac │ ├── gnsspps.c │ ├── gnsspps.h │ ├── gnsspps.pc.in │ └── timepps.h ├── loc-hal.pc.in ├── location │ ├── Android.mk │ ├── LocationAPI.cpp │ ├── LocationAPI.h │ ├── LocationAPIClientBase.cpp │ ├── LocationAPIClientBase.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_oneplus3.cpp ├── keylayout ├── fpc1020.kl └── synaptics.kl ├── libhidl └── Android.mk ├── liblight ├── Android.mk ├── NOTICE └── lights.c ├── libshims ├── Android.mk ├── GraphicBuffer.cpp ├── jstring.h ├── strdup16to8.cpp └── strdup8to16.cpp ├── lineage.dependencies ├── lineage_oneplus3.mk ├── lineagehw ├── livedisplay │ ├── AdaptiveBacklight.cpp │ ├── AdaptiveBacklight.h │ ├── Android.bp │ ├── MixedDisplayModes.cpp │ ├── MixedDisplayModes.h │ ├── service.cpp │ └── vendor.lineage.livedisplay@2.0-service.oneplus3.rc └── touch │ ├── Android.bp │ ├── KeyDisabler.cpp │ ├── KeyDisabler.h │ ├── KeySwapper.cpp │ ├── KeySwapper.h │ ├── TouchscreenGesture.cpp │ ├── TouchscreenGesture.h │ ├── service.cpp │ ├── vendor.lineage.touch@1.0-service.oneplus3.rc │ └── vendor.lineage.touch@1.0-service.oneplus3.xml ├── org.ifaa.android.manager ├── Android.bp └── src │ ├── com │ └── android │ │ └── internal │ │ └── app │ │ └── IIFAAService.aidl │ └── org │ └── ifaa │ └── android │ └── manager │ ├── IFAAManager.java │ ├── IFAAManagerFactory.java │ ├── IFAAManagerV2.java │ └── IFAAManagerV3.java ├── overlay-lineage ├── lineage-sdk │ └── lineage │ │ └── res │ │ └── res │ │ └── values │ │ └── config.xml └── packages │ └── apps │ ├── Dialer │ └── java │ │ └── com │ │ └── android │ │ └── dialer │ │ └── callrecord │ │ └── res │ │ └── values │ │ └── config.xml │ ├── LineageParts │ └── res │ │ └── values │ │ └── config.xml │ ├── Settings │ └── res │ │ └── values │ │ ├── arrays.xml │ │ ├── config.xml │ │ └── dimens.xml │ └── Snap │ └── res │ └── values │ ├── cm_strings.xml │ ├── config.xml │ └── qcomstrings.xml ├── overlay ├── frameworks │ ├── base │ │ ├── core │ │ │ └── res │ │ │ │ └── res │ │ │ │ ├── values-mcc234-mnc15-en-rGB │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc234-mnc15-en-rIN │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc234-mnc15 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc262-mnc02-en-rGB │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc262-mnc02-en-rIN │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc262-mnc02 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc262-mnc04-en-rGB │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc262-mnc04-en-rIN │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc262-mnc04 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc262-mnc09-en-rGB │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc262-mnc09-en-rIN │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc262-mnc09 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc310-mnc004 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc310-mnc120 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc310-mnc260 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc310-mnc410 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc311-mnc480 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc312-mnc530 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc313-mnc100 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc460-mnc03 │ │ │ │ └── config.xml │ │ │ │ ├── values-mcc460-mnc11 │ │ │ │ └── config.xml │ │ │ │ ├── values │ │ │ │ └── config.xml │ │ │ │ └── xml │ │ │ │ ├── power_profile.xml │ │ │ │ └── power_profile_3t.xml │ │ └── packages │ │ │ ├── SettingsProvider │ │ │ └── res │ │ │ │ └── values │ │ │ │ └── defaults.xml │ │ │ └── SystemUI │ │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ └── opt │ │ └── net │ │ └── wifi │ │ └── service │ │ └── res │ │ └── values │ │ └── config.xml └── packages │ ├── apps │ ├── Bluetooth │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ ├── CarrierConfig │ │ └── res │ │ │ └── xml │ │ │ └── vendor.xml │ ├── CellBroadcastReceiver │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ └── Mms │ │ └── res │ │ └── values │ │ └── config.xml │ └── services │ ├── Telecomm │ └── res │ │ └── values │ │ └── config.xml │ └── Telephony │ └── res │ └── values │ └── config.xml ├── pocketmode ├── Android.mk ├── AndroidManifest.xml ├── proguard.flags └── src │ └── org │ └── lineageos │ └── pocketmode │ ├── BootCompletedReceiver.java │ ├── PocketModeService.java │ └── PocketSensor.java ├── proprietary-files.txt ├── recovery ├── Android.mk ├── recovery.fstab └── recovery_updater.cpp ├── releasetools.py ├── rootdir ├── Android.mk └── etc │ ├── fstab.qcom │ ├── init.class_main.sh │ ├── init.oneplus3.rc │ ├── init.qcom.early_boot.sh │ ├── init.qcom.post_boot.sh │ ├── init.qcom.rc │ ├── init.qcom.sensors.sh │ ├── init.qcom.sh │ ├── init.qcom.usb.rc │ ├── init.qcom.usb.sh │ ├── init.qti.ims.sh │ ├── init.recovery.qcom.rc │ ├── init.target.rc │ └── ueventd.qcom.rc ├── rro_overlays └── TetheringOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ └── values │ └── config.xml ├── seccomp ├── mediacodec-seccomp.policy └── mediaextractor-seccomp.policy ├── sepolicy ├── adsprpcd.te ├── bootanim.te ├── dashd.te ├── dataservice_app.te ├── device.te ├── domain.te ├── file.te ├── file_contexts ├── genfs_contexts ├── hal_bluetooth_qti.te ├── hal_camera_default.te ├── hal_fingerprint_default.te ├── hal_ifaa.te ├── hal_lineage_livedisplay_qti.te ├── hal_lineage_touch_default.te ├── hal_nfc_default.te ├── hal_param.te ├── hal_perf_default.te ├── hal_power_default.te ├── hal_vr.te ├── hal_wifi_default.te ├── hwservice.te ├── hwservice_contexts ├── mm-qcamerad.te ├── platform_app.te ├── property.te ├── property_contexts ├── public │ └── attributes ├── radio.te ├── remosaic_daemon.te ├── rild.te ├── seapp_contexts ├── service.te ├── service_contexts ├── system_app.te ├── system_server.te ├── tee.te ├── thermal-engine.te ├── uncrypt.te ├── vendor_init.te └── vold.te ├── setup-makefiles.sh ├── system.prop ├── thermal ├── Android.mk └── thermal.c ├── vr ├── Android.mk └── vr.c └── wifi ├── WCNSS_qcom_cfg.ini ├── move_wifi_data.sh ├── p2p_supplicant_overlay.conf └── wpa_supplicant_overlay.conf /.clang-format: -------------------------------------------------------------------------------- 1 | ../../../build/soong/scripts/system-clang-format -------------------------------------------------------------------------------- /Android.bp: -------------------------------------------------------------------------------- 1 | soong_namespace { 2 | } 3 | -------------------------------------------------------------------------------- /AndroidProducts.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2018 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 | PRODUCT_MAKEFILES := \ 17 | $(LOCAL_DIR)/lineage_oneplus3.mk 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016 - The CyanogenMod Project 2 | 3 | Copyright (C) 2017 - The LineageOS Project 4 | 5 | Unified device configuration for OnePlus 3/3T 6 | ============== 7 | 8 | The OnePlus 3/3T (codenamed _"oneplus3"_) are high-end smartphones from OnePlus. 9 | 10 | OnePlus 3 was announced in February 2016. Release date was June 2016. 11 | 12 | OnePlus 3T was announced in November 2016. Release date was November 2016. 13 | 14 | ## Device specifications 15 | 16 | | Device | OnePlus 3 | OnePlus 3T | 17 | | -----------: | :---------------------------------------------- | :---------------------------------------------- | 18 | | SoC | Qualcomm MSM8996 Snapdragon 820 | Qualcomm MSM8996 Snapdragon 821 | 19 | | CPU | Dual-core 2.15GHz Kryo & dual-core 1.6GHz Kryo | Dual-core 2.35GHz Kryo & dual-core 1.6GHz Kryo | 20 | | GPU | 624MHz Adreno 530 | 652MHz Adreno 530 | 21 | | Memory | 6 GB RAM (LPDDR4 1866MHz dual-channel) | 6 GB RAM (LPDDR4 1866MHz dual-channel) | 22 | | Shipped Android version | 6.0 | 6.0 | 23 | | Storage | 64 GB (UFS 2.0 Flash) | 64 GB / 128GB (UFS 2.0 Flash) | 24 | | Battery | Non-removable Li-Po 3000 mAh | Non-removable Li-Po 3400 mAh | 25 | | Dimensions | 152.7 x 74.7 x 7.35 mm | 152.7 x 74.7 x 7.35 mm | 26 | | Display | 1920 x 1080 px, 5.5 inches (401 PPI) | 1920 x 1080 px, 5.5 inches (401 PPI) | 27 | | Rear camera | 16 MPx, f/2.0, PDAF autofocus, LED flash | 16 MPx, f/2.0, PDAF autofocus, LED flash | 28 | | Front camera | 8 MPx, f/2.0 | 16 MPx, f/2.0 | 29 | 30 | ## Device picture 31 | 32 | ![OnePlus 3](https://content.oneplus.net/skin/frontend/oneplus2015/default/images/oneplus3/oxygenos/parameter.png "OnePlus 3 in grey") 33 | -------------------------------------------------------------------------------- /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_passthrough { 43 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING|AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH 44 | formats AUDIO_FORMAT_DTS|AUDIO_FORMAT_DTS_HD 45 | sampling_rates 32000|44100|48000|88200|96000|176400|192000 46 | bit_width 16 47 | app_type 69941 48 | } 49 | compress_offload_16 { 50 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING 51 | formats AUDIO_FORMAT_MP3|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 52 | sampling_rates 44100|48000|96000|192000 53 | bit_width 16 54 | app_type 69936 55 | } 56 | compress_offload_24 { 57 | flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_NON_BLOCKING 58 | formats AUDIO_FORMAT_FLAC|AUDIO_FORMAT_ALAC|AUDIO_FORMAT_APE|AUDIO_FORMAT_VORBIS|AUDIO_FORMAT_WMA|AUDIO_FORMAT_WMA_PRO 59 | sampling_rates 44100|48000|96000|192000 60 | bit_width 24 61 | app_type 69940 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /bluetooth/bdroid_buildcfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. 4 | * Not a Contribution, Apache license notifications and license are retained 5 | * for attribution purposes only. 6 | * 7 | * Copyright (C) 2012 The Android Open Source Project 8 | * Copyright (C) 2017 The LineageOS Project 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #ifndef _BDROID_BUILDCFG_H 24 | #define _BDROID_BUILDCFG_H 25 | 26 | #include 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | int32_t property_get_int32(const char *key, int32_t default_value); 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | static inline const char* BtmGetDefaultName() 37 | { 38 | int32_t rf_version = property_get_int32("ro.boot.rf_version", 0); 39 | 40 | switch (rf_version) { 41 | case 11: 42 | case 21: 43 | case 31: 44 | return "OnePlus 3"; 45 | case 12: 46 | case 22: 47 | case 32: 48 | return "OnePlus 3T"; 49 | } 50 | 51 | return ""; 52 | } 53 | 54 | #define BTM_DEF_LOCAL_NAME BtmGetDefaultName() 55 | #define BLUETOOTH_QTI_SW TRUE 56 | // Disables read remote device feature 57 | #define MAX_ACL_CONNECTIONS 16 58 | #define MAX_L2CAP_CHANNELS 16 59 | #define BLE_VND_INCLUDED TRUE 60 | // skips conn update at conn completion 61 | #define BT_CLEAN_TURN_ON_DISABLED 1 62 | 63 | /* Increasing SEPs to 12 from 6 to support SHO/MCast i.e. two streams per codec */ 64 | #define AVDT_NUM_SEPS 12 65 | #endif 66 | -------------------------------------------------------------------------------- /board-info.txt: -------------------------------------------------------------------------------- 1 | require version-modem=2019-05-11 00:00:51|OxygenOS 9.0.2 2 | -------------------------------------------------------------------------------- /configs/framework_manifest.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | 31 | vendor.qti.hardware.radio.atcmdfwd 32 | hwbinder 33 | 1.0 34 | 35 | IAtCmdFwd 36 | AtCmdFwdService 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /configs/public.libraries.txt: -------------------------------------------------------------------------------- 1 | libqti-perfd-client.so 2 | libadsprpc.so 3 | libcdsprpc.so 4 | libsdsprpc.so 5 | libfastcvopt.so 6 | #liblistenjni.so 7 | #liblistensoundmodel2.so 8 | libOpenCL.so 9 | #libnpu.so 10 | -------------------------------------------------------------------------------- /configs/thermal-engine-vr.conf: -------------------------------------------------------------------------------- 1 | [SKIN_SHUTDOWN] 2 | algo_type monitor 3 | sampling 1000 4 | sensor emmc_therm 5 | thresholds 60000 6 | thresholds_clr 59000 7 | actions shutdown 8 | action_info 1 9 | 10 | [VR-EMMC] 11 | algo_type monitor 12 | sensor emmc_therm 13 | sampling 1000 14 | thresholds 58000 15 | thresholds_clr 52000 16 | actions cluster0+cluster1+gpu 17 | action_info 691200+691200+214000000 18 | -------------------------------------------------------------------------------- /configs/thermal-engine.conf: -------------------------------------------------------------------------------- 1 | [SKIN_SHUTDOWN] 2 | algo_type monitor 3 | sampling 1000 4 | sensor emmc_therm 5 | thresholds 60000 6 | thresholds_clr 59000 7 | actions shutdown 8 | action_info 1 9 | 10 | [SKIN-HIGH-FLOOR] 11 | algo_type ss 12 | sampling 2000 13 | sensor emmc_therm 14 | device cpu_voltage 15 | set_point 47000 16 | set_point_clr 44000 17 | device_perf_floor 1670400 18 | time_constant 0 19 | 20 | [SKIN-MID-FLOOR] 21 | algo_type ss 22 | sampling 2000 23 | sensor emmc_therm 24 | device cpu_voltage 25 | set_point 49000 26 | set_point_clr 48000 27 | device_perf_floor 1440000 28 | time_constant 0 29 | 30 | [SKIN-LOW-FLOOR] 31 | algo_type ss 32 | sampling 2000 33 | sensor emmc_therm 34 | device cpu_voltage 35 | set_point 51000 36 | set_point_clr 50000 37 | device_perf_floor 1132800 38 | time_constant 0 39 | 40 | [SKIN-RESTRICT-FLOOR] 41 | algo_type ss 42 | sampling 2000 43 | sensor emmc_therm 44 | device cpu_voltage 45 | set_point 54000 46 | set_point_clr 52000 47 | device_perf_floor 768000 48 | time_constant 0 49 | 50 | [SKIN-CRITICAL] 51 | algo_type monitor 52 | sensor emmc_therm 53 | sampling 1000 54 | thresholds 56000 58000 55 | thresholds_clr 55000 57000 56 | actions cluster0+cluster1+gpu cluster0+cluster1+gpu 57 | action_info 691200+691200+133000000 307200+307200+133000000 58 | 59 | [HOT-SKIN-VIRTUAL] 60 | algo_type virtual 61 | trip_sensor emmc_therm 62 | sensors tsens_tz_sensor15 tsens_tz_sensor0 63 | list_cnt 2 64 | weights 1 -1 65 | set_point 47000 66 | set_point_clr 44000 67 | sampling 1000 68 | math 0 69 | 70 | [VIRTUAL-SS-GPU-SKIN] 71 | algo_type ss 72 | sensor HOT-SKIN-VIRTUAL 73 | device gpu 74 | sampling 2000 75 | set_point 7000 76 | set_point_clr 2000 77 | device_max_limit 400000000 78 | -------------------------------------------------------------------------------- /display/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE := qdcm_calib_data_samsung_s6e3fa3_1080p_cmd_mode_dsi_panel.xml 5 | LOCAL_MODULE_TAGS := optional 6 | LOCAL_MODULE_CLASS := ETC 7 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc 8 | LOCAL_SRC_FILES := qdcm_calib_data_samsung_s6e3fa3_1080p_cmd_mode_dsi_panel.xml 9 | include $(BUILD_PREBUILT) 10 | 11 | include $(CLEAR_VARS) 12 | LOCAL_MODULE := qdcm_calib_data_samsung_s6e3fa5_1080p_cmd_mode_dsi_panel.xml 13 | LOCAL_MODULE_TAGS := optional 14 | LOCAL_MODULE_CLASS := ETC 15 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc 16 | LOCAL_SRC_FILES := qdcm_calib_data_samsung_s6e3fa5_1080p_cmd_mode_dsi_panel.xml 17 | include $(BUILD_PREBUILT) 18 | 19 | include $(CLEAR_VARS) 20 | LOCAL_MODULE := FOSSConfig.xml 21 | LOCAL_MODULE_TAGS := optional 22 | LOCAL_MODULE_CLASS := ETC 23 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/etc 24 | LOCAL_SRC_FILES := FOSSConfig.xml 25 | include $(BUILD_PREBUILT) 26 | -------------------------------------------------------------------------------- /display/FOSSConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 4 | 0 5 | 128 6 | 1 7 | 60 8 | 8 9 | 4 10 | 4 11 | 0 36 72 109 145 182 218 255 12 | 0 45 73 143 253 438 717 1023 13 | 32 48 700 788 14 | 255 204 204 192 15 | 55 128 175 204 16 | 80 64 16 1 17 | 18 | -------------------------------------------------------------------------------- /doze/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_MODULE_TAGS := optional 5 | 6 | LOCAL_SRC_FILES := $(call all-java-files-under, src) 7 | 8 | LOCAL_PACKAGE_NAME := OneplusDoze 9 | LOCAL_CERTIFICATE := platform 10 | LOCAL_PRIVATE_PLATFORM_APIS := true 11 | LOCAL_PRIVILEGED_MODULE := true 12 | 13 | LOCAL_USE_AAPT2 := true 14 | 15 | LOCAL_STATIC_ANDROID_LIBRARIES := \ 16 | androidx.core_core \ 17 | androidx.preference_preference 18 | 19 | LOCAL_RESOURCE_DIR := \ 20 | $(LOCAL_PATH)/res \ 21 | $(TOP)/packages/resources/devicesettings/res 22 | 23 | LOCAL_PROGUARD_FLAG_FILES := proguard.flags 24 | 25 | include frameworks/base/packages/SettingsLib/common.mk 26 | 27 | include $(BUILD_PACKAGE) 28 | -------------------------------------------------------------------------------- /doze/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /doze/proguard.flags: -------------------------------------------------------------------------------- 1 | -keep class org.lineageos.settings.doze.* { 2 | *; 3 | } 4 | -------------------------------------------------------------------------------- /doze/res/color/switch_bar_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doze/res/drawable/ic_hand.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doze/res/drawable/ic_pickup.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doze/res/drawable/ic_pocket.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doze/res/drawable/switchbar_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /doze/res/layout/doze.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /doze/res/layout/switch_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 27 | 28 | 40 | 41 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /doze/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | #82000000 19 | @android:color/black 20 | 21 | -------------------------------------------------------------------------------- /doze/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | @*android:color/material_grey_600 19 | #BFFFFFFF 20 | @android:color/white 21 | 22 | -------------------------------------------------------------------------------- /doze/res/xml/doze_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 26 | 27 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/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.doze; 19 | 20 | import android.content.BroadcastReceiver; 21 | import android.content.Context; 22 | import android.content.Intent; 23 | import android.util.Log; 24 | 25 | public class BootCompletedReceiver extends BroadcastReceiver { 26 | 27 | private static final boolean DEBUG = false; 28 | private static final String TAG = "OneplusDoze"; 29 | 30 | @Override 31 | public void onReceive(final Context context, Intent intent) { 32 | if (DEBUG) Log.d(TAG, "Received boot completed intent"); 33 | Utils.checkDozeService(context); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2016 The CyanogenMod Project 3 | * 2017 The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.lineageos.settings.doze; 19 | 20 | import android.os.Bundle; 21 | import android.preference.PreferenceActivity; 22 | 23 | public class DozeSettingsActivity extends PreferenceActivity { 24 | 25 | private static final String TAG_DOZE = "doze"; 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | 31 | getFragmentManager().beginTransaction().replace(android.R.id.content, 32 | new DozeSettingsFragment(), TAG_DOZE).commit(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /extract-files.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 | DEVICE=oneplus3 12 | VENDOR=oneplus 13 | 14 | # Load extract_utils and do some sanity checks 15 | MY_DIR="${BASH_SOURCE%/*}" 16 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 17 | 18 | ANDROID_ROOT="${MY_DIR}/../../.." 19 | 20 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 21 | if [ ! -f "${HELPER}" ]; then 22 | echo "Unable to find helper script at ${HELPER}" 23 | exit 1 24 | fi 25 | source "${HELPER}" 26 | 27 | # Default to sanitizing the vendor folder before extraction 28 | CLEAN_VENDOR=true 29 | 30 | KANG= 31 | SECTION= 32 | 33 | while [ "${#}" -gt 0 ]; do 34 | case "${1}" in 35 | -n | --no-cleanup ) 36 | CLEAN_VENDOR=false 37 | ;; 38 | -k | --kang ) 39 | KANG="--kang" 40 | ;; 41 | -s | --section ) 42 | SECTION="${2}"; shift 43 | CLEAN_VENDOR=false 44 | ;; 45 | * ) 46 | SRC="${1}" 47 | ;; 48 | esac 49 | shift 50 | done 51 | 52 | if [ -z "${SRC}" ]; then 53 | SRC="adb" 54 | fi 55 | 56 | function blob_fixup() { 57 | case "${1}" in 58 | vendor/lib/libwvhidl.so) 59 | "${PATCHELF}" --replace-needed "libprotobuf-cpp-lite.so" "libprotobuf-cpp-lite-v28.so" "${2}" 60 | ;; 61 | vendor/lib64/libsettings.so) 62 | "${PATCHELF}" --replace-needed "libprotobuf-cpp-full.so" "libprotobuf-cpp-full-v28.so" "${2}" 63 | ;; 64 | vendor/lib\(64\)?/hw/vulkan.msm8996.so) 65 | "${PATCHELF}" --set-soname "vulkan.msm8996.so" "${2}" 66 | ;; 67 | etc/permissions/qti_libpermissions.xml) 68 | sed -i "s/name=\"android.hidl.manager-V1.0-java/name=\"android.hidl.manager@1.0-java/g" "${2}" 69 | ;; 70 | esac 71 | } 72 | 73 | # Initialize the helper 74 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" 75 | 76 | extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" 77 | 78 | "${MY_DIR}/setup-makefiles.sh" 79 | -------------------------------------------------------------------------------- /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 | 5 | include $(call all-makefiles-under,$(LOCAL_PATH)) 6 | endif 7 | -------------------------------------------------------------------------------- /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/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/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti 5 | LOCAL_VENDOR_MODULE := true 6 | LOCAL_MODULE_RELATIVE_PATH := hw 7 | LOCAL_SRC_FILES := \ 8 | AGnss.cpp \ 9 | Gnss.cpp \ 10 | GnssBatching.cpp \ 11 | GnssGeofencing.cpp \ 12 | GnssMeasurement.cpp \ 13 | GnssNi.cpp \ 14 | GnssConfiguration.cpp \ 15 | GnssDebug.cpp \ 16 | AGnssRil.cpp 17 | 18 | LOCAL_SRC_FILES += \ 19 | location_api/LocationUtil.cpp \ 20 | location_api/GnssAPIClient.cpp \ 21 | location_api/GeofenceAPIClient.cpp \ 22 | location_api/BatchingAPIClient.cpp \ 23 | location_api/MeasurementAPIClient.cpp \ 24 | 25 | LOCAL_C_INCLUDES:= \ 26 | $(LOCAL_PATH)/location_api 27 | LOCAL_HEADER_LIBRARIES := \ 28 | libgps.utils_headers \ 29 | libloc_core_headers \ 30 | libloc_pla_headers \ 31 | liblocation_api_headers 32 | 33 | LOCAL_SHARED_LIBRARIES := \ 34 | liblog \ 35 | libhidlbase \ 36 | libhidltransport \ 37 | libhwbinder \ 38 | libcutils \ 39 | libutils \ 40 | android.hardware.gnss@1.0 \ 41 | 42 | LOCAL_SHARED_LIBRARIES += \ 43 | libloc_core \ 44 | libgps.utils \ 45 | libdl \ 46 | liblocation_api \ 47 | 48 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 49 | include $(BUILD_SHARED_LIBRARY) 50 | 51 | BUILD_GNSS_HIDL_SERVICE := true 52 | ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true) 53 | ifneq ($(LW_FEATURE_SET),true) 54 | BUILD_GNSS_HIDL_SERVICE := false 55 | endif # LW_FEATURE_SET 56 | endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET 57 | 58 | ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) 59 | include $(CLEAR_VARS) 60 | LOCAL_MODULE := android.hardware.gnss@1.0-service-qti 61 | LOCAL_VENDOR_MODULE := true 62 | LOCAL_MODULE_RELATIVE_PATH := hw 63 | LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc 64 | LOCAL_SRC_FILES := \ 65 | service.cpp \ 66 | 67 | LOCAL_C_INCLUDES:= \ 68 | $(LOCAL_PATH)/location_api 69 | LOCAL_HEADER_LIBRARIES := \ 70 | libgps.utils_headers \ 71 | libloc_core_headers \ 72 | libloc_pla_headers \ 73 | liblocation_api_headers 74 | 75 | 76 | LOCAL_SHARED_LIBRARIES := \ 77 | liblog \ 78 | libcutils \ 79 | libdl \ 80 | libbase \ 81 | libutils \ 82 | 83 | LOCAL_SHARED_LIBRARIES += \ 84 | libhwbinder \ 85 | libhidlbase \ 86 | libhidltransport \ 87 | android.hardware.gnss@1.0 \ 88 | 89 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 90 | include $(BUILD_EXECUTABLE) 91 | endif # BUILD_GNSS_HIDL_SERVICE 92 | -------------------------------------------------------------------------------- /gps/android/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/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/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/android.hardware.gnss@1.1-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 5 | -------------------------------------------------------------------------------- /gps/android/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/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 | 26 | using android::hardware::gnss::V1_0::IGnss; 27 | using android::hardware::defaultPassthroughServiceImplementation; 28 | 29 | int main() { 30 | return defaultPassthroughServiceImplementation(); 31 | } 32 | -------------------------------------------------------------------------------- /gps/build/target_specific_features.mk: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS := \ 2 | -Werror \ 3 | -Wno-error=unused-parameter \ 4 | -Wno-error=format \ 5 | -Wno-error=macro-redefined \ 6 | -Wno-error=reorder \ 7 | -Wno-error=missing-braces \ 8 | -Wno-error=self-assign \ 9 | -Wno-error=enum-conversion \ 10 | -Wno-error=logical-op-parentheses \ 11 | -Wno-error=null-arithmetic \ 12 | -Wno-error=null-conversion \ 13 | -Wno-error=parentheses-equality \ 14 | -Wno-error=undefined-bool-conversion \ 15 | -Wno-error=tautological-compare \ 16 | -Wno-error=switch \ 17 | -Wno-error=date-time 18 | -------------------------------------------------------------------------------- /gps/core/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | ifneq ($(BUILD_TINY_ANDROID),true) 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_MODULE := libloc_core 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | ifeq ($(TARGET_DEVICE),apq8026_lw) 13 | LOCAL_CFLAGS += -DPDK_FEATURE_SET 14 | else ifeq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET),true) 15 | LOCAL_CFLAGS += -DPDK_FEATURE_SET 16 | endif 17 | 18 | LOCAL_SHARED_LIBRARIES := \ 19 | liblog \ 20 | libutils \ 21 | libcutils \ 22 | libgps.utils \ 23 | libdl \ 24 | liblog 25 | 26 | LOCAL_SRC_FILES += \ 27 | LocApiBase.cpp \ 28 | LocAdapterBase.cpp \ 29 | ContextBase.cpp \ 30 | LocDualContext.cpp \ 31 | loc_core_log.cpp \ 32 | data-items/DataItemsFactoryProxy.cpp \ 33 | SystemStatusOsObserver.cpp \ 34 | SystemStatus.cpp 35 | 36 | LOCAL_CFLAGS += \ 37 | -fno-short-enums \ 38 | -D_ANDROID_ 39 | 40 | LOCAL_C_INCLUDES:= \ 41 | $(LOCAL_PATH)/data-items \ 42 | $(LOCAL_PATH)/data-items/common \ 43 | $(LOCAL_PATH)/observer \ 44 | 45 | LOCAL_HEADER_LIBRARIES := \ 46 | libutils_headers \ 47 | libgps.utils_headers \ 48 | libloc_pla_headers \ 49 | liblocation_api_headers 50 | 51 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 52 | 53 | include $(BUILD_SHARED_LIBRARY) 54 | 55 | include $(CLEAR_VARS) 56 | LOCAL_MODULE := libloc_core_headers 57 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ 58 | $(LOCAL_PATH) \ 59 | $(LOCAL_PATH)/data-items \ 60 | $(LOCAL_PATH)/data-items/common \ 61 | $(LOCAL_PATH)/observer 62 | include $(BUILD_HEADER_LIBRARY) 63 | 64 | endif # not BUILD_TINY_ANDROID 65 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 66 | -------------------------------------------------------------------------------- /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 | LocDualContext.h \ 19 | LBSProxyBase.h \ 20 | UlpProxyBase.h \ 21 | loc_core_log.h \ 22 | LocAdapterProxyBase.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 | LocDualContext.cpp \ 38 | loc_core_log.cpp \ 39 | data-items/DataItemsFactoryProxy.cpp \ 40 | SystemStatusOsObserver.cpp \ 41 | SystemStatus.cpp 42 | 43 | library_includedir = $(pkgincludedir) 44 | 45 | library_include_HEADERS = $(libloc_core_la_h_sources) 46 | 47 | libloc_core_la_SOURCES = $(libloc_core_la_c_sources) 48 | 49 | if USE_GLIB 50 | libloc_core_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 51 | libloc_core_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 52 | libloc_core_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 53 | else 54 | libloc_core_la_CFLAGS = $(AM_CFLAGS) 55 | libloc_core_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 56 | libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 57 | endif 58 | 59 | libloc_core_la_LIBADD = -ldl $(GPSUTILS_LIBS) 60 | 61 | #Create and Install libraries 62 | lib_LTLIBRARIES = libloc_core.la 63 | 64 | pkgconfigdir = $(libdir)/pkgconfig 65 | pkgconfig_DATA = loc-core.pc 66 | EXTRA_DIST = $(pkgconfig_DATA) 67 | -------------------------------------------------------------------------------- /gps/core/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps loc-core 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps loc-hal package version 1.0.0 8 | AC_INIT([loc-core],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([loc-core.pc.in]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | AC_ARG_WITH([core_includes], 37 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], 38 | [Specify the location of the core headers]), 39 | [core_incdir=$withval], 40 | with_core_includes=no) 41 | 42 | if test "x$with_core_includes" != "xno"; then 43 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 44 | fi 45 | 46 | AC_ARG_WITH([locpla_includes], 47 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 48 | [specify the path to locpla-includes in loc-pla_git.bb]), 49 | [locpla_incdir=$withval], 50 | with_locpla_includes=no) 51 | 52 | if test "x$with_locpla_includes" != "xno"; then 53 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 54 | fi 55 | 56 | AC_SUBST([CPPFLAGS]) 57 | 58 | AC_ARG_WITH([glib], 59 | AC_HELP_STRING([--with-glib], 60 | [enable glib, building HLOS systems which use glib])) 61 | 62 | if (test "x${with_glib}" = "xyes"); then 63 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 64 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 65 | AC_MSG_ERROR(GThread >= 2.16 is required)) 66 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 67 | AC_MSG_ERROR(GLib >= 2.16 is required)) 68 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 69 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 70 | 71 | AC_SUBST(GLIB_CFLAGS) 72 | AC_SUBST(GLIB_LIBS) 73 | fi 74 | 75 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 76 | 77 | AC_CONFIG_FILES([ \ 78 | Makefile \ 79 | loc-core.pc \ 80 | ]) 81 | 82 | AC_OUTPUT 83 | -------------------------------------------------------------------------------- /gps/core/data-items/DataItemsFactoryProxy.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __DATAITEMFACTORYBASE__ 31 | #define __DATAITEMFACTORYBASE__ 32 | 33 | #include 34 | #include 35 | 36 | namespace loc_core 37 | { 38 | 39 | #define DATA_ITEMS_LIB_NAME "libdataitems.so" 40 | #define DATA_ITEMS_GET_CONCRETE_DI "getConcreteDataItem" 41 | 42 | typedef IDataItemCore * (get_concrete_data_item_fn)(DataItemId); 43 | 44 | class DataItemsFactoryProxy { 45 | public: 46 | static IDataItemCore* createNewDataItem(DataItemId id); 47 | static void closeDataItemLibraryHandle(); 48 | static void *dataItemLibHandle; 49 | static get_concrete_data_item_fn *getConcreteDIFunc; 50 | }; 51 | 52 | } // namespace loc_core 53 | 54 | #endif //__DATAITEMFACTORYBASE__ 55 | 56 | -------------------------------------------------------------------------------- /gps/core/loc-core.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: loc-core 7 | Description: QTI GPS Loc Core 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lloc_core 10 | Cflags: -I${includedir}/loc-core 11 | -------------------------------------------------------------------------------- /gps/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) 2012-2013 Qualcomm Atheros, Inc. 9 | # All Rights Reserved. 10 | # Qualcomm Atheros Confidential and Proprietary. 11 | # 12 | # Export of this technology or software is regulated by the U.S. Government. 13 | # Diversion contrary to U.S. law prohibited. 14 | #=============================================================================*/ 15 | 16 | # X86 ONLY - UBUNTU: 17 | # Copy this file in the same directory where the executable is 18 | 19 | # Log level 20 | # EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100 21 | LOWI_LOG_LEVEL = 3 22 | -------------------------------------------------------------------------------- /gps/etc/sap.conf: -------------------------------------------------------------------------------- 1 | ################################ 2 | # Sensor Settings 3 | ################################ 4 | #The following parameters are optional. 5 | #Internal defaults support MEMS sensors 6 | #native to most handset devices. 7 | #Device specific sensor characterization 8 | #for improved performance is possible as 9 | #described in SAP application notes. 10 | #GYRO_BIAS_RANDOM_WALK= 11 | #ACCEL_RANDOM_WALK_SPECTRAL_DENSITY= 12 | #ANGLE_RANDOM_WALK_SPECTRAL_DENSITY= 13 | #RATE_RANDOM_WALK_SPECTRAL_DENSITY= 14 | #VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY= 15 | 16 | # Sensor Sampling Rate Parameters for Low-Data Rate Filter (should be greater than 0) 17 | # used in loc_eng_reinit 18 | SENSOR_ACCEL_BATCHES_PER_SEC=2 19 | SENSOR_ACCEL_SAMPLES_PER_BATCH=5 20 | SENSOR_GYRO_BATCHES_PER_SEC=2 21 | SENSOR_GYRO_SAMPLES_PER_BATCH=5 22 | # Sensor Sampling Rate Parameters for High-Data Rate Filter (should be greater than 0) 23 | SENSOR_ACCEL_BATCHES_PER_SEC_HIGH=4 24 | SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH=25 25 | SENSOR_GYRO_BATCHES_PER_SEC_HIGH=4 26 | SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH=25 27 | 28 | # Sensor Control Mode (0=AUTO, 1=FORCE_ON) 29 | # used in loc_eng_reinit 30 | SENSOR_CONTROL_MODE=1 31 | 32 | # Enable or Disable Sensors for GPS use (0=Enable, 1=Disable) 33 | # used in loc_eng_reinit 34 | SENSOR_USAGE=0 35 | 36 | # Choose GSIFF sensor provider (1=Snapdragon Sensors Core, 2=Android NDK) 37 | SENSOR_PROVIDER=1 38 | 39 | # Bit mask used to define which sensor algorithms are used. 40 | # Setting each bit has the following definition: 41 | # 0x1 - DISABLE_INS_POSITIONING_FILTER 42 | # 0x0 - ENABLE_INS_POSITIONING_FILTER 43 | SENSOR_ALGORITHM_CONFIG_MASK=0x00 44 | 45 | 46 | #Vehicle Network Provider configuration 47 | 48 | #Service configuration strings 49 | #The number before colon in VN_X items defines version of the format of the rest of the string 50 | #VN_ACCEL_CFG=0:5 51 | #VN_GYRO_CFG=0:5.5 52 | #VN_ODOMETRY_CFG=0:2,4.5 53 | VN_ACCEL_CFG=1:128,0,12,0.0048828125,12,12,0.0048828125,24,12,0.0048828125 54 | VN_GYRO_CFG=1:129,0,16,0.00006103515625,16,16,0.00006103515625,32,16,0.00006103515625 55 | VN_ODOMETRY_CFG=1:130,0,1,5,6,32 56 | VN_SPEED_CFG=1:131,5,8,1,2,3,1,1,9,2,14,2 57 | VN_DWS_CFG=1:132,5,8,1,2,3,1,1,5,2,7,2,9,2,11,2,13,2,15,2,17,2,19,2 58 | VN_GEAR_CFG=1:422,20,4,0,4,1,9,0,1,2,3,4,5,6,7,8 59 | 60 | #Procesors clock ratio: AP and CAN bus microcontroller 61 | VN_PROC_CLOCK_RATIO=1.93165618815148 62 | 63 | # Time source used by Sensor HAL 64 | # Setting this value controls accuracy of location sensor services. 65 | # 0 - Unknown 66 | # 1 - CLOCK_BOOTTIME 67 | # 2 - CLOCK_MONOTONIC 68 | # 3 - CLOCK_REALTIME 69 | # 4 - CLOCK_BOOTTIME using Alarm timer interface 70 | NDK_PROVIDER_TIME_SOURCE=1 71 | 72 | -------------------------------------------------------------------------------- /gps/gnss/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | ifneq ($(BUILD_TINY_ANDROID),true) 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_MODULE := libgnss 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | libutils \ 14 | libcutils \ 15 | libdl \ 16 | liblog \ 17 | libloc_core \ 18 | libgps.utils 19 | 20 | LOCAL_SRC_FILES += \ 21 | location_gnss.cpp \ 22 | GnssAdapter.cpp \ 23 | Agps.cpp \ 24 | XtraSystemStatusObserver.cpp 25 | 26 | LOCAL_CFLAGS += \ 27 | -fno-short-enums \ 28 | 29 | ifeq ($(TARGET_BUILD_VARIANT),user) 30 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER 31 | endif 32 | 33 | LOCAL_HEADER_LIBRARIES := \ 34 | libgps.utils_headers \ 35 | libloc_core_headers \ 36 | libloc_pla_headers \ 37 | liblocation_api_headers 38 | 39 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 40 | 41 | LOCAL_PRELINK_MODULE := false 42 | 43 | include $(BUILD_SHARED_LIBRARY) 44 | 45 | endif # not BUILD_TINY_ANDROID 46 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 47 | -------------------------------------------------------------------------------- /gps/gnss/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | $(LOCPLA_CFLAGS) \ 3 | $(LOCHAL_CFLAGS) \ 4 | $(GPSUTILS_CFLAGS) \ 5 | $(LOCCORE_CFLAGS) \ 6 | -I./ \ 7 | -I../utils \ 8 | -I$(WORKSPACE)/hardware/qcom/gps/core/data-items \ 9 | -I../location \ 10 | -std=c++11 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++ $(GPSUTILS_LIBS) $(LOCCORE_LIBS) 29 | 30 | #Create and Install libraries 31 | lib_LTLIBRARIES = libgnss.la 32 | -------------------------------------------------------------------------------- /gps/gnsspps/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | LOCAL_PATH := $(call my-dir) 3 | 4 | include $(CLEAR_VARS) 5 | 6 | LOCAL_MODULE := libgnsspps 7 | LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib 8 | LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 9 | LOCAL_MODULE_TAGS := optional 10 | 11 | LOCAL_SHARED_LIBRARIES := \ 12 | libutils \ 13 | libcutils \ 14 | libgps.utils \ 15 | liblog 16 | 17 | LOCAL_SRC_FILES += \ 18 | gnsspps.c 19 | 20 | LOCAL_CFLAGS += \ 21 | -fno-short-enums \ 22 | -D_ANDROID_ 23 | 24 | ## Includes 25 | LOCAL_HEADER_LIBRARIES := \ 26 | libgps.utils_headers \ 27 | libloc_pla_headers 28 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 29 | include $(BUILD_SHARED_LIBRARY) 30 | 31 | include $(CLEAR_VARS) 32 | LOCAL_MODULE := libgnsspps_headers 33 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 34 | include $(BUILD_HEADER_LIBRARY) 35 | 36 | endif 37 | -------------------------------------------------------------------------------- /gps/gnsspps/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | $(LOCPLA_CFLAGS) \ 3 | $(GPSUTILS_CFLAGS) \ 4 | -I$(WORKSPACE)/system/core/include \ 5 | -I./ 6 | 7 | ACLOCAL_AMFLAGS = -I m4 8 | 9 | libgnsspps_la_SOURCES = \ 10 | gnsspps.c 11 | 12 | if USE_GLIB 13 | libgnsspps_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 14 | libgnsspps_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 15 | libgnsspps_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 16 | else 17 | libgnsspps_la_CFLAGS = $(AM_CFLAGS) 18 | libgnsspps_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 19 | libgnsspps_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 20 | endif 21 | 22 | libgnsspps_la_LIBADD = -lstdc++ $(GPSUTILS_LIBS) 23 | 24 | library_include_HEADERS = \ 25 | gnsspps.h 26 | 27 | #Create and Install libraries 28 | lib_LTLIBRARIES = libgnsspps.la 29 | 30 | library_includedir = $(pkgincludedir) 31 | pkgconfigdir = $(libdir)/pkgconfig 32 | pkgconfig_DATA = gnsspps.pc 33 | EXTRA_DIST = $(pkgconfig_DATA) 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /gps/gnsspps/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps lbs-core 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps lbs-core package version 1.0.0 8 | AC_INIT([gnsspps],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 | AC_ARG_WITH([locpla_includes], 37 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 38 | [Specify the path to locpla-includes in loc-pla_git.bb]), 39 | [locpla_incdir=$withval], 40 | with_locpla_includes=no) 41 | 42 | if test "x${with_locpla_includes}" != "xno"; then 43 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 44 | fi 45 | 46 | AC_ARG_WITH([glib], 47 | AC_HELP_STRING([--with-glib], 48 | [enable glib, building HLOS systems which use glib])) 49 | 50 | if (test "x${with_glib}" = "xyes"); then 51 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 52 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 53 | AC_MSG_ERROR(GThread >= 2.16 is required)) 54 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 55 | AC_MSG_ERROR(GLib >= 2.16 is required)) 56 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 57 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 58 | 59 | AC_SUBST(GLIB_CFLAGS) 60 | AC_SUBST(GLIB_LIBS) 61 | fi 62 | 63 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 64 | 65 | AC_CONFIG_FILES([ \ 66 | Makefile \ 67 | gnsspps.pc 68 | ]) 69 | 70 | AC_OUTPUT 71 | -------------------------------------------------------------------------------- /gps/gnsspps/gnsspps.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundatoin, 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 | #ifndef _GNSSPPS_H 29 | #define _GNSSPPS_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /* opens the device and fetches from PPS source */ 36 | int initPPS(char *devname); 37 | /* updates the fine time stamp */ 38 | int getPPS(struct timespec *current_ts, struct timespec *current_boottime, struct timespec *last_boottime); 39 | /* stops fetching and closes the device */ 40 | void deInitPPS(); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /gps/gnsspps/gnsspps.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: gnsspps 7 | Description: QTI GPS gnsspps 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgnsspps 10 | Cflags: -I${includedir}/gnsspps 11 | -------------------------------------------------------------------------------- /gps/loc-hal.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: loc-hal 7 | Description: QTI GPS Loc HAL 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgnss 10 | Cflags: -I${includedir} -I${includedir}/utils -I${includedir}/core -I${includedir}/loc-hal 11 | -------------------------------------------------------------------------------- /gps/location/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | ifneq ($(BUILD_TINY_ANDROID),true) 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | include $(CLEAR_VARS) 7 | 8 | LOCAL_MODULE := liblocation_api 9 | LOCAL_VENDOR_MODULE := true 10 | LOCAL_MODULE_TAGS := optional 11 | 12 | LOCAL_SHARED_LIBRARIES := \ 13 | libutils \ 14 | libcutils \ 15 | libgps.utils \ 16 | libdl \ 17 | liblog 18 | 19 | LOCAL_SRC_FILES += \ 20 | LocationAPI.cpp \ 21 | LocationAPIClientBase.cpp 22 | 23 | LOCAL_CFLAGS += \ 24 | -fno-short-enums 25 | 26 | LOCAL_HEADER_LIBRARIES := \ 27 | libloc_pla_headers \ 28 | libgps.utils_headers 29 | 30 | LOCAL_PRELINK_MODULE := false 31 | 32 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 33 | include $(BUILD_SHARED_LIBRARY) 34 | 35 | include $(CLEAR_VARS) 36 | LOCAL_MODULE := liblocation_api_headers 37 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 38 | include $(BUILD_HEADER_LIBRARY) 39 | 40 | endif # not BUILD_TINY_ANDROID 41 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 42 | -------------------------------------------------------------------------------- /gps/location/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = \ 4 | -I./ \ 5 | -I../utils \ 6 | $(LOCPLA_CFLAGS) \ 7 | $(GPSUTILS_CFLAGS) \ 8 | -std=c++11 9 | 10 | liblocation_api_la_SOURCES = \ 11 | LocationAPI.cpp \ 12 | LocationAPIClientBase.cpp 13 | 14 | if USE_GLIB 15 | liblocation_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 16 | liblocation_api_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 17 | liblocation_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 18 | else 19 | liblocation_api_la_CFLAGS = $(AM_CFLAGS) 20 | liblocation_api_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 21 | liblocation_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 22 | endif 23 | 24 | liblocation_api_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) 25 | 26 | library_include_HEADERS = \ 27 | LocationAPI.h \ 28 | LocationAPIClientBase.h \ 29 | location_interface.h 30 | 31 | #Create and Install libraries 32 | lib_LTLIBRARIES = liblocation_api.la 33 | 34 | library_includedir = $(pkgincludedir) 35 | 36 | pkgconfigdir = $(libdir)/pkgconfig 37 | pkgconfig_DATA = location-api.pc 38 | EXTRA_DIST = $(pkgconfig_DATA) 39 | -------------------------------------------------------------------------------- /gps/location/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps location-api-iface 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps location-api-iface package version 1.0.0 8 | AC_INIT([location-api-iface],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([location-api.pc.in]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | AC_ARG_WITH([core_includes], 37 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], 38 | [Specify the location of the core headers]), 39 | [core_incdir=$withval], 40 | with_core_includes=no) 41 | 42 | if test "x$with_core_includes" != "xno"; then 43 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 44 | fi 45 | 46 | AC_ARG_WITH([locpla_includes], 47 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 48 | [Specify the path to locpla-includes in loc-pla_git.bb]), 49 | [locpla_incdir=$withval], 50 | with_locpla_includes=no) 51 | 52 | if test "x${with_locpla_includes}" != "xno"; then 53 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 54 | fi 55 | 56 | AC_SUBST([CPPFLAGS]) 57 | 58 | AC_ARG_WITH([glib], 59 | AC_HELP_STRING([--with-glib], 60 | [enable glib, building HLOS systems which use glib])) 61 | 62 | if (test "x${with_glib}" = "xyes"); then 63 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 64 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 65 | AC_MSG_ERROR(GThread >= 2.16 is required)) 66 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 67 | AC_MSG_ERROR(GLib >= 2.16 is required)) 68 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 69 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 70 | 71 | AC_SUBST(GLIB_CFLAGS) 72 | AC_SUBST(GLIB_LIBS) 73 | fi 74 | 75 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 76 | 77 | AC_CONFIG_FILES([ \ 78 | Makefile \ 79 | location-api.pc \ 80 | ]) 81 | 82 | AC_OUTPUT 83 | -------------------------------------------------------------------------------- /gps/location/location-api.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-api 7 | Description: Location API 8 | Version: @VERSION 9 | Libs: -L${libdir} -llocation_api 10 | Cflags: -I${includedir}/location-api 11 | -------------------------------------------------------------------------------- /gps/pla/Android.mk: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS := \ 2 | -Werror \ 3 | -Wno-error=unused-parameter \ 4 | -Wno-error=format \ 5 | -Wno-error=macro-redefined \ 6 | -Wno-error=reorder \ 7 | -Wno-error=missing-braces \ 8 | -Wno-error=self-assign \ 9 | -Wno-error=enum-conversion \ 10 | -Wno-error=logical-op-parentheses \ 11 | -Wno-error=null-arithmetic \ 12 | -Wno-error=null-conversion \ 13 | -Wno-error=parentheses-equality \ 14 | -Wno-error=undefined-bool-conversion \ 15 | -Wno-error=tautological-compare \ 16 | -Wno-error=switch \ 17 | -Wno-error=date-time 18 | 19 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 20 | ifneq ($(BUILD_TINY_ANDROID),true) 21 | 22 | LOCAL_PATH := $(call my-dir) 23 | 24 | include $(CLEAR_VARS) 25 | LOCAL_MODULE := libloc_pla_headers 26 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/android 27 | include $(BUILD_HEADER_LIBRARY) 28 | 29 | endif # not BUILD_TINY_ANDROID 30 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 31 | -------------------------------------------------------------------------------- /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 | 45 | #define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" 46 | #define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" 47 | #define LOC_PATH_FLP_CONF_STR "/vendor/etc/flp.conf" 48 | #define LOC_PATH_LOWI_CONF_STR "/vendor/etc/lowi.conf" 49 | #define LOC_PATH_SAP_CONF_STR "/vendor/etc/sap.conf" 50 | #define LOC_PATH_APDR_CONF_STR "/vendor/etc/apdr.conf" 51 | #define LOC_PATH_XTWIFI_CONF_STR "/vendor/etc/xtwifi.conf" 52 | #define LOC_PATH_QUIPC_CONF_STR "/vendor/etc/quipc.conf" 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif /*__cplusplus */ 57 | 58 | #endif /* __LOC_PLA__ */ 59 | -------------------------------------------------------------------------------- /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 | libutils \ 13 | libcutils \ 14 | liblog \ 15 | libprocessgroup 16 | 17 | LOCAL_SRC_FILES += \ 18 | loc_log.cpp \ 19 | loc_cfg.cpp \ 20 | msg_q.c \ 21 | linked_list.c \ 22 | loc_target.cpp \ 23 | LocHeap.cpp \ 24 | LocTimer.cpp \ 25 | LocThread.cpp \ 26 | MsgTask.cpp \ 27 | loc_misc_utils.cpp \ 28 | loc_nmea.cpp \ 29 | LocIpc.cpp 30 | 31 | # Flag -std=c++11 is not accepted by compiler when LOCAL_CLANG is set to true 32 | LOCAL_CFLAGS += \ 33 | -fno-short-enums \ 34 | -D_ANDROID_ 35 | 36 | ifeq ($(TARGET_BUILD_VARIANT),user) 37 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER 38 | endif 39 | 40 | LOCAL_LDFLAGS += -Wl,--export-dynamic 41 | 42 | ## Includes 43 | LOCAL_HEADER_LIBRARIES := \ 44 | libutils_headers \ 45 | libloc_pla_headers \ 46 | liblocation_api_headers 47 | 48 | LOCAL_MODULE := libgps.utils 49 | LOCAL_VENDOR_MODULE := true 50 | LOCAL_MODULE_TAGS := optional 51 | 52 | LOCAL_PRELINK_MODULE := false 53 | 54 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 55 | 56 | include $(BUILD_SHARED_LIBRARY) 57 | 58 | include $(CLEAR_VARS) 59 | LOCAL_MODULE := libgps.utils_headers 60 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 61 | include $(BUILD_HEADER_LIBRARY) 62 | 63 | endif # not BUILD_TINY_ANDROID 64 | endif # BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE 65 | -------------------------------------------------------------------------------- /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++11 \ 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 | 33 | libgps_utils_la_c_sources = \ 34 | linked_list.c \ 35 | msg_q.c \ 36 | loc_cfg.cpp \ 37 | loc_log.cpp \ 38 | loc_target.cpp \ 39 | LocHeap.cpp \ 40 | LocTimer.cpp \ 41 | LocThread.cpp \ 42 | LocIpc.cpp \ 43 | MsgTask.cpp \ 44 | loc_misc_utils.cpp \ 45 | loc_nmea.cpp 46 | 47 | library_includedir = $(pkgincludedir) 48 | 49 | library_include_HEADERS = $(libgps_utils_la_h_sources) 50 | 51 | libgps_utils_la_SOURCES = $(libgps_utils_la_c_sources) 52 | 53 | if USE_GLIB 54 | libgps_utils_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 55 | libgps_utils_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 56 | libgps_utils_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 57 | else 58 | libgps_utils_la_CFLAGS = $(AM_CFLAGS) 59 | libgps_utils_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 60 | libgps_utils_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 61 | endif 62 | 63 | libgps_utils_la_LIBADD = $(CUTILS_LIBS) 64 | 65 | #Create and Install libraries 66 | lib_LTLIBRARIES = libgps_utils.la 67 | 68 | pkgconfigdir = $(libdir)/pkgconfig 69 | pkgconfig_DATA = gps-utils.pc 70 | EXTRA_DIST = $(pkgconfig_DATA) 71 | -------------------------------------------------------------------------------- /gps/utils/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps gps-utils 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 gps-utils package version 1.0.0 8 | AC_INIT([gps-utils],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([CUTILS], [libcutils]) 33 | AC_SUBST([CUTILS_CFLAGS]) 34 | AC_SUBST([CUTILS_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 | gps-utils.pc 80 | ]) 81 | 82 | AC_OUTPUT 83 | -------------------------------------------------------------------------------- /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_nmea.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012-2013, 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 LOC_ENG_NMEA_H 31 | #define LOC_ENG_NMEA_H 32 | 33 | #include 34 | #include 35 | #include 36 | #define NMEA_SENTENCE_MAX_LENGTH 200 37 | 38 | void loc_nmea_generate_sv(const GnssSvNotification &svNotify, 39 | std::vector &nmeaArraystr); 40 | 41 | void loc_nmea_generate_pos(const UlpLocation &location, 42 | const GpsLocationExtended &locationExtended, 43 | unsigned char generate_nmea, 44 | std::vector &nmeaArraystr); 45 | 46 | #define DEBUG_NMEA_MINSIZE 6 47 | #define DEBUG_NMEA_MAXSIZE 4096 48 | inline bool loc_nmea_is_debug(const char* nmea, int length) { 49 | return ((nullptr != nmea) && 50 | (length >= DEBUG_NMEA_MINSIZE) && (length <= DEBUG_NMEA_MAXSIZE) && 51 | (nmea[0] == '$') && (nmea[1] == 'P') && (nmea[2] == 'Q') && (nmea[3] == 'W')); 52 | } 53 | 54 | #endif // LOC_ENG_NMEA_H 55 | -------------------------------------------------------------------------------- /init/Android.bp: -------------------------------------------------------------------------------- 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 | cc_library_static { 18 | name: "libinit_oneplus3", 19 | recovery_available: true, 20 | srcs: ["init_oneplus3.cpp"], 21 | include_dirs: [ 22 | "system/core/init" 23 | ], 24 | shared_libs: ["libbase"], 25 | } 26 | -------------------------------------------------------------------------------- /keylayout/fpc1020.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012, 2014 The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 102 HOME VIRTUAL 29 | -------------------------------------------------------------------------------- /keylayout/synaptics.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012, 2014 The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 580 APP_SWITCH VIRTUAL 29 | key 158 BACK VIRTUAL 30 | key 143 WAKEUP 31 | -------------------------------------------------------------------------------- /libhidl/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 The LineageOS Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | include $(CLEAR_VARS) 17 | LOCAL_SHARED_LIBRARIES := libhidltransport 18 | LOCAL_MODULE := android.hidl.base@1.0 19 | LOCAL_MODULE_TAGS := optional 20 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 21 | include $(BUILD_SHARED_LIBRARY) 22 | -------------------------------------------------------------------------------- /liblight/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2014 The CyanogenMod Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | LOCAL_PATH:= $(call my-dir) 16 | # HAL module implemenation stored in 17 | # hw/..so 18 | include $(CLEAR_VARS) 19 | 20 | LOCAL_SRC_FILES := lights.c 21 | LOCAL_MODULE_RELATIVE_PATH := hw 22 | LOCAL_SHARED_LIBRARIES := liblog libcutils 23 | 24 | LOCAL_MODULE := lights.msm8996 25 | LOCAL_MODULE_TAGS := optional 26 | LOCAL_VENDOR_MODULE := true 27 | 28 | include $(BUILD_SHARED_LIBRARY) 29 | -------------------------------------------------------------------------------- /libshims/Android.mk: -------------------------------------------------------------------------------- 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 | LOCAL_PATH := $(call my-dir) 18 | 19 | include $(CLEAR_VARS) 20 | 21 | LOCAL_SRC_FILES := \ 22 | GraphicBuffer.cpp 23 | 24 | LOCAL_SHARED_LIBRARIES := libui 25 | LOCAL_MODULE := libui_shim 26 | LOCAL_MODULE_TAGS := optional 27 | 28 | include $(BUILD_SHARED_LIBRARY) 29 | 30 | include $(CLEAR_VARS) 31 | 32 | LOCAL_SRC_FILES := \ 33 | strdup16to8.cpp \ 34 | strdup8to16.cpp 35 | 36 | LOCAL_SHARED_LIBRARIES := libcutils 37 | LOCAL_MODULE := libcutils_shim 38 | LOCAL_MODULE_TAGS := optional 39 | 40 | include $(BUILD_SHARED_LIBRARY) 41 | -------------------------------------------------------------------------------- /libshims/GraphicBuffer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace android { 4 | extern "C" void _ZN7android13GraphicBuffer4lockEjPPvPiS3_(uint32_t inUsage, void** vaddr, int32_t* outBytesPerPixel, int32_t* outBytesPerStride); 5 | 6 | extern "C" void _ZN7android13GraphicBuffer4lockEjPPv(uint32_t inUsage, void** vaddr) { 7 | _ZN7android13GraphicBuffer4lockEjPPvPiS3_(inUsage, vaddr, nullptr, nullptr); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /libshims/jstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 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 __CUTILS_STRING16_H 18 | #define __CUTILS_STRING16_H 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #if __STDC_VERSION__ < 201112L && __cplusplus < 201103L 28 | typedef uint16_t char16_t; 29 | #endif 30 | // otherwise char16_t is a keyword with the right semantics 31 | 32 | extern char * strndup16to8 (const char16_t* s, size_t n); 33 | extern size_t strnlen16to8 (const char16_t* s, size_t n); 34 | extern char * strncpy16to8 (char *dest, const char16_t*s, size_t n); 35 | 36 | extern char16_t * strdup8to16 (const char* s, size_t *out_len); 37 | extern size_t strlen8to16 (const char* utf8Str); 38 | extern char16_t * strcpy8to16 (char16_t *dest, const char*s, size_t *out_len); 39 | extern char16_t * strcpylen8to16 (char16_t *dest, const char*s, int length, 40 | size_t *out_len); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* __CUTILS_STRING16_H */ 47 | -------------------------------------------------------------------------------- /lineage.dependencies: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "repository": "android_device_oppo_common", 4 | "target_path": "device/oppo/common" 5 | }, 6 | { 7 | "repository": "android_kernel_oneplus_msm8996", 8 | "target_path": "kernel/oneplus/msm8996" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /lineage_oneplus3.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 The CyanogenMod Project 2 | # Copyright (C) 2017-2018 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 | # Inherit from those products. Most specific first. 17 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) 18 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) 19 | 20 | # Inherit from oneplus3 device 21 | $(call inherit-product, device/oneplus/oneplus3/device.mk) 22 | 23 | # Inherit some common Lineage stuff. 24 | $(call inherit-product, vendor/lineage/config/common_full_phone.mk) 25 | 26 | # Vendor security patch level 27 | VENDOR_SECURITY_PATCH := 2019-10-01 28 | 29 | PRODUCT_NAME := lineage_oneplus3 30 | PRODUCT_DEVICE := oneplus3 31 | PRODUCT_MANUFACTURER := OnePlus 32 | PRODUCT_BRAND := OnePlus 33 | 34 | PRODUCT_GMS_CLIENTID_BASE := android-oneplus 35 | 36 | BUILD_FINGERPRINT := "OnePlus/OnePlus3/OnePlus3:9/PKQ1.181203.001/1907311932:user/release-keys" 37 | 38 | TARGET_VENDOR := oneplus 39 | -------------------------------------------------------------------------------- /lineagehw/livedisplay/AdaptiveBacklight.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2020 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 | #pragma once 18 | 19 | #include 20 | 21 | namespace vendor { 22 | namespace lineage { 23 | namespace livedisplay { 24 | namespace V2_0 { 25 | namespace sdm { 26 | 27 | using ::android::hardware::Return; 28 | 29 | class AdaptiveBacklight : public IAdaptiveBacklight { 30 | public: 31 | static bool isSupported(); 32 | 33 | // Methods from ::vendor::lineage::livedisplay::V2_0::IAdaptiveBacklight follow. 34 | Return isEnabled() override; 35 | Return setEnabled(bool enabled) override; 36 | 37 | private: 38 | bool enabled_ = false; 39 | }; 40 | 41 | } // namespace sdm 42 | } // namespace V2_0 43 | } // namespace livedisplay 44 | } // namespace lineage 45 | } // namespace vendor 46 | -------------------------------------------------------------------------------- /lineagehw/livedisplay/Android.bp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019-2021 The LineageOS Project 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | cc_defaults { 16 | name: "livedisplay_oneplus3_defaults", 17 | defaults: ["hidl_defaults"], 18 | relative_install_path: "hw", 19 | srcs: [ 20 | ":vendor.lineage.livedisplay@2.0-sdm-dm", 21 | ":vendor.lineage.livedisplay@2.0-sdm-pa", 22 | ":vendor.lineage.livedisplay@2.0-sdm-utils", 23 | ":vendor.lineage.livedisplay@2.0-sysfs-sre", 24 | "AdaptiveBacklight.cpp", 25 | "MixedDisplayModes.cpp", 26 | "service.cpp", 27 | ], 28 | shared_libs: [ 29 | "libbase", 30 | "libbinder", 31 | "libcutils", 32 | "libdl", 33 | "libhidlbase", 34 | "libutils", 35 | "vendor.lineage.livedisplay@2.0", 36 | ], 37 | header_libs: [ 38 | "vendor.lineage.livedisplay@2.0-sdm-headers", 39 | "vendor.lineage.livedisplay@2.0-sysfs-headers", 40 | ], 41 | } 42 | 43 | cc_binary { 44 | name: "vendor.lineage.livedisplay@2.0-service.oneplus3", 45 | init_rc: ["vendor.lineage.livedisplay@2.0-service.oneplus3.rc"], 46 | defaults: ["livedisplay_oneplus3_defaults"], 47 | vendor: true, 48 | } 49 | -------------------------------------------------------------------------------- /lineagehw/livedisplay/MixedDisplayModes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019-2020 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 | #pragma once 18 | 19 | #include 20 | 21 | namespace vendor { 22 | namespace lineage { 23 | namespace livedisplay { 24 | namespace V2_0 { 25 | namespace sdm { 26 | 27 | class MixedDisplayModes : public DisplayModes { 28 | public: 29 | explicit MixedDisplayModes(std::shared_ptr controller); 30 | 31 | // Methods from ::vendor::lineage::livedisplay::V2_0::IDisplayModes follow. 32 | Return setDisplayMode(int32_t modeID, bool makeDefault) override; 33 | 34 | private: 35 | int32_t active_mode_id_; 36 | 37 | std::vector getDisplayModesQDCM(); 38 | std::vector getDisplayModesSysfs(); 39 | int32_t getCurrentDisplayModeId(); 40 | int32_t getDefaultDisplayModeId(); 41 | int32_t getDefaultDisplayModeIdQDCM(); 42 | bool setModeState(int32_t modeId, bool on); 43 | bool saveInitialDisplayMode(); 44 | 45 | // Methods from ::vendor::lineage::livedisplay::V2_0::sdm::DisplayModes follow. 46 | std::vector getDisplayModesInternal() override; 47 | DisplayMode getCurrentDisplayModeInternal() override; 48 | DisplayMode getDefaultDisplayModeInternal() override; 49 | 50 | DISALLOW_IMPLICIT_CONSTRUCTORS(MixedDisplayModes); 51 | }; 52 | 53 | } // namespace sdm 54 | } // namespace V2_0 55 | } // namespace livedisplay 56 | } // namespace lineage 57 | } // namespace vendor 58 | -------------------------------------------------------------------------------- /lineagehw/livedisplay/vendor.lineage.livedisplay@2.0-service.oneplus3.rc: -------------------------------------------------------------------------------- 1 | on boot 2 | chown system system /sys/class/graphics/fb0/srgb 3 | chmod 0660 /sys/class/graphics/fb0/srgb 4 | chown system system /sys/class/graphics/fb0/dci_p3 5 | chmod 0660 /sys/class/graphics/fb0/dci_p3 6 | chown system system /sys/devices/virtual/graphics/fb0/hbm 7 | chmod 0660 /sys/devices/virtual/graphics/fb0/hbm 8 | 9 | service vendor.livedisplay-oneplus3-hal-2-0 /vendor/bin/hw/vendor.lineage.livedisplay@2.0-service.oneplus3 10 | class late_start 11 | user system 12 | group system 13 | -------------------------------------------------------------------------------- /lineagehw/touch/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2019,2021 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 | cc_binary { 17 | name: "vendor.lineage.touch@1.0-service.oneplus3", 18 | init_rc: ["vendor.lineage.touch@1.0-service.oneplus3.rc"], 19 | defaults: ["hidl_defaults"], 20 | vintf_fragments: ["vendor.lineage.touch@1.0-service.oneplus3.xml"], 21 | relative_install_path: "hw", 22 | vendor: true, 23 | srcs: [ 24 | "KeyDisabler.cpp", 25 | "KeySwapper.cpp", 26 | "TouchscreenGesture.cpp", 27 | "service.cpp", 28 | ], 29 | shared_libs: [ 30 | "libbase", 31 | "libhidlbase", 32 | "libutils", 33 | "vendor.lineage.touch@1.0", 34 | ], 35 | } 36 | -------------------------------------------------------------------------------- /lineagehw/touch/KeyDisabler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019,2021 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 { 24 | constexpr const char kControlPath[] = "/proc/s1302/virtual_key"; 25 | }; // anonymous namespace 26 | 27 | namespace vendor { 28 | namespace lineage { 29 | namespace touch { 30 | namespace V1_0 { 31 | namespace implementation { 32 | 33 | KeyDisabler::KeyDisabler() : has_key_disabler_(!access(kControlPath, R_OK | W_OK)) {} 34 | 35 | // Methods from ::vendor::lineage::touch::V1_0::IKeyDisabler follow. 36 | Return KeyDisabler::isEnabled() { 37 | if (!has_key_disabler_) return false; 38 | 39 | std::string buf; 40 | if (!android::base::ReadFileToString(kControlPath, &buf)) { 41 | LOG(ERROR) << "Failed to read " << kControlPath; 42 | return false; 43 | } 44 | 45 | return std::stoi(android::base::Trim(buf)) == 1; 46 | } 47 | 48 | Return KeyDisabler::setEnabled(bool enabled) { 49 | if (!has_key_disabler_) return false; 50 | 51 | if (!android::base::WriteStringToFile(std::to_string(enabled), kControlPath)) { 52 | LOG(ERROR) << "Failed to write " << kControlPath; 53 | return false; 54 | } 55 | 56 | return true; 57 | } 58 | 59 | } // namespace implementation 60 | } // namespace V1_0 61 | } // namespace touch 62 | } // namespace lineage 63 | } // namespace vendor 64 | -------------------------------------------------------------------------------- /lineagehw/touch/KeyDisabler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 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 | #pragma once 18 | 19 | #include 20 | 21 | namespace vendor { 22 | namespace lineage { 23 | namespace touch { 24 | namespace V1_0 { 25 | namespace implementation { 26 | 27 | using ::android::hardware::Return; 28 | 29 | class KeyDisabler : public IKeyDisabler { 30 | public: 31 | KeyDisabler(); 32 | // Methods from ::vendor::lineage::touch::V1_0::IKeyDisabler follow. 33 | Return isEnabled() override; 34 | Return setEnabled(bool enabled) override; 35 | 36 | private: 37 | const bool has_key_disabler_; 38 | }; 39 | 40 | } // namespace implementation 41 | } // namespace V1_0 42 | } // namespace touch 43 | } // namespace lineage 44 | } // namespace vendor 45 | -------------------------------------------------------------------------------- /lineagehw/touch/KeySwapper.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019,2021 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 "KeySwapper.h" 22 | 23 | namespace { 24 | constexpr const char kControlPath[] = "/proc/s1302/key_rep"; 25 | }; // anonymous namespace 26 | 27 | namespace vendor { 28 | namespace lineage { 29 | namespace touch { 30 | namespace V1_0 { 31 | namespace implementation { 32 | 33 | KeySwapper::KeySwapper() : has_key_swapper_(!access(kControlPath, R_OK | W_OK)) {} 34 | 35 | // Methods from ::vendor::lineage::touch::V1_0::IKeySwapper follow. 36 | Return KeySwapper::isEnabled() { 37 | if (!has_key_swapper_) return false; 38 | 39 | std::string buf; 40 | if (!android::base::ReadFileToString(kControlPath, &buf)) { 41 | LOG(ERROR) << "Failed to read " << kControlPath; 42 | return false; 43 | } 44 | 45 | return std::stoi(android::base::Trim(buf)) == 1; 46 | } 47 | 48 | Return KeySwapper::setEnabled(bool enabled) { 49 | if (!has_key_swapper_) return false; 50 | 51 | if (!android::base::WriteStringToFile(std::to_string(enabled), kControlPath)) { 52 | LOG(ERROR) << "Failed to write " << kControlPath; 53 | return false; 54 | } 55 | 56 | return true; 57 | } 58 | 59 | } // namespace implementation 60 | } // namespace V1_0 61 | } // namespace touch 62 | } // namespace lineage 63 | } // namespace vendor 64 | -------------------------------------------------------------------------------- /lineagehw/touch/KeySwapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019,2021 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 | #pragma once 18 | 19 | #include 20 | 21 | namespace vendor { 22 | namespace lineage { 23 | namespace touch { 24 | namespace V1_0 { 25 | namespace implementation { 26 | 27 | using ::android::hardware::Return; 28 | 29 | class KeySwapper : public IKeySwapper { 30 | public: 31 | KeySwapper(); 32 | // Methods from ::vendor::lineage::touch::V1_0::IKeySwapper follow. 33 | Return isEnabled() override; 34 | Return setEnabled(bool enabled) override; 35 | 36 | private: 37 | const bool has_key_swapper_; 38 | }; 39 | 40 | } // namespace implementation 41 | } // namespace V1_0 42 | } // namespace touch 43 | } // namespace lineage 44 | } // namespace vendor 45 | -------------------------------------------------------------------------------- /lineagehw/touch/TouchscreenGesture.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019,2021 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 | #pragma once 18 | 19 | #include 20 | 21 | namespace vendor { 22 | namespace lineage { 23 | namespace touch { 24 | namespace V1_0 { 25 | namespace implementation { 26 | 27 | using ::android::hardware::Return; 28 | using ::android::hardware::Void; 29 | 30 | class TouchscreenGesture : public ITouchscreenGesture { 31 | public: 32 | // Methods from ::vendor::lineage::touch::V1_0::ITouchscreenGesture follow. 33 | Return getSupportedGestures(getSupportedGestures_cb resultCb) override; 34 | Return setGestureEnabled(const ::vendor::lineage::touch::V1_0::Gesture& gesture, 35 | bool enabled) override; 36 | }; 37 | 38 | } // namespace implementation 39 | } // namespace V1_0 40 | } // namespace touch 41 | } // namespace lineage 42 | } // namespace vendor 43 | -------------------------------------------------------------------------------- /lineagehw/touch/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019,2021 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.oneplus3" 18 | 19 | #include 20 | #include 21 | 22 | #include "KeyDisabler.h" 23 | #include "KeySwapper.h" 24 | #include "TouchscreenGesture.h" 25 | 26 | using ::android::OK; 27 | using ::android::sp; 28 | 29 | using ::vendor::lineage::touch::V1_0::IKeyDisabler; 30 | using ::vendor::lineage::touch::V1_0::IKeySwapper; 31 | using ::vendor::lineage::touch::V1_0::ITouchscreenGesture; 32 | using ::vendor::lineage::touch::V1_0::implementation::KeyDisabler; 33 | using ::vendor::lineage::touch::V1_0::implementation::KeySwapper; 34 | using ::vendor::lineage::touch::V1_0::implementation::TouchscreenGesture; 35 | 36 | int main() { 37 | sp gesture_service = new TouchscreenGesture(); 38 | sp key_disabler = new KeyDisabler(); 39 | sp key_swapper = new KeySwapper(); 40 | 41 | android::hardware::configureRpcThreadpool(1, true /*callerWillJoin*/); 42 | 43 | if (gesture_service->registerAsService() != OK) { 44 | LOG(ERROR) << "Cannot register touchscreen gesture HAL service."; 45 | return 1; 46 | } 47 | 48 | if (key_disabler->registerAsService() != OK) { 49 | LOG(ERROR) << "Cannot register keydisabler HAL service."; 50 | return 1; 51 | } 52 | 53 | if (key_swapper->registerAsService() != OK) { 54 | LOG(ERROR) << "Cannot register keyswapper HAL service."; 55 | return 1; 56 | } 57 | 58 | LOG(INFO) << "Touchscreen HAL service ready."; 59 | 60 | android::hardware::joinRpcThreadpool(); 61 | 62 | LOG(ERROR) << "Touchscreen HAL service failed to join thread pool."; 63 | return 1; 64 | } 65 | -------------------------------------------------------------------------------- /lineagehw/touch/vendor.lineage.touch@1.0-service.oneplus3.rc: -------------------------------------------------------------------------------- 1 | on early-boot 2 | chown system system /proc/s1302/key_rep 3 | chmod 0660 /proc/s1302/key_rep 4 | chown system system /proc/s1302/virtual_key 5 | chmod 0660 /proc/s1302/virtual_key 6 | 7 | chown system system /proc/touchpanel/up_swipe_enable 8 | chmod 0660 /proc/touchpanel/up_swipe_enable 9 | chown system system /proc/touchpanel/down_swipe_enable 10 | chmod 0660 /proc/touchpanel/down_swipe_enable 11 | chown system system /proc/touchpanel/left_swipe_enable 12 | chmod 0660 /proc/touchpanel/left_swipe_enable 13 | chown system system /proc/touchpanel/right_swipe_enable 14 | chmod 0660 /proc/touchpanel/right_swipe_enable 15 | chown system system /proc/touchpanel/double_swipe_enable 16 | chmod 0660 /proc/touchpanel/double_swipe_enable 17 | chown system system /proc/touchpanel/up_arrow_enable 18 | chmod 0660 /proc/touchpanel/up_arrow_enable 19 | chown system system /proc/touchpanel/down_arrow_enable 20 | chmod 0660 /proc/touchpanel/down_arrow_enable 21 | chown system system /proc/touchpanel/left_arrow_enable 22 | chmod 0660 /proc/touchpanel/left_arrow_enable 23 | chown system system /proc/touchpanel/right_arrow_enable 24 | chmod 0660 /proc/touchpanel/right_arrow_enable 25 | chown system system /proc/touchpanel/letter_o_enable 26 | chmod 0660 /proc/touchpanel/letter_o_enable 27 | 28 | service touch-hal-1-0 /vendor/bin/hw/vendor.lineage.touch@1.0-service.oneplus3 29 | class hal 30 | user system 31 | group system 32 | -------------------------------------------------------------------------------- /lineagehw/touch/vendor.lineage.touch@1.0-service.oneplus3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | vendor.lineage.touch 4 | hwbinder 5 | 1.0 6 | 7 | IKeyDisabler 8 | default 9 | 10 | 11 | ITouchscreenGesture 12 | default 13 | 14 | 15 | IKeySwapper 16 | default 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/Android.bp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2020 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 | java_library { 18 | name: "org.ifaa.android.manager", 19 | installable: true, 20 | libs: [ 21 | "unsupportedappusage", // for android.compat.annotation.UnsupportedAppUsage 22 | ], 23 | srcs: [ 24 | "src/**/*.java", 25 | "src/**/I*.aidl", 26 | ], 27 | } 28 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/src/com/android/internal/app/IIFAAService.aidl: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Copyright (C), 2014-2017, OnePlus Mobile Comm Corp., Ltd 3 | ** VENDOR_EDIT, All rights reserved. 4 | ** 5 | ** File: - IIFAAService.aidl 6 | ** Description: 7 | ** IFAAService service interface 8 | ** 9 | ** ------------------------------- Revision History: ---------------------------- 10 | ** 11 | ** ------------------------------------------------------------------------------ 12 | ** KenShen@Framework 2017-03-30 v1 add init version. 13 | 14 | ********************************************************************************/ 15 | 16 | package com.android.internal.app; 17 | 18 | interface IIFAAService { 19 | byte[] processCmdV2(in byte[] dataIn); 20 | } 21 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManager.java: -------------------------------------------------------------------------------- 1 | package org.ifaa.android.manager; 2 | 3 | import android.compat.annotation.UnsupportedAppUsage; 4 | import android.content.Context; 5 | 6 | public abstract class IFAAManager { 7 | 8 | /** 9 | * 返回手机系统上支持的校验方式,目前IFAF协议1.0版本指纹为0x01、虹膜为0x02 10 | */ 11 | @UnsupportedAppUsage 12 | public abstract int getSupportBIOTypes(Context context); 13 | 14 | /** 15 | * 启动系统的指纹/虹膜管理应用界面,让用户进行指纹录入。指纹录入是在系统的指纹管理应用中实现的, 16 | * 本函数的作用只是将指纹管理应用运行起来,直接进行页面跳转,方便用户录入。 17 | * @param context 18 | * @param authType 生物特征识别类型,指纹为1,虹膜为2 19 | * @return 0,成功启动指纹管理应用;-1,启动指纹管理应用失败。 20 | */ 21 | @UnsupportedAppUsage 22 | public abstract int startBIOManager(Context context, int authType); 23 | 24 | /** 25 | * 获取设备型号,同一款机型型号需要保持一致 26 | */ 27 | @UnsupportedAppUsage 28 | public abstract String getDeviceModel(); 29 | 30 | /** 31 | * 获取IFAAManager接口定义版本,目前为1 32 | */ 33 | @UnsupportedAppUsage 34 | public abstract int getVersion(); 35 | } 36 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManagerV2.java: -------------------------------------------------------------------------------- 1 | package org.ifaa.android.manager; 2 | 3 | import android.compat.annotation.UnsupportedAppUsage; 4 | import android.content.Context; 5 | 6 | public abstract class IFAAManagerV2 extends IFAAManager{ 7 | @UnsupportedAppUsage 8 | public abstract byte[] processCmdV2(Context paramContext, byte[] paramArrayOfByte); 9 | } 10 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAManagerV3.java: -------------------------------------------------------------------------------- 1 | package org.ifaa.android.manager; 2 | 3 | import android.compat.annotation.UnsupportedAppUsage; 4 | 5 | public abstract class IFAAManagerV3 extends IFAAManagerV2 { 6 | @UnsupportedAppUsage 7 | public static final String KEY_FINGERPRINT_FULLVIEW = "org.ifaa.ext.key.CUSTOM_VIEW"; 8 | @UnsupportedAppUsage 9 | public static final String KEY_GET_SENSOR_LOCATION = "org.ifaa.ext.key.GET_SENSOR_LOCATION"; 10 | @UnsupportedAppUsage 11 | public static final String VALUE_FINGERPRINT_DISABLE = "disable"; 12 | @UnsupportedAppUsage 13 | public static final String VLAUE_FINGERPRINT_ENABLE = "enable"; 14 | 15 | @UnsupportedAppUsage 16 | public abstract String getExtInfo(int authType, String keyExtInfo); 17 | 18 | @UnsupportedAppUsage 19 | public abstract void setExtInfo(int authType, String keyExtInfo, String valExtInfo); 20 | } 21 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | true 19 | 4 20 | 21 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/LineageParts/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 23 | 24 | 4 25 | 2 26 | 8 27 | 9 28 | 7 29 | 1 30 | 31 | 32 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Settings/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 24 | 25 | 0 26 | -1 27 | -1 28 | 29 | 30 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Settings/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | true 19 | 20 | 26 | 1 27 | 28 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Settings/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 5dp 19 | 94.6% 20 | 21 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Snap/res/values/cm_strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | Burst 20 | ClearShot 21 | 22 | 23 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Snap/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 25 | 100 26 | 27 | 31 | 32 | placeholder 33 | 34 | 35 | 36 | true 37 | 38 | 39 | false 40 | 41 | 42 | false 43 | 44 | 45 | true 46 | 47 | 48 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Snap/res/values/qcomstrings.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | false 26 | on 27 | enable 28 | 1920x1080 29 | 30 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc310-mnc004/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 6 36 | 37 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc310-mnc120/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 6 36 | 37 | 38 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc310-mnc260/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 3 36 | 37 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc310-mnc410/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 3 36 | 37 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc311-mnc480/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | true 38 | 39 | 42 | 6 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc312-mnc530/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 32 | 33 | "0" 34 | "00" 35 | "*2" 36 | 37 | 38 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc313-mnc100/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 32 | 33 | "0" 34 | "00" 35 | "*0" 36 | "*1" 37 | "*2" 38 | "*3" 39 | "*4" 40 | "*5" 41 | "*6" 42 | "*7" 43 | "*8" 44 | "*9" 45 | "#0" 46 | "#1" 47 | "#2" 48 | "#3" 49 | "#4" 50 | "#5" 51 | "#6" 52 | "#7" 53 | "#8" 54 | "#9" 55 | 56 | 57 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc460-mnc03/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 6 36 | 37 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values-mcc460-mnc11/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | 32 | 35 | 6 36 | 37 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | true 23 | 24 | 25 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 32 | 33 | 34 | true 35 | 36 | -------------------------------------------------------------------------------- /overlay/packages/apps/Bluetooth/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 32 | 33 | true 34 | false 35 | true 36 | false 37 | true 38 | 39 | -------------------------------------------------------------------------------- /overlay/packages/apps/CellBroadcastReceiver/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | true 23 | 24 | true 25 | 26 | true 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /overlay/packages/apps/Mms/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 32 | 33 | true 34 | 35 | -------------------------------------------------------------------------------- /overlay/packages/services/Telecomm/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 32 | 34 | 35 | 36 | true 37 | 39 | 40 | -------------------------------------------------------------------------------- /overlay/packages/services/Telephony/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 21 | 22 | 24 | 1 25 | 26 | 27 | true 28 | 29 | 30 | true 31 | 32 | 35 | true 36 | 37 | 41 | true 42 | 43 | 44 | true 45 | 46 | 47 | org.codeaurora.ims 48 | 49 | 50 | org.codeaurora.ims 51 | 52 | -------------------------------------------------------------------------------- /pocketmode/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_MODULE_TAGS := optional 5 | 6 | LOCAL_SRC_FILES := $(call all-java-files-under, src) 7 | 8 | LOCAL_PACKAGE_NAME := OneplusPocketMode 9 | LOCAL_CERTIFICATE := platform 10 | LOCAL_PRIVATE_PLATFORM_APIS := true 11 | LOCAL_PRIVILEGED_MODULE := true 12 | 13 | LOCAL_PROGUARD_FLAG_FILES := proguard.flags 14 | 15 | include $(BUILD_PACKAGE) 16 | -------------------------------------------------------------------------------- /pocketmode/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /pocketmode/proguard.flags: -------------------------------------------------------------------------------- 1 | -keep class org.lineageos.pocketmode.* { 2 | *; 3 | } 4 | -------------------------------------------------------------------------------- /pocketmode/src/org/lineageos/pocketmode/BootCompletedReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 The CyanogenMod Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.lineageos.pocketmode; 18 | 19 | import android.content.BroadcastReceiver; 20 | import android.content.Context; 21 | import android.content.Intent; 22 | import android.util.Log; 23 | 24 | public class BootCompletedReceiver extends BroadcastReceiver { 25 | 26 | private static final String TAG = "OneplusPocketMode"; 27 | 28 | @Override 29 | public void onReceive(final Context context, Intent intent) { 30 | Log.d(TAG, "Starting"); 31 | context.startService(new Intent(context, PocketModeService.class)); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /recovery/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | ifneq ($(TARGET_PLATFORM_DEVICE_BASE),) 6 | LOCAL_CFLAGS += -DUSES_BOOTDEVICE_PATH 7 | endif 8 | 9 | LOCAL_C_INCLUDES := \ 10 | bootable/recovery \ 11 | bootable/recovery/edify/include \ 12 | bootable/recovery/otautil/include 13 | LOCAL_SRC_FILES := recovery_updater.cpp 14 | LOCAL_MODULE := librecovery_updater_op3 15 | include $(BUILD_STATIC_LIBRARY) 16 | -------------------------------------------------------------------------------- /releasetools.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009 The Android Open Source Project 2 | # Copyright (c) 2011, The Linux Foundation. All rights reserved. 3 | # Copyright (C) 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 | import hashlib 18 | import common 19 | import re 20 | 21 | 22 | def FullOTA_Assertions(info): 23 | AddModemAssertion(info, info.input_zip) 24 | 25 | 26 | def IncrementalOTA_Assertions(info): 27 | AddModemAssertion(info, info.target_zip) 28 | 29 | 30 | def AddModemAssertion(info, input_zip): 31 | android_info = input_zip.read("OTA/android-info.txt") 32 | m = re.search(r'require\s+version-modem\s*=\s*(.+)$', android_info) 33 | if m: 34 | modem_version, build_version = m.group(1).split('|') 35 | if modem_version and '*' not in modem_version: 36 | cmd = ('assert(op3.verify_modem("{}") == "1" || abort("Modem firmware ' 37 | 'from {} or newer stock ROMs is prerequisite to be compatible ' 38 | 'with this build."););'.format(modem_version, build_version)) 39 | info.script.AppendExtra(cmd) 40 | -------------------------------------------------------------------------------- /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 | #TODO: Add 'check' as fs_mgr_flags with data partition. 6 | # Currently we dont have e2fsck compiled. So fs check would failed. 7 | 8 | # 9 | /dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,nodiratime wait,encryptable=footer,quota 10 | /dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,encryptable=footer,quota 11 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults 12 | /dev/block/bootdevice/by-name/cache /cache f2fs noatime,nosuid,nodev,inline_xattr,flush_merge,data_flush wait 13 | /dev/block/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1 wait 14 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait 15 | /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 16 | /dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait 17 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait 18 | /devices/soc/6a00000.ssusb/6a00000.dwc3/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usbotg:auto 19 | -------------------------------------------------------------------------------- /rootdir/etc/init.qcom.sensors.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | # Copyright (c) 2015,2018 The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of The Linux Foundation nor 12 | # the names of its contributors may be used to endorse or promote 13 | # products derived from this software without specific prior written 14 | # permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | 29 | # 30 | # Function to start sensors for SSC enabled platforms 31 | # 32 | start_sensors() 33 | { 34 | start vendor.sensors.qti 35 | 36 | # Only for SLPI 37 | if [ -c /dev/msm_dsps -o -c /dev/sensors ] ; then 38 | start vendor.sensors 39 | fi 40 | } 41 | 42 | start_sensors 43 | -------------------------------------------------------------------------------- /rootdir/etc/init.qti.ims.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | 3 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above 11 | # copyright notice, this list of conditions and the following 12 | # disclaimer in the documentation and/or other materials provided 13 | # with the distribution. 14 | # * Neither the name of The Linux Foundation nor the names of its 15 | # contributors may be used to endorse or promote products derived 16 | # from this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 19 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 22 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 25 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 27 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 28 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | # 31 | 32 | dir0=/data 33 | trigger_file=$dir0/ims_disabled 34 | ims_disabled=`getprop persist.vendor.ims.disabled` 35 | target=`getprop ro.build.product` 36 | 37 | #if [ ! -e $trigger_file ]; then 38 | # for future use in doing conditional debugging 39 | #else 40 | # 41 | #fi 42 | echo "$ims_disabled" 43 | echo "$target" 44 | 45 | if [ "$ims_disabled" = "0" ]; then 46 | echo "ims will be enabled" 47 | setprop vendor.service.qti.ims.enabled 1 48 | exit 49 | fi 50 | 51 | if [ "$ims_disabled" = "1" ] || [ "$target" = "msm8909_512" ]; then 52 | echo "ims is disabled" 53 | setprop vendor.service.qti.ims.enabled 0 54 | else 55 | echo "ims is enabled" 56 | setprop vendor.service.qti.ims.enabled 1 57 | fi 58 | -------------------------------------------------------------------------------- /rootdir/etc/init.recovery.qcom.rc: -------------------------------------------------------------------------------- 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 met: 5 | # * Redistributions of source code must retain the above copyright 6 | # notice, this list of conditions and the following disclaimer. 7 | # * Redistributions in binary form must reproduce the above copyright 8 | # notice, this list of conditions and the following disclaimer in the 9 | # documentation and/or other materials provided with the distribution. 10 | # * Neither the name of The Linux Foundation nor 11 | # the names of its contributors may be used to endorse or promote 12 | # products derived from this software without specific prior written 13 | # permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | on init 29 | write /sys/class/backlight/panel0-backlight/brightness 200 30 | 31 | on fs 32 | wait /dev/block/platform/soc/${ro.boot.bootdevice} 33 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice 34 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /seccomp/mediacodec-seccomp.policy: -------------------------------------------------------------------------------- 1 | # device specific syscalls 2 | # extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy 3 | pselect6: 1 4 | eventfd2: 1 5 | sendto: 1 6 | recvfrom: 1 7 | _llseek: 1 8 | sysinfo: 1 9 | getcwd: 1 10 | getdents64: 1 11 | inotify_init1: 1 12 | inotify_add_watch: 1 13 | -------------------------------------------------------------------------------- /seccomp/mediaextractor-seccomp.policy: -------------------------------------------------------------------------------- 1 | # device specific syscalls. 2 | # extension of services/mediaextractor/minijail/seccomp_policy/mediaextractor-seccomp-arm.policy 3 | readlinkat: 1 4 | pread64: 1 5 | mremap: 1 6 | -------------------------------------------------------------------------------- /sepolicy/adsprpcd.te: -------------------------------------------------------------------------------- 1 | allow adsprpcd vendor_file:dir r_dir_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/bootanim.te: -------------------------------------------------------------------------------- 1 | allow bootanim sysfs_kgsl:dir search; 2 | -------------------------------------------------------------------------------- /sepolicy/dashd.te: -------------------------------------------------------------------------------- 1 | # dash daemon 2 | 3 | type dashd, domain; 4 | type dashd_exec, exec_type, vendor_file_type, file_type; 5 | 6 | init_daemon_domain(dashd) 7 | 8 | # Write to /dev/kmsg 9 | allow dashd kmsg_device:chr_file rw_file_perms; 10 | 11 | r_dir_file(dashd, sysfs_battery_supply) 12 | r_dir_file(dashd, sysfs_usb_supply) 13 | 14 | allow dashd { 15 | sysfs_battery_supply 16 | sysfs_usb_supply 17 | }:file rw_file_perms; 18 | 19 | allow dashd dash_device:chr_file { open read write ioctl }; 20 | -------------------------------------------------------------------------------- /sepolicy/dataservice_app.te: -------------------------------------------------------------------------------- 1 | allow vendor_dataservice_app system_app_data_file:dir create_dir_perms; 2 | allow vendor_dataservice_app system_app_data_file:{ file lnk_file } create_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/device.te: -------------------------------------------------------------------------------- 1 | type fpc1020_device, dev_type; 2 | type dash_device, dev_type; 3 | -------------------------------------------------------------------------------- /sepolicy/domain.te: -------------------------------------------------------------------------------- 1 | # Silence /dev/stune logspam 2 | dontaudit domain device:file w_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/file.te: -------------------------------------------------------------------------------- 1 | type debugfs_rmt_storage, debugfs_type, fs_type; 2 | type proc_touchpanel, fs_type, proc_type; 3 | type sysfs_fpc, sysfs_type, fs_type; 4 | -------------------------------------------------------------------------------- /sepolicy/file_contexts: -------------------------------------------------------------------------------- 1 | # Alipay 2 | /(vendor|system/vendor)/bin/hw/vendor\.oneplus\.hardware\.ifaa@2\.0-service u:object_r:hal_ifaa_default_exec:s0 3 | 4 | # Camera 5 | /(vendor|system/vendor)/bin/remosaic_daemon u:object_r:remosaic_daemon_exec:s0 6 | 7 | # Charger 8 | /dev/dash u:object_r:dash_device:s0 9 | /(vendor|system/vendor)/bin/dashd u:object_r:dashd_exec:s0 10 | 11 | # Fingerprint 12 | /dev/fpc1020 u:object_r:fpc1020_device:s0 13 | /data/fpc(/.*)? u:object_r:fingerprintd_data_file:s0 14 | /data/fpc_images(/.*)? u:object_r:fingerprintd_data_file:s0 15 | 16 | # FRP partition 17 | /dev/block/platform/soc/624000.ufshc/by-name/config u:object_r:frp_block_device:s0 18 | 19 | # Lineage hardware 20 | /(vendor|system/vendor)/bin/hw/vendor\.lineage\.livedisplay@2\.0-service\.oneplus3 u:object_r:hal_lineage_livedisplay_qti_exec:s0 21 | /(vendor|system/vendor)/bin/hw/vendor\.lineage\.touch@1\.0-service\.oneplus3 u:object_r:hal_lineage_touch_default_exec:s0 22 | 23 | # Ril 24 | /data/vendor/oemnvitems(/.*)? u:object_r:vendor_radio_data_file:s0 25 | /dev/block/platform/soc/624000.ufshc/by-name/oem_dycnvbk u:object_r:modem_efs_partition_device:s0 26 | /dev/block/platform/soc/624000.ufshc/by-name/oem_stanvbk u:object_r:modem_efs_partition_device:s0 27 | /(vendor|system/vendor)/bin/hw/vendor\.oneplus\.hardware\.param@1\.0-service u:object_r:hal_param_default_exec:s0 28 | 29 | # Widevine 30 | /(vendor|system/vendor)/bin/hw/android\.hardware\.drm@1\.1-service.widevine u:object_r:hal_drm_widevine_exec:s0 31 | -------------------------------------------------------------------------------- /sepolicy/genfs_contexts: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | genfscon sysfs /devices/soc/soc:fpc_fpc1020 u:object_r:sysfs_fpc:s0 3 | 4 | # Healthd 5 | genfscon sysfs /devices/soc/msm-bcl-14/power_supply/fg_adc/type u:object_r:sysfs_batteryinfo:s0 6 | genfscon sysfs /devices/soc/qpnp-fg-17/power_supply/bms u:object_r:sysfs_battery_supply:s0 7 | genfscon sysfs /devices/soc/qpnp-smbcharger-16/power_supply/battery u:object_r:sysfs_battery_supply:s0 8 | genfscon sysfs /devices/soc/qpnp-smbcharger-16/power_supply/dc u:object_r:sysfs_battery_supply:s0 9 | genfscon sysfs /devices/soc/soc:qcom,bcl/power_supply/bcl/type u:object_r:sysfs_batteryinfo:s0 10 | 11 | # LEDs 12 | genfscon sysfs /devices/soc/leds-qpnp-18/leds u:object_r:sysfs_leds:s0 13 | genfscon sysfs /devices/soc/leds-qpnp-24/leds u:object_r:sysfs_leds:s0 14 | genfscon sysfs /devices/soc/leds-qpnp-25/leds u:object_r:sysfs_leds:s0 15 | 16 | # LiveDisplay 17 | genfscon sysfs /devices/virtual/graphics/fb0/dci_p3 u:object_r:sysfs_livedisplay_tuneable:s0 18 | genfscon sysfs /devices/virtual/graphics/fb0/srgb u:object_r:sysfs_livedisplay_tuneable:s0 19 | 20 | # Ril 21 | genfscon debugfs /rmt_storage u:object_r:debugfs_rmt_storage:s0 22 | 23 | # Thermal engine 24 | genfscon sysfs /devices/soc/70000.qcom,msm-core/uio/uio1 u:object_r:sysfs_uio_file:s0 25 | genfscon sysfs /devices/soc/70000.qcom,msm-thermal/uio/uio2 u:object_r:sysfs_uio_file:s0 26 | 27 | # Touchscreen 28 | genfscon proc /touchpanel u:object_r:proc_touchpanel:s0 29 | genfscon proc /s1302 u:object_r:proc_touchpanel:s0 30 | 31 | # Tri-state key 32 | genfscon proc /tri-state-key u:object_r:proc_touchpanel:s0 33 | 34 | # USB 35 | genfscon sysfs /devices/soc/6a00000.ssusb/6a00000.dwc3/gadget/lun0/ u:object_r:sysfs_android_usb:s0 36 | -------------------------------------------------------------------------------- /sepolicy/hal_bluetooth_qti.te: -------------------------------------------------------------------------------- 1 | r_dir_file(hal_bluetooth_qti, vendor_radio_data_file) 2 | -------------------------------------------------------------------------------- /sepolicy/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | allow hal_camera_default camera_data_file:dir search; 2 | allow hal_camera_default camera_data_file:sock_file write; 3 | -------------------------------------------------------------------------------- /sepolicy/hal_fingerprint_default.te: -------------------------------------------------------------------------------- 1 | allow hal_fingerprint_default firmware_file:dir search; 2 | allow hal_fingerprint_default firmware_file:file r_file_perms; 3 | 4 | allow hal_fingerprint_default sysfs_fpc:dir r_dir_perms; 5 | allow hal_fingerprint_default sysfs_fpc:file rw_file_perms; 6 | 7 | # access to /data/system/users/[0-9]+/fpdata 8 | allow hal_fingerprint_default fingerprintd_data_file:file create_file_perms; 9 | allow hal_fingerprint_default fingerprintd_data_file:dir rw_dir_perms; 10 | allow hal_fingerprint_default fingerprintd_data_file:sock_file { create unlink }; 11 | 12 | allow hal_fingerprint_default tee_device:chr_file rw_file_perms; 13 | -------------------------------------------------------------------------------- /sepolicy/hal_ifaa.te: -------------------------------------------------------------------------------- 1 | type hal_ifaa_default, domain; 2 | hal_server_domain(hal_ifaa_default, hal_ifaa) 3 | 4 | type hal_ifaa_default_exec, exec_type, vendor_file_type, file_type; 5 | init_daemon_domain(hal_ifaa_default) 6 | 7 | # Allow hwbinder call from hal client to server 8 | binder_call(hal_ifaa_client, hal_ifaa_server) 9 | 10 | # Add hwservice related rules 11 | add_hwservice(hal_ifaa_server, hal_ifaa_hwservice) 12 | allow hal_ifaa_client hal_ifaa_hwservice:hwservice_manager find; 13 | 14 | #Allow access to tee device 15 | allow hal_ifaa_server tee_device:chr_file rw_file_perms; 16 | 17 | #Allow access to ion device 18 | allow hal_ifaa_server ion_device:chr_file r_file_perms; 19 | 20 | #Allow IPerf access 21 | allow hal_ifaa_server hal_perf_hwservice:hwservice_manager find; 22 | binder_call(hal_ifaa_server, hal_perf_server) 23 | 24 | #Allow access to firmware 25 | r_dir_file(hal_ifaa_server, firmware_file) 26 | -------------------------------------------------------------------------------- /sepolicy/hal_lineage_livedisplay_qti.te: -------------------------------------------------------------------------------- 1 | # Grant access over LiveDisplay tuneables 2 | allow hal_lineage_livedisplay_qti sysfs_livedisplay_tuneable:file rw_file_perms; 3 | 4 | # Allow LiveDisplay to access pps socket 5 | unix_socket_connect(hal_lineage_livedisplay_qti, pps, mm-pp-daemon) 6 | -------------------------------------------------------------------------------- /sepolicy/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/hal_nfc_default.te: -------------------------------------------------------------------------------- 1 | # Data file accesses. 2 | allow hal_nfc_default nfc_vendor_data_file:dir create_dir_perms; 3 | allow hal_nfc_default nfc_vendor_data_file:file create_file_perms; 4 | -------------------------------------------------------------------------------- /sepolicy/hal_param.te: -------------------------------------------------------------------------------- 1 | type hal_param_default, domain; 2 | hal_server_domain(hal_param_default, hal_param) 3 | 4 | type hal_param_default_exec, exec_type, vendor_file_type, file_type; 5 | init_daemon_domain(hal_param_default) 6 | 7 | # Allow hwbinder call from hal client to server 8 | binder_call(hal_param_client, hal_param_server) 9 | 10 | # Add hwservice related rules 11 | add_hwservice(hal_param_server, hal_param_hwservice) 12 | allow hal_param_client hal_param_hwservice:hwservice_manager find; 13 | -------------------------------------------------------------------------------- /sepolicy/hal_perf_default.te: -------------------------------------------------------------------------------- 1 | dontaudit hal_perf_default self:capability dac_override; 2 | set_prop(hal_perf_default, vendor_mpctl_prop) 3 | -------------------------------------------------------------------------------- /sepolicy/hal_power_default.te: -------------------------------------------------------------------------------- 1 | allow hal_power_default proc_touchpanel:file rw_file_perms; 2 | allow hal_power_default proc_touchpanel:dir search; 3 | -------------------------------------------------------------------------------- /sepolicy/hal_vr.te: -------------------------------------------------------------------------------- 1 | # interact with thermal_config 2 | set_prop(hal_vr, thermal_prop) 3 | -------------------------------------------------------------------------------- /sepolicy/hal_wifi_default.te: -------------------------------------------------------------------------------- 1 | allow hal_wifi_default proc_net:file w_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/hwservice.te: -------------------------------------------------------------------------------- 1 | type hal_ifaa_hwservice, hwservice_manager_type; 2 | type hal_param_hwservice, hwservice_manager_type; 3 | -------------------------------------------------------------------------------- /sepolicy/hwservice_contexts: -------------------------------------------------------------------------------- 1 | vendor.oneplus.fingerprint.extension::IVendorFingerprintExtensions u:object_r:hal_fingerprint_hwservice:s0 2 | vendor.oneplus.hardware.ifaa::IOneplusIfaa u:object_r:hal_ifaa_hwservice:s0 3 | vendor.oneplus.hardware.param::IOneplusParam u:object_r:hal_param_hwservice:s0 4 | -------------------------------------------------------------------------------- /sepolicy/mm-qcamerad.te: -------------------------------------------------------------------------------- 1 | allow mm-qcamerad camera_data_file:sock_file { create unlink }; 2 | allow mm-qcamerad camera_data_file:dir rw_dir_perms; 3 | set_prop(mm-qcamerad, vendor_default_prop) 4 | -------------------------------------------------------------------------------- /sepolicy/platform_app.te: -------------------------------------------------------------------------------- 1 | hal_client_domain(platform_app, hal_ifaa) 2 | -------------------------------------------------------------------------------- /sepolicy/property.te: -------------------------------------------------------------------------------- 1 | type thermal_prop, property_type; 2 | -------------------------------------------------------------------------------- /sepolicy/property_contexts: -------------------------------------------------------------------------------- 1 | sys.qcom.thermalcfg u:object_r:thermal_prop:s0 2 | ctl.thermal-engine u:object_r:thermal_prop:s0 3 | vendor.min_freq_0 u:object_r:vendor_mpctl_prop:s0 4 | vendor.min_freq_4 u:object_r:vendor_mpctl_prop:s0 5 | wifi.active.interface u:object_r:wifi_prop:s0 6 | persist.vendor.wigig.npt.enable u:object_r:vendor_default_prop:s0 7 | -------------------------------------------------------------------------------- /sepolicy/public/attributes: -------------------------------------------------------------------------------- 1 | # HALs 2 | attribute hal_ifaa; 3 | attribute hal_ifaa_client; 4 | attribute hal_ifaa_server; 5 | 6 | attribute hal_param; 7 | attribute hal_param_client; 8 | attribute hal_param_server; 9 | -------------------------------------------------------------------------------- /sepolicy/radio.te: -------------------------------------------------------------------------------- 1 | allow radio hal_datafactory_hwservice:hwservice_manager find; 2 | 3 | get_prop(radio, vendor_qcom_ims_prop) 4 | -------------------------------------------------------------------------------- /sepolicy/remosaic_daemon.te: -------------------------------------------------------------------------------- 1 | type remosaic_daemon, domain; 2 | type remosaic_daemon_exec, exec_type, vendor_file_type, file_type; 3 | 4 | #Allow for transition from init domain to remosaic_daemon 5 | init_daemon_domain(remosaic_daemon) 6 | 7 | #Allow remosaic_daemon to use Binder IPC 8 | binder_use(remosaic_daemon) 9 | 10 | #Allow remosaic_daemon to be registered with service manager 11 | allow remosaic_daemon remosaic_service:service_manager add; 12 | -------------------------------------------------------------------------------- /sepolicy/rild.te: -------------------------------------------------------------------------------- 1 | # qcril.so needs access to /vendor/radio/qcril_database/qcril.db 2 | allow rild vendor_file:file ioctl; 3 | 4 | set_prop(rild, vendor_default_prop) 5 | -------------------------------------------------------------------------------- /sepolicy/seapp_contexts: -------------------------------------------------------------------------------- 1 | # uceShimService 2 | user=system seinfo=platform name=.dataservices domain=vendor_dataservice_app type=radio_data_file 3 | -------------------------------------------------------------------------------- /sepolicy/service.te: -------------------------------------------------------------------------------- 1 | type remosaic_service, service_manager_type; 2 | -------------------------------------------------------------------------------- /sepolicy/service_contexts: -------------------------------------------------------------------------------- 1 | android.samsung.IRemosaicDaemon u:object_r:remosaic_service:s0 2 | -------------------------------------------------------------------------------- /sepolicy/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app proc_touchpanel:dir search; 2 | allow system_app proc_touchpanel:file rw_file_perms; 3 | 4 | allow system_app sysfs_fpc:dir search; 5 | allow system_app sysfs_fpc:file rw_file_perms; 6 | -------------------------------------------------------------------------------- /sepolicy/system_server.te: -------------------------------------------------------------------------------- 1 | # OTA with encrypted f2fs 2 | allow system_server ota_package_file:dir getattr; 3 | -------------------------------------------------------------------------------- /sepolicy/tee.te: -------------------------------------------------------------------------------- 1 | allow tee system_data_file:dir r_dir_perms; 2 | allow tee fingerprintd_data_file:dir rw_dir_perms; 3 | allow tee fingerprintd_data_file:file create_file_perms; 4 | -------------------------------------------------------------------------------- /sepolicy/thermal-engine.te: -------------------------------------------------------------------------------- 1 | allow thermal-engine sysfs:dir r_dir_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/uncrypt.te: -------------------------------------------------------------------------------- 1 | # OTA with encrypted f2fs 2 | allow uncrypt self:capability fowner; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor_init.te: -------------------------------------------------------------------------------- 1 | allow vendor_init { 2 | camera_data_file 3 | fingerprintd_data_file 4 | system_data_file 5 | tombstone_data_file 6 | }:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom }; 7 | 8 | allow vendor_init proc_touchpanel:file write; 9 | 10 | set_prop(vendor_init, thermal_prop) 11 | -------------------------------------------------------------------------------- /sepolicy/vold.te: -------------------------------------------------------------------------------- 1 | # For setting read_ahead_kb 2 | allow vold sysfs_mmc_host:file w_file_perms; 3 | -------------------------------------------------------------------------------- /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 | DEVICE=oneplus3 12 | VENDOR=oneplus 13 | 14 | # Load extract_utils and do some sanity checks 15 | MY_DIR="${BASH_SOURCE%/*}" 16 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 17 | 18 | ANDROID_ROOT="${MY_DIR}/../../.." 19 | 20 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 21 | if [ ! -f "${HELPER}" ]; then 22 | echo "Unable to find helper script at ${HELPER}" 23 | exit 1 24 | fi 25 | source "${HELPER}" 26 | 27 | # Initialize the helper 28 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" 29 | 30 | # Warning headers and guards 31 | write_headers 32 | 33 | write_makefiles "${MY_DIR}/proprietary-files.txt" true 34 | 35 | # Finish 36 | write_footers 37 | -------------------------------------------------------------------------------- /thermal/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 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 | LOCAL_PATH := $(call my-dir) 18 | 19 | include $(CLEAR_VARS) 20 | LOCAL_CFLAGS := -Wno-unused-parameter 21 | LOCAL_MODULE_RELATIVE_PATH := hw 22 | LOCAL_SRC_FILES := thermal.c 23 | LOCAL_SHARED_LIBRARIES := liblog libcutils 24 | LOCAL_MODULE_TAGS := optional 25 | LOCAL_MODULE_OWNER := qcom 26 | LOCAL_PROPRIETARY_MODULE := true 27 | LOCAL_MODULE := thermal.msm8996 28 | include $(BUILD_SHARED_LIBRARY) 29 | -------------------------------------------------------------------------------- /vr/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright 2016 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | LOCAL_PATH:= $(call my-dir) 16 | 17 | include $(CLEAR_VARS) 18 | 19 | LOCAL_SRC_FILES := vr.c 20 | LOCAL_MODULE_RELATIVE_PATH := hw 21 | LOCAL_SHARED_LIBRARIES := liblog libcutils 22 | LOCAL_CFLAGS += -Wno-unused-parameter 23 | LOCAL_MODULE := vr.msm8996 24 | LOCAL_MODULE_TAGS := optional 25 | LOCAL_MODULE_OWNER := qcom 26 | LOCAL_PROPRIETARY_MODULE := true 27 | 28 | include $(BUILD_SHARED_LIBRARY) 29 | -------------------------------------------------------------------------------- /vr/vr.c: -------------------------------------------------------------------------------- 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 | #define LOG_TAG "VrHALImpl" 18 | 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | static void restart_thermal_engine() { 26 | if (property_set("ctl.restart", "thermal-engine")) { 27 | ALOGE("%s: couldn't set a system property, " 28 | "ctl.restart.", __FUNCTION__); 29 | } 30 | } 31 | 32 | static void vr_init(struct vr_module *module) { 33 | // NOOP 34 | } 35 | 36 | static void vr_set_vr_mode(struct vr_module *module, bool enabled) { 37 | if (enabled) { 38 | if (property_set("sys.qcom.thermalcfg", "/vendor/etc/thermal-engine-vr.conf")) { 39 | ALOGE("%s: couldn't set a system property, " 40 | "sys.qcom.thermalcfg.", __FUNCTION__); 41 | } 42 | } else { 43 | if (property_set("sys.qcom.thermalcfg", "/vendor/etc/thermal-engine.conf")) { 44 | ALOGE("%s: couldn't set a system property, " 45 | "sys.qcom.thermalcfg.", __FUNCTION__); 46 | } 47 | } 48 | restart_thermal_engine(); 49 | } 50 | 51 | static struct hw_module_methods_t vr_module_methods = { 52 | .open = NULL, // There are no devices for this HAL interface. 53 | }; 54 | 55 | 56 | vr_module_t HAL_MODULE_INFO_SYM = { 57 | .common = { 58 | .tag = HARDWARE_MODULE_TAG, 59 | .module_api_version = VR_MODULE_API_VERSION_1_0, 60 | .hal_api_version = HARDWARE_HAL_API_VERSION, 61 | .id = VR_HARDWARE_MODULE_ID, 62 | .name = "OnePlus 3 VR HAL", 63 | .author = "The Android Open Source Project", 64 | .methods = &vr_module_methods, 65 | }, 66 | 67 | .init = vr_init, 68 | .set_vr_mode = vr_set_vr_mode, 69 | }; 70 | -------------------------------------------------------------------------------- /wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_search_delay=100 3 | p2p_no_group_iface=1 4 | persistent_reconnect=1 5 | -------------------------------------------------------------------------------- /wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_disabled=1 3 | tdls_external_control=1 4 | --------------------------------------------------------------------------------