├── configs ├── sensors │ └── hals.conf ├── msm_irqbalance.conf ├── thermal-engine.conf └── media_codecs_vendor_audio.xml ├── sepolicy ├── vendor │ ├── idmap.te │ ├── ims.te │ ├── atfwd.te │ ├── hal_cas_default.te │ ├── magisk.te │ ├── proc_net.te │ ├── hal_imsrtp.te │ ├── adsprpcd_file.te │ ├── hal_dpmQmiMgr.te │ ├── hal_gnss_qti.te │ ├── mediaswcodec.te │ ├── poweroffalarm_app.te │ ├── hal_perf_default.te │ ├── hal_rcsservice.te │ ├── device.te │ ├── hal_bluetooth_qti.te │ ├── vndservice.te │ ├── power_off_alarm.te │ ├── dataservice_app.te │ ├── hal_health_default.te │ ├── hostapd.te │ ├── cnd.te │ ├── hvdcp.te │ ├── sensors.te │ ├── hal_wifi_hostapd_default.te │ ├── app.te │ ├── location.te │ ├── hal_bootctl_default.te │ ├── vendor_per_mgr.te │ ├── vndservice_contexts │ ├── service.te │ ├── thermal_engine.te │ ├── hal_vibrator_default.te │ ├── hal_wifi_default.te │ ├── mediadrmserver.te │ ├── snap_app.te │ ├── cameraserver.te │ ├── hwservice_contexts │ ├── time_daemon.te │ ├── hal_ir_default.te │ ├── hal_memtrack_default.te │ ├── installd.te │ ├── vndservicemanager.te │ ├── hal_bluetooth_default.te │ ├── netd.te │ ├── bluetooth.te │ ├── perfservice.te │ ├── rild.te │ ├── hal_light_default.te │ ├── hal_graphics_allocator_default.te │ ├── radio.te │ ├── webview_zygote.te │ ├── hal_wifi_defaul.te │ ├── service_contexts │ ├── fsck.te │ ├── hal_graphics_composer_default.te │ ├── hal_sensors_default.te │ ├── hal_drm_widevine.te │ ├── kernel.te │ ├── zygote.te │ ├── mediaprovider.te │ ├── healthd.te │ ├── bootanim.te │ ├── netmgrd.te │ ├── isolated_app.te │ ├── rmt_storage.te │ ├── vold.te │ ├── surfaceflinger.te │ ├── hwservicemanager.te │ ├── servicemanager.te │ ├── hal_keymaster_qti.te │ ├── hal_power_default.te │ ├── ueventd.te │ ├── untrusted_app_25.te │ ├── property.te │ ├── wcnss_service.te │ ├── flags_health_check.te │ ├── shell.te │ ├── tee.te │ ├── init_fingerprint.te │ ├── hal_audio_default.te │ ├── vendor_init.te │ ├── file.te │ ├── system_app.te │ ├── system_server.te │ ├── hal_camera_default.te │ ├── genfs_contexts │ ├── mm-qcamerad.te │ ├── platform_app.te │ ├── qti_init_shell.te │ ├── property_contexts │ ├── untrusted_app.te │ ├── untrusted_app_27.te │ ├── priv_app.te │ └── init.te └── private │ ├── gsid.te │ ├── adbd.te │ ├── toolbox.te │ ├── healthd.te │ └── vendor_init.te ├── gps ├── etc │ ├── gps.conf │ ├── lowi.conf │ └── flp.conf ├── Android.mk ├── android │ ├── android.hardware.gnss@1.1-service-qti.rc │ ├── service.cpp │ ├── GnssDebug.h │ ├── Android.mk │ ├── GnssConfiguration.h │ ├── GnssNi.h │ ├── AGnss.h │ ├── location_api │ │ ├── LocationUtil.h │ │ ├── BatchingAPIClient.h │ │ └── MeasurementAPIClient.h │ ├── GnssNi.cpp │ ├── GnssMeasurement.h │ ├── GnssBatching.h │ ├── AGnssRil.h │ └── AGnssRil.cpp ├── build │ └── target_specific_features.mk ├── pla │ ├── Android.mk │ ├── android │ │ └── loc_pla.h │ └── oe │ │ └── loc_pla.h ├── gnsspps │ ├── Android.mk │ └── gnsspps.h ├── location │ └── Android.mk ├── gnss │ └── Android.mk ├── utils │ ├── Android.mk │ ├── loc_nmea.h │ ├── loc_log.h │ ├── MsgTask.h │ ├── LocSharedLock.h │ ├── loc_target.h │ └── loc_timer.h └── core │ ├── Android.mk │ ├── data-items │ ├── DataItemsFactoryProxy.h │ ├── IDataItemCore.h │ └── DataItemId.h │ ├── loc_core_log.h │ ├── observer │ └── IDataItemObserver.h │ ├── LBSProxyBase.h │ └── LocAdapterProxyBase.h ├── wifi ├── p2p_supplicant_overlay.conf ├── WCNSS_cfg.dat ├── WCNSS_qcom_wlan_nv.bin └── wpa_supplicant_overlay.conf ├── README.md ├── rootdir ├── sbin │ └── chargeonlymode ├── etc │ ├── move_time_data.sh │ └── move_wifi_data.sh ├── fstab.qcom ├── init.qcom.sh └── Android.mk ├── ims └── Android.bp ├── camera └── Android.bp ├── lineage.dependencies ├── seccomp_policy └── mediacodec.policy ├── keylayout ├── uinput-goodix.kl ├── uinput-fpc.kl ├── gf3208.kl ├── msm8953-snd-card-mtp_Button_Jack.kl ├── gpio-keys.kl ├── ist30xx_ts_input.kl ├── ft5435_ts.kl └── goodix-ts.kl ├── init ├── Android.bp └── init_msm8953.cpp ├── light ├── android.hardware.light@2.0-service.msm8953.rc ├── Android.bp ├── service.cpp └── Light.h ├── overlay-lineage ├── packages │ └── apps │ │ └── Dialer │ │ └── java │ │ └── com │ │ └── android │ │ └── dialer │ │ └── callrecord │ │ └── res │ │ └── values │ │ └── config.xml └── lineage-sdk │ └── lineage │ └── res │ └── res │ └── values │ └── config.xml ├── overlay ├── packages │ ├── apps │ │ ├── Bluetooth │ │ │ └── res │ │ │ │ └── values │ │ │ │ └── config.xml │ │ ├── Settings │ │ │ └── res │ │ │ │ └── values │ │ │ │ └── arrays.xml │ │ ├── Snap │ │ │ └── res │ │ │ │ └── values │ │ │ │ └── config.xml │ │ └── CarrierConfig │ │ │ └── res │ │ │ └── xml │ │ │ └── vendor_device.xml │ └── services │ │ ├── Telecomm │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ │ └── Telephony │ │ └── res │ │ └── values │ │ └── config.xml └── frameworks │ └── base │ └── packages │ └── SystemUI │ └── res │ ├── values │ └── config.xml │ └── drawable │ └── ic_volte.xml ├── libhidl └── Android.mk ├── bluetooth └── bdroid_buildcfg.h ├── setup-makefiles.sh ├── permissions └── privapp-permissions-qti.xml ├── update-sha1sums.py ├── compatibility_matrix.xml ├── vndk └── Android.mk └── audio └── audio_tuning_mixer.txt /configs/sensors/hals.conf: -------------------------------------------------------------------------------- 1 | sensors.ssc.so 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/idmap.te: -------------------------------------------------------------------------------- 1 | allow idmap installd:file read; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/ims.te: -------------------------------------------------------------------------------- 1 | allow ims sysfs:file { open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/private/gsid.te: -------------------------------------------------------------------------------- 1 | allow gsid device:file { open write }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/atfwd.te: -------------------------------------------------------------------------------- 1 | allow atfwd sysfs:file { open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_cas_default.te: -------------------------------------------------------------------------------- 1 | vndbinder_use(hal_cas_default); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/magisk.te: -------------------------------------------------------------------------------- 1 | allow magisk system_file:file { ioctl }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/proc_net.te: -------------------------------------------------------------------------------- 1 | allow proc_net proc:filesystem associate; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_imsrtp.te: -------------------------------------------------------------------------------- 1 | allow hal_imsrtp sysfs:file { open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/adsprpcd_file.te: -------------------------------------------------------------------------------- 1 | allow adsprpcd_file self:filesystem associate; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_dpmQmiMgr.te: -------------------------------------------------------------------------------- 1 | allow hal_dpmQmiMgr sysfs:file { open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_gnss_qti.te: -------------------------------------------------------------------------------- 1 | allow hal_gnss_qti sysfs:file { open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/mediaswcodec.te: -------------------------------------------------------------------------------- 1 | allow mediaswcodec servicemanager:binder call; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/poweroffalarm_app.te: -------------------------------------------------------------------------------- 1 | allow poweroffalarm_app cgroup:file write; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_perf_default.te: -------------------------------------------------------------------------------- 1 | allow hal_perf_default sysfs:dir { open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_rcsservice.te: -------------------------------------------------------------------------------- 1 | allow hal_rcsservice sysfs:file { open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/device.te: -------------------------------------------------------------------------------- 1 | type lirc_device, dev_type; 2 | type gx_fpd_device, dev_type; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bluetooth_qti.te: -------------------------------------------------------------------------------- 1 | allow hal_bluetooth_qti persist_file:lnk_file read; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vndservice.te: -------------------------------------------------------------------------------- 1 | type goodix_fingerprint_vndservice, vndservice_manager_type; -------------------------------------------------------------------------------- /configs/msm_irqbalance.conf: -------------------------------------------------------------------------------- 1 | PRIO=0,0,0,0,1,1,1,1 2 | IGNORED_IRQ=20,39 3 | BLACKLIST_IRQ=6 4 | -------------------------------------------------------------------------------- /sepolicy/private/adbd.te: -------------------------------------------------------------------------------- 1 | allow adbd vendor_file:file getattr; 2 | allow adbd oemfs:dir search; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/power_off_alarm.te: -------------------------------------------------------------------------------- 1 | allow power_off_alarm kmsg_device:chr_file { getattr }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/dataservice_app.te: -------------------------------------------------------------------------------- 1 | allow dataservice_app bootloader_boot_reason_prop:file read; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_health_default.te: -------------------------------------------------------------------------------- 1 | allow hal_health_default sysfs:file { getattr open read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hostapd.te: -------------------------------------------------------------------------------- 1 | allow hostapd hal_wifi_hostapd_default:unix_dgram_socket { sendto }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/cnd.te: -------------------------------------------------------------------------------- 1 | allow cnd hostapd:process { sigkill }; 2 | allow cnd sysfs:file { open read }; 3 | -------------------------------------------------------------------------------- /gps/etc/gps.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperiorOS-Devices/device_xiaomi_daisy-common/ten/gps/etc/gps.conf -------------------------------------------------------------------------------- /sepolicy/vendor/hvdcp.te: -------------------------------------------------------------------------------- 1 | allow hvdcp sysfs:dir { open read }; 2 | allow hvdcp sysfs:file { open read write }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/sensors.te: -------------------------------------------------------------------------------- 1 | allow sensors sysfs:dir { open read }; 2 | allow sensors sysfs:file { open read }; 3 | -------------------------------------------------------------------------------- /wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_no_group_iface=1 3 | persistent_reconnect=1 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_wifi_hostapd_default.te: -------------------------------------------------------------------------------- 1 | allow hal_wifi_hostapd_default hostapd:unix_dgram_socket { sendto }; 2 | -------------------------------------------------------------------------------- /wifi/WCNSS_cfg.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperiorOS-Devices/device_xiaomi_daisy-common/ten/wifi/WCNSS_cfg.dat -------------------------------------------------------------------------------- /sepolicy/vendor/app.te: -------------------------------------------------------------------------------- 1 | # Allow appdomain to get vendor_camera_prop 2 | #get_prop(appdomain, vendor_camera_prop) 3 | 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/location.te: -------------------------------------------------------------------------------- 1 | allow location kernel:system module_request; 2 | allow location sysfs:file { open read }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bootctl_default.te: -------------------------------------------------------------------------------- 1 | allow hal_bootctl_default block_device:blk_file { getattr ioctl open read write }; 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2017 - The LineageOS Project 2 | 3 | Common device tree for Xiaomi MSM8953 based devices 4 | ============== 5 | -------------------------------------------------------------------------------- /rootdir/sbin/chargeonlymode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperiorOS-Devices/device_xiaomi_daisy-common/ten/rootdir/sbin/chargeonlymode -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_per_mgr.te: -------------------------------------------------------------------------------- 1 | allow vendor_per_mgr sysfs:file { open read }; 2 | allow vendor_per_mgr vfat:file { open read }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/vndservice_contexts: -------------------------------------------------------------------------------- 1 | android.hardware.fingerprint.IGoodixFingerprintDaemon u:object_r:goodix_fingerprint_vndservice:s0 -------------------------------------------------------------------------------- /wifi/WCNSS_qcom_wlan_nv.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperiorOS-Devices/device_xiaomi_daisy-common/ten/wifi/WCNSS_qcom_wlan_nv.bin -------------------------------------------------------------------------------- /sepolicy/vendor/service.te: -------------------------------------------------------------------------------- 1 | type goodixfingerprintd_service, service_manager_type; 2 | type goodix_fingerprint_service, service_manager_type; -------------------------------------------------------------------------------- /sepolicy/vendor/thermal_engine.te: -------------------------------------------------------------------------------- 1 | allow thermal-engine sysfs:dir { open read }; 2 | allow thermal-engine sysfs:file { open read write }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_vibrator_default.te: -------------------------------------------------------------------------------- 1 | allow hal_vibrator_default sysfs:file { open write }; 2 | allow hal_vibrator_default sysfs_leds:dir search; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_wifi_default.te: -------------------------------------------------------------------------------- 1 | allow hal_wifi_default default_prop:property_service set; 2 | allow hal_wifi_default proc_net:file write; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/mediadrmserver.te: -------------------------------------------------------------------------------- 1 | allow mediadrmserver firmware_file:dir search; 2 | allow mediadrmserver firmware_file:file { open read getattr }; -------------------------------------------------------------------------------- /sepolicy/vendor/snap_app.te: -------------------------------------------------------------------------------- 1 | allow snap_app persist_camera_prop:file { getattr open read }; 2 | allow snap_app camera_prop:file { getattr open read }; -------------------------------------------------------------------------------- /sepolicy/vendor/cameraserver.te: -------------------------------------------------------------------------------- 1 | allow cameraserver mediacodec:binder call; 2 | allow cameraserver vendor_file:file { execute getattr open read }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | vendor.goodix.hardware.fingerprint::IGoodixBiometricsFingerprint u:object_r:hal_fingerprint_hwservice:s0 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/time_daemon.te: -------------------------------------------------------------------------------- 1 | allow time_daemon self:capability { setuid setgid sys_time dac_override }; 2 | allow time_daemon sysfs:file { open read }; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_ir_default.te: -------------------------------------------------------------------------------- 1 | allow hal_ir_default lirc_device:chr_file rw_file_perms; 2 | allow hal_ir_default device:chr_file { ioctl open read write }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_memtrack_default.te: -------------------------------------------------------------------------------- 1 | allow hal_memtrack_default sysfs:file { getattr open read }; 2 | allow hal_memtrack_default sysfs_kgsl:lnk_file read; 3 | -------------------------------------------------------------------------------- /gps/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(LOCAL_PATH)/build/target_specific_features.mk 3 | 4 | include $(call all-makefiles-under,$(LOCAL_PATH)) 5 | -------------------------------------------------------------------------------- /ims/Android.bp: -------------------------------------------------------------------------------- 1 | java_library { 2 | name: "ims-ext-common_system", 3 | installable: true, 4 | static_libs: [ 5 | "ims-ext-common", 6 | ], 7 | } 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/installd.te: -------------------------------------------------------------------------------- 1 | allow installd adsprpcd_file:filesystem quotaget; 2 | allow installd idmap:process noatsecure; 3 | allow installd device:file { open write }; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/vndservicemanager.te: -------------------------------------------------------------------------------- 1 | allow vndservicemanager runtime_event_log_tags_file:file read; 2 | allow vndservicemanager runtime_event_log_tags_file:file open; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bluetooth_default.te: -------------------------------------------------------------------------------- 1 | allow hal_bluetooth_default bluetooth_data_file:dir search; 2 | allow hal_bluetooth_default bluetooth_data_file:file r_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/netd.te: -------------------------------------------------------------------------------- 1 | allow netd proc_net:dir write; 2 | allow netd proc_net:dir add_name; 3 | allow netd proc_net:file create; 4 | allow netd device:file { open write }; 5 | -------------------------------------------------------------------------------- /sepolicy/private/toolbox.te: -------------------------------------------------------------------------------- 1 | allow toolbox init:fifo_file { getattr write }; 2 | allow toolbox property_socket:sock_file write; 3 | allow toolbox init:unix_stream_socket connectto; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/bluetooth.te: -------------------------------------------------------------------------------- 1 | allow bluetooth bootloader_boot_reason_prop:file read; 2 | allow bluetooth cnd_vendor_prop:file read; 3 | allow bluetooth boottime_prop:file read; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/perfservice.te: -------------------------------------------------------------------------------- 1 | allow perfservice same_process_hal_file:file { execute getattr open read }; 2 | allow perfservice vendor_file:file { execute getattr open read }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/rild.te: -------------------------------------------------------------------------------- 1 | allow rild rild_file:file r_file_perms; 2 | allow rild vendor_data_file:file { getattr lock }; 3 | allow rild vendor_data_file:file { getattr lock open read }; -------------------------------------------------------------------------------- /camera/Android.bp: -------------------------------------------------------------------------------- 1 | cc_library_static { 2 | name: "libcamera_parameters_ext_sakura", 3 | include_dirs: ["frameworks/av/include"], 4 | srcs: ["CameraParameters.cpp"], 5 | } 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_light_default.te: -------------------------------------------------------------------------------- 1 | allow hal_light_default sysfs:file { read write }; 2 | allow hal_light_default sysfs:file open; 3 | allow hal_light_default sysfs:file getattr; 4 | -------------------------------------------------------------------------------- /wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_disabled=1 3 | tdls_external_control=1 4 | wowlan_triggers=magic_pkt 5 | interworking=1 6 | hs20=1 7 | auto_interworking=0 -------------------------------------------------------------------------------- /gps/android/android.hardware.gnss@1.1-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti 2 | class hal 3 | user gps 4 | group system gps radio 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_graphics_allocator_default.te: -------------------------------------------------------------------------------- 1 | allow hal_graphics_allocator_default sysfs_kgsl:file { getattr read open }; 2 | allow hal_graphics_allocator_default sysfs_kgsl:lnk_file read; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/radio.te: -------------------------------------------------------------------------------- 1 | allow radio system_app_data_file:dir getattr; 2 | allow radio vendor_file:file { execute getattr open read }; 3 | allow radio adb_data_file:file { getattr open read }; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/webview_zygote.te: -------------------------------------------------------------------------------- 1 | allow webview_zygote zygote:unix_dgram_socket write; 2 | allow webview_zygote mnt_expand_file:dir getattr; 3 | allow webview_zygote app_data_file:dir getattr; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_wifi_defaul.te: -------------------------------------------------------------------------------- 1 | allow hal_wifi_default kernel:system module_request; 2 | allow hal_wifi_default proc_net:file write; 3 | allow hal_wifi_default default_prop:property_service { set }; -------------------------------------------------------------------------------- /sepolicy/vendor/service_contexts: -------------------------------------------------------------------------------- 1 | com.goodix.FingerprintService u:object_r:goodix_fingerprint_service:s0 2 | android.hardware.fingerprint.IGoodixFingerprintDaemon u:object_r:goodixfingerprintd_service:s0 -------------------------------------------------------------------------------- /sepolicy/vendor/fsck.te: -------------------------------------------------------------------------------- 1 | allow fsck block_device:blk_file { ioctl open read write }; 2 | allow fsck self:capability dac_override; 3 | allow fsck tmpfs:blk_file getattr; 4 | allow fsck mnt_vendor_file:dir getattr; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_graphics_composer_default.te: -------------------------------------------------------------------------------- 1 | allow hal_graphics_composer_default system_file:file { execute getattr open read }; 2 | allow hal_graphics_composer_default sysfs_kgsl:file { getattr open read }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_sensors_default.te: -------------------------------------------------------------------------------- 1 | allow hal_sensors_default self:socket read; 2 | #allow hal_sensors_default sensors_dbg_prop:file { getattr open read }; 3 | allow hal_sensors_default sysfs:file { open read }; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_drm_widevine.te: -------------------------------------------------------------------------------- 1 | allow hal_drm_widevine system_file:file rx_file_perms; 2 | 3 | allow hal_drm_widevine firmware_file:dir { getattr search }; 4 | allow hal_drm_widevine firmware_file:file { getattr open read }; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/kernel.te: -------------------------------------------------------------------------------- 1 | allow kernel init:process noatsecure; 2 | allow kernel self:security setenforce; 3 | allow kernel tmpfs:dir search; 4 | allow kernel vfat:file open; 5 | allow kernel self:capability { dac_override kill }; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/zygote.te: -------------------------------------------------------------------------------- 1 | allow zygote cgroup:file create; 2 | allow zygote self:capability kill; 3 | allow zygote vendor_file:file { execute getattr open read }; 4 | allow zygote theme_prop:file { read }; 5 | allow zygote theme_prop:file { open }; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/mediaprovider.te: -------------------------------------------------------------------------------- 1 | allow mediaprovider bootloader_boot_reason_prop:file read; 2 | allow mediaprovider runtime_event_log_tags_file:file read; 3 | allow mediaprovider bluetooth_prop:file read; 4 | allow mediaprovider boottime_prop:file read; 5 | -------------------------------------------------------------------------------- /sepolicy/private/healthd.te: -------------------------------------------------------------------------------- 1 | allow healthd sysfs:file { getattr open read }; 2 | allow healthd charger_exec:file { entrypoint }; 3 | allow healthd charger_exec:file { read }; 4 | allow healthd charger_exec:file { execute }; 5 | allow healthd charger_exec:file { getattr }; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/healthd.te: -------------------------------------------------------------------------------- 1 | allow healthd sysfs:file { getattr open read }; 2 | allow healthd charger_exec:file { entrypoint }; 3 | allow healthd charger_exec:file { read }; 4 | allow healthd charger_exec:file { execute }; 5 | allow healthd charger_exec:file { getattr }; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/bootanim.te: -------------------------------------------------------------------------------- 1 | allow bootanim device:chr_file { ioctl read write }; 2 | allow bootanim system_data_file:dir read; 3 | allow bootanim sysfs_kgsl:dir search; 4 | allow bootanim sysfs_kgsl:lnk_file read; 5 | allow bootanim vendor_file:file { execute getattr open read }; -------------------------------------------------------------------------------- /lineage.dependencies: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "repository": "android_kernel_xiaomi_msm8953", 4 | "target_path": "kernel/xiaomi/msm8953" 5 | }, 6 | { 7 | "repository": "android_packages_resources_devicesettings", 8 | "target_path": "packages/resources/devicesettings" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/netmgrd.te: -------------------------------------------------------------------------------- 1 | set_prop(netmgrd, vendor_xlat_prop) 2 | allow netmgrd kernel:system module_request; 3 | allow netmgrd netutils_wrapper:process noatsecure; 4 | allow netmgrd sysfs:file { open read }; 5 | allow netmgrd system_file:file { execute execute_no_trans getattr open read }; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/isolated_app.te: -------------------------------------------------------------------------------- 1 | allow isolated_app bluetooth_prop:file read; 2 | allow isolated_app boottime_prop:file read; 3 | allow isolated_app bootloader_boot_reason_prop:file { read }; 4 | allow isolated_app cnd_vendor_prop:file { read }; 5 | allow isolated_app app_data_file:dir { getattr }; 6 | -------------------------------------------------------------------------------- /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 | 7 | allow rmt_storage block_device:blk_file { open read write }; 8 | allow rmt_storage sysfs:file { open read }; 9 | -------------------------------------------------------------------------------- /sepolicy/vendor/vold.te: -------------------------------------------------------------------------------- 1 | allow vold proc_touchpanel:dir r_dir_perms; 2 | allow vold blkid_untrusted:process noatsecure; 3 | allow vold fsck_untrusted:process noatsecure; 4 | allow vold sgdisk:process noatsecure; 5 | allow vold sdcardd:process noatsecure; 6 | allow vold vold_prepare_subdirs:process noatsecure; 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/surfaceflinger.te: -------------------------------------------------------------------------------- 1 | allow surfaceflinger device:chr_file ioctl; 2 | allow surfaceflinger sysfs_kgsl:lnk_file read; 3 | allow surfaceflinger vendor_file:file { execute getattr open read }; 4 | allow surfaceflinger sysfs_kgsl:file { getattr read open }; 5 | allow surfaceflinger firmware_file:dir search; 6 | -------------------------------------------------------------------------------- /seccomp_policy/mediacodec.policy: -------------------------------------------------------------------------------- 1 | # device specific syscalls 2 | # extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy 3 | pselect6: 1 4 | eventfd2: 1 5 | sendto: 1 6 | recvfrom: 1 7 | _llseek: 1 8 | sysinfo: 1 9 | getcwd: 1 10 | getdents64: 1 11 | inotify_init1: 1 12 | inotify_add_watch: 1 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservicemanager.te: -------------------------------------------------------------------------------- 1 | allow hwservicemanager init:binder transfer; 2 | allow hwservicemanager init:dir search; 3 | allow hwservicemanager init:file { open read }; 4 | allow hwservicemanager init:process getattr; 5 | allow hwservicemanager runtime_event_log_tags_file:file read; 6 | allow hwservicemanager runtime_event_log_tags_file:file open; 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/servicemanager.te: -------------------------------------------------------------------------------- 1 | allow servicemanager update_verifier:dir search; 2 | allow servicemanager update_verifier:file { open read }; 3 | allow servicemanager update_verifier:process getattr; 4 | allow servicemanager mediaswcodec:dir search; 5 | allow servicemanager mediaswcodec:file { open read }; 6 | allow servicemanager mediaswcodec:process getattr; 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_keymaster_qti.te: -------------------------------------------------------------------------------- 1 | allow hal_keymaster_qti system_file:file rx_file_perms; 2 | allow hal_keymaster_qti system_file:file { open read }; 3 | allow hal_keymaster_qti theme_prop:file { read }; 4 | allow hal_keymaster_qti system_file:file { getattr }; 5 | allow hal_keymaster_qti theme_prop:file { read }; 6 | allow hal_keymaster_qti system_file:file { execute }; -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | # Allow writing to files in /proc/touchpanel 2 | allow hal_power_default proc_touchpanel:dir search; 3 | allow hal_power_default proc_touchpanel:file rw_file_perms; 4 | allow hal_power_default init:binder call; 5 | allow hal_power_default sysfs:file { open read write }; 6 | allow hal_power_default proc:file { open write }; 7 | allow hal_power_default input_device:chr_file { open read write }; 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/ueventd.te: -------------------------------------------------------------------------------- 1 | allow ueventd fpc_sysfs:file rw_file_perms; 2 | 3 | allow ueventd wifi_vendor_data_file:dir search; 4 | allow ueventd wifi_vendor_data_file:file { getattr open read }; 5 | allow ueventd debugfs:dir { open read relabelfrom }; 6 | allow ueventd debugfs:file getattr; 7 | allow ueventd debugfs_wakeup_sources:file getattr; 8 | allow ueventd qti_debugfs:dir relabelto; 9 | allow ueventd vfat:file { getattr open read }; 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/untrusted_app_25.te: -------------------------------------------------------------------------------- 1 | allow untrusted_app_25 bluetooth_prop:file { read }; 2 | allow untrusted_app_25 bootloader_boot_reason_prop:file { read }; 3 | allow untrusted_app_25 boottime_prop:file { read }; 4 | allow untrusted_app_25 ctl_bootanim_prop:file { read }; 5 | allow untrusted_app_25 ctl_bugreport_prop:file { read }; 6 | allow untrusted_app_25 cnd_vendor_prop:file { read }; 7 | allow untrusted_app_25 postinstall_mnt_dir:dir { getattr }; -------------------------------------------------------------------------------- /keylayout/uinput-goodix.kl: -------------------------------------------------------------------------------- 1 | # 2 | # Goodix Touch sensor driver 3 | # 4 | # Copyright (c) 2017 Goodix 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | key 195 SYSTEM_NAVIGATION_UP 12 | key 196 SYSTEM_NAVIGATION_DOWN 13 | key 197 SYSTEM_NAVIGATION_LEFT 14 | key 198 SYSTEM_NAVIGATION_RIGHT 15 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | # Fingerprint 2 | type fingerprint_status_prop, property_type; 3 | 4 | # Post Boot 5 | type sys_post_boot_prop, property_type; 6 | 7 | # Mlipay 8 | type ifaa_prop, property_type; 9 | 10 | # Sensors 11 | type sensors_panel_prop, property_type; 12 | 13 | # Spectrum 14 | type spectrum_prop, property_type; 15 | 16 | # Thermal engine 17 | type thermal_prop, property_type; 18 | 19 | # Dirac 20 | type dirac_prop, property_type; 21 | -------------------------------------------------------------------------------- /keylayout/uinput-fpc.kl: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | key 195 SYSTEM_NAVIGATION_UP 12 | key 196 SYSTEM_NAVIGATION_DOWN 13 | key 197 SYSTEM_NAVIGATION_LEFT 14 | key 198 SYSTEM_NAVIGATION_RIGHT 15 | -------------------------------------------------------------------------------- /sepolicy/vendor/wcnss_service.te: -------------------------------------------------------------------------------- 1 | set_prop(wcnss_service, wifi_prop); 2 | set_prop(wcnss_service, serialno_prop); 3 | 4 | allow wcnss_service wifi_data_file:dir search; 5 | 6 | allow wcnss_service init:unix_stream_socket connectto; 7 | allow wcnss_service property_socket:sock_file write; 8 | 9 | allow wcnss_service sysfs:file { open read }; 10 | allow wcnss_service serialno_prop:file { read }; 11 | allow wcnss_service serialno_prop:file open; 12 | allow wcnss_service serialno_prop:file getattr; -------------------------------------------------------------------------------- /keylayout/gf3208.kl: -------------------------------------------------------------------------------- 1 | # 2 | # Goodix fingerprint sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | key 195 SYSTEM_NAVIGATION_UP 12 | key 196 SYSTEM_NAVIGATION_DOWN 13 | key 197 SYSTEM_NAVIGATION_LEFT 14 | key 198 SYSTEM_NAVIGATION_RIGHT 15 | #key 353 CAMERA 16 | -------------------------------------------------------------------------------- /sepolicy/vendor/flags_health_check.te: -------------------------------------------------------------------------------- 1 | allow flags_health_check adsprpc_prop:file { getattr open }; 2 | allow flags_health_check apexd_prop:file { getattr open }; 3 | allow flags_health_check bg_boot_complete_prop:file { getattr open }; 4 | allow flags_health_check bg_daemon_prop:file open; 5 | allow flags_health_check boottime_prop:file open; 6 | allow flags_health_check vendor_cgroup_follow_prop:file { getattr open }; 7 | allow flags_health_check vendor_coresight_prop:file open; 8 | allow flags_health_check vendor_gpu_prop:file open; 9 | -------------------------------------------------------------------------------- /rootdir/etc/move_time_data.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | # Copyright (c) 2018 Qualcomm Technologies, Inc. 4 | # All Rights Reserved. 5 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 6 | 7 | DEST_PATH="/data/vendor/time" 8 | FILES_MOVED="/data/vendor/time/moved" 9 | SRC_PATH="/data/time" 10 | 11 | if [ ! -f "$FILES_MOVED" ]; then 12 | for i in "$SRC_PATH/ats"*; do 13 | dest_path=$DEST_PATH/"${i#$SRC_PATH/}" 14 | mv $i "$dest_path" 15 | done 16 | restorecon -R "$DEST_PATH" 17 | echo 1 > "$FILES_MOVED" 18 | fi 19 | -------------------------------------------------------------------------------- /sepolicy/vendor/shell.te: -------------------------------------------------------------------------------- 1 | allow shell vendor_file:file getattr; 2 | allow shell vendor_firmware_file:dir getattr; 3 | allow shell adb_data_file:file { execute getattr open read }; 4 | allow shell cache_file:lnk_file { getattr read }; 5 | allow shell kernel:system syslog_read; 6 | allow shell init_exec:lnk_file { getattr read }; 7 | allow shell mnt_vendor_file:lnk_file { getattr read }; 8 | allow shell postinstall_mnt_dir:dir getattr; 9 | allow shell rootfs:file getattr; 10 | allow shell adsprpcd_file:dir getattr; 11 | allow shell firmware_file:dir getattr; 12 | 13 | -------------------------------------------------------------------------------- /gps/build/target_specific_features.mk: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS := \ 2 | -Werror \ 3 | -Wno-error=unused-parameter \ 4 | -Wno-error=format \ 5 | -Wno-error=macro-redefined \ 6 | -Wno-error=reorder \ 7 | -Wno-error=missing-braces \ 8 | -Wno-error=self-assign \ 9 | -Wno-error=enum-conversion \ 10 | -Wno-error=logical-op-parentheses \ 11 | -Wno-error=null-arithmetic \ 12 | -Wno-error=null-conversion \ 13 | -Wno-error=parentheses-equality \ 14 | -Wno-error=undefined-bool-conversion \ 15 | -Wno-error=tautological-compare \ 16 | -Wno-error=switch \ 17 | -Wno-error=date-time 18 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | # /data/goodix labeling 2 | type_transition tee system_data_file:{ dir file } gx_fpd_data_file; 3 | 4 | allow tee gx_fpd_data_file:dir create_dir_perms; 5 | allow tee gx_fpd_data_file:file create_file_perms; 6 | allow tee system_data_file:dir create_dir_perms; 7 | allow tee fingerprintd_data_file:dir create_dir_perms; 8 | allow tee fingerprintd_data_file:file create_file_perms; 9 | 10 | # Set the sys.listeners.registered property 11 | set_prop(tee, system_prop) 12 | 13 | allow tee block_device:blk_file { getattr open read write }; 14 | allow tee system_file:file { execute getattr open read }; 15 | -------------------------------------------------------------------------------- /gps/pla/Android.mk: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS := \ 2 | -Werror \ 3 | -Wno-error=unused-parameter \ 4 | -Wno-error=format \ 5 | -Wno-error=macro-redefined \ 6 | -Wno-error=reorder \ 7 | -Wno-error=missing-braces \ 8 | -Wno-error=self-assign \ 9 | -Wno-error=enum-conversion \ 10 | -Wno-error=logical-op-parentheses \ 11 | -Wno-error=null-arithmetic \ 12 | -Wno-error=null-conversion \ 13 | -Wno-error=parentheses-equality \ 14 | -Wno-error=undefined-bool-conversion \ 15 | -Wno-error=tautological-compare \ 16 | -Wno-error=switch \ 17 | -Wno-error=date-time 18 | 19 | LOCAL_PATH := $(call my-dir) 20 | 21 | include $(CLEAR_VARS) 22 | LOCAL_MODULE := libloc_pla_headers 23 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/android 24 | include $(BUILD_HEADER_LIBRARY) 25 | -------------------------------------------------------------------------------- /sepolicy/vendor/init_fingerprint.te: -------------------------------------------------------------------------------- 1 | type init_fingerprint, domain; 2 | type init_fingerprint_exec, exec_type, vendor_file_type, file_type; 3 | 4 | # Allow for transition from init domain to init_fingerprint 5 | init_daemon_domain(init_fingerprint) 6 | 7 | # Shell script needs to execute /vendor/bin/sh 8 | allow init_fingerprint vendor_shell_exec:file rx_file_perms; 9 | allow init_fingerprint vendor_toolbox_exec:file rx_file_perms; 10 | 11 | # Allow to delete file 12 | allow init_fingerprint mnt_vendor_file:dir search; 13 | allow init_fingerprint persist_drm_file:dir { read search open write remove_name }; 14 | allow init_fingerprint persist_drm_file:file { getattr unlink }; 15 | allow init_fingerprint system_data_file:file r_file_perms; 16 | 17 | allow init_fingerprint self:capability dac_override; 18 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | dontaudit hal_audio_default sysfs:dir { open read }; 2 | allow hal_audio_default property_socket:sock_file { rw_file_perms }; 3 | allow hal_audio_default audio_prop:property_service set; 4 | allow hal_audio_default init:unix_stream_socket connectto; 5 | allow hal_audio_default init:binder { call }; 6 | allow hal_audio_default audio_prop:file { getattr open read }; 7 | allow hal_audio_default vendor_data_file:dir { create write add_name }; 8 | allow hal_audio_default vendor_data_file:file { create rw_file_perms }; 9 | #allow hal_audio_default vendor_data_file:file { append read } 10 | #allow hal_audio_default sysfs:dir { open read }; 11 | allow hal_audio_default sysfs:file { getattr open read }; 12 | get_prop(hal_audio_default, dirac_prop) 13 | set_prop(hal_audio_default, dirac_prop) 14 | -------------------------------------------------------------------------------- /gps/gnsspps/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := libgnsspps 6 | LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib 7 | LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 8 | LOCAL_MODULE_TAGS := optional 9 | 10 | LOCAL_SHARED_LIBRARIES := \ 11 | libutils \ 12 | libcutils \ 13 | libgps.utils \ 14 | liblog 15 | 16 | LOCAL_SRC_FILES += \ 17 | gnsspps.c 18 | 19 | LOCAL_CFLAGS += \ 20 | -fno-short-enums \ 21 | -D_ANDROID_ 22 | 23 | ## Includes 24 | LOCAL_HEADER_LIBRARIES := \ 25 | libgps.utils_headers \ 26 | libloc_pla_headers 27 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 28 | include $(BUILD_SHARED_LIBRARY) 29 | 30 | include $(CLEAR_VARS) 31 | LOCAL_MODULE := libgnsspps_headers 32 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 33 | include $(BUILD_HEADER_LIBRARY) 34 | -------------------------------------------------------------------------------- /gps/location/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := liblocation_api 6 | LOCAL_VENDOR_MODULE := true 7 | LOCAL_MODULE_TAGS := optional 8 | 9 | LOCAL_SHARED_LIBRARIES := \ 10 | libutils \ 11 | libcutils \ 12 | libgps.utils \ 13 | libdl \ 14 | liblog 15 | 16 | LOCAL_SRC_FILES += \ 17 | LocationAPI.cpp \ 18 | LocationAPIClientBase.cpp 19 | 20 | LOCAL_CFLAGS += \ 21 | -fno-short-enums 22 | 23 | LOCAL_HEADER_LIBRARIES := \ 24 | libloc_pla_headers \ 25 | libgps.utils_headers 26 | 27 | LOCAL_PRELINK_MODULE := false 28 | 29 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 30 | include $(BUILD_SHARED_LIBRARY) 31 | 32 | include $(CLEAR_VARS) 33 | LOCAL_MODULE := liblocation_api_headers 34 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 35 | include $(BUILD_HEADER_LIBRARY) 36 | -------------------------------------------------------------------------------- /init/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2019 The LineageOS Project 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | cc_library_static { 18 | name: "libinit_msm8953", 19 | recovery_available: true, 20 | srcs: ["init_msm8953.cpp"], 21 | include_dirs: [ 22 | "system/core/base/include", 23 | "system/core/init" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /gps/gnss/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := libgnss 6 | LOCAL_VENDOR_MODULE := true 7 | LOCAL_MODULE_TAGS := optional 8 | 9 | LOCAL_SHARED_LIBRARIES := \ 10 | libutils \ 11 | libcutils \ 12 | libdl \ 13 | liblog \ 14 | libloc_core \ 15 | libgps.utils 16 | 17 | LOCAL_SRC_FILES += \ 18 | location_gnss.cpp \ 19 | GnssAdapter.cpp \ 20 | Agps.cpp \ 21 | XtraSystemStatusObserver.cpp 22 | 23 | LOCAL_CFLAGS += \ 24 | -fno-short-enums \ 25 | 26 | ifeq ($(TARGET_BUILD_VARIANT),user) 27 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER 28 | endif 29 | 30 | LOCAL_HEADER_LIBRARIES := \ 31 | libgps.utils_headers \ 32 | libloc_core_headers \ 33 | libloc_pla_headers \ 34 | liblocation_api_headers 35 | 36 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 37 | 38 | LOCAL_PRELINK_MODULE := false 39 | 40 | include $(BUILD_SHARED_LIBRARY) 41 | -------------------------------------------------------------------------------- /configs/thermal-engine.conf: -------------------------------------------------------------------------------- 1 | # File empty by default. 2 | # Replace contents of this file with custom configuration. 3 | [MODEM_PA_MITIGATION] 4 | #algo_type monitor 5 | sampling 10000 6 | sensor case_therm 7 | thresholds 70000 70000 8 | thresholds_clr 69000 69000 9 | actions modem modem 10 | action_info 2 3 11 | 12 | [MODEM_PROC_TEMP_MITIGATION] 13 | #algo_type monitor 14 | sampling 10000 15 | sensor case_therm 16 | thresholds 70000 70000 17 | thresholds_clr 69000 69000 18 | actions modem_proc modem_proc 19 | action_info 1 3 20 | 21 | [SS-CASE-THERM] 22 | algo_type ss 23 | sampling 10000 24 | sensor case_therm 25 | device cluster0 26 | set_point 40000 27 | set_point_clr 38000 28 | time_constant 0 29 | device_max_limit 1689600 30 | 31 | [SS-CASE-THERM-1] 32 | algo_type ss 33 | sampling 10000 34 | sensor case_therm 35 | device cluster0 36 | set_point 50000 37 | set_point_clr 45000 38 | time_constant 0 39 | device_max_limit 1401600 40 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | allow vendor_init rootfs:dir { add_name write }; 2 | allow vendor_init cgroup:file create; 3 | allow vendor_init sysfs:dir write; 4 | allow vendor_init sysfs_zram:dir write; 5 | allow vendor_init bluetooth_data_file:dir setattr; 6 | allow vendor_init system_data_file:dir write; 7 | allow vendor_init sysfs:dir add_name; 8 | allow vendor_init sysfs_zram:dir add_name; 9 | allow vendor_init device:file { create write }; 10 | allow vendor_init system_data_file:dir { add_name }; 11 | allow vendor_init camera_data_file:dir create; 12 | allow vendor_init system_data_file:dir create; 13 | allow vendor_init tombstone_data_file:dir { search setattr }; 14 | allow vendor_init camera_data_file:dir setattr; 15 | allow vendor_init system_data_file:dir setattr; 16 | allow vendor_init tombstone_data_file:dir write; 17 | allow vendor_init tombstone_data_file:dir add_name; 18 | allow vendor_init tombstone_data_file:dir create; 19 | -------------------------------------------------------------------------------- /light/android.hardware.light@2.0-service.msm8953.rc: -------------------------------------------------------------------------------- 1 | on boot 2 | # leds light 3 | chown system system /sys/class/leds/red/brightness 4 | chown system system /sys/class/leds/red/blink 5 | chown system system /sys/class/leds/red/duty_pcts 6 | chown system system /sys/class/leds/red/pause_hi 7 | chown system system /sys/class/leds/red/pause_lo 8 | chown system system /sys/class/leds/red/ramp_step_ms 9 | chown system system /sys/class/leds/red/start_idx 10 | 11 | chmod 660 /sys/class/leds/red/blink 12 | chmod 660 /sys/class/leds/red/duty_pcts 13 | chmod 660 /sys/class/leds/red/pause_hi 14 | chmod 660 /sys/class/leds/red/pause_lo 15 | chmod 660 /sys/class/leds/red/ramp_step_ms 16 | chmod 660 /sys/class/leds/red/start_idx 17 | 18 | service light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.msm8953 19 | class hal 20 | user system 21 | group system 22 | shutdown critical 23 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | true 19 | 4 20 | 21 | -------------------------------------------------------------------------------- /sepolicy/vendor/file.te: -------------------------------------------------------------------------------- 1 | # Avb 2 | type avb_file, file_type; 3 | 4 | # Boot reason 5 | type proc_boot_reason, fs_type, proc_type; 6 | 7 | # Camera 8 | type camera_socket, file_type, data_file_type; 9 | 10 | # Fingerprint 11 | type fpc_data_file, file_type, core_data_file_type, data_file_type; 12 | type fpce_socket, file_type; 13 | type fpc_sysfs, fs_type, sysfs_type; 14 | type gx_fpd_data_file, file_type, core_data_file_type, data_file_type; 15 | type fingerprintd_device, file_type, dev_type; 16 | type fingerprint_data_file, data_file_type, file_type; 17 | type fingerprint_persist_file, file_type; 18 | type sysfs_fpc_dev, sysfs_type, fs_type; 19 | 20 | # Input 21 | type idc_file, file_type, vendor_file_type; 22 | type keylayout_file, file_type, vendor_file_type; 23 | 24 | # Rild 25 | type rild_file, file_type, vendor_file_type; 26 | 27 | # Rmt 28 | type debugfs_rmt, debugfs_type, fs_type; 29 | 30 | # Touchscreen 31 | type proc_touchpanel, fs_type, sysfs_type, proc_type; 32 | -------------------------------------------------------------------------------- /gps/etc/lowi.conf: -------------------------------------------------------------------------------- 1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* 2 | # 3 | # LOWI Config file 4 | # 5 | # GENERAL DESCRIPTION 6 | # This file contains the config params for LOWI 7 | # 8 | # Copyright (c) 2019 Qualcomm Technologies, Inc. 9 | # All Rights Reserved. 10 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 11 | # 12 | # 2012-2013 Qualcomm Atheros, Inc. 13 | # All Rights Reserved. 14 | # Qualcomm Atheros Confidential and Proprietary. 15 | # 16 | # Export of this technology or software is regulated by the U.S. Government. 17 | # Diversion contrary to U.S. law prohibited. 18 | #=============================================================================*/ 19 | 20 | # X86 ONLY - UBUNTU: 21 | # Copy this file in the same directory where the executable is 22 | 23 | # Log level 24 | # EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100 25 | LOWI_LOG_LEVEL = 3 26 | LOWI_USE_LOWI_LP = 0 27 | 28 | -------------------------------------------------------------------------------- /sepolicy/private/vendor_init.te: -------------------------------------------------------------------------------- 1 | allow vendor_init seemp_data_file:dir { create setattr }; 2 | allow vendor_init rootfs:dir { add_name write }; 3 | allow vendor_init cgroup:file create; 4 | allow vendor_init sysfs:dir write; 5 | allow vendor_init sysfs_zram:dir write; 6 | allow vendor_init bluetooth_data_file:dir setattr; 7 | allow vendor_init system_data_file:dir write; 8 | allow vendor_init sysfs:dir add_name; 9 | allow vendor_init sysfs_zram:dir add_name; 10 | allow vendor_init device:file { create write }; 11 | allow vendor_init system_data_file:dir { add_name }; 12 | allow vendor_init camera_data_file:dir create; 13 | allow vendor_init system_data_file:dir create; 14 | allow vendor_init tombstone_data_file:dir { search setattr }; 15 | allow vendor_init camera_data_file:dir setattr; 16 | allow vendor_init system_data_file:dir setattr; 17 | allow vendor_init tombstone_data_file:dir write; 18 | allow vendor_init tombstone_data_file:dir add_name; 19 | allow vendor_init tombstone_data_file:dir create; 20 | -------------------------------------------------------------------------------- /overlay/packages/apps/Bluetooth/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | true 17 | 18 | 21 | false 22 | 23 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | true 25 | 26 | 27 | -------------------------------------------------------------------------------- /libhidl/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 The LineageOS Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | include $(CLEAR_VARS) 17 | LOCAL_SHARED_LIBRARIES := libhidltransport 18 | LOCAL_MODULE := android.hidl.base@1.0 19 | LOCAL_MODULE_TAGS := optional 20 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 21 | include $(BUILD_SHARED_LIBRARY) 22 | 23 | include $(CLEAR_VARS) 24 | LOCAL_SHARED_LIBRARIES := libhidltransport 25 | LOCAL_MODULE := android.hidl.manager@1.0 26 | LOCAL_MODULE_TAGS := optional 27 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 28 | include $(BUILD_SHARED_LIBRARY) 29 | 30 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app init:binder call; 2 | allow system_app bootloader_boot_reason_prop:file read; 3 | allow system_app boottime_prop:file read; 4 | allow system_app cnd_vendor_prop:file read; 5 | allow system_app fs_bpf:dir search; 6 | allow system_app ctl_bootanim_prop:file { read }; 7 | allow system_app ctl_console_prop:file { read }; 8 | allow system_app ctl_fuse_prop:file { read }; 9 | allow system_app ctl_interface_restart_prop:file { read }; 10 | allow system_app ctl_interface_start_prop:file { read }; 11 | allow system_app ctl_interface_stop_prop:file { read }; 12 | allow system_app ctl_mdnsd_prop:file { read }; 13 | allow system_app ctl_qcrild_prop:file { read }; 14 | allow system_app ctl_restart_prop:file { read }; 15 | allow system_app proc_pagetypeinfo:file { getattr open read }; 16 | allow system_app sysfs_zram:dir { search }; 17 | allow system_app sysfs_zram:file { getattr open read }; 18 | allow system_app sysfs_thermal:file { write }; 19 | allow system_app sysfs_kgsl:lnk_file read; 20 | allow system_app fm_prop:property_service set; 21 | allow system_app vendor_file:file { execute getattr open read }; 22 | -------------------------------------------------------------------------------- /configs/media_codecs_vendor_audio.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 24 | 25 | 0 26 | -1 27 | -1 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_server.te: -------------------------------------------------------------------------------- 1 | # binder 2 | allow system_server init:binder call; 3 | 4 | # camera 5 | allow system_server mm-qcamerad:binder { call }; 6 | allow system_server sysfs:file read; 7 | allow system_server bluetooth_prop:file read; 8 | allow system_server sysfs:file open; 9 | 10 | # input files 11 | r_dir_file(system_server, idc_file) 12 | r_dir_file(system_server, keylayout_file) 13 | 14 | # smart charging 15 | allow system_server sysfs_battery_supply:file rw_file_perms; 16 | 17 | # touchpanel 18 | allow system_server proc_touchpanel:dir search; 19 | allow system_server proc_touchpanel:file rw_file_perms; 20 | allow system_server proc_touchpanel:lnk_file read; 21 | 22 | # vibrator 23 | allow system_server sysfs_vibrator:file read; 24 | allow system_server init:binder { call }; 25 | allow system_server device:chr_file { ioctl }; 26 | allow system_server sysfs:file { getattr }; 27 | 28 | allow system_server default_android_hwservice:hwservice_manager { find }; 29 | allow system_server vendor_file:file { getattr open read }; 30 | 31 | allow system_server adb_data_file:file { getattr open read }; 32 | allow system_server persist_camera_prop:file { getattr }; 33 | -------------------------------------------------------------------------------- /gps/android/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "android.hardware.gnss@1.1-service-qti" 22 | 23 | #include 24 | #include 25 | 26 | using android::hardware::gnss::V1_0::IGnss; 27 | using android::hardware::defaultPassthroughServiceImplementation; 28 | 29 | int main() { 30 | return defaultPassthroughServiceImplementation(); 31 | } 32 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | allow hal_camera_default camera_data_file:sock_file write; 2 | allow hal_camera_default camera_data_file:dir search; 3 | allow hal_camera_default camera_socket:sock_file write; 4 | allow hal_camera_default camera_socket:dir search; 5 | allow hal_camera_default hal_configstore_ISurfaceFlingerConfigs:hwservice_manager find; 6 | allow hal_camera_default hal_configstore_default:binder call; 7 | allow hal_camera_default hal_graphics_allocator_default:binder call; 8 | allow hal_camera_default hal_graphics_allocator_hwservice:hwservice_manager find; 9 | allow hal_camera_default persist_camera_prop:file r_file_perms; 10 | allow hal_camera_default persist_camera_prop:sock_file r_file_perms; 11 | allow hal_camera_default persist_camera_prop:property_service set; 12 | allow hal_camera_default sysfs_kgsl:lnk_file read; 13 | allow hal_camera_default system_file:file { execute getattr open read }; 14 | allow hal_camera_default sysfs_kgsl:file { getattr read open }; 15 | allow hal_camera_default vendor_default_prop:file r_file_perms; 16 | allow hal_camera_default vendor_default_prop:sock_file r_file_perms; 17 | allow hal_camera_default vendor_default_prop:property_service set; 18 | -------------------------------------------------------------------------------- /light/Android.bp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018 The LineageOS Project 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | cc_binary { 16 | relative_install_path: "hw", 17 | defaults: ["hidl_defaults"], 18 | name: "android.hardware.light@2.0-service.msm8953", 19 | proprietary: true, 20 | init_rc: ["android.hardware.light@2.0-service.msm8953.rc"], 21 | srcs: ["service.cpp", "Light.cpp"], 22 | shared_libs: [ 23 | "libhardware", 24 | "libhidlbase", 25 | "libhidltransport", 26 | "liblog", 27 | "libhwbinder", 28 | "libutils", 29 | "android.hardware.light@2.0", 30 | ], 31 | } 32 | -------------------------------------------------------------------------------- /sepolicy/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | # Boot reason 2 | genfscon proc /sys/kernel/boot_reason u:object_r:proc_boot_reason:s0 3 | 4 | # Leds 5 | genfscon sysfs /devices/platform/soc/200f000.qcom,spmi/spmi-0/spmi0-00/200f000.qcom,spmi:qcom,pm8953@0:qcom,leds@a100 u:object_r:sysfs_leds:s0 6 | genfscon sysfs /devices/platform/soc/78b6000.i2c/i2c-2/2-0045/leds/ u:object_r:sysfs_leds:s0 7 | 8 | # Power 9 | genfscon sysfs /devices/soc/soc:qcom,bcl/power_supply u:object_r:sysfs_batteryinfo:s0 10 | genfscon sysfs /devices/soc/msm-bcl-21/power_supply u:object_r:sysfs_batteryinfo:s0 11 | genfscon sysfs /devices/soc/qpnp-typec-9/power_supply u:object_r:sysfs_batteryinfo:s0 12 | genfscon sysfs /devices/platform/soc/200f000.qcom,spmi/spmi-0/spmi0-02/200f000.qcom,spmi:qcom,pmi8950@2:vadc@3100 u:object_r:sysfs_battery_supply:s0 13 | 14 | # Rmt 15 | genfscon debugfs /rmt_storage u:object_r:debugfs_rmt:s0 16 | 17 | # Touchscreen 18 | genfscon proc /touchpanel u:object_r:proc_touchpanel:s0 19 | 20 | # Healthd 21 | #genfscon sysfs /devices/soc/soc:qcom,bcl/power_supply u:object_r:sysfs_batteryinfo:s0 22 | #genfscon sysfs /devices/soc/msm-bcl-20/power_supply u:object_r:sysfs_batteryinfo:s0 23 | -------------------------------------------------------------------------------- /sepolicy/vendor/mm-qcamerad.te: -------------------------------------------------------------------------------- 1 | allow mm-qcamerad camera_data_file:dir { add_name write }; 2 | allow mm-qcamerad camera_data_file:file { create getattr open write }; 3 | allow mm-qcamerad persist_camera_prop:file { getattr open read }; 4 | allow mm-qcamerad sysfs_kgsl:lnk_file read; 5 | type_transition mm-qcamerad camera_data_file:sock_file camera_socket "cam_socket1"; 6 | type_transition mm-qcamerad camera_data_file:sock_file camera_socket "cam_socket2"; 7 | allow mm-qcamerad camera_socket:dir w_dir_perms; 8 | allow mm-qcamerad camera_socket:sock_file { create unlink write }; 9 | allow mm-qcamerad sysfs_graphics:file r_file_perms; 10 | allow mm-qcamerad camera_data_file:file create_file_perms; 11 | allow mm-qcamerad camera_data_file:dir w_dir_perms; 12 | allow mm-qcamerad sysfs_kgsl:file { getattr open read }; 13 | allow mm-qcamerad fwk_sensor_hwservice:hwservice_manager find; 14 | allow mm-qcamerad sysfs:file { getattr open read }; 15 | allow mm-qcamerad debugfs:dir { read open }; 16 | allow mm-qcamerad diag_device:chr_file { ioctl open read write }; 17 | allow mm-qcamerad persist_camera_prop:property_service set; 18 | allow mm-qcamerad camera_data_file:dir { add_name write }; 19 | allow mm-qcamerad camera_data_file:dir { search }; 20 | -------------------------------------------------------------------------------- /sepolicy/vendor/platform_app.te: -------------------------------------------------------------------------------- 1 | allow platform_app bluetooth_prop:file read; 2 | allow platform_app bootloader_boot_reason_prop:file read; 3 | allow platform_app boottime_prop:file read; 4 | allow platform_app cnd_vendor_prop:file read; 5 | allow platform_app ctl_bootanim_prop:file { read }; 6 | allow platform_app ctl_bugreport_prop:file { read }; 7 | allow platform_app ctl_console_prop:file { read }; 8 | allow platform_app ctl_default_prop:file { read }; 9 | allow platform_app ctl_dumpstate_prop:file { read }; 10 | allow platform_app ctl_fuse_prop:file { read }; 11 | allow platform_app ctl_interface_restart_prop:file { read }; 12 | allow platform_app ctl_interface_start_prop:file { read }; 13 | allow platform_app ctl_interface_stop_prop:file { read }; 14 | allow platform_app fs_bpf:dir search; 15 | allow platform_app sysfs_kgsl:dir search; 16 | allow platform_app sysfs_kgsl:lnk_file read; 17 | allow platform_app sysfs_kgsl:file { getattr open read }; 18 | allow platform_app time_daemon:unix_stream_socket connectto; 19 | allow platform_app vendor_file:file { getattr open read }; 20 | allow platform_app time_daemon:file { read }; 21 | allow platform_app system_file:file { read }; 22 | allow platform_app system_file:file { getattr }; 23 | -------------------------------------------------------------------------------- /overlay/packages/apps/Snap/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 20 | 21 | 22 | true 23 | 24 | 25 | true 26 | 27 | 28 | -------------------------------------------------------------------------------- /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 BT_CLEAN_TURN_ON_DISABLED 1 28 | #define BTM_SCO_ENHANCED_SYNC_ENABLED FALSE 29 | 30 | #define BTA_DISABLE_DELAY 1000 /* in milliseconds */ 31 | #define BTM_WBS_INCLUDED TRUE 32 | #define BTIF_HF_WBS_PREFERRED TRUE 33 | #endif 34 | -------------------------------------------------------------------------------- /gps/utils/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | 6 | ## Libs 7 | LOCAL_SHARED_LIBRARIES := \ 8 | libutils \ 9 | libcutils \ 10 | liblog \ 11 | libprocessgroup 12 | 13 | LOCAL_SRC_FILES += \ 14 | loc_log.cpp \ 15 | loc_cfg.cpp \ 16 | msg_q.c \ 17 | linked_list.c \ 18 | loc_target.cpp \ 19 | LocHeap.cpp \ 20 | LocTimer.cpp \ 21 | LocThread.cpp \ 22 | MsgTask.cpp \ 23 | loc_misc_utils.cpp \ 24 | loc_nmea.cpp \ 25 | LocIpc.cpp 26 | 27 | # Flag -std=c++11 is not accepted by compiler when LOCAL_CLANG is set to true 28 | LOCAL_CFLAGS += \ 29 | -fno-short-enums \ 30 | -D_ANDROID_ 31 | 32 | ifeq ($(TARGET_BUILD_VARIANT),user) 33 | LOCAL_CFLAGS += -DTARGET_BUILD_VARIANT_USER 34 | endif 35 | 36 | LOCAL_LDFLAGS += -Wl,--export-dynamic 37 | 38 | ## Includes 39 | LOCAL_HEADER_LIBRARIES := \ 40 | libutils_headers \ 41 | libloc_pla_headers \ 42 | liblocation_api_headers 43 | 44 | LOCAL_MODULE := libgps.utils 45 | LOCAL_VENDOR_MODULE := true 46 | LOCAL_MODULE_TAGS := optional 47 | 48 | LOCAL_PRELINK_MODULE := false 49 | 50 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 51 | 52 | include $(BUILD_SHARED_LIBRARY) 53 | 54 | include $(CLEAR_VARS) 55 | LOCAL_MODULE := libgps.utils_headers 56 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 57 | include $(BUILD_HEADER_LIBRARY) 58 | -------------------------------------------------------------------------------- /overlay/packages/services/Telecomm/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 16 | 17 | 21 | true 22 | 23 | 24 | true 25 | 26 | -------------------------------------------------------------------------------- /setup-makefiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017 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 | set -e 20 | DEVICE=daisy 21 | VENDOR=xiaomi 22 | INITIAL_COPYRIGHT_YEAR=2020 23 | 24 | # Load extract_utils and do some sanity checks 25 | MY_DIR="${BASH_SOURCE%/*}" 26 | if [[ ! -d "{$MY_DIR}" ]]; then MY_DIR="{$PWD}"; fi 27 | 28 | MK_ROOT="{$MY_DIR}/../../.." 29 | 30 | HELPER="$MK_ROOT/vendor/lineage/build/tools/extract_utils.sh" 31 | if [ ! -f "{$HELPER}" ]; then 32 | echo "Unable to find helper script at {$HELPER}" 33 | exit 1 34 | fi 35 | source "${HELPER}" 36 | 37 | # Initialize the helper 38 | setup_vendor "${DEVICE}" "${VENDOR}" "${MK_ROOT}" 39 | 40 | # Copyright headers and guards 41 | write_headers 42 | 43 | write_makefiles "${MY_DIR}/proprietary-files.txt" true 44 | 45 | # Finish 46 | write_footers 47 | -------------------------------------------------------------------------------- /gps/core/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := libloc_core 6 | LOCAL_VENDOR_MODULE := true 7 | LOCAL_MODULE_TAGS := optional 8 | 9 | ifeq ($(TARGET_DEVICE),apq8026_lw) 10 | LOCAL_CFLAGS += -DPDK_FEATURE_SET 11 | else ifeq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET),true) 12 | LOCAL_CFLAGS += -DPDK_FEATURE_SET 13 | endif 14 | 15 | LOCAL_SHARED_LIBRARIES := \ 16 | liblog \ 17 | libutils \ 18 | libcutils \ 19 | libgps.utils \ 20 | libdl \ 21 | liblog 22 | 23 | LOCAL_SRC_FILES += \ 24 | LocApiBase.cpp \ 25 | LocAdapterBase.cpp \ 26 | ContextBase.cpp \ 27 | LocDualContext.cpp \ 28 | loc_core_log.cpp \ 29 | data-items/DataItemsFactoryProxy.cpp \ 30 | SystemStatusOsObserver.cpp \ 31 | SystemStatus.cpp 32 | 33 | LOCAL_CFLAGS += \ 34 | -fno-short-enums \ 35 | -D_ANDROID_ 36 | 37 | LOCAL_C_INCLUDES:= \ 38 | $(LOCAL_PATH)/data-items \ 39 | $(LOCAL_PATH)/data-items/common \ 40 | $(LOCAL_PATH)/observer \ 41 | 42 | LOCAL_HEADER_LIBRARIES := \ 43 | libutils_headers \ 44 | libgps.utils_headers \ 45 | libloc_pla_headers \ 46 | liblocation_api_headers 47 | 48 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 49 | 50 | include $(BUILD_SHARED_LIBRARY) 51 | 52 | include $(CLEAR_VARS) 53 | LOCAL_MODULE := libloc_core_headers 54 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ 55 | $(LOCAL_PATH) \ 56 | $(LOCAL_PATH)/data-items \ 57 | $(LOCAL_PATH)/data-items/common \ 58 | $(LOCAL_PATH)/observer 59 | include $(BUILD_HEADER_LIBRARY) 60 | -------------------------------------------------------------------------------- /light/service.cpp: -------------------------------------------------------------------------------- 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 | #define LOG_TAG "android.hardware.light@2.0-service.msm8953" 18 | 19 | #include 20 | 21 | #include "Light.h" 22 | 23 | using android::hardware::configureRpcThreadpool; 24 | using android::hardware::joinRpcThreadpool; 25 | 26 | using android::hardware::light::V2_0::ILight; 27 | using android::hardware::light::V2_0::implementation::Light; 28 | 29 | using android::OK; 30 | using android::sp; 31 | using android::status_t; 32 | 33 | int main() { 34 | sp service = new Light(); 35 | 36 | configureRpcThreadpool(1, true); 37 | 38 | status_t status = service->registerAsService(); 39 | if (status != OK) { 40 | ALOGE("Cannot register Light HAL service."); 41 | return 1; 42 | } 43 | 44 | ALOGI("Light HAL service ready."); 45 | 46 | joinRpcThreadpool(); 47 | 48 | ALOGI("Light HAL service failed to join thread pool."); 49 | return 1; 50 | } 51 | -------------------------------------------------------------------------------- /sepolicy/vendor/qti_init_shell.te: -------------------------------------------------------------------------------- 1 | allow qti_init_shell proc_touchpanel:dir { r_dir_perms setattr }; 2 | allow qti_init_shell proc_touchpanel:file { getattr setattr }; 3 | allow qti_init_shell bluetooth_data_file:file r_file_perms; 4 | allow qti_init_shell ctl_default_prop:property_service set; 5 | allow qti_init_shell ctl_start_prop:property_service set; 6 | allow qti_init_shell sysfs_devices_system_cpu:dir write; 7 | allow qti_init_shell sysfs_lowmemorykiller:dir write; 8 | 9 | allow qti_init_shell sysfs:dir setattr; 10 | allow qti_init_shell sysfs:file { setattr write }; 11 | 12 | allow qti_init_shell sysfs_devfreq:dir setattr; 13 | allow qti_init_shell sysfs_ssr:file setattr; 14 | 15 | allow qti_init_shell mnt_vendor_file:dir rmdir; 16 | 17 | allow qti_init_shell self:capability { dac_override kill }; 18 | 19 | allow qti_init_shell sysfs_leds:dir setattr; 20 | allow qti_init_shell sysfs_leds:file setattr; 21 | 22 | allow qti_init_shell system_data_file:dir { getattr read write open remove_name rmdir }; 23 | allow qti_init_shell system_data_file:file { getattr unlink }; 24 | 25 | allow qti_init_shell fpc_sysfs:dir setattr; 26 | allow qti_init_shell fpc_sysfs:file setattr; 27 | 28 | allow qti_init_shell sysfs_graphics:dir setattr; 29 | 30 | allow qti_init_shell ctl_start_prop:property_service set; 31 | 32 | allow qti_init_shell sysfs_battery_supply:dir setattr; 33 | allow qti_init_shell sysfs_extcon:dir setattr; 34 | allow qti_init_shell vfat:dir { open read }; 35 | allow qti_init_shell vfat:file { getattr open read }; 36 | 37 | allow qti_init_shell proc_boot_reason:file { getattr open read }; 38 | allow qti_init_shell self:capability dac_override; 39 | -------------------------------------------------------------------------------- /keylayout/msm8953-snd-card-mtp_Button_Jack.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 226 HEADSETHOOK 29 | key 257 VOLUME_UP 30 | key 258 VOLUME_DOWN 31 | -------------------------------------------------------------------------------- /keylayout/gpio-keys.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 115 VOLUME_UP 29 | key 114 VOLUME_DOWN 30 | key 102 HOME 31 | key 528 FOCUS 32 | key 766 CAMERA 33 | -------------------------------------------------------------------------------- /keylayout/ist30xx_ts_input.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 158 BACK VIRTUAL 29 | key 139 APP_SWITCH VIRTUAL 30 | key 172 HOME VIRTUAL 31 | key 143 WAKEUP 32 | -------------------------------------------------------------------------------- /keylayout/ft5435_ts.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 158 BACK VIRTUAL 29 | key 139 APP_SWITCH VIRTUAL 30 | key 172 HOME VIRTUAL 31 | key 217 SEARCH VIRTUAL 32 | key 143 WAKEUP 33 | -------------------------------------------------------------------------------- /keylayout/goodix-ts.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 158 BACK VIRTUAL 29 | key 139 APP_SWITCH VIRTUAL 30 | key 172 HOME VIRTUAL 31 | key 217 SEARCH VIRTUAL 32 | key 143 WAKEUP 33 | -------------------------------------------------------------------------------- /gps/android/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 18 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 19 | 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace gnss { 27 | namespace V1_0 { 28 | namespace implementation { 29 | 30 | using ::android::hardware::gnss::V1_0::IGnssDebug; 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | using ::android::hardware::hidl_vec; 34 | using ::android::hardware::hidl_string; 35 | using ::android::sp; 36 | 37 | /* Interface for GNSS Debug support. */ 38 | struct Gnss; 39 | struct GnssDebug : public IGnssDebug { 40 | GnssDebug(Gnss* gnss); 41 | ~GnssDebug() {}; 42 | 43 | /* 44 | * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. 45 | * These declarations were generated from IGnssDebug.hal. 46 | */ 47 | Return getDebugData(getDebugData_cb _hidl_cb) override; 48 | 49 | private: 50 | Gnss* mGnss = nullptr; 51 | }; 52 | 53 | } // namespace implementation 54 | } // namespace V1_0 55 | } // namespace gnss 56 | } // namespace hardware 57 | } // namespace android 58 | 59 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 60 | -------------------------------------------------------------------------------- /rootdir/fstab.qcom: -------------------------------------------------------------------------------- 1 | # Android fstab file. 2 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 3 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 4 | 5 | # 6 | /dev/block/bootdevice/by-name/system / ext4 ro,barrier=1,discard wait,slotselect 7 | /dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,discard,fsync_mode=nobarrier wait,check,encryptable=footer,quota 8 | /dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,noatime,noauto_da_alloc wait,check,encryptable=footer,quota,formattable 9 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 nosuid,nodev,noatime wait,check 10 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev wait 11 | /dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect 12 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults 13 | /dev/block/bootdevice/by-name/config /frp emmc defaults defaults 14 | 15 | /devices/platform/soc/7864900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=footer 16 | /devices/platform/soc/7000000.ssusb/7000000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto 17 | /devices/soc/7864900.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,noemulatedsd,encryptable=footer 18 | /devices/soc/7000000.ssusb/7000000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto 19 | 20 | /dev/block/zram0 none swap defaults zramsize=536870912,max_comp_streams=8 21 | -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | # Camera 2 | persist.camera.debug.logfile u:object_r:persist_camera_prop:s0 3 | camera.dual.mode u:object_r:camera_prop:s0 4 | persist.camera. u:object_r:camera_prop:s0 5 | 6 | 7 | # Fingerprint 8 | persist.sys.fp. u:object_r:fingerprint_prop:s0 9 | persist.vendor.sys.fp. u:object_r:fingerprint_prop:s0 10 | ro.boot.fp. u:object_r:fingerprint_prop:s0 11 | ro.boot.fpsensor u:object_r:fingerprint_prop:s0 12 | sys.fp.goodix u:object_r:fingerprint_prop:s0 13 | sys.fp.vendor u:object_r:fingerprint_prop:s0 14 | 15 | 16 | # Mlipay 17 | persist.vendor.sys.pay.ifaa u:object_r:ifaa_prop:s0 18 | 19 | # Netmgrd 20 | persist.net.doxlat u:object_r:vendor_xlat_prop:s0 21 | 22 | # Post Boot 23 | sys.post_boot.parsed u:object_r:vendor_mpctl_prop:s0 24 | 25 | # Radio 26 | sys.fake_bs_flag0 u:object_r:system_radio_prop:s0 27 | sys.fake_bs_flag1 u:object_r:system_radio_prop:s0 28 | 29 | # Sensors 30 | sys.panel. u:object_r:sensors_panel_prop:s0 31 | 32 | # Spectrum 33 | persist.spectrum.profile u:object_r:spectrum_prop:s0 34 | 35 | # Qseecomd 36 | sys.listeners.registered u:object_r:vendor_tee_listener_prop:s0 37 | 38 | # Thermal engine 39 | persist.sys.thermal. u:object_r:thermal_prop:s0 40 | sys.thermal. u:object_r:thermal_prop:s0 41 | 42 | # Dirac 43 | persist.audio.dirac. u:object_r:dirac_prop:s0 44 | -------------------------------------------------------------------------------- /overlay/packages/services/Telephony/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 21 | 22 | 24 | 25 | 27 | 1 28 | 29 | 33 | 34 | true 35 | 36 | 37 | false 38 | 39 | -------------------------------------------------------------------------------- /gps/gnsspps/gnsspps.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundatoin, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | #ifndef _GNSSPPS_H 29 | #define _GNSSPPS_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /* opens the device and fetches from PPS source */ 36 | int initPPS(char *devname); 37 | /* updates the fine time stamp */ 38 | int getPPS(struct timespec *current_ts, struct timespec *current_boottime, struct timespec *last_boottime); 39 | /* stops fetching and closes the device */ 40 | void deInitPPS(); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /gps/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 | # By default if network fixes are not sensor assisted 54 | # these fixes must be dropped. This parameter adds an exception 55 | # for targets where there is no PDR and we still want to 56 | # report out network fixes 57 | # 0: MUST NOT ALLOW NETWORK FIXES 58 | # 1: ALLOW NETWORK FIXES 59 | #################################### 60 | ALLOW_NETWORK_FIXES = 0 61 | -------------------------------------------------------------------------------- /light/Light.h: -------------------------------------------------------------------------------- 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 | #ifndef ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H 18 | #define ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | using ::android::hardware::Return; 28 | using ::android::hardware::Void; 29 | using ::android::hardware::light::V2_0::Flash; 30 | using ::android::hardware::light::V2_0::ILight; 31 | using ::android::hardware::light::V2_0::LightState; 32 | using ::android::hardware::light::V2_0::Status; 33 | using ::android::hardware::light::V2_0::Type; 34 | 35 | typedef void (*LightStateHandler)(const LightState&); 36 | 37 | struct LightBackend { 38 | Type type; 39 | LightState state; 40 | LightStateHandler handler; 41 | 42 | LightBackend(Type type, LightStateHandler handler) : type(type), handler(handler) { 43 | this->state.color = 0xff000000; 44 | } 45 | }; 46 | 47 | namespace android { 48 | namespace hardware { 49 | namespace light { 50 | namespace V2_0 { 51 | namespace implementation { 52 | 53 | class Light : public ILight { 54 | public: 55 | Return setLight(Type type, const LightState& state) override; 56 | Return getSupportedTypes(getSupportedTypes_cb _hidl_cb) override; 57 | 58 | private: 59 | std::mutex globalLock; 60 | }; 61 | 62 | } // namespace implementation 63 | } // namespace V2_0 64 | } // namespace light 65 | } // namespace hardware 66 | } // namespace android 67 | 68 | #endif // ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H -------------------------------------------------------------------------------- /sepolicy/vendor/untrusted_app.te: -------------------------------------------------------------------------------- 1 | allow untrusted_app bluetooth_prop:file read; 2 | allow untrusted_app bootloader_boot_reason_prop:file read; 3 | allow untrusted_app proc_vmstat:file read; 4 | allow untrusted_app runtime_event_log_tags_file:file read; 5 | allow untrusted_app boottime_prop:file read; 6 | allow untrusted_app cnd_vendor_prop:file read; 7 | allow untrusted_app runtime_event_log_tags_file:file open; 8 | allow untrusted_app ctl_dumpstate_prop:file { read }; 9 | allow untrusted_app ctl_fuse_prop:file { read }; 10 | allow untrusted_app ctl_interface_restart_prop:file { read }; 11 | allow untrusted_app ctl_interface_start_prop:file { read }; 12 | allow untrusted_app ctl_interface_stop_prop:file { read }; 13 | allow untrusted_app ctl_mdnsd_prop:file { read }; 14 | allow untrusted_app ctl_qcrild_prop:file { read }; 15 | allow untrusted_app ctl_restart_prop:file { read }; 16 | allow untrusted_app ctl_rildaemon_prop:file { read }; 17 | allow untrusted_app ctl_sigstop_prop:file { read }; 18 | allow untrusted_app ctl_start_prop:file { read }; 19 | allow untrusted_app ctl_stop_prop:file { read }; 20 | allow untrusted_app sysfs_thermal:file { write }; 21 | allow untrusted_app rootfs:dir { read }; 22 | allow untrusted_app debugfs:dir { read }; 23 | allow untrusted_app firmware_file:dir { getattr }; 24 | allow untrusted_app init_exec:file { getattr }; 25 | allow untrusted_app device:dir { read }; 26 | allow untrusted_app device:file { getattr }; 27 | allow untrusted_app xdsp_device:chr_file { getattr }; 28 | allow untrusted_app device:chr_file { getattr }; 29 | allow untrusted_app sepolicy_file:file { getattr }; 30 | allow untrusted_app file_contexts_file:file { getattr }; 31 | allow untrusted_app hwservice_contexts_file:file { getattr }; 32 | allow untrusted_app mac_perms_file:file { getattr }; 33 | allow untrusted_app firmware_file:dir { read }; 34 | allow untrusted_app firmware_file:dir { search }; 35 | allow untrusted_app persist_camera_prop:file { getattr open read }; 36 | allow untrusted_app sysfs_kgsl:dir search; 37 | allow untrusted_app sysfs_kgsl:file { open read }; 38 | allow untrusted_app camera_prop:file { getattr open read }; 39 | allow untrusted_app theme_prop:file { read }; 40 | allow untrusted_app net_dns_prop:file { read }; 41 | allow untrusted_app proc:file { read }; 42 | allow untrusted_app proc:file { open }; 43 | -------------------------------------------------------------------------------- /permissions/privapp-permissions-qti.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /rootdir/etc/move_wifi_data.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | # Copyright (c) 2018, 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 | DEST_PATH="/data/vendor/wifi" 33 | FILES_MOVED="/data/vendor/wifi/moved" 34 | SRC_PATH="/data/misc/wifi" 35 | 36 | if [ ! -f "$FILES_MOVED" ]; then 37 | for i in "$SRC_PATH/"*; do 38 | dest_path=$DEST_PATH/"${i#$SRC_PATH/}" 39 | echo $dest_path 40 | if [ -d "$i" ]; then 41 | mkdir -p $dest_path -m 700 42 | mv $i "$DEST_PATH" 43 | else 44 | mv $i "$DEST_PATH" 45 | fi 46 | find $DEST_PATH -print0 | while IFS= read -r -d '' file 47 | do 48 | chgrp wifi "$file" 49 | done 50 | echo $i 51 | done 52 | restorecon -R "$DEST_PATH" 53 | echo 1 > "$FILES_MOVED" 54 | fi 55 | -------------------------------------------------------------------------------- /gps/core/data-items/DataItemsFactoryProxy.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __DATAITEMFACTORYBASE__ 31 | #define __DATAITEMFACTORYBASE__ 32 | 33 | #include 34 | #include 35 | 36 | namespace loc_core 37 | { 38 | 39 | #define DATA_ITEMS_LIB_NAME "libdataitems.so" 40 | #define DATA_ITEMS_GET_CONCRETE_DI "getConcreteDataItem" 41 | 42 | typedef IDataItemCore * (get_concrete_data_item_fn)(DataItemId); 43 | 44 | class DataItemsFactoryProxy { 45 | public: 46 | static IDataItemCore* createNewDataItem(DataItemId id); 47 | static void closeDataItemLibraryHandle(); 48 | static void *dataItemLibHandle; 49 | static get_concrete_data_item_fn *getConcreteDIFunc; 50 | }; 51 | 52 | } // namespace loc_core 53 | 54 | #endif //__DATAITEMFACTORYBASE__ 55 | 56 | -------------------------------------------------------------------------------- /update-sha1sums.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2018 The LineageOS Project 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | from hashlib import sha1 20 | import sys 21 | 22 | device='daisy' 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 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/drawable/ic_volte.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 20 | 24 | 28 | 31 | 35 | 39 | 42 | 43 | -------------------------------------------------------------------------------- /gps/android/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti 5 | LOCAL_VENDOR_MODULE := true 6 | LOCAL_MODULE_RELATIVE_PATH := hw 7 | LOCAL_SRC_FILES := \ 8 | AGnss.cpp \ 9 | Gnss.cpp \ 10 | GnssBatching.cpp \ 11 | GnssGeofencing.cpp \ 12 | GnssMeasurement.cpp \ 13 | GnssNi.cpp \ 14 | GnssConfiguration.cpp \ 15 | GnssDebug.cpp \ 16 | AGnssRil.cpp 17 | 18 | LOCAL_SRC_FILES += \ 19 | location_api/LocationUtil.cpp \ 20 | location_api/GnssAPIClient.cpp \ 21 | location_api/GeofenceAPIClient.cpp \ 22 | location_api/BatchingAPIClient.cpp \ 23 | location_api/MeasurementAPIClient.cpp \ 24 | 25 | LOCAL_C_INCLUDES:= \ 26 | $(LOCAL_PATH)/location_api 27 | LOCAL_HEADER_LIBRARIES := \ 28 | libgps.utils_headers \ 29 | libloc_core_headers \ 30 | libloc_pla_headers \ 31 | liblocation_api_headers 32 | 33 | LOCAL_SHARED_LIBRARIES := \ 34 | liblog \ 35 | libhidlbase \ 36 | libhidltransport \ 37 | libhwbinder \ 38 | libcutils \ 39 | libutils \ 40 | android.hardware.gnss@1.0 \ 41 | 42 | LOCAL_SHARED_LIBRARIES += \ 43 | libloc_core \ 44 | libgps.utils \ 45 | libdl \ 46 | liblocation_api \ 47 | 48 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 49 | include $(BUILD_SHARED_LIBRARY) 50 | 51 | BUILD_GNSS_HIDL_SERVICE := true 52 | ifneq ($(BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET), true) 53 | ifneq ($(LW_FEATURE_SET),true) 54 | BUILD_GNSS_HIDL_SERVICE := false 55 | endif # LW_FEATURE_SET 56 | endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET 57 | 58 | ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) 59 | include $(CLEAR_VARS) 60 | LOCAL_MODULE := android.hardware.gnss@1.0-service-qti 61 | LOCAL_VENDOR_MODULE := true 62 | LOCAL_MODULE_RELATIVE_PATH := hw 63 | LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc 64 | LOCAL_SRC_FILES := \ 65 | service.cpp \ 66 | 67 | LOCAL_C_INCLUDES:= \ 68 | $(LOCAL_PATH)/location_api 69 | LOCAL_HEADER_LIBRARIES := \ 70 | libgps.utils_headers \ 71 | libloc_core_headers \ 72 | libloc_pla_headers \ 73 | liblocation_api_headers 74 | 75 | 76 | LOCAL_SHARED_LIBRARIES := \ 77 | liblog \ 78 | libcutils \ 79 | libdl \ 80 | libbase \ 81 | libutils \ 82 | 83 | LOCAL_SHARED_LIBRARIES += \ 84 | libhwbinder \ 85 | libhidlbase \ 86 | libhidltransport \ 87 | android.hardware.gnss@1.0 \ 88 | 89 | LOCAL_CFLAGS += $(GNSS_CFLAGS) 90 | include $(BUILD_EXECUTABLE) 91 | endif # BUILD_GNSS_HIDL_SERVICE 92 | -------------------------------------------------------------------------------- /overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 17 | true 18 | true 19 | 20 | 32 | 83 33 | 34 | 48 | 1 49 | 50 | 52 | true 53 | 54 | -------------------------------------------------------------------------------- /gps/android/GnssConfiguration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | 6 | /* Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | 22 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 23 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssConfiguration; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* 42 | * Interface for passing GNSS configuration info from platform to HAL. 43 | */ 44 | struct Gnss; 45 | struct GnssConfiguration : public IGnssConfiguration { 46 | GnssConfiguration(Gnss* gnss); 47 | ~GnssConfiguration() = default; 48 | 49 | /* 50 | * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow. 51 | * These declarations were generated from IGnssConfiguration.hal. 52 | */ 53 | Return setSuplVersion(uint32_t version) override; 54 | Return setSuplMode(uint8_t mode) override; 55 | Return setSuplEs(bool enabled) override; 56 | Return setLppProfile(uint8_t lppProfile) override; 57 | Return setGlonassPositioningProtocol(uint8_t protocol) override; 58 | Return setEmergencySuplPdn(bool enable) override; 59 | Return setGpsLock(uint8_t lock) override; 60 | 61 | private: 62 | Gnss* mGnss = nullptr; 63 | }; 64 | 65 | } // namespace implementation 66 | } // namespace V1_0 67 | } // namespace gnss 68 | } // namespace hardware 69 | } // namespace android 70 | 71 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 72 | -------------------------------------------------------------------------------- /compatibility_matrix.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.frameworks.displayservice 4 | 1.0 5 | 6 | IDisplayService 7 | default 8 | 9 | 10 | 11 | android.frameworks.schedulerservice 12 | 1.0 13 | 14 | ISchedulingPolicyService 15 | default 16 | 17 | 18 | 19 | android.frameworks.sensorservice 20 | 1.0 21 | 22 | ISensorManager 23 | default 24 | 25 | 26 | 27 | android.hidl.allocator 28 | 1.0 29 | 30 | IAllocator 31 | ashmem 32 | 33 | 34 | 35 | android.hidl.manager 36 | 1.0 37 | 38 | IServiceManager 39 | default 40 | 41 | 42 | 43 | android.hidl.memory 44 | 1.0 45 | 46 | IMapper 47 | ashmem 48 | 49 | 50 | 51 | android.hidl.token 52 | 1.0 53 | 54 | ITokenManager 55 | default 56 | 57 | 58 | 59 | android.system.net.netd 60 | 1.0 61 | 62 | INetd 63 | default 64 | 65 | 66 | 67 | android.system.wifi.keystore 68 | 1.0 69 | 70 | IKeystore 71 | default 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /gps/android/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_0 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V1_0 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/pla/android/loc_pla.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef __LOC_PLA__ 30 | #define __LOC_PLA__ 31 | 32 | #ifdef __cplusplus 33 | #include 34 | #define uptimeMillis android::uptimeMillis 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | #include 42 | #include 43 | #include 44 | 45 | #define LOC_PATH_GPS_CONF_STR "/vendor/etc/gps.conf" 46 | #define LOC_PATH_IZAT_CONF_STR "/vendor/etc/izat.conf" 47 | #define LOC_PATH_FLP_CONF_STR "/vendor/etc/flp.conf" 48 | #define LOC_PATH_LOWI_CONF_STR "/vendor/etc/lowi.conf" 49 | #define LOC_PATH_SAP_CONF_STR "/vendor/etc/sap.conf" 50 | #define LOC_PATH_APDR_CONF_STR "/vendor/etc/apdr.conf" 51 | #define LOC_PATH_XTWIFI_CONF_STR "/vendor/etc/xtwifi.conf" 52 | #define LOC_PATH_QUIPC_CONF_STR "/vendor/etc/quipc.conf" 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif /*__cplusplus */ 57 | 58 | #endif /* __LOC_PLA__ */ 59 | -------------------------------------------------------------------------------- /sepolicy/vendor/untrusted_app_27.te: -------------------------------------------------------------------------------- 1 | allow untrusted_app_27 bluetooth_prop:file read; 2 | allow untrusted_app_27 bootloader_boot_reason_prop:file read; 3 | allow untrusted_app_27 runtime_event_log_tags_file:file read; 4 | allow untrusted_app_27 boottime_prop:file read; 5 | allow untrusted_app_27 cnd_vendor_prop:file read; 6 | allow untrusted_app_27 ctl_bootanim_prop:file read; 7 | allow untrusted_app_27 ctl_bugreport_prop:file read; 8 | allow untrusted_app_27 ctl_console_prop:file read; 9 | allow untrusted_app_27 runtime_event_log_tags_file:file open; 10 | allow untrusted_app_27 serialno_prop:file read; 11 | allow untrusted_app_27 sysfs:file read; 12 | allow untrusted_app_27 ctl_default_prop:file { read }; 13 | allow untrusted_app_27 ctl_dumpstate_prop:file { read }; 14 | allow untrusted_app_27 ctl_fuse_prop:file { read }; 15 | allow untrusted_app_27 ctl_interface_restart_prop:file { read }; 16 | allow untrusted_app_27 ctl_interface_start_prop:file { read }; 17 | allow untrusted_app_27 ctl_interface_stop_prop:file { read }; 18 | allow untrusted_app_27 ctl_mdnsd_prop:file { read }; 19 | allow untrusted_app_27 ctl_qcrild_prop:file { read }; 20 | allow untrusted_app_27 ctl_restart_prop:file { read }; 21 | allow untrusted_app_27 rootfs:dir { search read }; 22 | allow untrusted_app_27 proc_uptime:file { read }; 23 | allow untrusted_app_27 proc_uptime:file { open }; 24 | allow untrusted_app_27 proc_uptime:file { getattr }; 25 | allow untrusted_app_27 proc_stat:file { read }; 26 | allow untrusted_app_27 proc_stat:file { open }; 27 | allow untrusted_app_27 ctl_rildaemon_prop:file { read }; 28 | allow untrusted_app_27 ctl_sigstop_prop:file { read }; 29 | allow untrusted_app_27 ctl_start_prop:file { read }; 30 | allow untrusted_app_27 ctl_stop_prop:file { read }; 31 | allow untrusted_app_27 ctl_vendor_hbtp_prop:file { read }; 32 | allow untrusted_app_27 sysfs:dir { read }; 33 | allow untrusted_app_27 hal_memtrack_default:binder { call }; 34 | allow untrusted_app_27 net_dns_prop:file { read }; 35 | allow untrusted_app_27 mnt_media_rw_file:dir { getattr }; 36 | allow untrusted_app_27 mnt_product_file:dir { getattr }; 37 | allow untrusted_app_27 net_dns_prop:file { open }; 38 | allow untrusted_app_27 mnt_vendor_file:dir { getattr }; 39 | allow untrusted_app_27 sysfs:dir { open }; 40 | allow untrusted_app_27 net_dns_prop:file { getattr }; 41 | allow untrusted_app_27 sysfs:file { getattr }; 42 | allow untrusted_app_27 sysfs:file { open }; 43 | allow untrusted_app_27 persist_camera_prop:file { getattr open read }; 44 | allow untrusted_app_27 rootfs:dir { search }; 45 | allow untrusted_app_27 theme_prop:file { open read }; 46 | allow untrusted_app_27 theme_prop:file { getattr }; 47 | allow untrusted_app_27 persist_camera_prop:file { read }; -------------------------------------------------------------------------------- /gps/android/AGnss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IAGnss; 35 | using ::android::hardware::gnss::V1_0::IAGnssCallback; 36 | using ::android::hardware::Return; 37 | using ::android::hardware::Void; 38 | using ::android::hardware::hidl_vec; 39 | using ::android::hardware::hidl_string; 40 | using ::android::sp; 41 | 42 | struct Gnss; 43 | struct AGnss : public IAGnss { 44 | 45 | AGnss(Gnss* gnss); 46 | ~AGnss(); 47 | /* 48 | * Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow. 49 | * These declarations were generated from IAGnss.hal. 50 | */ 51 | Return setCallback(const sp& callback) override; 52 | 53 | Return dataConnClosed() override; 54 | 55 | Return dataConnFailed() override; 56 | 57 | Return dataConnOpen(const hidl_string& apn, 58 | IAGnss::ApnIpType apnIpType) override; 59 | 60 | Return setServer(IAGnssCallback::AGnssType type, 61 | const hidl_string& hostname, int32_t port) override; 62 | 63 | void statusIpV4Cb(AGnssExtStatusIpV4 status); 64 | 65 | /* Data call setup callback passed down to GNSS HAL implementation */ 66 | static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); 67 | 68 | private: 69 | Gnss* mGnss = nullptr; 70 | sp mAGnssCbIface = nullptr; 71 | }; 72 | 73 | } // namespace implementation 74 | } // namespace V1_0 75 | } // namespace gnss 76 | } // namespace hardware 77 | } // namespace android 78 | 79 | #endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H 80 | -------------------------------------------------------------------------------- /gps/utils/loc_nmea.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012-2013, 2015-2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_ENG_NMEA_H 31 | #define LOC_ENG_NMEA_H 32 | 33 | #include 34 | #include 35 | #include 36 | #define NMEA_SENTENCE_MAX_LENGTH 200 37 | 38 | void loc_nmea_generate_sv(const GnssSvNotification &svNotify, 39 | std::vector &nmeaArraystr); 40 | 41 | void loc_nmea_generate_pos(const UlpLocation &location, 42 | const GpsLocationExtended &locationExtended, 43 | unsigned char generate_nmea, 44 | std::vector &nmeaArraystr); 45 | 46 | #define DEBUG_NMEA_MINSIZE 6 47 | #define DEBUG_NMEA_MAXSIZE 4096 48 | inline bool loc_nmea_is_debug(const char* nmea, int length) { 49 | return ((nullptr != nmea) && 50 | (length >= DEBUG_NMEA_MINSIZE) && (length <= DEBUG_NMEA_MAXSIZE) && 51 | (nmea[0] == '$') && (nmea[1] == 'P') && (nmea[2] == 'Q') && (nmea[3] == 'W')); 52 | } 53 | 54 | #endif // LOC_ENG_NMEA_H 55 | -------------------------------------------------------------------------------- /gps/android/location_api/LocationUtil.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOCATION_UTIL_H 31 | #define LOCATION_UTIL_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace android { 38 | namespace hardware { 39 | namespace gnss { 40 | namespace V1_0 { 41 | namespace implementation { 42 | 43 | void convertGnssLocation(Location& in, V1_0::GnssLocation& out); 44 | void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); 45 | void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); 46 | void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); 47 | void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); 48 | void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); 49 | 50 | } // namespace implementation 51 | } // namespace V1_0 52 | } // namespace gnss 53 | } // namespace hardware 54 | } // namespace android 55 | #endif // LOCATION_UTIL_H 56 | -------------------------------------------------------------------------------- /init/init_msm8953.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, The CyanogenMod Project 3 | Copyright (C) 2019 The LineageOS Project. 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 | 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 | #include 31 | 32 | #include "vendor_init.h" 33 | #include "property_service.h" 34 | 35 | char const *heapgrowthlimit; 36 | char const *heapminfree; 37 | 38 | using android::init::property_set; 39 | 40 | void check_device() 41 | { 42 | struct sysinfo sys; 43 | 44 | sysinfo(&sys); 45 | 46 | if (sys.totalram > 2048ull * 1024 * 1024) { 47 | // from - Stock rom 48 | heapgrowthlimit = "256m"; 49 | heapminfree = "4m"; 50 | } else { 51 | // from - phone-xxhdpi-2048-dalvik-heap.mk 52 | heapgrowthlimit = "192m"; 53 | heapminfree = "2m"; 54 | } 55 | } 56 | 57 | void vendor_load_properties() 58 | { 59 | check_device(); 60 | 61 | property_set("dalvik.vm.heapstartsize", "16m"); 62 | property_set("dalvik.vm.heapgrowthlimit", heapgrowthlimit); 63 | property_set("dalvik.vm.heapsize", "512m"); 64 | property_set("dalvik.vm.heaptargetutilization", "0.75"); 65 | property_set("dalvik.vm.heapminfree", heapminfree); 66 | property_set("dalvik.vm.heapmaxfree", "8m"); 67 | } 68 | -------------------------------------------------------------------------------- /vndk/Android.mk: -------------------------------------------------------------------------------- 1 | # TODO(b/69526027): DEPRECATE USE OF THIS. 2 | # USE BOARD_VNDK_VERSION:=current instead. 3 | 4 | LOCAL_PATH := $(call my-dir) 5 | 6 | # b/69526027: This VNDK-SP install routine must be removed. Instead, we must 7 | # build vendor variants of the VNDK-SP modules. 8 | 9 | ifndef BOARD_VNDK_VERSION 10 | # The libs with "vndk: {enabled: true, support_system_process: true}" will be 11 | # added VNDK_SP_LIBRARIES automatically. And the core variants of the VNDK-SP 12 | # libs will be copied to vndk-sp directory. 13 | # However, some of those libs need FWK-ONLY libs, which must be listed here 14 | # manually. 15 | VNDK_SP_LIBRARIES := \ 16 | libdexfile_support \ 17 | 18 | install_in_hw_dir := \ 19 | android.hidl.memory@1.0-impl 20 | 21 | vndk_sp_dir := vndk-sp-$(PLATFORM_VNDK_VERSION) 22 | 23 | define define-vndk-sp-lib 24 | include $$(CLEAR_VARS) 25 | LOCAL_MODULE := $1.vndk-sp-gen 26 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 27 | LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,,)/$1.so 28 | LOCAL_STRIP_MODULE := false 29 | LOCAL_MULTILIB := first 30 | LOCAL_MODULE_TAGS := optional 31 | LOCAL_INSTALLED_MODULE_STEM := $1.so 32 | LOCAL_MODULE_SUFFIX := .so 33 | LOCAL_MODULE_RELATIVE_PATH := $(vndk_sp_dir)$(if $(filter $1,$(install_in_hw_dir)),/hw) 34 | LOCAL_CHECK_ELF_FILES := false 35 | include $$(BUILD_PREBUILT) 36 | 37 | ifneq ($$(TARGET_2ND_ARCH),) 38 | ifneq ($$(TARGET_TRANSLATE_2ND_ARCH),true) 39 | include $$(CLEAR_VARS) 40 | LOCAL_MODULE := $1.vndk-sp-gen 41 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 42 | LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,$$(TARGET_2ND_ARCH_VAR_PREFIX),)/$1.so 43 | LOCAL_STRIP_MODULE := false 44 | LOCAL_MULTILIB := 32 45 | LOCAL_MODULE_TAGS := optional 46 | LOCAL_INSTALLED_MODULE_STEM := $1.so 47 | LOCAL_MODULE_SUFFIX := .so 48 | LOCAL_MODULE_RELATIVE_PATH := $(vndk_sp_dir)$(if $(filter $1,$(install_in_hw_dir)),/hw) 49 | LOCAL_CHECK_ELF_FILES := false 50 | include $$(BUILD_PREBUILT) 51 | endif # TARGET_TRANSLATE_2ND_ARCH is not true 52 | endif # TARGET_2ND_ARCH is not empty 53 | endef 54 | 55 | # Add VNDK-SP libs to the list if they are missing 56 | $(foreach lib,$(VNDK_SAMEPROCESS_LIBRARIES),\ 57 | $(if $(filter $(lib),$(VNDK_SP_LIBRARIES)),,\ 58 | $(eval VNDK_SP_LIBRARIES += $(lib)))) 59 | 60 | # Remove libz from the VNDK-SP list (b/73296261) 61 | VNDK_SP_LIBRARIES := $(filter-out libz,$(VNDK_SP_LIBRARIES)) 62 | 63 | $(foreach lib,$(VNDK_SP_LIBRARIES),\ 64 | $(eval $(call define-vndk-sp-lib,$(lib)))) 65 | 66 | install_in_hw_dir := 67 | 68 | include $(CLEAR_VARS) 69 | LOCAL_MODULE := vndk-sp 70 | LOCAL_MODULE_OWNER := google 71 | LOCAL_MODULE_TAGS := optional 72 | LOCAL_REQUIRED_MODULES := $(addsuffix .vndk-sp-gen,$(VNDK_SP_LIBRARIES)) 73 | include $(BUILD_PHONY_PACKAGE) 74 | endif 75 | -------------------------------------------------------------------------------- /gps/core/loc_core_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, 2016-2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_CORE_LOG_H 31 | #define LOC_CORE_LOG_H 32 | 33 | #include 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" 38 | { 39 | #endif 40 | 41 | const char* loc_get_gps_status_name(LocGpsStatusValue gps_status); 42 | const char* loc_get_position_mode_name(LocGpsPositionMode mode); 43 | const char* loc_get_position_recurrence_name(LocGpsPositionRecurrence recur); 44 | const char* loc_get_aiding_data_mask_names(LocGpsAidingData data); 45 | const char* loc_get_agps_type_name(LocAGpsType type); 46 | const char* loc_get_ni_type_name(LocGpsNiType type); 47 | const char* loc_get_ni_response_name(LocGpsUserResponseType response); 48 | const char* loc_get_ni_encoding_name(LocGpsNiEncodingType encoding); 49 | const char* loc_get_agps_bear_name(AGpsBearerType bear); 50 | const char* loc_get_server_type_name(LocServerType type); 51 | const char* loc_get_position_sess_status_name(enum loc_sess_status status); 52 | const char* loc_get_agps_status_name(LocAGpsStatusValue status); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* LOC_CORE_LOG_H */ 59 | -------------------------------------------------------------------------------- /gps/pla/oe/loc_pla.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef __LOC_PLA__ 30 | #define __LOC_PLA__ 31 | 32 | #ifdef __cplusplus 33 | #include 34 | #define uptimeMillis android::uptimeMillis 35 | 36 | extern "C" { 37 | #endif 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #ifndef OFF_TARGET 46 | #include 47 | #define strlcat g_strlcat 48 | #define strlcpy g_strlcpy 49 | #else 50 | #define strlcat strncat 51 | #define strlcpy strncpy 52 | #endif 53 | 54 | #define LOC_PATH_GPS_CONF_STR "/etc/gps.conf" 55 | #define LOC_PATH_IZAT_CONF_STR "/etc/izat.conf" 56 | #define LOC_PATH_FLP_CONF_STR "/etc/flp.conf" 57 | #define LOC_PATH_LOWI_CONF_STR "/etc/lowi.conf" 58 | #define LOC_PATH_SAP_CONF_STR "/etc/sap.conf" 59 | #define LOC_PATH_APDR_CONF_STR "/etc/apdr.conf" 60 | #define LOC_PATH_XTWIFI_CONF_STR "/etc/xtwifi.conf" 61 | #define LOC_PATH_QUIPC_CONF_STR "/etc/quipc.conf" 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif /*__cplusplus */ 66 | 67 | #endif /* __LOC_PLA__ */ 68 | -------------------------------------------------------------------------------- /gps/android/GnssNi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "LocSvc_GnssNiInterface" 22 | 23 | #include 24 | #include "Gnss.h" 25 | #include "GnssNi.h" 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_0 { 31 | namespace implementation { 32 | 33 | void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { 34 | LOC_LOGE("%s] service died. cookie: %llu, who: %p", 35 | __FUNCTION__, static_cast(cookie), &who); 36 | // we do nothing here 37 | // Gnss::GnssDeathRecipient will stop the session 38 | } 39 | 40 | GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { 41 | mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); 42 | } 43 | 44 | // Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 45 | Return GnssNi::setCallback(const sp& callback) { 46 | if (mGnss == nullptr) { 47 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 48 | return Void(); 49 | } 50 | 51 | mGnss->setGnssNiCb(callback); 52 | 53 | if (mGnssNiCbIface != nullptr) { 54 | mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); 55 | } 56 | mGnssNiCbIface = callback; 57 | if (mGnssNiCbIface != nullptr) { 58 | mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); 59 | } 60 | 61 | return Void(); 62 | } 63 | 64 | Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { 65 | if (mGnss == nullptr) { 66 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 67 | return Void(); 68 | } 69 | 70 | GnssAPIClient* api = mGnss->getApi(); 71 | if (api == nullptr) { 72 | LOC_LOGE("%s]: api is nullptr", __FUNCTION__); 73 | return Void(); 74 | } 75 | 76 | api->gnssNiRespond(notifId, userResponse); 77 | 78 | return Void(); 79 | } 80 | 81 | } // namespace implementation 82 | } // namespace V1_0 83 | } // namespace gnss 84 | } // namespace hardware 85 | } // namespace android 86 | -------------------------------------------------------------------------------- /gps/utils/loc_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2012, 2015 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_LOG_H 31 | #define LOC_LOG_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif 37 | 38 | #include 39 | #include 40 | #include "loc_target.h" 41 | 42 | typedef struct 43 | { 44 | const char *name; 45 | long val; 46 | } loc_name_val_s_type; 47 | 48 | #define NAME_VAL(x) {"" #x "", x } 49 | 50 | #define UNKNOWN_STR "UNKNOWN" 51 | 52 | #define CHECK_MASK(type, value, mask_var, mask) \ 53 | (((mask_var) & (mask)) ? (type) (value) : (type) (-1)) 54 | 55 | #define LOC_TABLE_SIZE(table) (sizeof(table)/sizeof((table)[0])) 56 | 57 | /* Get names from value */ 58 | const char* loc_get_name_from_mask(const loc_name_val_s_type table[], size_t table_size, long mask); 59 | const char* loc_get_name_from_val(const loc_name_val_s_type table[], size_t table_size, long value); 60 | const char* loc_get_msg_q_status(int status); 61 | const char* loc_get_target_name(unsigned int target); 62 | 63 | extern const char* log_succ_fail_string(int is_succ); 64 | 65 | extern char *loc_get_time(char *time_string, size_t buf_size); 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif /* LOC_LOG_H */ 72 | -------------------------------------------------------------------------------- /gps/android/GnssMeasurement.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssMeasurement; 35 | using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback; 36 | using ::android::hardware::Return; 37 | using ::android::hardware::Void; 38 | using ::android::hardware::hidl_vec; 39 | using ::android::hardware::hidl_string; 40 | using ::android::sp; 41 | 42 | class MeasurementAPIClient; 43 | struct GnssMeasurement : public IGnssMeasurement { 44 | GnssMeasurement(); 45 | ~GnssMeasurement(); 46 | 47 | /* 48 | * Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. 49 | * These declarations were generated from IGnssMeasurement.hal. 50 | */ 51 | Return setCallback( 52 | const sp& callback) override; 53 | Return close() override; 54 | 55 | private: 56 | struct GnssMeasurementDeathRecipient : hidl_death_recipient { 57 | GnssMeasurementDeathRecipient(sp gnssMeasurement) : 58 | mGnssMeasurement(gnssMeasurement) { 59 | } 60 | ~GnssMeasurementDeathRecipient() = default; 61 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 62 | sp mGnssMeasurement; 63 | }; 64 | 65 | private: 66 | sp mGnssMeasurementDeathRecipient = nullptr; 67 | sp mGnssMeasurementCbIface = nullptr; 68 | MeasurementAPIClient* mApi; 69 | }; 70 | 71 | } // namespace implementation 72 | } // namespace V1_0 73 | } // namespace gnss 74 | } // namespace hardware 75 | } // namespace android 76 | 77 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H 78 | -------------------------------------------------------------------------------- /overlay/packages/apps/CarrierConfig/res/xml/vendor_device.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /gps/utils/MsgTask.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013,2015 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __MSG_TASK__ 30 | #define __MSG_TASK__ 31 | 32 | #include 33 | 34 | struct LocMsg { 35 | inline LocMsg() {} 36 | inline virtual ~LocMsg() {} 37 | virtual void proc() const = 0; 38 | inline virtual void log() const {} 39 | }; 40 | 41 | class MsgTask : public LocRunnable { 42 | const void* mQ; 43 | LocThread* mThread; 44 | friend class LocThreadDelegate; 45 | protected: 46 | virtual ~MsgTask(); 47 | public: 48 | MsgTask(LocThread::tCreate tCreator, const char* threadName = NULL, bool joinable = true); 49 | MsgTask(const char* threadName = NULL, bool joinable = true); 50 | // this obj will be deleted once thread is deleted 51 | void destroy(); 52 | void sendMsg(const LocMsg* msg) const; 53 | // Overrides of LocRunnable methods 54 | // This method will be repeated called until it returns false; or 55 | // until thread is stopped. 56 | virtual bool run(); 57 | 58 | // The method to be run before thread loop (conditionally repeatedly) 59 | // calls run() 60 | virtual void prerun(); 61 | 62 | // The method to be run after thread loop (conditionally repeatedly) 63 | // calls run() 64 | inline virtual void postrun() {} 65 | }; 66 | 67 | #endif //__MSG_TASK__ 68 | -------------------------------------------------------------------------------- /gps/android/GnssBatching.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H 23 | 24 | #include 25 | #include 26 | 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssBatching; 35 | using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; 36 | using ::android::hidl::base::V1_0::IBase; 37 | using ::android::hardware::hidl_array; 38 | using ::android::hardware::hidl_memory; 39 | using ::android::hardware::hidl_string; 40 | using ::android::hardware::hidl_vec; 41 | using ::android::hardware::Return; 42 | using ::android::hardware::Void; 43 | using ::android::sp; 44 | 45 | class BatchingAPIClient; 46 | struct GnssBatching : public IGnssBatching { 47 | GnssBatching(); 48 | ~GnssBatching(); 49 | 50 | // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. 51 | Return init(const sp& callback) override; 52 | Return getBatchSize() override; 53 | Return start(const IGnssBatching::Options& options ) override; 54 | Return flush() override; 55 | Return stop() override; 56 | Return cleanup() override; 57 | 58 | private: 59 | struct GnssBatchingDeathRecipient : hidl_death_recipient { 60 | GnssBatchingDeathRecipient(sp gnssBatching) : 61 | mGnssBatching(gnssBatching) { 62 | } 63 | ~GnssBatchingDeathRecipient() = default; 64 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 65 | sp mGnssBatching; 66 | }; 67 | 68 | private: 69 | sp mGnssBatchingDeathRecipient = nullptr; 70 | sp mGnssBatchingCbIface = nullptr; 71 | BatchingAPIClient* mApi = nullptr; 72 | }; 73 | 74 | } // namespace implementation 75 | } // namespace V1_0 76 | } // namespace gnss 77 | } // namespace hardware 78 | } // namespace android 79 | 80 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H 81 | -------------------------------------------------------------------------------- /gps/core/observer/IDataItemObserver.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, 2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __IDATAITEMOBSERVER_H__ 31 | #define __IDATAITEMOBSERVER_H__ 32 | 33 | #include 34 | #include 35 | 36 | using namespace std; 37 | 38 | namespace loc_core 39 | { 40 | class IDataItemCore; 41 | 42 | /** 43 | * @brief IDataItemObserver interface 44 | * @details IDataItemObserver interface; 45 | * In OS dependent code this type serves as a handle to an OS independent instance of this interface. 46 | */ 47 | class IDataItemObserver { 48 | 49 | public: 50 | 51 | /** 52 | * @brief Gets name of Data Item Observer 53 | * @details Gets name of Data Item Observer 54 | * 55 | * @param name reference to name of Data Item Observer 56 | */ 57 | virtual void getName (string & name) = 0; 58 | 59 | /** 60 | * @brief Notify updated values of Data Items 61 | * @details Notifys updated values of Data items 62 | * 63 | * @param dlist List of updated data items 64 | */ 65 | virtual void notify (const std :: list & dlist) = 0; 66 | 67 | /** 68 | * @brief Destructor 69 | * @details Destructor 70 | */ 71 | virtual ~IDataItemObserver () {} 72 | }; 73 | 74 | } // namespace loc_core 75 | 76 | #endif // #ifndef __IDATAITEMOBSERVER_H__ 77 | -------------------------------------------------------------------------------- /gps/core/data-items/IDataItemCore.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015, 2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __IDATAITEMCORE_H__ 31 | #define __IDATAITEMCORE_H__ 32 | 33 | #include 34 | #include 35 | 36 | namespace loc_core { 37 | 38 | using namespace std; 39 | 40 | /** 41 | * @brief IDataItemCore interface. 42 | * @details IDataItemCore interface. 43 | * 44 | */ 45 | class IDataItemCore { 46 | public: 47 | /** 48 | * @brief Gets Data item id. 49 | * @details Gets Data item id. 50 | * @return Data item id. 51 | */ 52 | virtual DataItemId getId () = 0; 53 | 54 | /** 55 | * @brief Stringify. 56 | * @details Stringify. 57 | * 58 | * @param valueStr Reference to string. 59 | */ 60 | virtual void stringify (string & valueStr) = 0; 61 | 62 | /** 63 | * @brief copy. 64 | * @details copy. 65 | * 66 | * @param src Where to copy from. 67 | * @param dataItemCopied Boolean flag indicated whether or not copied. 68 | * 69 | * @return Zero for success or non zero for failure. 70 | */ 71 | virtual int32_t copy (IDataItemCore * src, bool *dataItemCopied = nullptr) = 0; 72 | 73 | /** 74 | * @brief Destructor. 75 | * @details Destructor. 76 | */ 77 | virtual ~IDataItemCore () {} 78 | }; 79 | 80 | } // namespace loc_core 81 | 82 | #endif // __IDATAITEMCORE_H__ 83 | -------------------------------------------------------------------------------- /rootdir/init.qcom.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | 3 | # Copyright (c) 2009-2016, 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 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 copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | # Remove recovery cache from persist 31 | rm -rf /mnt/vendor/persist/cache/recovery 32 | 33 | # 34 | # Make modem config folder and copy firmware config to that folder for RIL 35 | # 36 | if [ -f /data/vendor/modem_config/ver_info.txt ]; then 37 | prev_version_info=`cat /data/vendor/modem_config/ver_info.txt` 38 | else 39 | prev_version_info="" 40 | fi 41 | 42 | cur_version_info=`cat /vendor/firmware_mnt/verinfo/ver_info.txt` 43 | if [ ! -f /vendor/firmware_mnt/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then 44 | # add W for group recursively before delete 45 | chmod g+w -R /data/vendor/modem_config/* 46 | rm -rf /data/vendor/modem_config/* 47 | # preserve the read only mode for all subdir and files 48 | cp --preserve=m -dr /vendor/firmware_mnt/image/modem_pr/mcfg/configs/* /data/vendor/modem_config 49 | cp --preserve=m -d /vendor/firmware_mnt/verinfo/ver_info.txt /data/vendor/modem_config/ 50 | cp --preserve=m -d /vendor/firmware_mnt/image/modem_pr/mbn_ota.txt /data/vendor/modem_config/ 51 | # the group must be root, otherwise this script could not add "W" for group recursively 52 | chown -hR radio.root /data/vendor/modem_config/* 53 | fi 54 | chmod g-w /data/vendor/modem_config 55 | setprop ro.vendor.ril.mbn_copy_completed 1 56 | -------------------------------------------------------------------------------- /gps/core/data-items/DataItemId.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __DATAITEMID_H__ 31 | #define __DATAITEMID_H__ 32 | 33 | /** 34 | * Enumeration of Data Item types 35 | * When add/remove/update changes are made to Data Items, this file needs to be updated 36 | * accordingly 37 | */ 38 | typedef enum e_DataItemId { 39 | INVALID_DATA_ITEM_ID = -1, 40 | // 0 - 4 41 | AIRPLANEMODE_DATA_ITEM_ID, 42 | ENH_DATA_ITEM_ID, 43 | GPSSTATE_DATA_ITEM_ID, 44 | NLPSTATUS_DATA_ITEM_ID, 45 | WIFIHARDWARESTATE_DATA_ITEM_ID, 46 | // 5 - 9 47 | NETWORKINFO_DATA_ITEM_ID, 48 | RILVERSION_DATA_ITEM_ID, 49 | RILSERVICEINFO_DATA_ITEM_ID, 50 | RILCELLINFO_DATA_ITEM_ID, 51 | SERVICESTATUS_DATA_ITEM_ID, 52 | // 10 - 14 53 | MODEL_DATA_ITEM_ID, 54 | MANUFACTURER_DATA_ITEM_ID, 55 | VOICECALL_DATA_ITEM, 56 | ASSISTED_GPS_DATA_ITEM_ID, 57 | SCREEN_STATE_DATA_ITEM_ID, 58 | // 15 - 19 59 | POWER_CONNECTED_STATE_DATA_ITEM_ID, 60 | TIMEZONE_CHANGE_DATA_ITEM_ID, 61 | TIME_CHANGE_DATA_ITEM_ID, 62 | WIFI_SUPPLICANT_STATUS_DATA_ITEM_ID, 63 | SHUTDOWN_STATE_DATA_ITEM_ID, 64 | // 20 - 24 65 | TAC_DATA_ITEM_ID, 66 | MCCMNC_DATA_ITEM_ID, 67 | BTLE_SCAN_DATA_ITEM_ID, 68 | BT_SCAN_DATA_ITEM_ID, 69 | OEM_GTP_UPLOAD_TRIGGER_READY_ITEM_ID, 70 | 71 | MAX_DATA_ITEM_ID, 72 | 73 | // 26 - 74 | BATTERY_LEVEL_DATA_ITEM_ID, 75 | 76 | MAX_DATA_ITEM_ID_1_1, 77 | } DataItemId; 78 | 79 | #endif // #ifndef __DATAITEMID_H__ 80 | -------------------------------------------------------------------------------- /gps/utils/LocSharedLock.h: -------------------------------------------------------------------------------- 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 | */ 29 | #ifndef __LOC_SHARED_LOCK__ 30 | #define __LOC_SHARED_LOCK__ 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | // This is a utility created for use cases such that there are more than 37 | // one client who need to share the same lock, but it is not predictable 38 | // which of these clients is to last to go away. This shared lock deletes 39 | // itself when the last client calls its drop() method. To add a cient, 40 | // this share lock's share() method has to be called, so that the obj 41 | // can maintain an accurate client count. 42 | class LocSharedLock { 43 | volatile int32_t mRef; 44 | pthread_mutex_t mMutex; 45 | inline ~LocSharedLock() { pthread_mutex_destroy(&mMutex); } 46 | public: 47 | // first client to create this LockSharedLock 48 | inline LocSharedLock() : mRef(1) { pthread_mutex_init(&mMutex, NULL); } 49 | // following client(s) are to *share()* this lock created by the first client 50 | inline LocSharedLock* share() { android_atomic_inc(&mRef); return this; } 51 | // whe a client no longer needs this shared lock, drop() shall be called. 52 | inline void drop() { if (1 == android_atomic_dec(&mRef)) delete this; } 53 | // locking the lock to enter critical section 54 | inline void lock() { pthread_mutex_lock(&mMutex); } 55 | // unlocking the lock to leave the critical section 56 | inline void unlock() { pthread_mutex_unlock(&mMutex); } 57 | }; 58 | 59 | #endif //__LOC_SHARED_LOCK__ 60 | -------------------------------------------------------------------------------- /sepolicy/vendor/priv_app.te: -------------------------------------------------------------------------------- 1 | allow priv_app device:chr_file ioctl; 2 | allow priv_app bluetooth_prop:file read; 3 | allow priv_app bootloader_boot_reason_prop:file read; 4 | allow priv_app boottime_prop:file read; 5 | allow priv_app cnd_vendor_prop:file read; 6 | allow priv_app adsprpcd_file:filesystem getattr; 7 | allow priv_app ctl_bootanim_prop:file read; 8 | allow priv_app ctl_bugreport_prop:file read; 9 | allow priv_app ctl_console_prop:file read; 10 | allow priv_app ctl_default_prop:file read; 11 | allow priv_app ctl_dumpstate_prop:file read; 12 | allow priv_app ctl_fuse_prop:file read; 13 | allow priv_app ctl_interface_restart_prop:file read; 14 | allow priv_app default_prop:property_service set; 15 | allow priv_app device:dir { open read }; 16 | allow priv_app firmware_file:filesystem getattr; 17 | allow priv_app device:dir open; 18 | allow priv_app proc:file { getattr open }; 19 | allow priv_app proc_interrupts:file open; 20 | allow priv_app proc_interrupts:file read; 21 | allow priv_app proc_modules:file { getattr open }; 22 | allow priv_app ctl_interface_start_prop:file { read }; 23 | allow priv_app ctl_interface_stop_prop:file { read }; 24 | allow priv_app ctl_mdnsd_prop:file { read }; 25 | allow priv_app ctl_qcrild_prop:file { read }; 26 | allow priv_app ctl_restart_prop:file { read }; 27 | allow priv_app ctl_rildaemon_prop:file { read }; 28 | allow priv_app ctl_sigstop_prop:file { read }; 29 | allow priv_app ctl_start_prop:file { read }; 30 | allow priv_app ctl_stop_prop:file { read }; 31 | allow priv_app ctl_vendor_hbtp_prop:file { read }; 32 | allow priv_app ctl_vendor_imsrcsservice_prop:file { read }; 33 | allow priv_app ctl_vendor_mmid_prop:file { read }; 34 | allow priv_app msm_irqbalance_prop:file { read }; 35 | allow priv_app spcomlib_prop:file { read }; 36 | allow priv_app system_boot_reason_prop:file { read }; 37 | allow priv_app firmware_file:dir { search }; 38 | allow priv_app ctl_vendor_rmt_storage_prop:file { read }; 39 | allow priv_app ctl_vendor_wigigsvc_prop:file { read }; 40 | allow priv_app mnt_vendor_file:dir { search }; 41 | allow priv_app sysfs:file { open read }; 42 | allow priv_app sysfs:dir open; 43 | allow priv_app sysfs_loop:file { open read }; 44 | allow priv_app proc_interrupts:file { open }; 45 | allow priv_app firmware_file:file { getattr }; 46 | allow priv_app firmware_file:file { read }; 47 | allow priv_app firmware_file:file { open }; 48 | allow priv_app sysfs_android_usb:file open; 49 | allow priv_app mnt_vendor_file:dir search; 50 | allow priv_app sysfs_kgsl:file { open read }; 51 | allow priv_app vendor_file:file { getattr open read }; 52 | allow priv_app privapp_data_file:file { read }; 53 | allow priv_app rootfs:file { read }; 54 | allow priv_app privapp_data_file:fifo_file { create }; 55 | allow priv_app rootfs:file { execute }; 56 | allow priv_app privapp_data_file:file { execute_no_trans }; 57 | allow priv_app sensors_panel_prop:file { read }; 58 | allow priv_app sysfs_graphics:file { read }; 59 | allow priv_app system_file:file { read }; 60 | allow priv_app system_file:file { getattr }; 61 | allow priv_app system_bootstrap_lib_file:dir { getattr }; 62 | allow priv_app sensors_panel_prop:file { open }; 63 | allow priv_app sysfs_graphics:file { open }; 64 | -------------------------------------------------------------------------------- /gps/android/AGnssRil.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_AGNSSRIL_H_ 22 | #define ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IAGnssRil; 35 | using ::android::hardware::gnss::V1_0::IAGnssRilCallback; 36 | using ::android::hardware::Return; 37 | using ::android::hardware::Void; 38 | using ::android::hardware::hidl_vec; 39 | using ::android::hardware::hidl_string; 40 | using ::android::sp; 41 | 42 | struct Gnss; 43 | /* 44 | * Extended interface for AGNSS RIL support. An Assisted GNSS Radio Interface Layer interface 45 | * allows the GNSS chipset to request radio interface layer information from Android platform. 46 | * Examples of such information are reference location, unique subscriber ID, phone number string 47 | * and network availability changes. Also contains wrapper methods to allow methods from 48 | * IAGnssiRilCallback interface to be passed into the conventional implementation of the GNSS HAL. 49 | */ 50 | struct AGnssRil : public IAGnssRil { 51 | AGnssRil(Gnss* gnss); 52 | ~AGnssRil(); 53 | 54 | /* 55 | * Methods from ::android::hardware::gnss::V1_0::IAGnssRil follow. 56 | * These declarations were generated from IAGnssRil.hal. 57 | */ 58 | Return setCallback(const sp& /*callback*/) override { 59 | return Void(); 60 | } 61 | Return setRefLocation(const IAGnssRil::AGnssRefLocation& /*agnssReflocation*/) override { 62 | return Void(); 63 | } 64 | Return setSetId(IAGnssRil::SetIDType /*type*/, const hidl_string& /*setid*/) override { 65 | return false; 66 | } 67 | Return updateNetworkAvailability(bool /*available*/, 68 | const hidl_string& /*apn*/) override { 69 | return false; 70 | } 71 | Return updateNetworkState(bool connected, NetworkType type, bool roaming) override; 72 | 73 | private: 74 | Gnss* mGnss = nullptr; 75 | }; 76 | 77 | } // namespace implementation 78 | } // namespace V1_0 79 | } // namespace gnss 80 | } // namespace hardware 81 | } // namespace android 82 | 83 | #endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSSRIL_H_ 84 | -------------------------------------------------------------------------------- /rootdir/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | # Init scripts 4 | 5 | include $(CLEAR_VARS) 6 | LOCAL_MODULE := fstab.qcom 7 | LOCAL_MODULE_TAGS := optional 8 | LOCAL_MODULE_CLASS := ETC 9 | LOCAL_SRC_FILES := fstab.qcom 10 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) 11 | include $(BUILD_PREBUILT) 12 | 13 | include $(CLEAR_VARS) 14 | LOCAL_MODULE := init.msm.usb.configfs.rc 15 | LOCAL_MODULE_TAGS := optional 16 | LOCAL_MODULE_CLASS := ETC 17 | LOCAL_SRC_FILES := init.msm.usb.configfs.rc 18 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 19 | include $(BUILD_PREBUILT) 20 | 21 | include $(CLEAR_VARS) 22 | LOCAL_MODULE := init.qcom.rc 23 | LOCAL_MODULE_TAGS := optional 24 | LOCAL_MODULE_CLASS := ETC 25 | LOCAL_SRC_FILES := init.qcom.rc 26 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 27 | include $(BUILD_PREBUILT) 28 | 29 | include $(CLEAR_VARS) 30 | LOCAL_MODULE := init.qcom.sh 31 | LOCAL_MODULE_TAGS := optional 32 | LOCAL_MODULE_CLASS := ETC 33 | LOCAL_SRC_FILES := init.qcom.sh 34 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 35 | include $(BUILD_PREBUILT) 36 | 37 | include $(CLEAR_VARS) 38 | LOCAL_MODULE := init.target.rc 39 | LOCAL_MODULE_TAGS := optional 40 | LOCAL_MODULE_CLASS := ETC 41 | LOCAL_SRC_FILES := init.target.rc 42 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 43 | include $(BUILD_PREBUILT) 44 | 45 | 46 | include $(CLEAR_VARS) 47 | LOCAL_MODULE := init.qcom.usb.rc 48 | LOCAL_MODULE_TAGS := optional 49 | LOCAL_MODULE_CLASS := ETC 50 | LOCAL_SRC_FILES := init.qcom.usb.rc 51 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 52 | include $(BUILD_PREBUILT) 53 | 54 | include $(CLEAR_VARS) 55 | LOCAL_MODULE := ueventd.qcom.rc 56 | LOCAL_MODULE_STEM := ueventd.rc 57 | LOCAL_MODULE_TAGS := optional 58 | LOCAL_MODULE_CLASS := ETC 59 | LOCAL_SRC_FILES := ueventd.qcom.rc 60 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR) 61 | include $(BUILD_PREBUILT) 62 | 63 | # Configuration scripts 64 | 65 | include $(CLEAR_VARS) 66 | LOCAL_MODULE := init.qcom.post_boot.sh 67 | LOCAL_MODULE_TAGS := optional 68 | LOCAL_MODULE_CLASS := ETC 69 | LOCAL_SRC_FILES := etc/init.qcom.post_boot.sh 70 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 71 | include $(BUILD_PREBUILT) 72 | 73 | include $(CLEAR_VARS) 74 | LOCAL_MODULE := move_time_data.sh 75 | LOCAL_MODULE_TAGS := optional 76 | LOCAL_MODULE_CLASS := ETC 77 | LOCAL_SRC_FILES := etc/move_time_data.sh 78 | LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES) 79 | include $(BUILD_PREBUILT) 80 | 81 | include $(CLEAR_VARS) 82 | LOCAL_MODULE := move_wifi_data.sh 83 | LOCAL_MODULE_TAGS := optional 84 | LOCAL_MODULE_CLASS := ETC 85 | LOCAL_SRC_FILES := etc/move_wifi_data.sh 86 | LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES) 87 | include $(BUILD_PREBUILT) 88 | 89 | # Offmode charging 90 | include $(CLEAR_VARS) 91 | LOCAL_MODULE := chargeonlymode 92 | LOCAL_MODULE_OWNER := xiaomi 93 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) 94 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) 95 | LOCAL_SRC_FILES := sbin/chargeonlymode 96 | LOCAL_MODULE_TAGS := optional 97 | LOCAL_MODULE_CLASS := EXECUTABLES 98 | include $(BUILD_PREBUILT) 99 | -------------------------------------------------------------------------------- /audio/audio_tuning_mixer.txt: -------------------------------------------------------------------------------- 1 | #ANC_TEST_P_PATH_MIC_STEREO Capture 2 | acdb_dev_id:85 3 | !Capture 4 | Txdevice:0 5 | 6 | enable 7 | TX7 HPF Switch:0 8 | TX8 HPF Switch:0 9 | AIF1_CAP Mixer SLIM TX7:1 10 | AIF1_CAP Mixer SLIM TX8:1 11 | SLIM TX7 MUX:DEC9 12 | DEC9 MUX:DMIC4 13 | SLIM TX8 MUX:DEC10 14 | DEC10 MUX:DMIC3 15 | SLIM_0_TX Channels:Two 16 | MultiMedia1 Mixer SLIM_0_TX:1 17 | 18 | disable 19 | MultiMedia1 Mixer SLIM_0_TX:0 20 | AIF1_CAP Mixer SLIM TX7:0 21 | AIF1_CAP Mixer SLIM TX8:0 22 | SLIM TX7 MUX:ZERO 23 | SLIM TX8 MUX:ZERO 24 | DEC10 MUX:ZERO 25 | DEC9 MUX:ZERO 26 | TX7 HPF Switch:0 27 | TX8 HPF Switch:0 28 | 29 | #ANC_TEST_S_PATH_MIC_STEREO Capture 30 | acdb_dev_id:88 31 | !Capture 32 | Txdevice:0 33 | 34 | enable 35 | TX7 HPF Switch:0 36 | TX8 HPF Switch:0 37 | AIF1_CAP Mixer SLIM TX7:1 38 | AIF1_CAP Mixer SLIM TX8:1 39 | SLIM TX7 MUX:DEC8 40 | DEC7 MUX:ANC2_FB 41 | ANC2 MUX:DMIC3 42 | SLIM TX8 MUX:DEC7 43 | DEC8 MUX:ANC1_FB 44 | ANC1 MUX:DMIC3 45 | ANC1 FB MUX:EAR_HPH_L 46 | SLIM_0_TX Channels:Two 47 | MultiMedia1 Mixer SLIM_0_TX:1 48 | 49 | disable 50 | MultiMedia1 Mixer SLIM_0_TX:0 51 | AIF1_CAP Mixer SLIM TX7:0 52 | AIF1_CAP Mixer SLIM TX8:0 53 | SLIM TX7 MUX:ZERO 54 | SLIM TX8 MUX:ZERO 55 | DEC7 MUX:ZERO 56 | ANC2 MUX:ZERO 57 | ANC1 MUX:ZERO 58 | DEC8 MUX:ZERO 59 | ANC1 FB MUX:ZERO 60 | TX7 HPF Switch:0 61 | TX8 HPF Switch:0 62 | 63 | #ANC_TEST_E_PATH_MIC_STEREO Capture 64 | acdb_dev_id:91 65 | !Capture 66 | Txdevice:0 67 | 68 | enable 69 | TX7 HPF Switch:0 70 | TX8 HPF Switch:0 71 | AIF1_CAP Mixer SLIM TX7:1 72 | AIF1_CAP Mixer SLIM TX8:1 73 | SLIM TX7 MUX:DEC8 74 | DEC7 MUX:ANC2_FB 75 | ANC2 MUX:DMIC4 76 | ANC1 MUX:DMIC4 77 | SLIM TX8 MUX:DEC7 78 | DEC8 MUX:ANC1_FB 79 | ANC1 FB MUX:EAR_HPH_L 80 | SLIM_0_TX Channels:Two 81 | MultiMedia1 Mixer SLIM_0_TX:1 82 | 83 | disable 84 | MultiMedia1 Mixer SLIM_0_TX:0 85 | AIF1_CAP Mixer SLIM TX7:0 86 | AIF1_CAP Mixer SLIM TX8:0 87 | SLIM TX7 MUX:ZERO 88 | SLIM TX8 MUX:ZERO 89 | DEC7 MUX:ZERO 90 | ANC2 MUX:ZERO 91 | DEC10 MUX:ZERO 92 | ANC1 FB MUX:ZERO 93 | TX7 HPF Switch:0 94 | TX8 HPF Switch:0 95 | 96 | #ANC_TEST_S_PATH_HANDSET_SPKR_ANC_MONO 97 | acdb_dev_id:86 98 | !Playback 99 | Rxdevice:0 100 | 101 | enable 102 | ANC Function:ON 103 | SLIM RX1 MUX:AIF1_PB 104 | SLIM_0_RX Channels:One 105 | RX1 MIX1 INP1:RX1 106 | CLASS_H_DSM MUX:DSM_HPHL_RX1 107 | RX1 Digital Volume:87 108 | DAC1 Switch:1 109 | ANC Slot:7 110 | SLIMBUS_0_RX Audio Mixer MultiMedia1:1 111 | 112 | disable 113 | SLIMBUS_0_RX Audio Mixer MultiMedia1:0 114 | ANC Slot:0 115 | SLIM RX1 MUX:ZERO 116 | RX1 MIX1 INP1:ZERO 117 | RX1 Digital Volume:0 118 | DAC1 Switch:0 119 | ANC Function:OFF 120 | 121 | #ANC_TEST_E_PATH_HANDSET_SPKR_ANC_MONO 122 | acdb_dev_id:89 123 | !Playback 124 | Rxdevice:0 125 | 126 | enable 127 | ANC Function:ON 128 | SLIM RX1 MUX:AIF1_PB 129 | SLIM_0_RX Channels:One 130 | RX1 MIX1 INP1:RX1 131 | CLASS_H_DSM MUX:DSM_HPHL_RX1 132 | RX1 Digital Volume:87 133 | DAC1 Switch:1 134 | ANC Slot:8 135 | SLIMBUS_0_RX Audio Mixer MultiMedia1:1 136 | 137 | disable 138 | SLIMBUS_0_RX Audio Mixer MultiMedia1:0 139 | ANC Slot:0 140 | SLIM RX1 MUX:ZERO 141 | RX1 MIX1 INP1:ZERO 142 | RX1 Digital Volume:0 143 | DAC1 Switch:0 144 | ANC Function:OFF 145 | -------------------------------------------------------------------------------- /gps/android/location_api/BatchingAPIClient.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef BATCHING_API_CLINET_H 31 | #define BATCHING_API_CLINET_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | namespace android { 40 | namespace hardware { 41 | namespace gnss { 42 | namespace V1_0 { 43 | namespace implementation { 44 | 45 | class BatchingAPIClient : public LocationAPIClientBase 46 | { 47 | public: 48 | BatchingAPIClient(const sp& callback); 49 | ~BatchingAPIClient(); 50 | int getBatchSize(); 51 | int startSession(const V1_0::IGnssBatching::Options& options); 52 | int updateSessionOptions(const V1_0::IGnssBatching::Options& options); 53 | int stopSession(); 54 | void getBatchedLocation(int last_n_locations); 55 | void flushBatchedLocations(); 56 | 57 | inline LocationCapabilitiesMask getCapabilities() { return mLocationCapabilitiesMask; } 58 | 59 | // callbacks 60 | void onCapabilitiesCb(LocationCapabilitiesMask capabilitiesMask) final; 61 | void onBatchingCb(size_t count, Location* location, BatchingOptions batchOptions) final; 62 | 63 | private: 64 | sp mGnssBatchingCbIface; 65 | uint32_t mDefaultId; 66 | LocationCapabilitiesMask mLocationCapabilitiesMask; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V1_0 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | #endif // BATCHING_API_CLINET_H 75 | -------------------------------------------------------------------------------- /gps/core/LBSProxyBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef IZAT_PROXY_BASE_H 30 | #define IZAT_PROXY_BASE_H 31 | #include 32 | #include 33 | 34 | namespace loc_core { 35 | 36 | class LocApiBase; 37 | class LocAdapterBase; 38 | class ContextBase; 39 | 40 | class LBSProxyBase { 41 | friend class ContextBase; 42 | inline virtual LocApiBase* 43 | getLocApi(const MsgTask* msgTask, 44 | LOC_API_ADAPTER_EVENT_MASK_T exMask, 45 | ContextBase* context) const { 46 | 47 | (void)msgTask; 48 | (void)exMask; 49 | (void)context; 50 | return NULL; 51 | } 52 | protected: 53 | inline LBSProxyBase() {} 54 | public: 55 | inline virtual ~LBSProxyBase() {} 56 | inline virtual void requestUlp(LocAdapterBase* adapter, 57 | unsigned long capabilities) const { 58 | 59 | (void)adapter; 60 | (void)capabilities; 61 | } 62 | inline virtual bool hasAgpsExtendedCapabilities() const { return false; } 63 | inline virtual bool hasCPIExtendedCapabilities() const { return false; } 64 | inline virtual void modemPowerVote(bool power) const { 65 | 66 | (void)power; 67 | } 68 | virtual void injectFeatureConfig(ContextBase* context) const { 69 | 70 | (void)context; 71 | } 72 | inline virtual bool hasNativeXtraClient() const { return false; } 73 | inline virtual IzatDevId_t getIzatDevId() const { return 0; } 74 | }; 75 | 76 | typedef LBSProxyBase* (getLBSProxy_t)(); 77 | 78 | } // namespace loc_core 79 | 80 | #endif // IZAT_PROXY_BASE_H 81 | -------------------------------------------------------------------------------- /gps/android/location_api/MeasurementAPIClient.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef MEASUREMENT_API_CLINET_H 31 | #define MEASUREMENT_API_CLINET_H 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | namespace android { 40 | namespace hardware { 41 | namespace gnss { 42 | namespace V1_0 { 43 | namespace implementation { 44 | 45 | using ::android::sp; 46 | 47 | class MeasurementAPIClient : public LocationAPIClientBase 48 | { 49 | public: 50 | MeasurementAPIClient(); 51 | virtual ~MeasurementAPIClient(); 52 | MeasurementAPIClient(const MeasurementAPIClient&) = delete; 53 | MeasurementAPIClient& operator=(const MeasurementAPIClient&) = delete; 54 | 55 | // for GpsMeasurementInterface 56 | Return measurementSetCallback( 57 | const sp& callback); 58 | void measurementClose(); 59 | Return startTracking(); 60 | 61 | // callbacks we are interested in 62 | void onGnssMeasurementsCb(GnssMeasurementsNotification gnssMeasurementsNotification) final; 63 | 64 | private: 65 | std::mutex mMutex; 66 | sp mGnssMeasurementCbIface; 67 | 68 | bool mTracking; 69 | }; 70 | 71 | } // namespace implementation 72 | } // namespace V1_0 73 | } // namespace gnss 74 | } // namespace hardware 75 | } // namespace android 76 | #endif // MEASUREMENT_API_CLINET_H 77 | -------------------------------------------------------------------------------- /gps/android/AGnssRil.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "LocSvc__AGnssRilInterface" 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include "Gnss.h" 31 | #include "AGnssRil.h" 32 | #include 33 | 34 | typedef void* (getLocationInterface)(); 35 | 36 | namespace android { 37 | namespace hardware { 38 | namespace gnss { 39 | namespace V1_0 { 40 | namespace implementation { 41 | 42 | 43 | AGnssRil::AGnssRil(Gnss* gnss) : mGnss(gnss) { 44 | ENTRY_LOG_CALLFLOW(); 45 | } 46 | 47 | AGnssRil::~AGnssRil() { 48 | ENTRY_LOG_CALLFLOW(); 49 | } 50 | 51 | Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool /*roaming*/) { 52 | ENTRY_LOG_CALLFLOW(); 53 | 54 | // for XTRA 55 | if (nullptr != mGnss && ( nullptr != mGnss->getGnssInterface() )) { 56 | int8_t typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; 57 | switch(type) 58 | { 59 | case IAGnssRil::NetworkType::MOBILE: 60 | typeout = loc_core::NetworkInfoDataItemBase::TYPE_MOBILE; 61 | break; 62 | case IAGnssRil::NetworkType::WIFI: 63 | typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIFI; 64 | break; 65 | case IAGnssRil::NetworkType::MMS: 66 | typeout = loc_core::NetworkInfoDataItemBase::TYPE_MMS; 67 | break; 68 | case IAGnssRil::NetworkType::SUPL: 69 | typeout = loc_core::NetworkInfoDataItemBase::TYPE_SUPL; 70 | break; 71 | case IAGnssRil::NetworkType::DUN: 72 | typeout = loc_core::NetworkInfoDataItemBase::TYPE_DUN; 73 | break; 74 | case IAGnssRil::NetworkType::HIPRI: 75 | typeout = loc_core::NetworkInfoDataItemBase::TYPE_HIPRI; 76 | break; 77 | case IAGnssRil::NetworkType::WIMAX: 78 | typeout = loc_core::NetworkInfoDataItemBase::TYPE_WIMAX; 79 | break; 80 | default: 81 | typeout = loc_core::NetworkInfoDataItemBase::TYPE_UNKNOWN; 82 | break; 83 | } 84 | mGnss->getGnssInterface()->updateConnectionStatus(connected, typeout); 85 | } 86 | return true; 87 | } 88 | 89 | } // namespace implementation 90 | } // namespace V1_0 91 | } // namespace gnss 92 | } // namespace hardware 93 | } // namespace android 94 | -------------------------------------------------------------------------------- /sepolicy/vendor/init.te: -------------------------------------------------------------------------------- 1 | # adsprpcd 2 | allow init adsprpcd_file:filesystem { mount relabelfrom relabelto }; 3 | 4 | # leds 5 | allow init sysfs_leds:lnk_file read; 6 | 7 | # offmode charging daemon 8 | allow init rootfs:file mounton; 9 | 10 | allow init self:capability2 block_suspend; 11 | allow init socket_device:sock_file { create setattr unlink }; 12 | allow init sysfs:file { open read write }; 13 | allow init self:netlink_route_socket read; 14 | allow init self:socket write; 15 | allow init self:tcp_socket { bind create setopt }; 16 | allow init self:udp_socket ioctl; 17 | allow init sysfs:file { open write }; 18 | allow init tmpfs:lnk_file create; 19 | allow init vendor_toolbox_exec:file execute_no_trans; 20 | allow init vfat:file { open read }; 21 | allow init cgroup:file create; 22 | 23 | allow init fsck:process noatsecure; 24 | allow init hal_gatekeeper_qti:process noatsecure; 25 | allow init hal_keymaster_qti:process noatsecure; 26 | allow init hal_wifi_supplicant_default:process noatsecure; 27 | allow init sysfs:dir write; 28 | allow init system_file:file execute_no_trans; 29 | allow init ueventd:process noatsecure; 30 | allow init vendor_init:process noatsecure; 31 | allow init proc:file setattr; 32 | allow init hwservicemanager:process noatsecure; 33 | allow init servicemanager:process noatsecure; 34 | allow init sysfs:dir add_name; 35 | allow init vdc:process noatsecure; 36 | allow init vndservicemanager:process noatsecure; 37 | allow init vold:process noatsecure; 38 | 39 | allow init bootanim:process noatsecure; 40 | allow init bootstat:process noatsecure; 41 | allow init gatekeeperd:process noatsecure; 42 | allow init hal_audio_default:process noatsecure; 43 | allow init hal_fingerprint_default:process noatsecure; 44 | allow init hal_imsrtp:process noatsecure; 45 | allow init ims:process noatsecure; 46 | allow init init_fingerprint:process noatsecure; 47 | allow init kernel:system module_request; 48 | allow init logd:process noatsecure; 49 | allow init netd:process noatsecure; 50 | allow init rild:process noatsecure; 51 | allow init sysfs:file setattr; 52 | allow init tombstoned:process noatsecure; 53 | allow init tzdatacheck:process noatsecure; 54 | allow init usbd:process noatsecure; 55 | allow init zygote:process noatsecure; 56 | allow init adbd:process { noatsecure }; 57 | allow init vendor_file:file mounton; 58 | allow init sysfs_battery_supply:file setattr; 59 | allow init proc_boot_reason:file r_file_perms; 60 | allow init proc_touchpanel:file { open write }; 61 | allow init same_process_hal_file:file execute; 62 | allow init hal_keymaster_hwservice:hwservice_manager add; 63 | allow init hal_power_stats_hwservice:hwservice_manager add; 64 | allow init hidl_base_hwservice:hwservice_manager add; 65 | allow init hwservicemanager:binder { call transfer }; 66 | allow init persist_file:lnk_file read; 67 | allow init sysfs_leds:lnk_file read; 68 | allow init system_file:file { execute_no_trans mounton }; 69 | allow init vendor_file:file { execute execute_no_trans }; 70 | allow init hal_perf_default:binder call; 71 | allow init sysfs:file setattr; 72 | allow init hal_power_stats_hwservice:hwservice_manager add; 73 | allow init hal_power_hwservice:hwservice_manager { add }; 74 | allow init firmware_file:filesystem getattr; 75 | allow init nativetest_data_file:dir search; 76 | allow init firmware_file:filesystem { getattr }; 77 | allow init system_file:file { mounton }; 78 | -------------------------------------------------------------------------------- /gps/utils/loc_target.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef LOC_TARGET_H 30 | #define LOC_TARGET_H 31 | #define TARGET_SET(gnss,ssc) ( (gnss<<1)|ssc ) 32 | #define TARGET_DEFAULT TARGET_SET(GNSS_MSM, HAS_SSC) 33 | #define TARGET_MDM TARGET_SET(GNSS_MDM, HAS_SSC) 34 | #define TARGET_APQ_SA TARGET_SET(GNSS_GSS, NO_SSC) 35 | #define TARGET_NO_GNSS TARGET_SET(GNSS_NONE, NO_SSC) 36 | #define TARGET_MSM_NO_SSC TARGET_SET(GNSS_MSM, NO_SSC) 37 | #define TARGET_AUTO TARGET_SET(GNSS_AUTO, NO_SSC) 38 | #define TARGET_UNKNOWN TARGET_SET(GNSS_UNKNOWN, NO_SSC) 39 | #define getTargetGnssType(target) (target>>1) 40 | 41 | #ifdef __cplusplus 42 | extern "C" 43 | { 44 | #endif 45 | 46 | unsigned int loc_get_target(void); 47 | 48 | /*The character array passed to this function should have length 49 | of atleast PROPERTY_VALUE_MAX*/ 50 | void loc_get_target_baseband(char *baseband, int array_length); 51 | /*The character array passed to this function should have length 52 | of atleast PROPERTY_VALUE_MAX*/ 53 | void loc_get_platform_name(char *platform_name, int array_length); 54 | /*The character array passed to this function should have length 55 | of atleast PROPERTY_VALUE_MAX*/ 56 | void loc_get_auto_platform_name(char *platform_name, int array_length); 57 | 58 | /* Please remember to update 'target_name' in loc_log.cpp, 59 | if do any changes to this enum. */ 60 | typedef enum { 61 | GNSS_NONE = 0, 62 | GNSS_MSM, 63 | GNSS_GSS, 64 | GNSS_MDM, 65 | GNSS_AUTO, 66 | GNSS_UNKNOWN 67 | }GNSS_TARGET; 68 | 69 | typedef enum { 70 | NO_SSC = 0, 71 | HAS_SSC 72 | }SSC_TYPE; 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /*LOC_TARGET_H*/ 79 | -------------------------------------------------------------------------------- /gps/core/LocAdapterProxyBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2014, 2016-2017 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOC_ADAPTER_PROXY_BASE_H 31 | #define LOC_ADAPTER_PROXY_BASE_H 32 | 33 | #include 34 | #include 35 | 36 | namespace loc_core { 37 | 38 | class LocAdapterProxyBase { 39 | private: 40 | LocAdapterBase *mLocAdapterBase; 41 | protected: 42 | inline LocAdapterProxyBase(const LOC_API_ADAPTER_EVENT_MASK_T mask, 43 | ContextBase* context): 44 | mLocAdapterBase(new LocAdapterBase(mask, context, this)) { 45 | } 46 | inline virtual ~LocAdapterProxyBase() { 47 | delete mLocAdapterBase; 48 | } 49 | inline void updateEvtMask(LOC_API_ADAPTER_EVENT_MASK_T event, 50 | loc_registration_mask_status isEnabled) { 51 | mLocAdapterBase->updateEvtMask(event,isEnabled); 52 | } 53 | 54 | inline uint32_t generateSessionId() { 55 | return mLocAdapterBase->generateSessionId(); 56 | } 57 | public: 58 | inline ContextBase* getContext() const { 59 | return mLocAdapterBase->getContext(); 60 | } 61 | 62 | inline virtual void handleEngineUpEvent() {}; 63 | inline virtual void handleEngineDownEvent() {}; 64 | inline virtual void reportPositionEvent(UlpLocation &location, 65 | GpsLocationExtended &locationExtended, 66 | enum loc_sess_status status, 67 | LocPosTechMask loc_technology_mask) { 68 | 69 | (void)location; 70 | (void)locationExtended; 71 | (void)status; 72 | (void)loc_technology_mask; 73 | } 74 | }; 75 | 76 | } // namespace loc_core 77 | 78 | #endif //LOC_ADAPTER_PROXY_BASE_H 79 | -------------------------------------------------------------------------------- /gps/utils/loc_timer.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013,2015 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef __LOC_DELAY_H__ 31 | #define __LOC_DELAY_H__ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif /* __cplusplus */ 36 | #include 37 | #include 38 | #include 39 | /* 40 | user_data: client context pointer, passthrough. Originally received 41 | from calling client when loc_timer_start() is called. 42 | result: 0 if timer successfully timed out; else timer failed. 43 | */ 44 | typedef void (*loc_timer_callback)(void *user_data, int32_t result); 45 | 46 | 47 | /* 48 | delay_msec: timeout value for the timer. 49 | cb_func: callback function pointer, implemented by client. 50 | Can not be NULL. 51 | user_data: client context pointer, passthrough. Will be 52 | returned when loc_timer_callback() is called. 53 | wakeOnExpire: true if to wake up CPU (if sleeping) upon timer 54 | expiration and notify the client. 55 | false if to wait until next time CPU wakes up (if 56 | sleeping) and then notify the client. 57 | Returns the handle, which can be used to stop the timer 58 | NULL, if timer start fails (e.g. if cb_func is NULL). 59 | */ 60 | void* loc_timer_start(uint64_t delay_msec, 61 | loc_timer_callback cb_func, 62 | void *user_data, 63 | bool wake_on_expire=false); 64 | 65 | /* 66 | handle becomes invalid upon the return of the callback 67 | */ 68 | void loc_timer_stop(void*& handle); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif /* __cplusplus */ 73 | 74 | #endif //__LOC_DELAY_H__ 75 | --------------------------------------------------------------------------------