├── sepolicy ├── vendor │ ├── vndservice.te │ ├── hwservice_contexts │ ├── vndservice_contexts │ ├── appdomain.te │ ├── device.te │ ├── hal_imsrtp.te │ ├── app.te │ ├── hal_cas_default.te │ ├── kernel.te │ ├── platform_app.te │ ├── vold.te │ ├── zygote.te │ ├── gpuservice.te │ ├── wcnss_service.te │ ├── bootanim.te │ ├── thermal_engine.te │ ├── power_off_alarm.te │ ├── system_app.te │ ├── hal_perf_default.te │ ├── hal_camera_default.te │ ├── rild.te │ ├── fastbootd.te │ ├── hvdcp.te │ ├── recovery.te │ ├── seapp_contexts │ ├── tee.te │ ├── rmt_storage.te │ ├── hal_ir_default.te │ ├── hal_wifi_default.te │ ├── netmgrd.te │ ├── property.te │ ├── qti_init_shell.te │ ├── hal_audio_default.te │ ├── hal_bluetooth_default.te │ ├── ueventd.te │ ├── system_server.te │ ├── radio.te │ ├── init.te │ ├── subsystem_state_notifier.te │ ├── init_xiaomi.te │ ├── file.te │ ├── vendor_init.te │ ├── init_acdbdata.te │ ├── mm-qcamerad.te │ ├── charger_led.te │ ├── property_contexts │ └── genfs_contexts ├── legacy │ └── vendor │ │ ├── wcnss_service.te │ │ ├── file_contexts │ │ └── init_baseband.te └── private │ └── property_contexts ├── Android.bp ├── odm.prop ├── system_ext.prop ├── vendor_k4.19.prop ├── configs ├── msm_irqbalance.conf ├── msm_irqbalance_little_big.conf ├── manifest │ ├── consumerir.xml │ ├── cryptfshw.xml │ ├── gatekeeper.xml │ ├── keymaster.xml │ └── q-display-stack.xml ├── component-overrides.xml └── telephony_product_privapp-permissions-qti.xml ├── wifi ├── p2p_supplicant_overlay.conf ├── wpa_supplicant_overlay.conf └── WCNSS_cfg.dat ├── gps ├── android │ ├── Android.mk │ ├── 1.0 │ │ ├── android.hardware.gnss@1.0-service-qti.rc │ │ ├── android.hardware.gnss@1.0-service-qti.xml │ │ ├── GnssDebug.h │ │ ├── GnssConfiguration.h │ │ └── GnssNi.h │ ├── 1.1 │ │ ├── android.hardware.gnss@1.1-service-qti.rc │ │ ├── android.hardware.gnss@1.1-service-qti.xml │ │ ├── GnssDebug.h │ │ └── GnssNi.h │ ├── 2.0 │ │ ├── android.hardware.gnss@2.0-service-qti.rc │ │ ├── android.hardware.gnss@2.0-service-qti.xml │ │ ├── GnssDebug.h │ │ └── GnssNi.h │ ├── 2.1 │ │ ├── android.hardware.gnss@2.1-service-qti.rc │ │ ├── android.hardware.gnss@2.1-service-qti.xml │ │ ├── GnssDebug.h │ │ └── AGnss.h │ ├── utils │ │ ├── Android.bp │ │ └── battery_listener.h │ └── auto_power │ │ └── Android.bp ├── etc │ ├── gps.conf │ ├── Android.bp │ ├── seccomp_policy │ │ ├── gnss@2.0-xtwifi-inet-agent.policy │ │ ├── gnss@2.0-xtra-daemon.policy │ │ └── gnss@2.0-xtwifi-client.policy │ └── flp.conf ├── pla │ └── Android.bp ├── Makefile.am ├── gps_vendor_board.mk ├── core │ ├── loc-core.pc.in │ ├── Android.bp │ ├── data-items │ │ └── DataItemsFactoryProxy.h │ ├── LocContext.h │ └── Makefile.am ├── utils │ ├── gps-utils.pc.in │ ├── Android.bp │ ├── LocLoggerBase.h │ ├── Makefile.am │ └── MsgTask.h ├── location │ ├── location-api.pc.in │ ├── Android.bp │ └── Makefile.am ├── batching │ ├── location-batching.pc.in │ ├── Android.bp │ ├── Makefile.am │ └── configure.ac ├── geofence │ ├── location-geofence.pc.in │ ├── Android.bp │ ├── Makefile.am │ └── configure.ac ├── loc-hal.pc.in ├── gnss │ ├── Android.bp │ └── Makefile.am ├── Android.bp ├── gps_vendor_product.mk ├── Android.mk └── CleanSpec.mk ├── manifest_k4.19.xml ├── parts ├── proguard.flags ├── res │ ├── drawable │ │ ├── ic_preset.xml │ │ ├── ic_headphone.xml │ │ ├── ic_pickup.xml │ │ ├── ic_hand.xml │ │ └── ic_pocket.xml │ ├── values │ │ └── colors.xml │ ├── layout │ │ ├── doze.xml │ │ └── dirac.xml │ └── xml │ │ ├── dirac_settings.xml │ │ └── doze_settings.xml ├── Android.bp └── src │ └── org │ └── lineageos │ └── settings │ ├── dirac │ └── DiracActivity.java │ ├── doze │ └── DozeSettingsActivity.java │ └── BootCompletedReceiver.java ├── rro_overlays ├── WifiOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── WifiOverlay_5GHz │ ├── Android.bp │ ├── res │ │ └── values │ │ │ └── config.xml │ └── AndroidManifest.xml ├── HapticOverlay_Settings │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml └── HapticOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ └── values │ └── config.xml ├── README.md ├── subsystem_state_notifier ├── subsystem_state_notifier.rc ├── Android.bp └── main.c ├── proprietary-files ├── 4.19 │ ├── qcom-vendor-multilib-module.txt │ └── qcom-system.txt └── 4.9 │ ├── qcom-vendor-multilib-module.txt │ └── qcom-system.txt ├── rootdir ├── bin │ ├── init.baseband.sh │ ├── init.qti.qseecomd.sh │ ├── init.qti.dcvs.sh │ ├── init.qcom.sensors.sh │ └── init.acdbdata.sh ├── Android.mk ├── etc │ └── init.uclamp.rc └── Android.bp ├── lights ├── lights-xiaomi_mithorium.xml ├── Android.bp ├── lights-xiaomi_mithorium.rc ├── main.cpp └── Lights.h ├── libshim ├── Android.mk ├── libbinder │ ├── IServiceManager.cpp │ └── PermissionCache.cpp ├── libshims_gui.cpp ├── libshims_android.cpp ├── libshims_ui.cpp └── Android.bp ├── manifest_k4.9.xml ├── libinit ├── init_xiaomi_mithorium.cpp ├── include │ ├── libinit_utils.h │ ├── libinit_dalvik_heap.h │ └── libinit_variant.h ├── Android.bp └── libinit_variant.cpp ├── libhidl └── Android.bp ├── charger_led ├── Android.bp ├── charger_led.recovery.rc └── charger_led.rc ├── thermal ├── Android.bp ├── android.hardware.thermal@2.0-service.qti.xiaomi_mithorium.rc ├── android.hardware.thermal@2.0-service.qti.xiaomi_mithorium.xml ├── service.cpp └── thermalConfig.h ├── overlay-lineage ├── packages │ └── apps │ │ └── Dialer │ │ └── java │ │ └── com │ │ └── android │ │ └── dialer │ │ └── callrecord │ │ └── res │ │ └── values │ │ └── config.xml └── lineage-sdk │ └── lineage │ └── res │ └── res │ └── values │ └── config.xml ├── media ├── msm8953 │ └── media_codecs_vendor_audio.xml └── msm8937 │ └── media_codecs_vendor_audio.xml ├── overlay ├── packages │ └── apps │ │ ├── Settings │ │ └── res │ │ │ └── values │ │ │ └── arrays.xml │ │ └── Snap │ │ └── res │ │ └── values │ │ └── qcomstrings.xml └── frameworks │ └── base │ └── packages │ └── SystemUI │ └── res │ └── values │ └── config.xml ├── bluetooth └── bdroid_buildcfg.h ├── overlay-tablet └── frameworks │ └── base │ └── core │ └── res │ └── res │ └── values │ └── config.xml ├── keylayout ├── qpnp_pon.kl └── gpio-keys.kl ├── system_radio.prop ├── vendor_radio.prop ├── overlay-radio └── packages │ └── services │ └── Telephony │ └── res │ └── values │ └── config.xml ├── reorder-libs.py ├── update-sha1sums.py └── audio └── audio_output_policy.conf /sepolicy/vendor/vndservice.te: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Android.bp: -------------------------------------------------------------------------------- 1 | soong_namespace { 2 | } 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sepolicy/vendor/vndservice_contexts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /odm.prop: -------------------------------------------------------------------------------- 1 | ro.vendor.qti.va_odm.support=1 2 | -------------------------------------------------------------------------------- /system_ext.prop: -------------------------------------------------------------------------------- 1 | persist.vendor.dpm.feature=11 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/appdomain.te: -------------------------------------------------------------------------------- 1 | get_prop(appdomain, camera_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/device.te: -------------------------------------------------------------------------------- 1 | # IR 2 | type ir_device, dev_type; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_imsrtp.te: -------------------------------------------------------------------------------- 1 | binder_call(hal_imsrtp, radio) 2 | -------------------------------------------------------------------------------- /vendor_k4.19.prop: -------------------------------------------------------------------------------- 1 | # Incremental FS 2 | ro.incremental.enable=1 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/app.te: -------------------------------------------------------------------------------- 1 | get_prop(appdomain, exported_camera_prop); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_cas_default.te: -------------------------------------------------------------------------------- 1 | vndbinder_use(hal_cas_default); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/kernel.te: -------------------------------------------------------------------------------- 1 | allow kernel kernel:capability { kill }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/platform_app.te: -------------------------------------------------------------------------------- 1 | get_prop(platform_app, boottime_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vold.te: -------------------------------------------------------------------------------- 1 | allow vold sysfs_mmc_host:file rw_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/zygote.te: -------------------------------------------------------------------------------- 1 | get_prop(zygote, exported_camera_prop); 2 | -------------------------------------------------------------------------------- /configs/msm_irqbalance.conf: -------------------------------------------------------------------------------- 1 | PRIO=0,0,0,0,1,1,1,1 2 | IGNORED_IRQ=20,39 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/gpuservice.te: -------------------------------------------------------------------------------- 1 | get_prop(gpuservice, graphics_config_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/wcnss_service.te: -------------------------------------------------------------------------------- 1 | #get_prop(wcnss_service, serialno_prop); 2 | -------------------------------------------------------------------------------- /sepolicy/legacy/vendor/wcnss_service.te: -------------------------------------------------------------------------------- 1 | set_prop(wcnss_service, wifi_prop); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/bootanim.te: -------------------------------------------------------------------------------- 1 | get_prop(bootanim, userspace_reboot_exported_prop); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/thermal_engine.te: -------------------------------------------------------------------------------- 1 | allow thermal-engine sysfs:dir r_dir_perms; 2 | -------------------------------------------------------------------------------- /configs/msm_irqbalance_little_big.conf: -------------------------------------------------------------------------------- 1 | PRIO=1,1,1,1,0,0,0,0 2 | IGNORED_IRQ=20,39 3 | -------------------------------------------------------------------------------- /wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_no_group_iface=1 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/power_off_alarm.te: -------------------------------------------------------------------------------- 1 | allow power_off_alarm kmsg_device:chr_file getattr; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app fm_radio_device:chr_file r_file_perms; 2 | -------------------------------------------------------------------------------- /gps/android/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(call all-subdir-makefiles) 3 | -------------------------------------------------------------------------------- /manifest_k4.19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_perf_default.te: -------------------------------------------------------------------------------- 1 | allow hal_perf_default proc_meminfo:file r_file_perms; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | allow hal_camera_default camera_data_file:sock_file write; 2 | -------------------------------------------------------------------------------- /wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_disabled=1 3 | wowlan_triggers=magic_pkt 4 | -------------------------------------------------------------------------------- /sepolicy/private/property_contexts: -------------------------------------------------------------------------------- 1 | # Fastbootd 2 | ro.fastbootd.available u:object_r:exported_default_prop:s0 3 | -------------------------------------------------------------------------------- /gps/etc/gps.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mi-Thorium/android_device_xiaomi_mithorium-common/HEAD/gps/etc/gps.conf -------------------------------------------------------------------------------- /sepolicy/vendor/rild.te: -------------------------------------------------------------------------------- 1 | allow rild rild_file:file r_file_perms; 2 | allow rild qtidataservices_app:binder call; 3 | -------------------------------------------------------------------------------- /wifi/WCNSS_cfg.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mi-Thorium/android_device_xiaomi_mithorium-common/HEAD/wifi/WCNSS_cfg.dat -------------------------------------------------------------------------------- /sepolicy/vendor/fastbootd.te: -------------------------------------------------------------------------------- 1 | recovery_only(` 2 | allow fastbootd persist_block_device:blk_file { rw_file_perms }; 3 | ') 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hvdcp.te: -------------------------------------------------------------------------------- 1 | allow hvdcp sysfs:dir r_dir_perms; 2 | 3 | recovery_only(` 4 | domain_trans(init, rootfs, hvdcp) 5 | ') 6 | -------------------------------------------------------------------------------- /sepolicy/legacy/vendor/file_contexts: -------------------------------------------------------------------------------- 1 | # Shell Script 2 | /(vendor|system/vendor)/bin/init\.baseband\.sh u:object_r:init_baseband_exec:s0 3 | -------------------------------------------------------------------------------- /parts/proguard.flags: -------------------------------------------------------------------------------- 1 | -keep class org.lineageos.settings.dirac.* { 2 | *; 3 | } 4 | 5 | -keep class org.lineageos.settings.doze.* { 6 | *; 7 | } 8 | -------------------------------------------------------------------------------- /gps/pla/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_headers { 3 | 4 | name: "libloc_pla_headers", 5 | export_include_dirs: ["android"], 6 | vendor: true, 7 | } 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/recovery.te: -------------------------------------------------------------------------------- 1 | recovery_only(` 2 | allow recovery sysfs_graphics:dir r_dir_perms; 3 | allow recovery sysfs_graphics:file rw_file_perms; 4 | ') 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/seapp_contexts: -------------------------------------------------------------------------------- 1 | # Power-off Alarm 2 | user=_app seinfo=platform name=com.qualcomm.qti.poweroffalarm domain=poweroffalarm_app type=app_data_file levelFrom=all 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | typeattribute tee data_between_core_and_vendor_violators; 2 | 3 | # /data/goodix labeling 4 | 5 | allow tee system_data_file:dir create_dir_perms; 6 | 7 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "WifiOverlay", 3 | theme: "WifiOverlay", 4 | sdk_version: "current", 5 | vendor: true 6 | } 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/rmt_storage.te: -------------------------------------------------------------------------------- 1 | # debugfs access 2 | userdebug_or_eng(` 3 | allow rmt_storage debugfs_rmt:dir search; 4 | allow rmt_storage debugfs_rmt:file rw_file_perms; 5 | ') 6 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay_5GHz/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "WifiOverlay_5GHz", 3 | theme: "WifiOverlay", 4 | sdk_version: "current", 5 | vendor: true 6 | } 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_ir_default.te: -------------------------------------------------------------------------------- 1 | allow hal_ir_default ir_device:chr_file rw_file_perms; 2 | allow hal_ir_default sysfs_leds:dir r_dir_perms; 3 | allow hal_ir_default sysfs_leds:file rw_file_perms; 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Common device tree for Xiaomi Thorium devices 2 | 3 | ``` 4 | # 5 | # Copyright (C) 2017-2022 The LineageOS Project 6 | # 7 | # SPDX-License-Identifier: Apache-2.0 8 | # 9 | ``` 10 | -------------------------------------------------------------------------------- /subsystem_state_notifier/subsystem_state_notifier.rc: -------------------------------------------------------------------------------- 1 | service vendor.subsystem_state_notifier.modem /vendor/bin/subsystem_state_notifier modem 2 | class main 3 | user system 4 | group system 5 | -------------------------------------------------------------------------------- /proprietary-files/4.19/qcom-vendor-multilib-module.txt: -------------------------------------------------------------------------------- 1 | # All unpinned blobs below are extracted from LA.UM.9.6.3.r1-06200-89xx.0 2 | 3 | # ADSP 4 | -vendor/lib/libadsprpc.so 5 | -vendor/lib64/libadsprpc.so 6 | -------------------------------------------------------------------------------- /rootdir/bin/init.baseband.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | 3 | baseband_str=$(grep -Eo 'MPSS.*' /sys/devices/soc0/images) 4 | 5 | if [ "$baseband_str" ]; then 6 | setprop gsm.version.baseband $baseband_str 7 | fi 8 | -------------------------------------------------------------------------------- /gps/android/1.0/android.hardware.gnss@1.0-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /gps/android/1.1/android.hardware.gnss@1.1-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /gps/android/2.0/android.hardware.gnss@2.0-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@2.0-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /gps/android/2.1/android.hardware.gnss@2.1-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@2.1-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /proprietary-files/4.9/qcom-vendor-multilib-module.txt: -------------------------------------------------------------------------------- 1 | # All unpinned blobs below are extracted from LA.UM.9.6.3.r1-06200-89xx.0 (4.9) 2 | 3 | # ADSP 4 | -vendor/lib/libadsprpc.so 5 | -vendor/lib64/libadsprpc.so 6 | -------------------------------------------------------------------------------- /rro_overlays/HapticOverlay_Settings/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "HapticOverlay_Settings", 3 | theme: "HapticOverlay_Settings", 4 | sdk_version: "current", 5 | vendor: true 6 | } 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_wifi_default.te: -------------------------------------------------------------------------------- 1 | allow hal_wifi_default proc_net:file rw_file_perms; 2 | allow hal_wifi_default mnt_vendor_file:file r_file_perms; 3 | allow hal_wifi_default wifi_vendor_data_file:dir r_dir_perms; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/netmgrd.te: -------------------------------------------------------------------------------- 1 | typeattribute netmgrd vendor_executes_system_violators; 2 | 3 | set_prop(netmgrd, vendor_xlat_prop) 4 | 5 | allow netmgrd system_file:file { execute execute_no_trans getattr open read }; 6 | -------------------------------------------------------------------------------- /lights/lights-xiaomi_mithorium.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.light 4 | ILights/default 5 | 6 | 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | # Dirac 2 | type dirac_prop, property_type; 3 | 4 | # Subsystem state notifier 5 | type vendor_subsys_state_notifier_prop, property_type; 6 | 7 | # Xiaomi 8 | type vendor_xiaomi_prop, property_type; 9 | -------------------------------------------------------------------------------- /sepolicy/vendor/qti_init_shell.te: -------------------------------------------------------------------------------- 1 | typeattribute qti_init_shell data_between_core_and_vendor_violators; 2 | 3 | allow qti_init_shell bluetooth_data_file:file r_file_perms; 4 | allow qti_init_shell sysfs_net:file rw_file_perms; 5 | -------------------------------------------------------------------------------- /rro_overlays/HapticOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "HapticOverlay", 3 | theme: "HapticOverlay", 4 | sdk_version: "current", 5 | required: ["HapticOverlay_Settings"], 6 | vendor: true 7 | } 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | # Dirac 2 | get_prop(hal_audio_default, dirac_prop) 3 | set_prop(hal_audio_default, dirac_prop) 4 | 5 | allow hal_audio_default self:capability sys_nice; 6 | allow hal_audio_default sysfs:dir r_dir_perms; 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libshim/Android.mk: -------------------------------------------------------------------------------- 1 | include $(CLEAR_VARS) 2 | LOCAL_SHARED_LIBRARIES := libgui_vendor 3 | LOCAL_MODULE := libwui 4 | LOCAL_MODULE_TAGS := optional 5 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 6 | LOCAL_VENDOR_MODULE := true 7 | include $(BUILD_SHARED_LIBRARY) 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bluetooth_default.te: -------------------------------------------------------------------------------- 1 | typeattribute hal_bluetooth_default data_between_core_and_vendor_violators; 2 | 3 | allow hal_bluetooth_default bluetooth_data_file:dir search; 4 | allow hal_bluetooth_default bluetooth_data_file:file r_file_perms; 5 | -------------------------------------------------------------------------------- /configs/manifest/consumerir.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.ir 4 | hwbinder 5 | @1.0::IConsumerIr/default 6 | 7 | 8 | -------------------------------------------------------------------------------- /gps/gps_vendor_board.mk: -------------------------------------------------------------------------------- 1 | # Flags from BoardConfigVendor.mk 2 | ifneq ($(TARGET_USES_QMAA),true) 3 | BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default 4 | else ifneq ($(TARGET_USES_QMAA_OVERRIDE_GPS),false) 5 | BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default 6 | endif 7 | 8 | -------------------------------------------------------------------------------- /gps/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 | -------------------------------------------------------------------------------- /configs/manifest/cryptfshw.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | vendor.qti.hardware.cryptfshw 4 | hwbinder 5 | @1.0::ICryptfsHw/default 6 | 7 | 8 | -------------------------------------------------------------------------------- /configs/manifest/gatekeeper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.gatekeeper 4 | hwbinder 5 | @1.0::IGatekeeper/default 6 | 7 | 8 | -------------------------------------------------------------------------------- /configs/manifest/keymaster.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.keymaster 4 | hwbinder 5 | @3.0::IKeymasterDevice/default 6 | 7 | 8 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /manifest_k4.9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.configstore 4 | hwbinder 5 | @1.1::ISurfaceFlingerConfigs/default 6 | 7 | 8 | -------------------------------------------------------------------------------- /gps/batching/location-batching.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-batching 7 | Description: QTI GPS Batching 8 | Version: @VERSION 9 | Libs: -L${libdir} -lbatching 10 | Cflags: -I${includedir}/location-batching 11 | -------------------------------------------------------------------------------- /gps/geofence/location-geofence.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-geofence 7 | Description: QTI GPS Geofence 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgeofencing 10 | Cflags: -I${includedir}/location-geofence 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/ueventd.te: -------------------------------------------------------------------------------- 1 | typeattribute ueventd data_between_core_and_vendor_violators; 2 | 3 | allow ueventd wcnss_persist_file:file r_file_perms; 4 | allow ueventd wifi_vendor_data_file:dir r_dir_perms; 5 | allow ueventd wifi_vendor_data_file:file r_file_perms; 6 | 7 | allow ueventd self:capability kill; 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_server.te: -------------------------------------------------------------------------------- 1 | # Input devices 2 | r_dir_file(system_server, vendor_idc_file); 3 | r_dir_file(system_server, vendor_keylayout_file); 4 | 5 | get_prop(system_server, exported_camera_prop); 6 | get_prop(system_server, userspace_reboot_config_prop); 7 | get_prop(system_server, userspace_reboot_exported_prop); 8 | -------------------------------------------------------------------------------- /libshim/libbinder/IServiceManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | 9 | namespace android { 10 | 11 | bool checkCallingPermission(const String16& /* permission */) { 12 | return true; 13 | }; 14 | 15 | } // namespace android 16 | -------------------------------------------------------------------------------- /libinit/init_xiaomi_mithorium.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #include "vendor_init.h" 11 | 12 | void vendor_load_properties() { 13 | set_bootloader_prop(); 14 | set_dalvik_heap(); 15 | } 16 | -------------------------------------------------------------------------------- /sepolicy/vendor/radio.te: -------------------------------------------------------------------------------- 1 | binder_call(radio, cnd) 2 | allow radio hal_datafactory_hwservice:hwservice_manager find; 3 | allow radio hal_iwlan_hwservice:hwservice_manager find; 4 | allow radio { cameraserver_service mediaextractor_service mediaserver_service mediametrics_service drmserver_service audioserver_service }:service_manager find; 5 | 6 | get_prop(radio, vendor_qcom_ims_prop) 7 | -------------------------------------------------------------------------------- /rro_overlays/HapticOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /subsystem_state_notifier/Android.bp: -------------------------------------------------------------------------------- 1 | cc_binary { 2 | name: "subsystem_state_notifier", 3 | cflags: [ 4 | "-Wall", 5 | "-Wextra", 6 | "-Werror", 7 | "-Wunused", 8 | ], 9 | srcs: [ 10 | "main.c", 11 | ], 12 | shared_libs: [ 13 | "libcutils", 14 | "liblog", 15 | ], 16 | init_rc: ["subsystem_state_notifier.rc"], 17 | vendor: true 18 | } 19 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_preset.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /rro_overlays/HapticOverlay_Settings/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/init.te: -------------------------------------------------------------------------------- 1 | allow init proc_boot_reason:file r_file_perms; 2 | 3 | # Firmware 4 | allow init firmware_file:filesystem getattr; 5 | 6 | # LED 7 | allow init sysfs_leds:lnk_file r_file_perms; 8 | 9 | # Prop 10 | get_prop(init, vendor_subsys_state_notifier_prop) 11 | get_prop(init, vendor_xiaomi_prop) 12 | 13 | # SDHCI 14 | allow init sysfs_kernel_sdhci_msm:file w_file_perms; 15 | 16 | # SoC info 17 | r_dir_file(init, sysfs_socinfo) 18 | -------------------------------------------------------------------------------- /lights/Android.bp: -------------------------------------------------------------------------------- 1 | cc_binary { 2 | name: "android.hardware.lights-service.xiaomi_mithorium", 3 | relative_install_path: "hw", 4 | init_rc: ["lights-xiaomi_mithorium.rc"], 5 | vintf_fragments: ["lights-xiaomi_mithorium.xml"], 6 | vendor: true, 7 | shared_libs: [ 8 | "libbase", 9 | "libbinder_ndk", 10 | "android.hardware.light-ndk_platform", 11 | ], 12 | srcs: [ 13 | "Lights.cpp", 14 | "main.cpp", 15 | ], 16 | } 17 | -------------------------------------------------------------------------------- /libhidl/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_shared { 8 | name: "android.hidl.base@1.0", 9 | shared_libs: ["libhidlbase"], 10 | system_ext_specific: true, 11 | vendor_available: true, 12 | } 13 | 14 | cc_library_shared { 15 | name: "android.hidl.manager@1.0", 16 | shared_libs: ["libhidlbase"], 17 | system_ext_specific: true, 18 | vendor_available: true, 19 | } 20 | -------------------------------------------------------------------------------- /configs/manifest/q-display-stack.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.graphics.allocator 4 | hwbinder 5 | @2.0::IAllocator/default 6 | 7 | 8 | android.hardware.graphics.mapper 9 | passthrough 10 | @2.1::IMapper/default 11 | 12 | 13 | -------------------------------------------------------------------------------- /libinit/include/libinit_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | void property_override(std::string prop, std::string value, bool add = true); 12 | 13 | void set_ro_build_prop(const std::string &prop, const std::string &value, bool product = false); 14 | 15 | std::string fingerprint_to_description(std::string fingerprint); 16 | 17 | void set_bootloader_prop(void); 18 | -------------------------------------------------------------------------------- /libinit/include/libinit_dalvik_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | typedef struct dalvik_heap_info { 12 | std::string heapstartsize; 13 | std::string heapgrowthlimit; 14 | std::string heapsize; 15 | std::string heapminfree; 16 | std::string heapmaxfree; 17 | std::string heaptargetutilization; 18 | } dalvik_heap_info_t; 19 | 20 | void set_dalvik_heap(void); 21 | -------------------------------------------------------------------------------- /parts/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2017-2022 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | android_app { 8 | name: "XiaomiParts", 9 | 10 | srcs: ["src/**/*.java"], 11 | resource_dirs: ["res"], 12 | certificate: "platform", 13 | platform_apis: true, 14 | privileged: true, 15 | 16 | static_libs: [ 17 | "org.lineageos.settings.resources", 18 | ], 19 | 20 | optimize: { 21 | proguard_flags_files: ["proguard.flags"], 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /sepolicy/vendor/subsystem_state_notifier.te: -------------------------------------------------------------------------------- 1 | type subsystem_state_notifier, domain; 2 | type subsystem_state_notifier_exec, exec_type, vendor_file_type, file_type; 3 | 4 | # Allow for transition from init domain to subsystem_state_notifier 5 | init_daemon_domain(subsystem_state_notifier) 6 | 7 | # Allow to read sysfs_modem_subsys 8 | allow subsystem_state_notifier sysfs_modem_subsys:file r_file_perms; 9 | 10 | # Allow to access subsys state notifier props 11 | set_prop(subsystem_state_notifier, vendor_subsys_state_notifier_prop) 12 | -------------------------------------------------------------------------------- /libshim/libbinder/PermissionCache.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | 9 | namespace android { 10 | namespace PermissionCache { 11 | 12 | bool checkPermission(const String16& /* permission */, pid_t /* pid */, uid_t /* uid */) { 13 | return true; 14 | }; 15 | 16 | bool checkCallingPermission(const String16& /* permission */) { 17 | return true; 18 | }; 19 | 20 | } // namespace PermissionCache 21 | } // namespace android 22 | -------------------------------------------------------------------------------- /libinit/include/libinit_variant.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | typedef struct variant_info { 12 | std::string hwc_value; 13 | std::string sku_value; 14 | 15 | std::string brand; 16 | std::string device; 17 | std::string marketname; 18 | std::string model; 19 | std::string build_fingerprint; 20 | 21 | unsigned int dpi; 22 | } variant_info_t; 23 | 24 | void set_variant_props(const variant_info_t variant); 25 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_headphone.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /libshim/libshims_gui.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace android { 5 | extern "C" void _ZN7android20DisplayEventReceiverC1ENS_16ISurfaceComposer11VsyncSourceENS1_13ConfigChangedE(void* vsyncSource, ISurfaceComposer::ConfigChanged configChanged); 6 | 7 | extern "C" void _ZN7android20DisplayEventReceiverC1ENS_16ISurfaceComposer11VsyncSourceE(void *vsyncSource) { 8 | _ZN7android20DisplayEventReceiverC1ENS_16ISurfaceComposer11VsyncSourceENS1_13ConfigChangedE(vsyncSource, ISurfaceComposer::eConfigChangedSuppress); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /sepolicy/legacy/vendor/init_baseband.te: -------------------------------------------------------------------------------- 1 | type init_baseband, domain; 2 | type init_baseband_exec, exec_type, vendor_file_type, file_type; 3 | 4 | # Allow for transition from init domain to init_baseband 5 | init_daemon_domain(init_baseband) 6 | 7 | # Shell script needs to execute /vendor/bin/sh 8 | allow init_baseband vendor_shell_exec:file { rx_file_perms entrypoint }; 9 | allow init_baseband vendor_toolbox_exec:file rx_file_perms; 10 | 11 | # Allow reading firmware version info 12 | r_dir_file(init_baseband, sysfs_socinfo) 13 | 14 | # Allow setting gsm. property 15 | set_prop(init_baseband, radio_prop) -------------------------------------------------------------------------------- /sepolicy/vendor/init_xiaomi.te: -------------------------------------------------------------------------------- 1 | type init_xiaomi, domain; 2 | type init_xiaomi_exec, exec_type, vendor_file_type, file_type; 3 | 4 | # Allow for transition from init domain to init_xiaomi 5 | init_daemon_domain(init_xiaomi) 6 | 7 | # Shell script needs to execute /vendor/bin/sh 8 | allow init_xiaomi vendor_shell_exec:file rx_file_perms; 9 | allow init_xiaomi vendor_toolbox_exec:file rx_file_perms; 10 | 11 | # Allow to read FDT model 12 | allow init_xiaomi fdt_model:file r_file_perms; 13 | 14 | # Allow to get/set prop 15 | get_prop(init_xiaomi, vendor_xiaomi_prop) 16 | set_prop(init_xiaomi, vendor_xiaomi_prop) 17 | -------------------------------------------------------------------------------- /gps/geofence/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | 3 | cc_library_shared { 4 | 5 | name: "libgeofencing", 6 | vendor: true, 7 | 8 | 9 | 10 | srcs: [ 11 | "GeofenceAdapter.cpp", 12 | "location_geofence.cpp", 13 | ], 14 | 15 | shared_libs: [ 16 | "libutils", 17 | "libcutils", 18 | "libgps.utils", 19 | "liblog", 20 | "libloc_core", 21 | ], 22 | 23 | header_libs: [ 24 | "libgps.utils_headers", 25 | "libloc_core_headers", 26 | "libloc_pla_headers", 27 | "liblocation_api_headers", 28 | ], 29 | 30 | cflags: GNSS_CFLAGS, 31 | } 32 | -------------------------------------------------------------------------------- /charger_led/Android.bp: -------------------------------------------------------------------------------- 1 | cc_defaults { 2 | name: "charger_led_defaults", 3 | cflags: [ 4 | "-Wall", 5 | "-Wextra", 6 | "-Werror", 7 | "-Wunused", 8 | ], 9 | shared_libs: ["libcutils"], 10 | srcs: ["main.c"], 11 | } 12 | 13 | cc_binary { 14 | name: "charger_led", 15 | defaults: ["charger_led_defaults"], 16 | vendor: true, 17 | init_rc: ["charger_led.rc"], 18 | } 19 | 20 | cc_binary { 21 | name: "charger_led_recovery", 22 | stem: "charger_led", 23 | defaults: ["charger_led_defaults"], 24 | recovery: true, 25 | init_rc: ["charger_led.recovery.rc"], 26 | } 27 | -------------------------------------------------------------------------------- /gps/batching/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "libbatching", 5 | vendor: true, 6 | 7 | 8 | 9 | shared_libs: [ 10 | "libutils", 11 | "libcutils", 12 | "liblog", 13 | "libloc_core", 14 | "libgps.utils", 15 | "libdl", 16 | ], 17 | 18 | srcs: [ 19 | "location_batching.cpp", 20 | "BatchingAdapter.cpp", 21 | ], 22 | 23 | header_libs: [ 24 | "libgps.utils_headers", 25 | "libloc_core_headers", 26 | "libloc_pla_headers", 27 | "liblocation_api_headers", 28 | ], 29 | 30 | cflags: GNSS_CFLAGS, 31 | } 32 | -------------------------------------------------------------------------------- /sepolicy/vendor/file.te: -------------------------------------------------------------------------------- 1 | # Boot reason 2 | type proc_boot_reason, fs_type, proc_type; 3 | 4 | # Camera 5 | type camera_socket, file_type, data_file_type; 6 | 7 | # FDT 8 | type fdt_compatible, fs_type, sysfs_type; 9 | type fdt_model, fs_type, sysfs_type; 10 | type fdt_sound, fs_type, sysfs_type; 11 | 12 | # Firmware 13 | type wcnss_persist_file, file_type, vendor_persist_type; 14 | 15 | # Rild 16 | type rild_file, file_type, vendor_file_type; 17 | 18 | # Rmt 19 | type debugfs_rmt, debugfs_type, fs_type; 20 | 21 | # SDHCI 22 | type sysfs_kernel_sdhci_msm, fs_type, sysfs_type; 23 | 24 | # Subsystem 25 | type sysfs_modem_subsys, fs_type, sysfs_type; 26 | -------------------------------------------------------------------------------- /gps/location/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "liblocation_api", 5 | vendor: true, 6 | 7 | 8 | 9 | shared_libs: [ 10 | "libutils", 11 | "libcutils", 12 | "libgps.utils", 13 | "libdl", 14 | "liblog", 15 | ], 16 | 17 | srcs: [ 18 | "LocationAPI.cpp", 19 | "LocationAPIClientBase.cpp", 20 | ], 21 | 22 | cflags: ["-fno-short-enums"] + GNSS_CFLAGS, 23 | 24 | header_libs: [ 25 | "libloc_pla_headers", 26 | "libgps.utils_headers", 27 | ], 28 | 29 | } 30 | 31 | cc_library_headers { 32 | 33 | name: "liblocation_api_headers", 34 | export_include_dirs: ["."], 35 | vendor: true, 36 | } 37 | -------------------------------------------------------------------------------- /libinit/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2019-2022 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_static { 8 | name: "libinit_xiaomi_mithorium", 9 | srcs: [ 10 | "libinit_dalvik_heap.cpp", 11 | "libinit_utils.cpp", 12 | "libinit_variant.cpp", 13 | ], 14 | whole_static_libs: ["libbase"], 15 | export_include_dirs: ["include"], 16 | recovery_available: true, 17 | } 18 | 19 | cc_library_static { 20 | name: "init_xiaomi_mithorium", 21 | srcs: ["init_xiaomi_mithorium.cpp"], 22 | whole_static_libs: ["libinit_xiaomi_mithorium"], 23 | include_dirs: ["system/core/init"], 24 | recovery_available: true, 25 | } 26 | -------------------------------------------------------------------------------- /gps/gnss/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | 3 | cc_library_shared { 4 | 5 | name: "libgnss", 6 | vendor: true, 7 | 8 | 9 | 10 | shared_libs: [ 11 | "libutils", 12 | "libcutils", 13 | "libdl", 14 | "liblog", 15 | "libloc_core", 16 | "libgps.utils", 17 | ], 18 | 19 | srcs: [ 20 | "location_gnss.cpp", 21 | "GnssAdapter.cpp", 22 | "Agps.cpp", 23 | "XtraSystemStatusObserver.cpp", 24 | "NativeAgpsHandler.cpp", 25 | ], 26 | 27 | cflags: ["-fno-short-enums"] + GNSS_CFLAGS, 28 | header_libs: [ 29 | "libgps.utils_headers", 30 | "libloc_core_headers", 31 | "libloc_pla_headers", 32 | "liblocation_api_headers", 33 | ], 34 | 35 | } 36 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | typeattribute vendor_init data_between_core_and_vendor_violators; 2 | 3 | allow vendor_init { 4 | bluetooth_data_file 5 | camera_data_file 6 | media_rw_data_file 7 | nfc_data_file 8 | system_data_file 9 | wifi_data_file 10 | wpa_socket 11 | tombstone_data_file 12 | system_data_root_file 13 | }:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom }; 14 | 15 | allow vendor_init { 16 | ipa_dev 17 | }:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom }; 18 | 19 | allow vendor_init { 20 | ipa_dev 21 | }:file rw_file_perms; 22 | 23 | allow vendor_init { 24 | proc_dirty 25 | proc_dirty_ratio 26 | sysfs_kernel_sdhci_msm 27 | }:file w_file_perms; 28 | -------------------------------------------------------------------------------- /sepolicy/vendor/init_acdbdata.te: -------------------------------------------------------------------------------- 1 | type init_acdbdata, domain; 2 | type init_acdbdata_exec, exec_type, vendor_file_type, file_type; 3 | 4 | # Allow for transition from init domain to init_acdbdata 5 | init_daemon_domain(init_acdbdata) 6 | 7 | # Shell script needs to execute /vendor/bin/sh 8 | allow init_acdbdata vendor_shell_exec:file rx_file_perms; 9 | allow init_acdbdata vendor_toolbox_exec:file rx_file_perms; 10 | 11 | # Allow to read FDT 12 | allow init_acdbdata fdt_compatible:file r_file_perms; 13 | allow init_acdbdata fdt_sound:file r_file_perms; 14 | 15 | # Allow to read vendor files 16 | allow init_acdbdata vendor_configs_file:dir r_dir_perms; 17 | allow init_acdbdata vendor_configs_file:file r_file_perms; 18 | 19 | # Allow to set prop 20 | set_prop(init_acdbdata, vendor_audio_prop) 21 | -------------------------------------------------------------------------------- /sepolicy/vendor/mm-qcamerad.te: -------------------------------------------------------------------------------- 1 | typeattribute mm-qcamerad data_between_core_and_vendor_violators; 2 | 3 | type_transition mm-qcamerad camera_data_file:sock_file camera_socket "cam_socket1"; 4 | type_transition mm-qcamerad camera_data_file:sock_file camera_socket "cam_socket2"; 5 | allow mm-qcamerad camera_socket:dir w_dir_perms; 6 | allow mm-qcamerad camera_socket:sock_file { create unlink write }; 7 | allow mm-qcamerad self:qipcrtr_socket { create getattr read setopt write }; 8 | allow mm-qcamerad sysfs_graphics:file r_file_perms; 9 | allow mm-qcamerad sysfs_jpeg:file r_file_perms; 10 | allow mm-qcamerad { camera_data_file vendor_camera_data_file }:file create_file_perms; 11 | allow mm-qcamerad camera_data_file:dir w_dir_perms; 12 | allow mm-qcamerad fwk_sensor_hwservice:hwservice_manager find; 13 | -------------------------------------------------------------------------------- /rootdir/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | # TODO on S 4 | # - Move to Soong with prebuilt_root 5 | # - ueventd.rc can go to vendor/etc/ueventd.rc 6 | # See https://android-review.googlesource.com/c/platform/system/core/+/1526382 7 | 8 | # Init scripts 9 | 10 | include $(CLEAR_VARS) 11 | LOCAL_MODULE := init.recovery.qcom.rc 12 | LOCAL_MODULE_TAGS := optional 13 | LOCAL_MODULE_CLASS := ETC 14 | LOCAL_SRC_FILES := etc/init.recovery.qcom.rc 15 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) 16 | include $(BUILD_PREBUILT) 17 | 18 | include $(CLEAR_VARS) 19 | LOCAL_MODULE := ueventd.qcom.rc 20 | LOCAL_MODULE_STEM := ueventd.rc 21 | LOCAL_MODULE_TAGS := optional 22 | LOCAL_MODULE_CLASS := ETC 23 | LOCAL_SRC_FILES := etc/ueventd.qcom.rc 24 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR) 25 | include $(BUILD_PREBUILT) 26 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_pickup.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /gps/android/utils/Android.bp: -------------------------------------------------------------------------------- 1 | cc_library_static { 2 | 3 | name: "liblocbatterylistener", 4 | vendor: true, 5 | 6 | 7 | 8 | cflags: GNSS_CFLAGS + ["-DBATTERY_LISTENER_ENABLED"], 9 | local_include_dirs: ["."], 10 | 11 | srcs: ["battery_listener.cpp"], 12 | 13 | shared_libs: [ 14 | "liblog", 15 | "libhidlbase", 16 | "libcutils", 17 | "libutils", 18 | "android.hardware.health@1.0", 19 | "android.hardware.health@2.0", 20 | "android.hardware.health@2.1", 21 | "android.hardware.power@1.2", 22 | "libbase", 23 | ], 24 | 25 | static_libs: ["libhealthhalutils"], 26 | 27 | header_libs: [ 28 | "libgps.utils_headers", 29 | "libloc_pla_headers", 30 | ], 31 | } 32 | 33 | cc_library_headers { 34 | 35 | name: "liblocbatterylistener_headers", 36 | export_include_dirs: ["."], 37 | } 38 | -------------------------------------------------------------------------------- /thermal/Android.bp: -------------------------------------------------------------------------------- 1 | cc_binary { 2 | name: "android.hardware.thermal@2.0-service.qti.xiaomi_mithorium", 3 | defaults: [ 4 | "hidl_defaults", 5 | ], 6 | vendor: true, 7 | relative_install_path: "hw", 8 | init_rc: ["android.hardware.thermal@2.0-service.qti.xiaomi_mithorium.rc"], 9 | vintf_fragments: ["android.hardware.thermal@2.0-service.qti.xiaomi_mithorium.xml"], 10 | srcs: [ 11 | "service.cpp", 12 | "thermal.cpp", 13 | "thermalConfig.cpp", 14 | "thermalCommon.cpp", 15 | "thermalUtils.cpp", 16 | "thermalMonitor.cpp", 17 | ], 18 | shared_libs: [ 19 | "libbase", 20 | "libcutils", 21 | "libhidlbase", 22 | "libutils", 23 | "liblog", 24 | "android.hardware.thermal@1.0", 25 | "android.hardware.thermal@2.0", 26 | ], 27 | header_libs: [ 28 | "liblog_headers", 29 | "libcutils_headers" 30 | ], 31 | cflags: [ 32 | "-Wno-unused-parameter", 33 | "-Wno-unused-variable", 34 | ], 35 | } 36 | -------------------------------------------------------------------------------- /charger_led/charger_led.recovery.rc: -------------------------------------------------------------------------------- 1 | service charger_led /system/bin/charger_led 2 | user system 3 | group system 4 | file /dev/kmsg w 5 | seclabel u:r:charger_led:s0 6 | oneshot 7 | 8 | on early-init 9 | chown system system /sys/class/leds/red/blink 10 | chown system system /sys/class/leds/red/breath 11 | chown system system /sys/class/leds/red/brightness 12 | 13 | chown system system /sys/class/leds/green/blink 14 | chown system system /sys/class/leds/green/breath 15 | chown system system /sys/class/leds/green/brightness 16 | 17 | chown system system /sys/class/leds/blue/blink 18 | chown system system /sys/class/leds/blue/breath 19 | chown system system /sys/class/leds/blue/brightness 20 | 21 | chown system system /sys/class/leds/white/blink 22 | chown system system /sys/class/leds/white/breath 23 | chown system system /sys/class/leds/white/brightness 24 | -------------------------------------------------------------------------------- /configs/component-overrides.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /gps/android/auto_power/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | 3 | cc_library_shared { 4 | 5 | name: "libgnssauto_power", 6 | vendor: true, 7 | local_include_dirs: ["."], 8 | 9 | srcs: ["GnssAutoPowerHandler.cpp"], 10 | 11 | header_libs: [ 12 | "libgps.utils_headers", 13 | "libloc_core_headers", 14 | "libloc_pla_headers", 15 | "vhal_v2_0_common_headers", 16 | "liblocation_api_headers", 17 | ], 18 | 19 | shared_libs: [ 20 | "liblog", 21 | "libhidlbase", 22 | "libcutils", 23 | "libutils", 24 | "libgps.utils", 25 | "liblocation_api", 26 | "android.hardware.gnss@1.0", 27 | "android.hardware.health@1.0", 28 | "android.hardware.health@2.0", 29 | "android.hardware.power@1.2", 30 | "android.hardware.automotive.vehicle@2.0", 31 | "libbase", 32 | ], 33 | 34 | cflags: GNSS_CFLAGS, 35 | } 36 | -------------------------------------------------------------------------------- /sepolicy/vendor/charger_led.te: -------------------------------------------------------------------------------- 1 | type charger_led, domain; 2 | type charger_led_exec, exec_type, vendor_file_type, file_type; 3 | 4 | # Allow for transition from init domain to charger_led 5 | init_daemon_domain(charger_led) 6 | 7 | recovery_only(` 8 | domain_trans(init, rootfs, charger_led) 9 | ') 10 | 11 | # Allow to write logs to /dev/kmsg 12 | allow charger_led kmsg_device:chr_file rw_file_perms; 13 | 14 | # Allow to read sysfs power_supply 15 | allow charger_led sysfs_battery_supply:dir r_dir_perms; 16 | allow charger_led sysfs_battery_supply:file r_file_perms; 17 | allow charger_led sysfs_usb_supply:dir r_dir_perms; 18 | allow charger_led sysfs_usb_supply:file r_file_perms; 19 | 20 | # Allow to write sysfs leds 21 | allow charger_led sysfs_graphics:dir r_dir_perms; 22 | allow charger_led sysfs_graphics:file rw_file_perms; 23 | allow charger_led sysfs_leds:dir r_dir_perms; 24 | allow charger_led sysfs_leds:file rw_file_perms; 25 | -------------------------------------------------------------------------------- /gps/Android.bp: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS = [ 2 | "-Werror", 3 | "-Wno-error=unused-parameter", 4 | "-Wno-error=macro-redefined", 5 | "-Wno-error=reorder", 6 | "-Wno-error=missing-braces", 7 | "-Wno-error=self-assign", 8 | "-Wno-error=enum-conversion", 9 | "-Wno-error=logical-op-parentheses", 10 | "-Wno-error=null-arithmetic", 11 | "-Wno-error=null-conversion", 12 | "-Wno-error=parentheses-equality", 13 | "-Wno-error=undefined-bool-conversion", 14 | "-Wno-error=tautological-compare", 15 | "-Wno-error=switch", 16 | "-Wno-error=date-time", 17 | ] 18 | 19 | /* Activate the following for debug purposes only, 20 | comment out for production */ 21 | GNSS_SANITIZE_DIAG = { 22 | /* 23 | diag: { 24 | cfi: true, 25 | misc_undefined: [ 26 | "bounds", 27 | "null", 28 | "unreachable", 29 | "integer", 30 | ], 31 | }, 32 | */ 33 | } 34 | -------------------------------------------------------------------------------- /gps/gps_vendor_product.mk: -------------------------------------------------------------------------------- 1 | PRODUCT_PACKAGES += gps.conf 2 | PRODUCT_PACKAGES += flp.conf 3 | PRODUCT_PACKAGES += gnss_antenna_info.conf 4 | PRODUCT_PACKAGES += gnss@2.0-base.policy 5 | PRODUCT_PACKAGES += gnss@2.0-xtra-daemon.policy 6 | PRODUCT_PACKAGES += gnss@2.0-xtwifi-client.policy 7 | PRODUCT_PACKAGES += gnss@2.0-xtwifi-inet-agent.policy 8 | PRODUCT_PACKAGES += libloc_pla_headers 9 | PRODUCT_PACKAGES += liblocation_api_headers 10 | PRODUCT_PACKAGES += libgps.utils_headers 11 | PRODUCT_PACKAGES += liblocation_api 12 | PRODUCT_PACKAGES += libgps.utils 13 | PRODUCT_PACKAGES += libbatching 14 | PRODUCT_PACKAGES += libgeofencing 15 | PRODUCT_PACKAGES += libloc_core 16 | PRODUCT_PACKAGES += libgnss 17 | 18 | ifeq ($(strip $(TARGET_BOARD_AUTO)),true) 19 | PRODUCT_PACKAGES += libgnssauto_power 20 | endif #TARGET_BOARD_AUTO 21 | 22 | PRODUCT_PACKAGES += android.hardware.gnss@2.1-impl-qti 23 | PRODUCT_PACKAGES += android.hardware.gnss@2.1-service-qti 24 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_hand.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | true 19 | 4 20 | 21 | -------------------------------------------------------------------------------- /libinit/libinit_variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | 9 | #include 10 | 11 | void set_variant_props(const variant_info_t variant) { 12 | set_ro_build_prop("brand", variant.brand, true); 13 | set_ro_build_prop("device", variant.device, true); 14 | set_ro_build_prop("marketname", variant.marketname, true); 15 | set_ro_build_prop("model", variant.model, true); 16 | 17 | if (variant.dpi) 18 | property_override("ro.sf.lcd_density", std::to_string(variant.dpi)); 19 | 20 | if (!variant.build_fingerprint.empty()) { 21 | set_ro_build_prop("fingerprint", variant.build_fingerprint); 22 | property_override("ro.bootimage.build.fingerprint", variant.build_fingerprint); 23 | property_override("ro.build.description", fingerprint_to_description(variant.build_fingerprint)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /parts/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | @*android:color/material_grey_600 19 | @android:color/white 20 | #BFFFFFFF 21 | 22 | 23 | -------------------------------------------------------------------------------- /parts/res/layout/doze.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /libshim/libshims_android.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace android { 4 | // libandroid.so 5 | extern "C" void ALooper_forThread() {} 6 | extern "C" void ALooper_pollOnce() {} 7 | extern "C" void ALooper_prepare() {} 8 | extern "C" void ALooper_wake() {} 9 | extern "C" void ASensor_getMaxRange() {} 10 | extern "C" void ASensor_getMinDelay() {} 11 | extern "C" void ASensor_getName() {} 12 | extern "C" void ASensor_getVendor() {} 13 | extern "C" void ASensorEventQueue_disableSensor() {} 14 | extern "C" void ASensorEventQueue_enableSensor() {} 15 | extern "C" void ASensorEventQueue_getEvents() {} 16 | extern "C" void ASensorEventQueue_setEventRate() {} 17 | extern "C" void ASensorManager_createEventQueue() {} 18 | extern "C" void ASensorManager_destroyEventQueue() {} 19 | extern "C" void ASensorManager_getDefaultSensor() {} 20 | extern "C" void ASensorManager_getInstanceForPackage() {} 21 | // libandroid_runtime.so 22 | extern "C" void _ZNK7android6Sensor11getMaxValueEv() {} 23 | } 24 | -------------------------------------------------------------------------------- /parts/res/layout/dirac.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /gps/gnss/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = \ 4 | $(LOCPLA_CFLAGS) \ 5 | $(LOCHAL_CFLAGS) \ 6 | $(GPSUTILS_CFLAGS) \ 7 | $(LOCCORE_CFLAGS) \ 8 | -I./ \ 9 | -I../location \ 10 | -std=c++14 11 | 12 | libgnss_la_SOURCES = \ 13 | location_gnss.cpp \ 14 | GnssAdapter.cpp \ 15 | XtraSystemStatusObserver.cpp \ 16 | Agps.cpp \ 17 | NativeAgpsHandler.cpp 18 | 19 | if USE_FEATURE_AUTOMOTIVE 20 | AM_CFLAGS += -DFEATURE_AUTOMOTIVE 21 | endif 22 | 23 | if USE_GLIB 24 | libgnss_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 25 | libgnss_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -avoid-version 26 | libgnss_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 27 | else 28 | libgnss_la_CFLAGS = $(AM_CFLAGS) 29 | libgnss_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 30 | libgnss_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 31 | endif 32 | 33 | libgnss_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) $(LOCCORE_LIBS) 34 | 35 | #Create and Install libraries 36 | lib_LTLIBRARIES = libgnss.la 37 | -------------------------------------------------------------------------------- /media/msm8953/media_codecs_vendor_audio.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /media/msm8937/media_codecs_vendor_audio.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /parts/res/drawable/ic_pocket.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay_5GHz/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | true 22 | 23 | 24 | true 25 | 26 | -------------------------------------------------------------------------------- /rro_overlays/HapticOverlay/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 22 | true 23 | 24 | -------------------------------------------------------------------------------- /gps/etc/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | prebuilt_etc { 3 | 4 | name: "gps.conf", 5 | vendor: true, 6 | src: "gps.conf", 7 | } 8 | 9 | prebuilt_etc { 10 | 11 | name: "flp.conf", 12 | vendor: true, 13 | src: "flp.conf", 14 | } 15 | 16 | prebuilt_etc { 17 | 18 | name: "gnss_antenna_info.conf", 19 | vendor: true, 20 | src: "gnss_antenna_info.conf", 21 | } 22 | 23 | prebuilt_etc { 24 | name: "gnss@2.0-base.policy", 25 | vendor: true, 26 | sub_dir: "seccomp_policy", 27 | src: "seccomp_policy/gnss@2.0-base.policy", 28 | } 29 | 30 | prebuilt_etc { 31 | name: "gnss@2.0-xtra-daemon.policy", 32 | vendor: true, 33 | sub_dir: "seccomp_policy", 34 | src: "seccomp_policy/gnss@2.0-xtra-daemon.policy", 35 | } 36 | 37 | prebuilt_etc { 38 | name: "gnss@2.0-xtwifi-client.policy", 39 | vendor: true, 40 | sub_dir: "seccomp_policy", 41 | src: "seccomp_policy/gnss@2.0-xtwifi-client.policy", 42 | } 43 | 44 | prebuilt_etc { 45 | name: "gnss@2.0-xtwifi-inet-agent.policy", 46 | vendor: true, 47 | sub_dir: "seccomp_policy", 48 | src: "seccomp_policy/gnss@2.0-xtwifi-inet-agent.policy", 49 | } 50 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 24 | 25 | 0 26 | -1 27 | -1 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /lights/lights-xiaomi_mithorium.rc: -------------------------------------------------------------------------------- 1 | on early-boot 2 | chown system system /sys/class/leds/red/blink 3 | chown system system /sys/class/leds/red/breath 4 | chown system system /sys/class/leds/red/brightness 5 | 6 | chown system system /sys/class/leds/green/blink 7 | chown system system /sys/class/leds/green/breath 8 | chown system system /sys/class/leds/green/brightness 9 | 10 | chown system system /sys/class/leds/blue/blink 11 | chown system system /sys/class/leds/blue/breath 12 | chown system system /sys/class/leds/blue/brightness 13 | 14 | chown system system /sys/class/leds/white/blink 15 | chown system system /sys/class/leds/white/breath 16 | chown system system /sys/class/leds/white/brightness 17 | 18 | chown system system /sys/class/leds/lcd-backlight/brightness 19 | chown system system /sys/class/backlight/panel0-backlight/brightness 20 | 21 | chown system system /sys/class/leds/button-backlight/brightness 22 | 23 | service vendor.light-xiaomi_mithorium /vendor/bin/hw/android.hardware.lights-service.xiaomi_mithorium 24 | class hal 25 | user system 26 | group system 27 | shutdown critical 28 | -------------------------------------------------------------------------------- /gps/utils/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "libgps.utils", 5 | vendor: true, 6 | 7 | 8 | 9 | //# Libs 10 | shared_libs: [ 11 | "libdl", 12 | "libutils", 13 | "libcutils", 14 | "liblog", 15 | "libprocessgroup", 16 | ], 17 | 18 | srcs: [ 19 | "loc_log.cpp", 20 | "loc_cfg.cpp", 21 | "msg_q.c", 22 | "linked_list.c", 23 | "loc_target.cpp", 24 | "LocHeap.cpp", 25 | "LocTimer.cpp", 26 | "LocThread.cpp", 27 | "MsgTask.cpp", 28 | "loc_misc_utils.cpp", 29 | "loc_nmea.cpp", 30 | "LocIpc.cpp", 31 | "LogBuffer.cpp", 32 | ], 33 | 34 | cflags: [ 35 | "-fno-short-enums", 36 | "-D_ANDROID_", 37 | ] + GNSS_CFLAGS, 38 | 39 | //# Includes 40 | ldflags: ["-Wl,--export-dynamic"], 41 | 42 | header_libs: [ 43 | "libutils_headers", 44 | "libloc_pla_headers", 45 | "liblocation_api_headers", 46 | ], 47 | } 48 | 49 | cc_library_headers { 50 | 51 | name: "libgps.utils_headers", 52 | export_include_dirs: ["."], 53 | vendor: true, 54 | } 55 | -------------------------------------------------------------------------------- /rootdir/etc/init.uclamp.rc: -------------------------------------------------------------------------------- 1 | # UClamp tunings 2 | on boot 3 | write /proc/sys/kernel/sched_util_clamp_min_rt_default 96 4 | write /proc/sys/kernel/sched_util_clamp_min 128 5 | 6 | # top-app 7 | write /dev/cpuset/top-app/uclamp.max max 8 | write /dev/cpuset/top-app/uclamp.min 20 9 | write /dev/cpuset/top-app/uclamp.boosted 1 10 | write /dev/cpuset/top-app/uclamp.latency_sensitive 1 11 | 12 | # foreground 13 | write /dev/cpuset/foreground/uclamp.max 50 14 | write /dev/cpuset/foreground/uclamp.min 20 15 | write /dev/cpuset/foreground/uclamp.boosted 0 16 | write /dev/cpuset/foreground/uclamp.latency_sensitive 0 17 | 18 | # background 19 | write /dev/cpuset/background/uclamp.max max 20 | write /dev/cpuset/background/uclamp.min 20 21 | write /dev/cpuset/background/uclamp.boosted 0 22 | write /dev/cpuset/background/uclamp.latency_sensitive 0 23 | 24 | # system-background 25 | write /dev/cpuset/system-background/uclamp.max 50 26 | write /dev/cpuset/system-background/uclamp.min 10 27 | write /dev/cpuset/system-background/uclamp.boosted 0 28 | write /dev/cpuset/system-background/uclamp.latency_sensitive 0 29 | -------------------------------------------------------------------------------- /overlay/packages/apps/Snap/res/values/qcomstrings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | off 20 | 21 | 22 | off 23 | 24 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay_5GHz/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /gps/core/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "libloc_core", 5 | vendor: true, 6 | 7 | 8 | 9 | shared_libs: [ 10 | "liblog", 11 | "libutils", 12 | "libcutils", 13 | "libgps.utils", 14 | "libdl", 15 | "liblog", 16 | ], 17 | 18 | srcs: [ 19 | "LocApiBase.cpp", 20 | "LocAdapterBase.cpp", 21 | "ContextBase.cpp", 22 | "LocContext.cpp", 23 | "loc_core_log.cpp", 24 | "data-items/DataItemsFactoryProxy.cpp", 25 | "data-items/DataItemConcreteTypes.cpp", 26 | "SystemStatusOsObserver.cpp", 27 | "SystemStatus.cpp", 28 | ], 29 | 30 | cflags: [ 31 | "-fno-short-enums", 32 | "-D_ANDROID_", 33 | ] + GNSS_CFLAGS, 34 | 35 | local_include_dirs: [ 36 | "data-items", 37 | "observer", 38 | ], 39 | 40 | header_libs: [ 41 | "libutils_headers", 42 | "libgps.utils_headers", 43 | "libloc_pla_headers", 44 | "liblocation_api_headers", 45 | ], 46 | 47 | } 48 | 49 | cc_library_headers { 50 | 51 | name: "libloc_core_headers", 52 | vendor: true, 53 | export_include_dirs: ["."] + [ 54 | "data-items", 55 | "observer", 56 | ], 57 | } 58 | -------------------------------------------------------------------------------- /bluetooth/bdroid_buildcfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The CyanogenMod Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _BDROID_BUILDCFG_H 18 | #define _BDROID_BUILDCFG_H 19 | // Disables read remote device feature 20 | #define BTA_SKIP_BLE_READ_REMOTE_FEAT FALSE 21 | #define MAX_ACL_CONNECTIONS 7 22 | #define MAX_L2CAP_CHANNELS 16 23 | #define BLE_VND_INCLUDED TRUE 24 | // skips conn update at conn completion 25 | #define BTA_BLE_SKIP_CONN_UPD FALSE 26 | #define BLE_PERIPHERAL_ADV_NAME FALSE 27 | #define BTM_SCO_ENHANCED_SYNC_ENABLED FALSE 28 | 29 | #define BTA_DISABLE_DELAY 1000 /* in milliseconds */ 30 | #define BTM_WBS_INCLUDED TRUE 31 | #define BTIF_HF_WBS_PREFERRED TRUE 32 | #endif 33 | -------------------------------------------------------------------------------- /parts/src/org/lineageos/settings/dirac/DiracActivity.java: -------------------------------------------------------------------------------- 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 | 17 | package org.lineageos.settings.dirac; 18 | 19 | import android.os.Bundle; 20 | import android.preference.PreferenceActivity; 21 | 22 | public class DiracActivity extends PreferenceActivity { 23 | 24 | private static final String TAG_DIRAC = "dirac"; 25 | 26 | @Override 27 | protected void onCreate(Bundle savedInstanceState) { 28 | super.onCreate(savedInstanceState); 29 | 30 | getFragmentManager().beginTransaction().replace(android.R.id.content, 31 | new DiracSettingsFragment(), TAG_DIRAC).commit(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /rro_overlays/HapticOverlay_Settings/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 22 | true 23 | 24 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | true 25 | 26 | 28 | true 29 | 30 | 31 | -------------------------------------------------------------------------------- /parts/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 | -------------------------------------------------------------------------------- /gps/batching/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | $(GPSUTILS_CFLAGS) \ 3 | $(LOCCORE_CFLAGS) \ 4 | -I./ \ 5 | -std=c++1y \ 6 | -D__func__=__PRETTY_FUNCTION__ \ 7 | -fno-short-enums 8 | 9 | ACLOCAL_AMFLAGS = -I m4 10 | 11 | requiredlibs = \ 12 | $(GPSUTILS_LIBS) \ 13 | $(LOCCORE_LIBS) \ 14 | -llog 15 | 16 | h_sources = \ 17 | BatchingAdapter.h 18 | 19 | libbatching_la_SOURCES = \ 20 | location_batching.cpp \ 21 | BatchingAdapter.cpp 22 | 23 | if USE_GLIB 24 | libbatching_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 25 | libbatching_la_LDFLAGS = -lstdc++ -g -Wl,-z,defs -lpthread $(requiredlibs) @GLIB_LIBS@ -shared -version-info 1:0:0 26 | libbatching_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 27 | else 28 | libbatching_la_CFLAGS = $(AM_CFLAGS) 29 | libbatching_la_LDFLAGS = -Wl,-z,defs -lpthread $(requiredlibs) -shared -version-info 1:0:0 30 | libbatching_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 31 | endif 32 | 33 | library_include_HEADERS = $(h_sources) 34 | 35 | library_includedir = $(pkgincludedir) 36 | 37 | #Create and Install libraries 38 | lib_LTLIBRARIES = libbatching.la 39 | 40 | pkgconfigdir = $(libdir)/pkgconfig 41 | pkgconfig_DATA = location-batching.pc 42 | sysconf_DATA = $(WORKSPACE)/hardware/qcom/gps/etc/flp.conf 43 | EXTRA_DIST = $(pkgconfig_DATA) 44 | 45 | -------------------------------------------------------------------------------- /gps/location/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = \ 4 | -I./ \ 5 | -I../utils \ 6 | $(LOCPLA_CFLAGS) \ 7 | $(GPSUTILS_CFLAGS) \ 8 | -std=c++11 9 | 10 | liblocation_api_la_SOURCES = \ 11 | LocationAPI.cpp \ 12 | LocationAPIClientBase.cpp 13 | 14 | if USE_EXTERNAL_AP 15 | AM_CFLAGS += -DFEATURE_EXTERNAL_AP 16 | endif 17 | 18 | if USE_GLIB 19 | liblocation_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 20 | liblocation_api_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 21 | liblocation_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 22 | else 23 | liblocation_api_la_CFLAGS = $(AM_CFLAGS) 24 | liblocation_api_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 25 | liblocation_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 26 | endif 27 | 28 | liblocation_api_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) 29 | 30 | library_include_HEADERS = \ 31 | LocationAPI.h \ 32 | LocationAPIClientBase.h \ 33 | location_interface.h \ 34 | LocationDataTypes.h \ 35 | ILocationAPI.h 36 | 37 | #Create and Install libraries 38 | lib_LTLIBRARIES = liblocation_api.la 39 | 40 | library_includedir = $(pkgincludedir) 41 | 42 | pkgconfigdir = $(libdir)/pkgconfig 43 | pkgconfig_DATA = location-api.pc 44 | EXTRA_DIST = $(pkgconfig_DATA) 45 | -------------------------------------------------------------------------------- /lights/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020 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 | #include "Lights.h" 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | using ::aidl::android::hardware::light::Lights; 24 | 25 | int main() { 26 | ABinderProcess_setThreadPoolMaxThreadCount(0); 27 | std::shared_ptr lights = ndk::SharedRefBase::make(); 28 | 29 | const std::string instance = std::string() + Lights::descriptor + "/default"; 30 | binder_status_t status = AServiceManager_addService(lights->asBinder().get(), instance.c_str()); 31 | CHECK(status == STATUS_OK); 32 | 33 | ABinderProcess_joinThreadPool(); 34 | return EXIT_FAILURE; // should not reached 35 | } 36 | -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | sys.listeners.registered u:object_r:vendor_tee_listener_prop:s0 2 | sys.post_boot.parsed u:object_r:vendor_mpctl_prop:s0 3 | persist.net.doxlat u:object_r:vendor_xlat_prop:s0 4 | ctl.vendor.imsrcsd u:object_r:vendor_ctl_vendor_imsrcsservice_prop:s0 5 | 6 | # Camera 7 | camera. u:object_r:camera_prop:s0 8 | cameradaemon.SaveMemAtBoot u:object_r:camera_prop:s0 9 | cpp.set.clock u:object_r:camera_prop:s0 10 | disable.cpp.power.collapse u:object_r:camera_prop:s0 11 | persist.cam. u:object_r:camera_prop:s0 12 | persist.camera. u:object_r:camera_prop:s0 13 | persist.partial.skip u:object_r:camera_prop:s0 14 | persist.vendor.cam. u:object_r:camera_prop:s0 15 | persist.vendor.camera. u:object_r:camera_prop:s0 16 | persist.vendor.partial.skip u:object_r:camera_prop:s0 17 | ro.camera. u:object_r:camera_prop:s0 18 | vendor.camera.cpp.set.clock u:object_r:camera_prop:s0 19 | vendor.camera.lowpower.record.enable u:object_r:camera_prop:s0 20 | vidc.enc.dcvs.extra-buff-count u:object_r:camera_prop:s0 21 | 22 | # Dirac 23 | persist.audio.dirac. u:object_r:dirac_prop:s0 24 | 25 | # Subsystem state notifier 26 | vendor.subsys_state_notifier. u:object_r:vendor_subsys_state_notifier_prop:s0 27 | 28 | # Wifi 29 | vendor.wlan.driver.ath u:object_r:vendor_wifi_version:s0 30 | 31 | # Xiaomi 32 | ro.vendor.xiaomi. u:object_r:vendor_xiaomi_prop:s0 33 | -------------------------------------------------------------------------------- /gps/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | 3 | # Set required flags 4 | GNSS_CFLAGS := \ 5 | -Werror \ 6 | -Wno-error=unused-parameter \ 7 | -Wno-error=macro-redefined \ 8 | -Wno-error=reorder \ 9 | -Wno-error=missing-braces \ 10 | -Wno-error=self-assign \ 11 | -Wno-error=enum-conversion \ 12 | -Wno-error=logical-op-parentheses \ 13 | -Wno-error=null-arithmetic \ 14 | -Wno-error=null-conversion \ 15 | -Wno-error=parentheses-equality \ 16 | -Wno-error=undefined-bool-conversion \ 17 | -Wno-error=tautological-compare \ 18 | -Wno-error=switch \ 19 | -Wno-error=date-time 20 | 21 | GNSS_HIDL_VERSION = 2.1 22 | 23 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8937 24 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8953 25 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8998 26 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += apq8098_latv 27 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm710 28 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += qcs605 29 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm845 30 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm660 31 | 32 | ifneq (,$(filter $(GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) 33 | GNSS_HIDL_LEGACY_MEASURMENTS = true 34 | endif 35 | 36 | LOCAL_PATH := $(call my-dir) 37 | include $(call all-makefiles-under,$(LOCAL_PATH)) 38 | 39 | GNSS_SANITIZE_DIAG := cfi bounds null unreachable integer address 40 | 41 | endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 42 | -------------------------------------------------------------------------------- /charger_led/charger_led.rc: -------------------------------------------------------------------------------- 1 | service vendor.charger_led /vendor/bin/charger_led 2 | class charger 3 | user system 4 | group system 5 | file /dev/kmsg w 6 | oneshot 7 | disabled 8 | 9 | on charger 10 | chown system system /sys/class/leds/red/blink 11 | chown system system /sys/class/leds/red/breath 12 | chown system system /sys/class/leds/red/brightness 13 | 14 | chown system system /sys/class/leds/green/blink 15 | chown system system /sys/class/leds/green/breath 16 | chown system system /sys/class/leds/green/brightness 17 | 18 | chown system system /sys/class/leds/blue/blink 19 | chown system system /sys/class/leds/blue/breath 20 | chown system system /sys/class/leds/blue/brightness 21 | 22 | chown system system /sys/class/leds/white/blink 23 | chown system system /sys/class/leds/white/breath 24 | chown system system /sys/class/leds/white/brightness 25 | 26 | start vendor.charger_led 27 | 28 | on late-init 29 | write /sys/class/leds/red/blink 0 30 | write /sys/class/leds/red/breath 0 31 | write /sys/class/leds/red/brightness 0 32 | 33 | write /sys/class/leds/green/blink 0 34 | write /sys/class/leds/green/breath 0 35 | write /sys/class/leds/green/brightness 0 36 | 37 | write /sys/class/leds/blue/blink 0 38 | write /sys/class/leds/blue/breath 0 39 | write /sys/class/leds/blue/brightness 0 40 | 41 | write /sys/class/leds/white/blink 0 42 | write /sys/class/leds/white/breath 0 43 | write /sys/class/leds/white/brightness 0 44 | -------------------------------------------------------------------------------- /gps/geofence/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = -Wundef \ 2 | -Wno-trigraphs \ 3 | -g -O0 \ 4 | -fno-inline \ 5 | -fno-short-enums \ 6 | -fpic \ 7 | ${GPSUTILS_CFLAGS} \ 8 | ${LOCCORE_CFLAGS} \ 9 | $(LOCPLA_CFLAGS) \ 10 | -D__func__=__PRETTY_FUNCTION__ \ 11 | -std=c++1y 12 | 13 | AM_CPPFLAGS = $(AM_CFLAGS) 14 | 15 | ACLOCAL_AMFLAGS = -I m4 16 | 17 | requiredlibs = \ 18 | ${LOCCORE_LIBS} \ 19 | $(GPSUTILS_LIBS) \ 20 | -llog 21 | 22 | h_sources = \ 23 | GeofenceAdapter.h 24 | 25 | c_sources = \ 26 | GeofenceAdapter.cpp \ 27 | location_geofence.cpp 28 | 29 | libgeofencing_la_SOURCES = $(c_sources) 30 | if USE_GLIB 31 | libgeofencing_la_CFLAGS = -DUSE_GLIB @GLIB_CFLAGS@ $(AM_CFLAGS) 32 | libgeofencing_la_CPPFLAGS = -DUSE_GLIB @GLIB_CFLAGS@ $(AM_CFLAGS) $(AM_CPPFLAGS) 33 | libgeofencing_la_LDFLAGS = -lstdc++ -Wl,-z,defs @GLIB_LIBS@ $(requiredlibs) -shared -version-info 1:0:0 34 | libgeofencing_la_LIBDADD = $(requiredlibs) -lstdc++ @GLIB_LIBS@ 35 | else 36 | libgeofencing_la_CFLAGS = $(AM_CFLAGS) 37 | libgeofencing_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 38 | libgeofencing_la_LDFLAGS = -lstdc++ -Wl,-z,defs $(requiredlibs) -shared -version-info 1:0:0 39 | libgeofencing_la_LIBDADD = $(requiredlibs) -lstdc++ 40 | endif 41 | 42 | library_include_HEADERS = $(h_sources) 43 | 44 | library_includedir = $(pkgincludedir) 45 | 46 | lib_LTLIBRARIES = libgeofencing.la 47 | 48 | pkgconfigdir = $(libdir)/pkgconfig 49 | pkgconfig_DATA = location-geofence.pc 50 | EXTRA_DIST = $(pkgconfig_DATA) 51 | -------------------------------------------------------------------------------- /parts/res/xml/dirac_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 27 | 28 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /parts/src/org/lineageos/settings/BootCompletedReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The CyanogenMod Project 3 | * 2017-2018 The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.lineageos.settings; 19 | 20 | import android.content.BroadcastReceiver; 21 | import android.content.Context; 22 | import android.content.Intent; 23 | import android.util.Log; 24 | 25 | import org.lineageos.settings.dirac.DiracUtils; 26 | import org.lineageos.settings.doze.DozeUtils; 27 | 28 | public class BootCompletedReceiver extends BroadcastReceiver { 29 | 30 | private static final boolean DEBUG = false; 31 | private static final String TAG = "XiaomiParts"; 32 | 33 | @Override 34 | public void onReceive(final Context context, Intent intent) { 35 | if (DozeUtils.isDozeEnabled(context) && DozeUtils.sensorsEnabled(context)) { 36 | if (DEBUG) Log.d(TAG, "Starting Doze service"); 37 | DozeUtils.startService(context); 38 | } 39 | new DiracUtils(context).onBootCompleted(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /proprietary-files/4.19/qcom-system.txt: -------------------------------------------------------------------------------- 1 | # All unpinned blobs below are extracted from LA.UM.9.6.3.r1-06200-89xx.0 2 | 3 | # Audiosphere 4 | system_ext/etc/permissions/audiosphere.xml 5 | system_ext/framework/audiosphere.jar 6 | 7 | # Perf 8 | #-system_ext/app/workloadclassifier/workloadclassifier.apk 9 | system/framework/QPerformance.jar 10 | system/framework/UxPerformance.jar 11 | system_ext/bin/perfservice 12 | system_ext/etc/init/perfservice.rc 13 | system_ext/etc/perf/wlc_model.tflite 14 | system_ext/etc/seccomp_policy/perfservice.policy 15 | system_ext/lib64/libqti-iopd-client_system.so 16 | system_ext/lib64/libqti-perfd-client_system.so 17 | system_ext/lib64/libqti-util_system.so 18 | system_ext/lib64/libqti_performance.so 19 | system_ext/lib64/libqti_workloadclassifiermodel.so 20 | system_ext/lib64/vendor.qti.hardware.iop@2.0.so 21 | 22 | # Power-off Alarm 23 | -product/app/PowerOffAlarm/PowerOffAlarm.apk 24 | system_ext/framework/vendor.qti.hardware.alarm-V1.0-java.jar 25 | system_ext/lib64/vendor.qti.hardware.alarm@1.0.so 26 | 27 | # QDMA 28 | system_ext/bin/qccsyshalservice 29 | system_ext/etc/init/vendor.qti.hardware.qccsyshal@1.0-service.rc 30 | system_ext/lib64/libqcc_file_agent_sys.so 31 | system_ext/lib64/vendor.qti.hardware.qccsyshal@1.0-halimpl.so 32 | system_ext/lib64/vendor.qti.hardware.qccsyshal@1.0.so 33 | 34 | # QMI 35 | system_ext/lib64/libdiag_system.so 36 | system_ext/lib64/vendor.qti.diaghal@1.0.so 37 | 38 | # Misc 39 | system/etc/public.libraries-qti.txt 40 | system_ext/etc/permissions/qti_libpermissions.xml 41 | system_ext/etc/permissions/qti_permissions.xml 42 | system_ext/etc/cdma_call_conf.xml 43 | system_ext/etc/spn-conf.xml 44 | -------------------------------------------------------------------------------- /proprietary-files/4.9/qcom-system.txt: -------------------------------------------------------------------------------- 1 | # All unpinned blobs below are extracted from LA.UM.9.6.3.r1-06200-89xx.0 (4.9) 2 | 3 | # Audiosphere 4 | system_ext/etc/permissions/audiosphere.xml 5 | system_ext/framework/audiosphere.jar 6 | 7 | # Perf 8 | #-system_ext/app/workloadclassifier/workloadclassifier.apk 9 | system/framework/QPerformance.jar 10 | system/framework/UxPerformance.jar 11 | system_ext/bin/perfservice 12 | system_ext/etc/init/perfservice.rc 13 | system_ext/etc/perf/wlc_model.tflite 14 | system_ext/etc/seccomp_policy/perfservice.policy 15 | system_ext/lib64/libqti-iopd-client_system.so 16 | system_ext/lib64/libqti-perfd-client_system.so 17 | system_ext/lib64/libqti-util_system.so 18 | system_ext/lib64/libqti_performance.so 19 | system_ext/lib64/libqti_workloadclassifiermodel.so 20 | system_ext/lib64/vendor.qti.hardware.iop@2.0.so 21 | 22 | # Power-off Alarm 23 | -product/app/PowerOffAlarm/PowerOffAlarm.apk 24 | system_ext/framework/vendor.qti.hardware.alarm-V1.0-java.jar 25 | system_ext/lib64/vendor.qti.hardware.alarm@1.0.so 26 | 27 | # QDMA 28 | system_ext/bin/qccsyshalservice 29 | system_ext/etc/init/vendor.qti.hardware.qccsyshal@1.0-service.rc 30 | system_ext/lib64/libqcc_file_agent_sys.so 31 | system_ext/lib64/vendor.qti.hardware.qccsyshal@1.0-halimpl.so 32 | system_ext/lib64/vendor.qti.hardware.qccsyshal@1.0.so 33 | 34 | # QMI 35 | system_ext/lib64/libdiag_system.so 36 | system_ext/lib64/vendor.qti.diaghal@1.0.so 37 | 38 | # Misc 39 | system/etc/public.libraries-qti.txt 40 | system_ext/etc/permissions/qti_libpermissions.xml 41 | system_ext/etc/permissions/qti_permissions.xml 42 | system_ext/etc/cdma_call_conf.xml 43 | system_ext/etc/spn-conf.xml 44 | -------------------------------------------------------------------------------- /overlay-tablet/frameworks/base/core/res/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 25 | true 26 | 27 | 28 | true 29 | 30 | 32 | true 33 | 34 | 35 | -------------------------------------------------------------------------------- /sepolicy/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | # Boot reason 2 | genfscon proc /sys/kernel/boot_reason u:object_r:proc_boot_reason:s0 3 | 4 | # FDT 5 | genfscon sysfs /firmware/devicetree/base/compatible u:object_r:fdt_compatible:s0 6 | genfscon sysfs /firmware/devicetree/base/model u:object_r:fdt_model:s0 7 | genfscon sysfs /firmware/devicetree/base/soc/sound/qcom,model u:object_r:fdt_sound:s0 8 | 9 | # Leds 10 | genfscon sysfs /devices/platform/soc/200f000.qcom,spmi/spmi-0/spmi0-00/200f000.qcom,spmi:qcom,pm8953@0:qcom,leds@a100 u:object_r:sysfs_leds:s0 11 | genfscon sysfs /devices/platform/soc/78b6000.i2c/i2c-2/2-0045/leds/ u:object_r:sysfs_leds:s0 12 | 13 | # Power 14 | genfscon sysfs /devices/soc/soc:qcom,bcl/power_supply u:object_r:sysfs_batteryinfo:s0 15 | genfscon sysfs /devices/soc/msm-bcl-21/power_supply u:object_r:sysfs_batteryinfo:s0 16 | genfscon sysfs /devices/soc/qpnp-typec-9/power_supply u:object_r:sysfs_batteryinfo:s0 17 | genfscon sysfs /devices/platform/soc/200f000.qcom,spmi/spmi-0/spmi0-02/200f000.qcom,spmi:qcom,pmi8950@2:vadc@3100 u:object_r:sysfs_battery_supply:s0 18 | 19 | # ProcFS 20 | genfscon proc /sys/vm/dirty_writeback_centisecs u:object_r:proc_dirty:s0 21 | 22 | # Rmt 23 | genfscon debugfs /rmt_storage u:object_r:debugfs_rmt:s0 24 | 25 | # RTC 26 | genfscon sysfs /devices/platform/soc/200f000.qcom,spmi/spmi-0/spmi0-00/200f000.qcom,spmi:qcom,pm8937@0:qcom,pm8937_rtc/rtc u:object_r:sysfs_rtc:s0 27 | genfscon sysfs /devices/platform/soc/200f000.qcom,spmi/spmi-0/spmi0-00/200f000.qcom,spmi:qcom,pm8953@0:qcom,pm8953_rtc/rtc u:object_r:sysfs_rtc:s0 28 | 29 | # SDHCI 30 | genfscon sysfs /kernel/sdhci_msm u:object_r:sysfs_kernel_sdhci_msm:s0 31 | -------------------------------------------------------------------------------- /configs/telephony_product_privapp-permissions-qti.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 29 | 30 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /keylayout/qpnp_pon.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 114 VOLUME_DOWN 29 | key 116 POWER 30 | -------------------------------------------------------------------------------- /overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 17 | true 18 | true 19 | 20 | 22 | true 23 | 24 | 25 | 26 | restart 27 | restart_recovery 28 | restart_bootloader 29 | restart_fastboot 30 | 31 | 32 | 33 | false 34 | false 35 | 36 | -------------------------------------------------------------------------------- /libshim/libshims_ui.cpp: -------------------------------------------------------------------------------- 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 | 17 | #include 18 | 19 | #include 20 | 21 | extern "C" void _ZN7android13GraphicBufferC1EjjijjjP13native_handleb( 22 | const native_handle_t* handle, 23 | android::GraphicBuffer::HandleWrapMethod method, 24 | uint32_t width, 25 | uint32_t height, 26 | int format, 27 | uint32_t layerCount, 28 | uint64_t usage, 29 | uint32_t stride); 30 | 31 | extern "C" void _ZN7android13GraphicBufferC1EjjijjP13native_handleb( 32 | uint32_t inWidth, 33 | uint32_t inHeight, 34 | int inFormat, 35 | uint32_t inUsage, 36 | uint32_t inStride, 37 | native_handle_t* inHandle, 38 | bool keepOwnership) 39 | { 40 | android::GraphicBuffer::HandleWrapMethod inMethod = 41 | (keepOwnership ? android::GraphicBuffer::TAKE_HANDLE : android::GraphicBuffer::WRAP_HANDLE); 42 | _ZN7android13GraphicBufferC1EjjijjjP13native_handleb(inHandle, inMethod, inWidth, inHeight, 43 | inFormat, static_cast(1), static_cast(inUsage), inStride); 44 | } 45 | -------------------------------------------------------------------------------- /system_radio.prop: -------------------------------------------------------------------------------- 1 | rild.libpath=/vendor/lib64/libril-qc-qmi-1.so 2 | rild.libargs=-d /dev/smd0 3 | persist.rild.nitz_plmn= 4 | persist.rild.nitz_long_ons_0= 5 | persist.rild.nitz_long_ons_1= 6 | persist.rild.nitz_long_ons_2= 7 | persist.rild.nitz_long_ons_3= 8 | persist.rild.nitz_short_ons_0= 9 | persist.rild.nitz_short_ons_1= 10 | persist.rild.nitz_short_ons_2= 11 | persist.rild.nitz_short_ons_3= 12 | ril.subscription.types=RUIM 13 | DEVICE_PROVISIONED=1 14 | 15 | # 16 | # system props for the data modules 17 | # 18 | persist.data.netmgrd.qos.enable=true 19 | 20 | #Added by libingkun.wt for Bug415748 on 2019/10/09 21 | persist.radio.DROPSETENABLE=1 22 | 23 | #ODM328-4166,DUT sends IPV4V6 in attach request after setting APN protocol to ipv6 only 24 | persist.data.profile_update=true 25 | 26 | #added by huwenxia.wt for chk 10532 20181107 27 | persist.radio.force_on_dc=true 28 | 29 | #Modified rcs to 1 by weitang for PAN-18193 on 2019/02/20 30 | #close imsrcsd 31 | persist.rcs.supported=1 32 | 33 | #Modified rcs to 1 by weitang for PAN-18193 on 2019/02/20 34 | #close imsrcsd 35 | persist.rcs.supported=1 36 | 37 | # +bug 421786 add by libingkun.wt not protected report the SAR_REPORT 20191009*/ 38 | persist.function_for_sar=1 39 | persist.function_for_sar_log_trigger=0 40 | # -bug 421786 add by libingkun.wt not protected report the SAR_REPORT 20191009*/ 41 | 42 | # +bug 418690 libingkun.wt,not using sar_sensor drop sar 20191009 43 | persist.radio.sarvalue=-1 44 | # -bug 418690 libingkun.wt,not using sar_sensor drop sar 20191009 45 | 46 | #chenhui.wt add for PAN-22636 20191031 47 | #jingyao.wt del for PAN-24809 20200410 48 | #persist.vendor.radio.facnotsup_as_nonw=1 49 | 50 | # IMS 51 | persist.dbg.volte_avail_ovr=1 52 | persist.dbg.vt_avail_ovr=1 53 | persist.dbg.wfc_avail_ovr=1 54 | -------------------------------------------------------------------------------- /keylayout/gpio-keys.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 115 VOLUME_UP 29 | key 114 VOLUME_DOWN 30 | key 102 HOME 31 | key 528 FOCUS 32 | key 766 CAMERA 33 | -------------------------------------------------------------------------------- /rootdir/bin/init.qti.qseecomd.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | # Copyright (c) 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 6 | # met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above 10 | # copyright notice, this list of conditions and the following 11 | # disclaimer in the documentation and/or other materials provided 12 | # with the distribution. 13 | # * Neither the name of The Linux Foundation nor the names of its 14 | # contributors may be used to endorse or promote products derived 15 | # from this software without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | # 30 | 31 | while [ "$registered" != "true" ] 32 | do 33 | sleep 0.1 34 | registered="`getprop vendor.sys.listeners.registered`" 35 | done 36 | -------------------------------------------------------------------------------- /libshim/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2020 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 | cc_library_shared { 17 | name: "libshims_binder", 18 | shared_libs: ["libbinder", "libutils"], 19 | srcs: [ 20 | "libbinder/IServiceManager.cpp", 21 | "libbinder/PermissionCache.cpp", 22 | ], 23 | vendor: true 24 | } 25 | 26 | // libandroid 27 | cc_library_shared { 28 | name: "libshims_android", 29 | proprietary: true, 30 | defaults: ["hidl_defaults"], 31 | srcs: [ 32 | "libshims_android.cpp", 33 | ], 34 | cflags: [ 35 | "-Werror", 36 | "-Wextra", 37 | "-Wall", 38 | ], 39 | shared_libs: [ 40 | "libutils", 41 | ], 42 | } 43 | 44 | // libgui 45 | cc_library_shared { 46 | name: "libshims_gui", 47 | proprietary: true, 48 | defaults: ["hidl_defaults"], 49 | srcs: [ 50 | "libshims_gui.cpp", 51 | ], 52 | cflags: [ 53 | "-Werror", 54 | "-Wextra", 55 | "-Wall", 56 | ], 57 | shared_libs: [ 58 | "libgui_vendor", 59 | ], 60 | } 61 | 62 | // libshim_camera 63 | cc_library_shared { 64 | name: "libshims_ui", 65 | srcs: ["libshims_ui.cpp"], 66 | shared_libs: ["libui"], 67 | vendor: true, 68 | compile_multilib: "32", 69 | } 70 | -------------------------------------------------------------------------------- /gps/utils/LocLoggerBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2020 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_LOGGER_BASE_H 30 | #define LOC_LOGGER_BASE_H 31 | 32 | namespace loc_util { 33 | class LocLoggerBase { 34 | public: 35 | virtual void log() {} 36 | }; 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /gps/android/1.0/android.hardware.gnss@1.0-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.0::IGnss/default 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /gps/android/1.1/android.hardware.gnss@1.1-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /gps/android/utils/battery_listener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, The Linux Foundation. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above 10 | * copyright notice, this list of conditions and the following 11 | * disclaimer in the documentation and/or other materials provided 12 | * with the distribution. 13 | * * Neither the name of The Linux Foundation nor the names of its 14 | * contributors may be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | typedef void (* battery_status_change_fn_t)(bool); 30 | void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn); 31 | void loc_extn_battery_properties_listener_deinit(); 32 | bool loc_extn_battery_properties_is_charging(); 33 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 18 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 19 | 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace gnss { 27 | namespace V1_0 { 28 | namespace implementation { 29 | 30 | using ::android::hardware::gnss::V1_0::IGnssDebug; 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | using ::android::hardware::hidl_vec; 34 | using ::android::hardware::hidl_string; 35 | using ::android::sp; 36 | 37 | /* Interface for GNSS Debug support. */ 38 | struct Gnss; 39 | struct GnssDebug : public IGnssDebug { 40 | GnssDebug(Gnss* gnss); 41 | ~GnssDebug() {}; 42 | 43 | /* 44 | * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. 45 | * These declarations were generated from IGnssDebug.hal. 46 | */ 47 | Return getDebugData(getDebugData_cb _hidl_cb) override; 48 | 49 | private: 50 | Gnss* mGnss = nullptr; 51 | }; 52 | 53 | } // namespace implementation 54 | } // namespace V1_0 55 | } // namespace gnss 56 | } // namespace hardware 57 | } // namespace android 58 | 59 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 60 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 18 | #define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 19 | 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace gnss { 27 | namespace V1_1 { 28 | namespace implementation { 29 | 30 | using ::android::hardware::gnss::V1_0::IGnssDebug; 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | using ::android::hardware::hidl_vec; 34 | using ::android::hardware::hidl_string; 35 | using ::android::sp; 36 | 37 | /* Interface for GNSS Debug support. */ 38 | struct Gnss; 39 | struct GnssDebug : public IGnssDebug { 40 | GnssDebug(Gnss* gnss); 41 | ~GnssDebug() {}; 42 | 43 | /* 44 | * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. 45 | * These declarations were generated from IGnssDebug.hal. 46 | */ 47 | Return getDebugData(getDebugData_cb _hidl_cb) override; 48 | 49 | private: 50 | Gnss* mGnss = nullptr; 51 | }; 52 | 53 | } // namespace implementation 54 | } // namespace V1_1 55 | } // namespace gnss 56 | } // namespace hardware 57 | } // namespace android 58 | 59 | #endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 60 | -------------------------------------------------------------------------------- /gps/android/2.0/android.hardware.gnss@2.0-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | @2.0::IGnss/default 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /gps/android/2.1/android.hardware.gnss@2.1-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | @2.1::IGnss/default 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /thermal/android.hardware.thermal@2.0-service.qti.xiaomi_mithorium.rc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, 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 | # 17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | service android.thermal-hal /vendor/bin/hw/android.hardware.thermal@2.0-service.qti.xiaomi_mithorium 30 | interface android.hardware.thermal@1.0::IThermal default 31 | interface android.hardware.thermal@2.0::IThermal default 32 | class hal 33 | user root 34 | group root 35 | -------------------------------------------------------------------------------- /lights/Lights.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020 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 | #pragma once 18 | 19 | #define LOG_TAG "lights-xiaomi_mithorium" 20 | 21 | #include 22 | 23 | namespace aidl { 24 | namespace android { 25 | namespace hardware { 26 | namespace light { 27 | 28 | enum led_type { 29 | RED, 30 | GREEN, 31 | BLUE, 32 | WHITE, 33 | }; 34 | 35 | class Lights : public BnLights { 36 | public: 37 | Lights(); 38 | 39 | ndk::ScopedAStatus setLightState(int id, const HwLightState& state) override; 40 | ndk::ScopedAStatus getLights(std::vector* types) override; 41 | 42 | private: 43 | void setSpeakerLightLocked(const HwLightState& state); 44 | void handleSpeakerBatteryLocked(); 45 | 46 | bool setLedBreath(led_type led, uint32_t value); 47 | bool setLedBrightness(led_type led, uint32_t value); 48 | 49 | bool IsLit(uint32_t color); 50 | uint32_t RgbaToBrightness(uint32_t color); 51 | bool WriteToFile(const std::string& path, uint32_t content); 52 | 53 | std::string mBacklightNode; 54 | bool mButtonExists; 55 | bool mWhiteLed; 56 | bool mBreath; 57 | HwLightState mNotification; 58 | HwLightState mBattery; 59 | }; 60 | 61 | } // namespace light 62 | } // namespace hardware 63 | } // namespace android 64 | } // namespace aidl 65 | -------------------------------------------------------------------------------- /vendor_radio.prop: -------------------------------------------------------------------------------- 1 | persist.vendor.radio.mt_sms_ack=30 2 | persist.radio.multisim.config=dsds 3 | persist.vendor.dpmhalservice.enable=1 4 | persist.vendor.radio.apm_sim_not_pwdn=1 5 | persist.vendor.radio.custom_ecc=1 6 | persist.vendor.radio.enableadvancedscan=false 7 | persist.vendor.radio.procedure_bytes=SKIP 8 | persist.vendor.radio.rat_on=other 9 | persist.vendor.radio.sib16_support=1 10 | vendor.rild.libpath=/vendor/lib64/libril-qc-qmi-1.so 11 | 12 | ### BEGIN Labeled as vendor in device/qcom/sepolicy-legacy-um 13 | 14 | # 15 | # system props for the cne module 16 | # 17 | persist.vendor.cne.feature=1 18 | 19 | # system prop for UBWC 20 | vendor.video.disable.ubwc=1 21 | 22 | #added by chenhui.wt for chk12880 20181120 23 | persist.vendor.radio.force_on_dc=true 24 | 25 | # +PAN-21323 add by jingyao.wt 20190621,[Mexico][Telcel AMX] String during wifi calling 26 | persist.vendor.radio.data_con_rprt=true 27 | # -PAN-21323 add by jingyao.wt 28 | 29 | #ODM328-4166,DUT sends IPV4V6 in attach request after setting APN protocol to ipv6 only 30 | persist.vendor.data.profile_update=true 31 | 32 | #chk10998 xiaowenyou.wt,add, 2019/10/04 33 | persist.vendor.ims.dropset_feature=1 34 | 35 | #Checklist 37911, add by tanjunwen on 2019-10-29 36 | persist.vendor.radio.ignore_dom_time=5 37 | 38 | ### END Labeled as vendor in device/qcom/sepolicy-legacy-um 39 | 40 | ### BEGIN Unlabeled vendor props 41 | 42 | # 43 | # system props for the data modules 44 | # 45 | ro.vendor.use_data_netmgrd=true 46 | persist.vendor.data.mode=concurrent 47 | persist.vendor.data.iwlan.enable=true 48 | 49 | ### END Unlabeled vendor props 50 | 51 | ### BEGIN system_vendor_config_prop 52 | 53 | # 54 | # Set network mode to (T/L/G/W/1X/EVDO, T/L/G/W/1X/EVDO) for 7+7 mode device on DSDS mode 55 | # 56 | ro.telephony.default_network=33,33 57 | 58 | # 59 | # System props for telephony 60 | # System prop to turn on CdmaLTEPhone always 61 | telephony.lteOnCdmaDevice=1 62 | 63 | ### END system_vendor_config_prop 64 | -------------------------------------------------------------------------------- /rootdir/bin/init.qti.dcvs.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | # 3 | # Copyright (c) 2020, 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 | for device in /sys/devices/platform/soc 31 | do 32 | for latfloor in $device/*cpu*-ddr-latfloor*/devfreq/*cpu-ddr-latfloor* 33 | do 34 | echo "compute" > $latfloor/governor 35 | echo 10 > $latfloor/polling_interval 36 | done 37 | done 38 | -------------------------------------------------------------------------------- /rootdir/bin/init.qcom.sensors.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | # Copyright (c) 2015,2018,2020 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 | 35 | chmod -h 664 /persist/sensors/sensors_settings 36 | chown -h -R system.system /persist/sensors 37 | start vendor.sensors.qti 38 | 39 | } 40 | 41 | start_sensors 42 | 43 | -------------------------------------------------------------------------------- /thermal/android.hardware.thermal@2.0-service.qti.xiaomi_mithorium.xml: -------------------------------------------------------------------------------- 1 | 30 | 31 | 32 | 33 | android.hardware.thermal 34 | hwbinder 35 | 1.0 36 | 2.0 37 | 38 | IThermal 39 | default 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /gps/core/data-items/DataItemsFactoryProxy.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017, 2020, 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 | class DataItemsFactoryProxy { 39 | public: 40 | static IDataItemCore* createNewDataItem(IDataItemCore* di); 41 | }; 42 | 43 | } // namespace loc_core 44 | 45 | #endif //__DATAITEMFACTORYBASE__ 46 | 47 | -------------------------------------------------------------------------------- /gps/etc/seccomp_policy/gnss@2.0-xtwifi-inet-agent.policy: -------------------------------------------------------------------------------- 1 | 2 | #******************************************************************************* 3 | # Copyright (c) 2020 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 | unlinkat: 1 33 | sched_getaffinity: 1 34 | newfstatat: 1 35 | fchmodat: 1 36 | madvise: 1 37 | mmap: 1 38 | getuid: 1 39 | getuid32: 1 40 | fstat64: 1 41 | fstatat64: 1 42 | gettimeofday: 1 43 | getdents64: 1 44 | -------------------------------------------------------------------------------- /gps/android/2.0/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 23 | 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V2_0::IGnssDebug; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* Interface for GNSS Debug support. */ 42 | struct Gnss; 43 | struct GnssDebug : public IGnssDebug { 44 | GnssDebug(Gnss* gnss); 45 | ~GnssDebug() {}; 46 | 47 | // Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow 48 | Return getDebugData(getDebugData_cb _hidl_cb) override; 49 | // Methods from ::android::hardware::gnss::V2_0::IGnssDebug follow. 50 | Return getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) override; 51 | 52 | private: 53 | Gnss* mGnss = nullptr; 54 | }; 55 | 56 | } // namespace implementation 57 | } // namespace V2_0 58 | } // namespace gnss 59 | } // namespace hardware 60 | } // namespace android 61 | 62 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 63 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 23 | 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V2_0::IGnssDebug; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* Interface for GNSS Debug support. */ 42 | struct Gnss; 43 | struct GnssDebug : public IGnssDebug { 44 | GnssDebug(Gnss* gnss); 45 | ~GnssDebug() {}; 46 | 47 | // Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow 48 | Return getDebugData(getDebugData_cb _hidl_cb) override; 49 | // Methods from ::android::hardware::gnss::V2_0::IGnssDebug follow. 50 | Return getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) override; 51 | 52 | private: 53 | Gnss* mGnss = nullptr; 54 | }; 55 | 56 | } // namespace implementation 57 | } // namespace V2_1 58 | } // namespace gnss 59 | } // namespace hardware 60 | } // namespace android 61 | 62 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 63 | -------------------------------------------------------------------------------- /gps/geofence/configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ(2.61) 2 | AC_INIT([location-geofence], 1.0.0) 3 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 4 | AC_CONFIG_SRCDIR([Makefile.am]) 5 | AC_CONFIG_HEADERS([config.h]) 6 | AC_CONFIG_MACRO_DIR([m4]) 7 | 8 | # Check for programs 9 | AC_PROG_LIBTOOL 10 | AC_PROG_CXX 11 | AC_PROG_CC 12 | AM_PROG_CC_C_O 13 | AC_PROG_AWK 14 | AC_PROG_CPP 15 | AC_PROG_INSTALL 16 | AC_PROG_LN_S 17 | AC_PROG_MAKE_SET 18 | PKG_PROG_PKG_CONFIG 19 | 20 | # Check for libraries 21 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 22 | AC_SUBST([GPSUTILS_CFLAGS]) 23 | AC_SUBST([GPSUTILS_LIBS]) 24 | 25 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 26 | AC_SUBST([LOCCORE_CFLAGS]) 27 | AC_SUBST([LOCCORE_LIBS]) 28 | 29 | AS_CASE([$host], 30 | [arm*], [ARM=yes], 31 | [ARM=no] 32 | ) 33 | 34 | AC_ARG_WITH([locpla_includes], 35 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 36 | [specify the path to locpla-includes in loc-pla_git.bb]), 37 | [locpla_incdir=$withval], 38 | with_locpla_includes=no) 39 | 40 | if test "x$with_locpla_includes" != "xno"; then 41 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 42 | fi 43 | 44 | AC_ARG_WITH([glib], 45 | AC_HELP_STRING([--with-glib], 46 | [enable glib, building HLOS systems which use glib])) 47 | 48 | if (test "x${with_glib}" = "xyes"); then 49 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 50 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 51 | AC_MSG_ERROR(GThread >= 2.16 is required)) 52 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 53 | AC_MSG_ERROR(GLib >= 2.16 is required)) 54 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 55 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 56 | 57 | AC_SUBST(GLIB_CFLAGS) 58 | AC_SUBST(GLIB_LIBS) 59 | fi 60 | 61 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 62 | 63 | AC_SUBST([CFLAGS]) 64 | AC_SUBST([CPPFLAGS]) 65 | AC_SUBST([LIBS]) 66 | 67 | AC_CONFIG_FILES([ \ 68 | Makefile \ 69 | location-geofence.pc 70 | ]) 71 | 72 | AC_OUTPUT 73 | -------------------------------------------------------------------------------- /rootdir/bin/init.acdbdata.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | 3 | ACDB_BIN_PATH="/vendor/etc/acdbdata" 4 | ETC_ROOT_PATH="/vendor/etc" 5 | DEFAULT_BOARD="MTP" 6 | LOG_TAG="init.acdbdata.sh" 7 | CALFILE_PROP="persist.vendor.audio.calfile" 8 | 9 | LOGE() { 10 | log -p f "${LOG_TAG}: ACDB -> $@" 11 | echo "E ${LOG_TAG}: ACDB -> $@" 12 | } 13 | 14 | LOGI() { 15 | log -p i "${LOG_TAG}: ACDB -> $@" 16 | echo "I ${LOG_TAG}: ACDB -> $@" 17 | } 18 | 19 | COMPATIBLE="$(cat /sys/firmware/devicetree/base/compatible)" 20 | if [ -z "$COMPATIBLE" ]; then 21 | LOGE "Unable to read dts compatible" 22 | exit 1 23 | fi 24 | 25 | is_compatible() { 26 | if echo -n "$COMPATIBLE" | grep "$1" 2>&1 > /dev/null ; then 27 | return 0 28 | else 29 | return 1 30 | fi 31 | } 32 | 33 | if is_compatible "qcom,mtp"; then 34 | BOARD_TYPE="MTP" 35 | elif is_compatible "qcom,qrd"; then 36 | BOARD_TYPE="QRD" 37 | else 38 | LOGE "Unable to determine board type" 39 | exit 1 40 | fi 41 | 42 | LOGI "board_type = $BOARD_TYPE" 43 | 44 | get_acdb_files() { 45 | dir="$1" 46 | if ! [ -d "$dir" ]; then LOGE "Failed to open directory ${dir}" ; return 1; fi 47 | files="`find $dir -type f \( -name '*.acdb' -o -name '*.qwsp' \) -maxdepth 1`" 48 | if [ -z "$files" ]; then LOGE "Failed to list files in directory ${dir}" ; return 1 ; fi 49 | i=0 50 | for f in $files; do 51 | setprop ${CALFILE_PROP}${i} ${f} || LOGE "setprop failed for prop: ${CALFILE_PROP}${i}=${f}" 52 | LOGI "Set calfile ${i}: ${f}" 53 | let i+=1 54 | done 55 | exit 0 56 | } 57 | 58 | SND_CARD_NAME="$(cat /sys/firmware/devicetree/base/soc/sound/qcom,model)" 59 | if [ "$SND_CARD_NAME" ]; then 60 | get_acdb_files "${ACDB_BIN_PATH}/${BOARD_TYPE}/${SND_CARD_NAME}" 61 | fi 62 | 63 | get_acdb_files "${ACDB_BIN_PATH}/${BOARD_TYPE}" 64 | 65 | if [ "$SND_CARD_NAME" ] && [ "$DEFAULT_BOARD" != "$BOARD_TYPE" ]; then 66 | get_acdb_files "${ACDB_BIN_PATH}/${DEFAULT_BOARD}/${SND_CARD_NAME}" 67 | fi 68 | 69 | get_acdb_files "${ACDB_BIN_PATH}/${DEFAULT_BOARD}" 70 | 71 | get_acdb_files "${ETC_ROOT_PATH}" 72 | 73 | LOGE "Could not open any directory!" 74 | exit 1 -------------------------------------------------------------------------------- /gps/etc/seccomp_policy/gnss@2.0-xtra-daemon.policy: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2020 The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are 6 | # met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above 10 | # copyright notice, this list of conditions and the following 11 | # disclaimer in the documentation and/or other materials provided 12 | # with the distribution. 13 | # * Neither the name of The Linux Foundation, nor the names of its 14 | # contributors may be used to endorse or promote products derived 15 | # from this software without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | #****************************************************************************** 30 | bind: 1 31 | getrlimit: 1 32 | 33 | pipe2: 1 34 | 35 | sched_getaffinity: 1 36 | timerfd_create: 1 37 | unlinkat: 1 38 | setpriority: 1 39 | 40 | epoll_create1: 1 41 | epoll_ctl: 1 42 | epoll_pwait: 1 43 | timerfd_settime: 1 44 | 45 | fdatasync: 1 46 | madvise: 1 47 | ftruncate: 1 48 | 49 | -------------------------------------------------------------------------------- /gps/utils/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = -Wundef \ 4 | -MD \ 5 | -Wno-trigraphs \ 6 | -g -O0 \ 7 | -fno-inline \ 8 | -fno-short-enums \ 9 | -fpic \ 10 | -I./ \ 11 | -std=c++14 \ 12 | $(LOCPLA_CFLAGS) 13 | 14 | libgps_utils_la_h_sources = \ 15 | msg_q.h \ 16 | linked_list.h \ 17 | loc_cfg.h \ 18 | loc_log.h \ 19 | loc_target.h \ 20 | loc_timer.h \ 21 | MsgTask.h \ 22 | LocHeap.h \ 23 | LocThread.h \ 24 | LocTimer.h \ 25 | LocIpc.h \ 26 | SkipList.h\ 27 | loc_misc_utils.h \ 28 | loc_nmea.h \ 29 | gps_extended_c.h \ 30 | gps_extended.h \ 31 | loc_gps.h \ 32 | log_util.h \ 33 | LocSharedLock.h \ 34 | LocUnorderedSetMap.h\ 35 | LocLoggerBase.h 36 | 37 | libgps_utils_la_c_sources = \ 38 | linked_list.c \ 39 | msg_q.c \ 40 | loc_cfg.cpp \ 41 | loc_log.cpp \ 42 | loc_target.cpp \ 43 | LocHeap.cpp \ 44 | LocTimer.cpp \ 45 | LocThread.cpp \ 46 | LocIpc.cpp \ 47 | LogBuffer.cpp \ 48 | MsgTask.cpp \ 49 | loc_misc_utils.cpp \ 50 | loc_nmea.cpp 51 | 52 | library_includedir = $(pkgincludedir) 53 | 54 | library_include_HEADERS = $(libgps_utils_la_h_sources) 55 | 56 | libgps_utils_la_SOURCES = $(libgps_utils_la_c_sources) 57 | 58 | if USE_GLIB 59 | libgps_utils_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 60 | libgps_utils_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 61 | libgps_utils_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 62 | else 63 | libgps_utils_la_CFLAGS = $(AM_CFLAGS) 64 | libgps_utils_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 65 | libgps_utils_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 66 | endif 67 | 68 | libgps_utils_la_LIBADD = $(CUTILS_LIBS) -ldl 69 | 70 | #Create and Install libraries 71 | lib_LTLIBRARIES = libgps_utils.la 72 | 73 | pkgconfigdir = $(libdir)/pkgconfig 74 | pkgconfig_DATA = gps-utils.pc 75 | EXTRA_DIST = $(pkgconfig_DATA) 76 | -------------------------------------------------------------------------------- /thermal/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, The Linux Foundation. All rights reserved. 3 | * Not a contribution 4 | * Copyright (C) 2018 The Android Open Source Project 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #define LOG_TAG "thermal_hal" 20 | 21 | #include 22 | #include 23 | #include "thermal.h" 24 | 25 | using ::android::OK; 26 | using ::android::status_t; 27 | 28 | // libhwbinder: 29 | using ::android::hardware::configureRpcThreadpool; 30 | using ::android::hardware::joinRpcThreadpool; 31 | 32 | // Generated HIDL files: 33 | using ::android::hardware::thermal::V2_0::IThermal; 34 | using ::android::hardware::thermal::V2_0::implementation::Thermal; 35 | 36 | static int shutdown() { 37 | LOG(ERROR) << "Thermal HAL Service is shutting down."; 38 | return 1; 39 | } 40 | 41 | int main(int /* argc */, char ** /* argv */) { 42 | status_t status; 43 | android::sp service = nullptr; 44 | 45 | LOG(INFO) << "Thermal HAL Service 2.0 starting..."; 46 | 47 | service = new Thermal(); 48 | if (service == nullptr) { 49 | LOG(ERROR) << "Error creating an instance of Thermal HAL. Exiting..."; 50 | return shutdown(); 51 | } 52 | 53 | configureRpcThreadpool(1, true /* callerWillJoin */); 54 | 55 | status = service->registerAsService(); 56 | if (status != OK) { 57 | LOG(ERROR) << "Could not register service for ThermalHAL (" << status << ")"; 58 | return shutdown(); 59 | } 60 | 61 | LOG(INFO) << "Thermal HAL Service 2.0 started successfully."; 62 | joinRpcThreadpool(); 63 | // We should not get past the joinRpcThreadpool(). 64 | return shutdown(); 65 | } 66 | -------------------------------------------------------------------------------- /rootdir/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021-2022 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | // Init scripts 8 | 9 | prebuilt_etc { 10 | name: "init.qcom.rc", 11 | src: "etc/init.qcom.rc", 12 | sub_dir: "init/hw", 13 | vendor: true, 14 | } 15 | 16 | prebuilt_etc { 17 | name: "init.qcom.usb.rc", 18 | src: "etc/init.qcom.usb.rc", 19 | sub_dir: "init/hw", 20 | vendor: true, 21 | } 22 | 23 | prebuilt_etc { 24 | name: "init.target.rc", 25 | src: "etc/init.target.rc", 26 | sub_dir: "init/hw", 27 | vendor: true, 28 | } 29 | 30 | prebuilt_etc { 31 | name: "init.uclamp.rc", 32 | src: "etc/init.uclamp.rc", 33 | sub_dir: "init", 34 | vendor: true, 35 | } 36 | 37 | prebuilt_etc { 38 | name: "init.xiaomi.rc", 39 | src: "etc/init.xiaomi.rc", 40 | sub_dir: "init/hw", 41 | vendor: true, 42 | } 43 | 44 | // Configuration scripts 45 | 46 | sh_binary { 47 | name: "init.acdbdata.sh", 48 | src: "bin/init.acdbdata.sh", 49 | vendor: true, 50 | } 51 | 52 | sh_binary { 53 | name: "init.baseband.sh", 54 | src: "bin/init.baseband.sh", 55 | vendor: true, 56 | } 57 | 58 | sh_binary { 59 | name: "init.class_main.sh", 60 | src: "bin/init.class_main.sh", 61 | vendor: true, 62 | } 63 | 64 | sh_binary { 65 | name: "init.qcom.early_boot.sh", 66 | src: "bin/init.qcom.early_boot.sh", 67 | vendor: true, 68 | } 69 | 70 | sh_binary { 71 | name: "init.qcom.post_boot.sh", 72 | src: "bin/init.qcom.post_boot.sh", 73 | vendor: true, 74 | } 75 | 76 | sh_binary { 77 | name: "init.qcom.sensors.sh", 78 | src: "bin/init.qcom.sensors.sh", 79 | vendor: true, 80 | } 81 | 82 | sh_binary { 83 | name: "init.qcom.sh", 84 | src: "bin/init.qcom.sh", 85 | vendor: true, 86 | } 87 | 88 | sh_binary { 89 | name: "init.qcom.usb.sh", 90 | src: "bin/init.qcom.usb.sh", 91 | vendor: true, 92 | } 93 | 94 | sh_binary { 95 | name: "init.qti.dcvs.sh", 96 | src: "bin/init.qti.dcvs.sh", 97 | vendor: true, 98 | } 99 | 100 | sh_binary { 101 | name: "init.qti.qseecomd.sh", 102 | src: "bin/init.qti.qseecomd.sh", 103 | vendor: true, 104 | } 105 | -------------------------------------------------------------------------------- /parts/res/xml/doze_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 24 | 25 | 28 | 29 | 35 | 36 | 37 | 38 | 41 | 42 | 48 | 49 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /gps/utils/MsgTask.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, 2015, 2020 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __MSG_TASK__ 30 | #define __MSG_TASK__ 31 | 32 | #include 33 | #include 34 | 35 | namespace loc_util { 36 | 37 | struct LocMsg { 38 | inline LocMsg() {} 39 | inline virtual ~LocMsg() {} 40 | virtual void proc() const = 0; 41 | inline virtual void log() const {} 42 | }; 43 | 44 | class MsgTask { 45 | const void* mQ; 46 | LocThread mThread; 47 | public: 48 | ~MsgTask() = default; 49 | MsgTask(const char* threadName = NULL); 50 | void sendMsg(const LocMsg* msg) const; 51 | void sendMsg(const std::function runnable) const; 52 | }; 53 | 54 | } // 55 | 56 | #endif //__MSG_TASK__ 57 | -------------------------------------------------------------------------------- /gps/etc/flp.conf: -------------------------------------------------------------------------------- 1 | ################################### 2 | ##### FLP settings ##### 3 | ################################### 4 | 5 | ################################### 6 | # FLP BATCH SIZE 7 | ################################### 8 | # The number of batched locations 9 | # requested to modem. The desired number 10 | # defined below may not be satisfied, as 11 | # the modem can only return the number 12 | # of batched locations that can be allocated, 13 | # which is limited by memory. The default 14 | # batch size defined as 20 as below. 15 | BATCH_SIZE=20 16 | 17 | ################################### 18 | # FLP OUTDOOR TRIP BATCH SIZE 19 | ################################### 20 | # The number of batched locations 21 | # requested to modem for outdoor 22 | # trip batching. The desired number 23 | # defined below may not be satisfied, as 24 | # the modem can only return the number 25 | # of batched locations that can be allocated, 26 | # which is limited by memory. The default 27 | # trip batch size defined as 600 as below. 28 | OUTDOOR_TRIP_BATCH_SIZE=600 29 | 30 | ################################### 31 | # FLP BATCHING SESSION TIMEOUT 32 | ################################### 33 | # Duration with which batch session timeout 34 | # happens in milliseconds. If not specified 35 | # or set to zero, batching session timeout 36 | # defaults to 20 seconds by the modem. 37 | # BATCH_SESSION_TIMEOUT=20000 38 | 39 | ################################### 40 | # FLP BATCHING ACCURACY 41 | ################################### 42 | # Set to one of the defined values below 43 | # to define the accuracy of batching. 44 | # If not specified, accuracy defaults 45 | # to LOW. 46 | # FLP BATCHING ACCURACY values: 47 | # Low accuracy = 0 48 | # Medium accuracy = 1 49 | # High accuracy = 2 50 | ACCURACY=1 51 | 52 | #################################### 53 | # 1: FORCE USING LB 1.0 54 | # 0: adaptive LB or LB 2.0 would be invoked 55 | # which would rely on CMC sensors 56 | #################################### 57 | USE_LB_1_0 = 1 58 | 59 | #################################### 60 | # By default if network fixes are not sensor assisted 61 | # these fixes must be dropped. This parameter adds an exception 62 | # for targets where there is no PDR and we still want to 63 | # report out network fixes 64 | # 0: MUST NOT ALLOW NETWORK FIXES 65 | # 1: ALLOW NETWORK FIXES 66 | #################################### 67 | ALLOW_NETWORK_FIXES = 0 68 | -------------------------------------------------------------------------------- /subsystem_state_notifier/main.c: -------------------------------------------------------------------------------- 1 | #define LOG_TAG "SubsystemStateNotifier" 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #define PROP_SUBSYS_STATE "vendor.subsys_state_notifier.%s.state" 11 | #define SUBSYS_STATE_PATH "/sys/class/subsys/subsys_%s/device/subsys%d/state" 12 | 13 | int main(int argc, char** argv) { 14 | char prop_subsys_state_key[64]; 15 | char subsystem[10]; 16 | char subsystem_state[11]; 17 | char subsystem_state_path[64]; 18 | int fd, i; 19 | struct pollfd pollfds[1]; 20 | 21 | // Get subsystem name from the first arg 22 | if (argc != 2) { 23 | ALOGE("Wrong arguments\n"); 24 | goto error; 25 | } 26 | strncpy(subsystem, argv[1], sizeof(subsystem)); 27 | ALOGI("Subsystem to monitor: %s\n", subsystem); 28 | 29 | // Open fd 30 | for (i = 0; i <= 9; ++i) { 31 | snprintf(subsystem_state_path, sizeof(subsystem_state_path), SUBSYS_STATE_PATH, subsystem, 32 | i); 33 | fd = open(subsystem_state_path, O_RDONLY); 34 | if (fd >= 0) { 35 | ALOGI("Opened %s subsystem state path %s\n", subsystem, subsystem_state_path); 36 | break; 37 | } 38 | } 39 | if (fd < 0) { 40 | ALOGE("Failed to open %s subsystem state\n", subsystem); 41 | goto error; 42 | } 43 | 44 | // Set property key for notifying state 45 | snprintf(prop_subsys_state_key, sizeof(prop_subsys_state_key), PROP_SUBSYS_STATE, subsystem); 46 | 47 | // Prepare for poll 48 | pollfds[0].fd = fd; 49 | pollfds[0].events = POLLERR | POLLPRI; 50 | 51 | // Poll 52 | while (true) { 53 | if (lseek(fd, 0, SEEK_SET) || !read(fd, subsystem_state, sizeof(subsystem_state))) { 54 | ALOGE("Error in reading\n"); 55 | goto error_fd; 56 | } 57 | 58 | subsystem_state[strlen(subsystem_state) - 1] = '\0'; 59 | ALOGI("%s subsystem state: %s\n", subsystem, subsystem_state); 60 | property_set(prop_subsys_state_key, subsystem_state); 61 | 62 | if (!poll(pollfds, 1, -1)) { 63 | ALOGE("Error in polling\n"); 64 | goto error_fd; 65 | } 66 | } 67 | 68 | // We should never reach here 69 | close(fd); 70 | return 0; 71 | 72 | error_fd: 73 | close(fd); 74 | error: 75 | return 1; 76 | } 77 | -------------------------------------------------------------------------------- /overlay-radio/packages/services/Telephony/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 21 | 22 | 24 | 25 | 27 | 1 28 | 29 | 33 | 34 | true 35 | 36 | 37 | false 38 | 39 | 40 | org.codeaurora.ims 41 | 42 | 43 | org.codeaurora.ims 44 | 45 | -------------------------------------------------------------------------------- /reorder-libs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2022 The LineageOS Project 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | 8 | from functools import cmp_to_key 9 | from locale import LC_ALL, setlocale, strcoll 10 | from pathlib import Path 11 | 12 | FILES = [Path(file) for file in [ 13 | "proprietary-files/4.9/qcom-system.txt", 14 | "proprietary-files/4.9/qcom-vendor.txt", 15 | "proprietary-files/4.9/qcom-vendor-32.txt", 16 | "proprietary-files/4.19/qcom-system.txt", 17 | "proprietary-files/4.19/qcom-vendor.txt", 18 | "proprietary-files/4.19/qcom-vendor-32.txt", 19 | ]] 20 | 21 | setlocale(LC_ALL, "C") 22 | 23 | def strcoll_extract_utils(string1: str, string2: str) -> int: 24 | # Skip logic if one of the string if empty 25 | if not string1 or not string2: 26 | return strcoll(string1, string2) 27 | 28 | # Remove '-' from strings if there, 29 | # it is used to indicate a build target 30 | string1 = string1.removeprefix('-') 31 | string2 = string2.removeprefix('-') 32 | 33 | # If no directories, compare normally 34 | if not "/" in string1 and not "/" in string2: 35 | return strcoll(string1, string2) 36 | 37 | string1_dir = string1.rsplit("/", 1)[0] + "/" 38 | string2_dir = string2.rsplit("/", 1)[0] + "/" 39 | if string1_dir == string2_dir: 40 | # Same directory, compare normally 41 | return strcoll(string1, string2) 42 | 43 | if string1_dir.startswith(string2_dir): 44 | # First string dir is a subdirectory of the second one, 45 | # return string1 > string2 46 | return -1 47 | 48 | if string2_dir.startswith(string1_dir): 49 | # Second string dir is a subdirectory of the first one, 50 | # return string2 > string1 51 | return 1 52 | 53 | # Compare normally 54 | return strcoll(string1, string2) 55 | 56 | for file in FILES: 57 | if not file.is_file(): 58 | print(f"File {str(file)} not found") 59 | continue 60 | 61 | with open(file, 'r') as f: 62 | sections = f.read().split("\n\n") 63 | 64 | ordered_sections = [] 65 | for section in sections: 66 | section_list = [line.strip() for line in section.splitlines()] 67 | section_list.sort(key=cmp_to_key(strcoll_extract_utils)) 68 | ordered_sections.append("\n".join(section_list)) 69 | 70 | with open(file, 'w') as f: 71 | f.write("\n\n".join(ordered_sections).strip() + "\n") 72 | -------------------------------------------------------------------------------- /update-sha1sums.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2022 The LineageOS Project 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | from hashlib import sha1 20 | import sys 21 | 22 | device='mithorium-common' 23 | vendor='xiaomi' 24 | 25 | lines = [ line for line in open('proprietary-files.txt', 'r') ] 26 | vendorPath = '../../../vendor/' + vendor + '/' + device + '/proprietary' 27 | needSHA1 = False 28 | 29 | def cleanup(): 30 | for index, line in enumerate(lines): 31 | # Remove '\n' character 32 | line = line[:-1] 33 | 34 | # Skip empty or commented lines 35 | if len(line) == 0 or line[0] == '#': 36 | continue 37 | 38 | # Drop SHA1 hash, if existing 39 | if '|' in line: 40 | line = line.split('|')[0] 41 | lines[index] = '%s\n' % (line) 42 | 43 | def update(): 44 | for index, line in enumerate(lines): 45 | # Remove '\n' character 46 | line = line[:-1] 47 | 48 | # Skip empty lines 49 | if len(line) == 0: 50 | continue 51 | 52 | # Check if we need to set SHA1 hash for the next files 53 | if line[0] == '#': 54 | needSHA1 = (' - from' in line) 55 | continue 56 | 57 | if needSHA1: 58 | # Remove existing SHA1 hash 59 | line = line.split('|')[0] 60 | filePath = line.split(':')[1] if len(line.split(':')) == 2 else line 61 | 62 | if filePath[0] == '-': 63 | file = open('%s/%s' % (vendorPath, filePath[1:]), 'rb').read() 64 | else: 65 | file = open('%s/%s' % (vendorPath, filePath), 'rb').read() 66 | 67 | hash = sha1(file).hexdigest() 68 | lines[index] = '%s|%s\n' % (line, hash) 69 | 70 | if len(sys.argv) == 2 and sys.argv[1] == '-c': 71 | cleanup() 72 | else: 73 | update() 74 | 75 | with open('proprietary-files.txt', 'w') as file: 76 | for line in lines: 77 | file.write(line) 78 | 79 | file.close() 80 | -------------------------------------------------------------------------------- /gps/batching/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps location-batching 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps location-batching package version 1.0.0 8 | AC_INIT([location-batching],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([Makefile.am]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 37 | AC_SUBST([LOCCORE_CFLAGS]) 38 | AC_SUBST([LOCCORE_LIBS]) 39 | 40 | AC_ARG_WITH([locpla_includes], 41 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 42 | [specify the path to locpla-includes in loc-pla_git.bb]), 43 | [locpla_incdir=$withval], 44 | with_locpla_includes=no) 45 | 46 | if test "x$with_locpla_includes" != "xno"; then 47 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 48 | fi 49 | 50 | AC_ARG_WITH([glib], 51 | AC_HELP_STRING([--with-glib], 52 | [enable glib, building HLOS systems which use glib])) 53 | 54 | if (test "x${with_glib}" = "xyes"); then 55 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 56 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 57 | AC_MSG_ERROR(GThread >= 2.16 is required)) 58 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 59 | AC_MSG_ERROR(GLib >= 2.16 is required)) 60 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 61 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 62 | 63 | AC_SUBST(GLIB_CFLAGS) 64 | AC_SUBST(GLIB_LIBS) 65 | fi 66 | 67 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 68 | 69 | AC_CONFIG_FILES([ \ 70 | Makefile \ 71 | location-batching.pc 72 | ]) 73 | 74 | AC_OUTPUT 75 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | true 22 | 23 | 24 | true 25 | 26 | 28 | 524288,2097152,4194304,262144,524288,1048576 29 | 30 | 31 | true 32 | 33 | 34 | true 35 | 36 | 37 | 32 38 | 39 | 40 | false 41 | 42 | 43 | false 44 | 45 | 46 | false 47 | 48 | -------------------------------------------------------------------------------- /gps/core/LocContext.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2014, 2017-2020 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __LOC_CONTEXT__ 30 | #define __LOC_CONTEXT__ 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | namespace loc_core { 38 | 39 | class LocContext : public ContextBase { 40 | static const MsgTask* mMsgTask; 41 | static ContextBase* mContext; 42 | static const MsgTask* getMsgTask(const char* name); 43 | static pthread_mutex_t mGetLocContextMutex; 44 | 45 | protected: 46 | LocContext(const MsgTask* msgTask); 47 | inline virtual ~LocContext() {} 48 | 49 | public: 50 | static const char* mLBSLibName; 51 | static const char* mLocationHalName; 52 | 53 | static ContextBase* getLocContext(const char* name); 54 | 55 | static void injectFeatureConfig(ContextBase *context); 56 | }; 57 | 58 | } 59 | 60 | #endif //__LOC_CONTEXT__ 61 | -------------------------------------------------------------------------------- /thermal/thermalConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, The Linux Foundation. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above 10 | * copyright notice, this list of conditions and the following 11 | * disclaimer in the documentation and/or other materials provided 12 | * with the distribution. 13 | * * Neither the name of The Linux Foundation nor the names of its 14 | * contributors may be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * 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 | #ifndef THERMAL_THERMAL_CONFIG_H__ 32 | #define THERMAL_THERMAL_CONFIG_H__ 33 | 34 | #include 35 | 36 | #include "thermalData.h" 37 | #include "thermalCommon.h" 38 | 39 | namespace android { 40 | namespace hardware { 41 | namespace thermal { 42 | namespace V2_0 { 43 | namespace implementation { 44 | 45 | class ThermalConfig { 46 | public: 47 | ThermalConfig(); 48 | ~ThermalConfig() = default; 49 | 50 | std::vector fetchConfig(void) 51 | { 52 | return thermalConfig; 53 | } 54 | 55 | private: 56 | std::vector thermalConfig; 57 | int soc_id; 58 | ThermalCommon cmnInst; 59 | }; 60 | 61 | } // namespace implementation 62 | } // namespace V2_0 63 | } // namespace thermal 64 | } // namespace hardware 65 | } // namespace android 66 | 67 | #endif // THERMAL_THERMAL_CONFIG_H__ 68 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssConfiguration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | 6 | /* Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | 22 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 23 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssConfiguration; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* 42 | * Interface for passing GNSS configuration info from platform to HAL. 43 | */ 44 | struct Gnss; 45 | struct GnssConfiguration : public IGnssConfiguration { 46 | GnssConfiguration(Gnss* gnss); 47 | ~GnssConfiguration() = default; 48 | 49 | /* 50 | * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow. 51 | * These declarations were generated from IGnssConfiguration.hal. 52 | */ 53 | Return setSuplVersion(uint32_t version) override; 54 | Return setSuplMode(uint8_t mode) override; 55 | Return setSuplEs(bool enabled) override; 56 | Return setLppProfile(uint8_t lppProfileMask) 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/etc/seccomp_policy/gnss@2.0-xtwifi-client.policy: -------------------------------------------------------------------------------- 1 | 2 | #******************************************************************************* 3 | # Copyright (c) 2020 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 | fdatasync: 1 33 | getdents64: 1 34 | gettimeofday: 1 35 | ioctl: 1 36 | lseek: 1 37 | madvise: 1 38 | mkdirat: 1 39 | pwrite64: 1 40 | 41 | timerfd_create: 1 42 | timerfd_settime: 1 43 | epoll_create1: 1 44 | epoll_pwait: 1 45 | epoll_ctl: 1 46 | 47 | sched_getaffinity: 1 48 | gettid: 1 49 | fchown: 1 50 | fchmod: 1 51 | fchmodat: 1 52 | getsockopt: 1 53 | fchownat: 1 54 | fstat: 1 55 | fstatfs: 1 56 | newfstatat: 1 57 | sendmsg: 1 58 | recvmsg: 1 59 | gettimeofday: 1 60 | setsockopt: 1 61 | rt_tgsigqueueinfo: 1 62 | ioctl: 1 63 | mmap: 1 64 | getuid32: 1 65 | getuid: 1 66 | fstat64: 1 67 | fstatat64: 1 68 | mkdir: 1 69 | rmdir: 1 70 | creat: 1 71 | chmod: 1 72 | lseek: 1 73 | geteuid32: 1 74 | -------------------------------------------------------------------------------- /gps/core/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = -I./ \ 4 | $(LOCPLA_CFLAGS) \ 5 | $(GPSUTILS_CFLAGS) \ 6 | -I./data-items/ \ 7 | -I./data-items/common \ 8 | -I./observer \ 9 | -I$(WORKSPACE)/gps-noship/flp \ 10 | -D__func__=__PRETTY_FUNCTION__ \ 11 | -fno-short-enums \ 12 | -std=c++11 13 | 14 | libloc_core_la_h_sources = \ 15 | LocApiBase.h \ 16 | LocAdapterBase.h \ 17 | ContextBase.h \ 18 | LocContext.h \ 19 | LBSProxyBase.h \ 20 | loc_core_log.h \ 21 | LocAdapterProxyBase.h \ 22 | EngineHubProxyBase.h \ 23 | data-items/DataItemId.h \ 24 | data-items/IDataItemCore.h \ 25 | data-items/DataItemConcreteTypes.h \ 26 | data-items/DataItemsFactoryProxy.h \ 27 | observer/IDataItemObserver.h \ 28 | observer/IDataItemSubscription.h \ 29 | observer/IFrameworkActionReq.h \ 30 | observer/IOsObserver.h \ 31 | SystemStatusOsObserver.h \ 32 | SystemStatus.h 33 | 34 | libloc_core_la_c_sources = \ 35 | LocApiBase.cpp \ 36 | LocAdapterBase.cpp \ 37 | ContextBase.cpp \ 38 | LocContext.cpp \ 39 | loc_core_log.cpp \ 40 | data-items/DataItemsFactoryProxy.cpp \ 41 | data-items/DataItemConcreteTypes.cpp \ 42 | SystemStatusOsObserver.cpp \ 43 | SystemStatus.cpp 44 | 45 | if USE_EXTERNAL_AP 46 | AM_CFLAGS += -DFEATURE_EXTERNAL_AP 47 | endif 48 | 49 | library_includedir = $(pkgincludedir) 50 | 51 | library_include_HEADERS = $(libloc_core_la_h_sources) 52 | 53 | libloc_core_la_SOURCES = $(libloc_core_la_c_sources) 54 | 55 | if USE_GLIB 56 | libloc_core_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 57 | libloc_core_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 58 | libloc_core_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 59 | else 60 | libloc_core_la_CFLAGS = $(AM_CFLAGS) 61 | libloc_core_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 62 | libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 63 | endif 64 | 65 | if USE_FEATURE_AUTOMOTIVE 66 | AM_CFLAGS += -DFEATURE_AUTOMOTIVE 67 | endif 68 | 69 | libloc_core_la_LIBADD = -ldl $(GPSUTILS_LIBS) 70 | 71 | #Create and Install libraries 72 | lib_LTLIBRARIES = libloc_core.la 73 | 74 | pkgconfigdir = $(libdir)/pkgconfig 75 | pkgconfig_DATA = loc-core.pc 76 | EXTRA_DIST = $(pkgconfig_DATA) 77 | -------------------------------------------------------------------------------- /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 | voip_rx { 22 | flags AUDIO_OUTPUT_FLAG_VOIP_RX|AUDIO_OUTPUT_FLAG_DIRECT 23 | formats AUDIO_FORMAT_PCM_16_BIT 24 | sampling_rates 8000|16000|32000|48000 25 | bit_width 16 26 | app_type 69946 27 | } 28 | deep_buffer { 29 | flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER 30 | formats AUDIO_FORMAT_PCM_16_BIT 31 | sampling_rates 48000 32 | bit_width 16 33 | app_type 69936 34 | } 35 | direct_pcm_16 { 36 | flags AUDIO_OUTPUT_FLAG_DIRECT 37 | formats AUDIO_FORMAT_PCM_16_BIT|AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT 38 | sampling_rates 44100|48000|96000|192000 39 | bit_width 16 40 | app_type 69936 41 | } 42 | direct_pcm_24 { 43 | flags AUDIO_OUTPUT_FLAG_DIRECT 44 | formats AUDIO_FORMAT_PCM_24_BIT_PACKED|AUDIO_FORMAT_PCM_8_24_BIT 45 | sampling_rates 44100|48000|96000|192000 46 | bit_width 24 47 | app_type 69940 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 59 | sampling_rates 44100|48000|96000|192000 60 | bit_width 24 61 | app_type 69940 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_0 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V1_0 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_1 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V1_1 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/2.0/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V2_0 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V2_0 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/2.1/AGnss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace android { 30 | namespace hardware { 31 | namespace gnss { 32 | namespace V2_1 { 33 | namespace implementation { 34 | 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 | using ::android::hardware::gnss::V2_0::IAGnssCallback; 41 | 42 | struct Gnss; 43 | struct AGnss : public V2_0::IAGnss { 44 | 45 | AGnss(Gnss* gnss); 46 | ~AGnss(); 47 | /* 48 | * Methods from ::android::hardware::gnss::V2_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(uint64_t networkHandle, const hidl_string& apn, 58 | V2_0::IAGnss::ApnIpType apnIpType) override; 59 | 60 | Return setServer(V2_0::IAGnssCallback::AGnssType type, 61 | const hidl_string& hostname, int32_t port) override; 62 | 63 | void statusCb(AGpsExtType type, AGpsStatusValue status); 64 | 65 | private: 66 | Gnss* mGnss = nullptr; 67 | std::mutex mMutex; 68 | sp mAGnssCbIface = nullptr; 69 | 70 | AGpsExtType mType; 71 | }; 72 | 73 | } // namespace implementation 74 | } // namespace V2_1 75 | } // namespace gnss 76 | } // namespace hardware 77 | } // namespace android 78 | 79 | #endif // ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 80 | --------------------------------------------------------------------------------