├── Android.bp ├── gps ├── android │ ├── Android.mk │ ├── 1.0 │ │ ├── android.hardware.gnss@1.0-service-qti.rc │ │ ├── android.hardware.gnss@1.0-service-qti.xml │ │ ├── GnssDebug.h │ │ ├── GnssConfiguration.h │ │ ├── GnssNi.h │ │ ├── AGnss.h │ │ ├── GnssNi.cpp │ │ ├── location_api │ │ │ └── LocationUtil.h │ │ ├── service.cpp │ │ ├── GnssMeasurement.h │ │ └── GnssBatching.h │ ├── 1.1 │ │ ├── android.hardware.gnss@1.1-service-qti.rc │ │ ├── android.hardware.gnss@1.1-service-qti.xml │ │ ├── GnssDebug.h │ │ ├── GnssNi.h │ │ ├── AGnss.h │ │ ├── GnssNi.cpp │ │ ├── location_api │ │ │ └── LocationUtil.h │ │ ├── service.cpp │ │ └── GnssConfiguration.h │ ├── 2.0 │ │ ├── android.hardware.gnss@2.0-service-qti.rc │ │ ├── android.hardware.gnss@2.0-service-qti.xml │ │ ├── GnssDebug.h │ │ ├── GnssNi.h │ │ ├── AGnss.h │ │ ├── service.cpp │ │ └── GnssNi.cpp │ ├── 2.1 │ │ ├── android.hardware.gnss@2.1-service-qti.rc │ │ ├── android.hardware.gnss@2.1-service-qti.xml │ │ ├── GnssDebug.h │ │ ├── GnssNi.h │ │ ├── AGnss.h │ │ ├── service.cpp │ │ └── GnssNi.cpp │ └── utils │ │ ├── Android.bp │ │ └── battery_listener.h ├── etc │ ├── gps.conf │ ├── lowi.conf │ ├── seccomp_policy │ │ ├── gnss@2.0-xtwifi-inet-agent.policy │ │ ├── gnss@2.0-xtra-daemon.policy │ │ └── gnss@2.0-xtwifi-client.policy │ └── flp.conf ├── pla │ └── Android.bp ├── Makefile.am ├── gps_vendor_board.mk ├── core │ ├── loc-core.pc.in │ ├── Android.bp │ ├── data-items │ │ └── DataItemsFactoryProxy.h │ ├── Makefile.am │ ├── LocContext.h │ ├── loc_core_log.h │ └── LBSProxyBase.h ├── utils │ ├── gps-utils.pc.in │ ├── Android.bp │ ├── LocLoggerBase.h │ ├── Makefile.am │ └── MsgTask.h ├── location │ ├── location-api.pc.in │ ├── Android.bp │ └── Makefile.am ├── batching │ ├── location-batching.pc.in │ ├── Android.bp │ ├── Makefile.am │ └── configure.ac ├── geofence │ ├── location-geofence.pc.in │ ├── Android.bp │ ├── Makefile.am │ └── configure.ac ├── loc-hal.pc.in ├── gnss │ ├── Android.bp │ └── Makefile.am ├── Android.bp ├── Android.mk ├── gps_vendor_product.mk ├── CleanSpec.mk └── configure.ac ├── configs ├── perf │ ├── perf-profile0.conf │ └── msm_irqbalance.conf ├── thermal │ ├── thermal-engine.conf │ ├── thermal-engine-map.conf │ ├── thermal-engine-normal.conf │ └── thermal-engine-camera.conf ├── component-overrides.xml ├── media │ ├── media_codecs_vendor_audio.xml │ └── system_properties.xml └── input │ └── excluded-input-devices.xml ├── wifi ├── hostapd.deny ├── p2p_supplicant_overlay.conf ├── hostapd.accept └── wpa_supplicant_overlay.conf ├── shims ├── libwatermark_shim │ └── libwatermark_shim.c └── Android.bp ├── org.ifaa.android.manager ├── lib │ └── org │ │ └── ifaa │ │ └── android │ │ └── manager │ │ ├── IIFAAService.aidl │ │ ├── IFAAManagerV2.java │ │ ├── IFAAManagerFactory.java │ │ ├── IFAAManagerV3.java │ │ └── IFAAManager.java ├── src │ └── org │ │ └── ifaa │ │ └── android │ │ └── manager │ │ ├── IIFAAService.aidl │ │ └── IFAAService.java ├── AndroidManifest.xml └── Android.bp ├── rro_overlays ├── WifiOverlay │ ├── Android.bp │ └── AndroidManifest.xml └── TetheringOverlay │ ├── AndroidManifest.xml │ └── Android.bp ├── light ├── android.hardware.light@2.0-service.ginkgo.xml ├── android.hardware.light@2.0-service.ginkgo.rc ├── Android.bp ├── service.cpp └── Light.h ├── fingerprint ├── android.hardware.biometrics.fingerprint@2.1-service.ginkgo.xml ├── android.hardware.biometrics.fingerprint@2.1-service.ginkgo.rc ├── Android.bp └── service.cpp ├── keylayout ├── uinput-fpc.kl └── uinput-goodix.kl ├── seccomp └── mediacodec-seccomp.policy ├── idc ├── uinput-fpc.idc └── uinput-goodix.idc ├── manifest_willow.xml ├── system_ext.prop ├── aosp.dependencies ├── AndroidProducts.mk ├── setup-makefiles.sh ├── init └── Android.bp ├── overlay ├── frameworks │ └── base │ │ ├── packages │ │ ├── SettingsProvider │ │ │ └── res │ │ │ │ └── values │ │ │ │ └── defaults.xml │ │ └── SystemUI │ │ │ └── res │ │ │ ├── drawable │ │ │ └── rounded.xml │ │ │ └── values │ │ │ ├── dimens.xml │ │ │ └── config.xml │ │ └── core │ │ └── res │ │ └── res │ │ └── values │ │ └── dimens.xml └── packages │ ├── apps │ ├── Aperture │ │ └── app │ │ │ └── src │ │ │ └── main │ │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ └── Settings │ │ └── res │ │ └── values │ │ └── config.xml │ └── services │ └── Telephony │ └── res │ ├── xml │ └── telephony_injection.xml │ └── values │ └── config.xml ├── releasetools.py ├── rootdir └── bin │ └── init.qti.dcvs.sh ├── aosp_ginkgo.mk ├── system.prop ├── update-sha1sums.py ├── framework_manifest.xml └── extract-files.sh /Android.bp: -------------------------------------------------------------------------------- 1 | soong_namespace { 2 | } 3 | -------------------------------------------------------------------------------- /gps/android/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(call all-subdir-makefiles) 3 | -------------------------------------------------------------------------------- /configs/perf/perf-profile0.conf: -------------------------------------------------------------------------------- 1 | [priority] # This profile is reserved for perflock requests 2 | 99 3 | -------------------------------------------------------------------------------- /gps/etc/gps.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PixelExperience-Devices/device_xiaomi_ginkgo/HEAD/gps/etc/gps.conf -------------------------------------------------------------------------------- /wifi/hostapd.deny: -------------------------------------------------------------------------------- 1 | # List of MAC addresses that are not allowed to authenticate (IEEE 802.11) 2 | # with the AP. 3 | -------------------------------------------------------------------------------- /configs/thermal/thermal-engine.conf: -------------------------------------------------------------------------------- 1 | # File empty by default. 2 | # Replace contents of this file with custom configuration. 3 | -------------------------------------------------------------------------------- /shims/libwatermark_shim/libwatermark_shim.c: -------------------------------------------------------------------------------- 1 | void _ZN4piex19GetPreviewImageDataEPNS_15StreamInterfaceEPNS_16PreviewImageDataE() {} 2 | -------------------------------------------------------------------------------- /wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_no_group_iface=1 3 | persistent_reconnect=1 4 | bss_max_count=400 5 | p2p_go_intent=14 6 | -------------------------------------------------------------------------------- /gps/pla/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_headers { 3 | 4 | name: "libloc_pla_headers", 5 | export_include_dirs: ["android"], 6 | vendor: true, 7 | } 8 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/lib/org/ifaa/android/manager/IIFAAService.aidl: -------------------------------------------------------------------------------- 1 | package org.ifaa.android.manager; 2 | 3 | interface IIFAAService { 4 | byte[] processCmd_v2(in byte[] param); 5 | } 6 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "WifiOverlay", 3 | theme: "WifiOverlay", 4 | sdk_version: "current", 5 | product_specific: true 6 | } 7 | -------------------------------------------------------------------------------- /gps/android/1.0/android.hardware.gnss@1.0-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /gps/android/1.1/android.hardware.gnss@1.1-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /gps/android/2.0/android.hardware.gnss@2.0-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@2.0-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /gps/android/2.1/android.hardware.gnss@2.1-service-qti.rc: -------------------------------------------------------------------------------- 1 | service gnss_service /vendor/bin/hw/android.hardware.gnss@2.1-service-qti 2 | class hal 3 | user gps 4 | group system gps radio vendor_qti_diag 5 | -------------------------------------------------------------------------------- /gps/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile.am - Automake script for gps loc_api 2 | # 3 | 4 | ACLOCAL_AMFLAGS = -I m4 5 | 6 | SUBDIRS = gnss 7 | 8 | pkgconfigdir = $(libdir)/pkgconfig 9 | pkgconfig_DATA = loc-hal.pc 10 | EXTRA_DIST = $(pkgconfig_DATA) 11 | -------------------------------------------------------------------------------- /wifi/hostapd.accept: -------------------------------------------------------------------------------- 1 | # List of MAC addresses that are allowed to authenticate (IEEE 802.11) 2 | # with the AP. Optional VLAN ID can be assigned for clients based on the 3 | # MAC address if dynamic VLANs (hostapd.conf dynamic_vlan option) are used. 4 | -------------------------------------------------------------------------------- /gps/gps_vendor_board.mk: -------------------------------------------------------------------------------- 1 | # Flags from BoardConfigVendor.mk 2 | ifneq ($(TARGET_USES_QMAA),true) 3 | BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default 4 | else ifneq ($(TARGET_USES_QMAA_OVERRIDE_GPS),false) 5 | BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := default 6 | endif 7 | 8 | -------------------------------------------------------------------------------- /gps/core/loc-core.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: loc-core 7 | Description: QTI GPS Loc Core 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lloc_core 10 | Cflags: -I${includedir}/loc-core 11 | -------------------------------------------------------------------------------- /gps/utils/gps-utils.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: gps-utils 7 | Description: QTI GPS Location utils 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgps_utils 10 | Cflags: -I${includedir}/gps-utils 11 | -------------------------------------------------------------------------------- /shims/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_shared { 8 | name: "libwatermark_shim", 9 | srcs: ["libwatermark_shim/libwatermark_shim.c"], 10 | vendor: true, 11 | } 12 | -------------------------------------------------------------------------------- /gps/location/location-api.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-api 7 | Description: Location API 8 | Version: @VERSION 9 | Libs: -L${libdir} -llocation_api 10 | Cflags: -I${includedir}/location-api 11 | -------------------------------------------------------------------------------- /gps/batching/location-batching.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-batching 7 | Description: QTI GPS Batching 8 | Version: @VERSION 9 | Libs: -L${libdir} -lbatching 10 | Cflags: -I${includedir}/location-batching 11 | -------------------------------------------------------------------------------- /gps/geofence/location-geofence.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: location-geofence 7 | Description: QTI GPS Geofence 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgeofencing 10 | Cflags: -I${includedir}/location-geofence 11 | -------------------------------------------------------------------------------- /gps/loc-hal.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: loc-hal 7 | Description: QTI GPS Loc HAL 8 | Version: @VERSION 9 | Libs: -L${libdir} -lgnss 10 | Cflags: -I${includedir} -I${includedir}/utils -I${includedir}/core -I${includedir}/loc-hal 11 | -------------------------------------------------------------------------------- /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 | bss_max_count=400 6 | interworking=1 7 | hs20=1 8 | auto_interworking=0 9 | driver_param="use_p2p_group_interface=1 no_rrm=1" 10 | config_methods=virtual_display virtual_push_button keypad 11 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/lib/org/ifaa/android/manager/IFAAManagerV2.java: -------------------------------------------------------------------------------- 1 | package org.ifaa.android.manager; 2 | 3 | import android.compat.annotation.UnsupportedAppUsage; 4 | import android.content.Context; 5 | 6 | public abstract class IFAAManagerV2 extends IFAAManager { 7 | @UnsupportedAppUsage 8 | public abstract byte[] processCmdV2(Context paramContext, byte[] paramArrayOfByte); 9 | } 10 | -------------------------------------------------------------------------------- /light/android.hardware.light@2.0-service.ginkgo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.light 4 | hwbinder 5 | 2.0 6 | 7 | ILight 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/lib/org/ifaa/android/manager/IFAAManagerFactory.java: -------------------------------------------------------------------------------- 1 | package org.ifaa.android.manager; 2 | 3 | import android.compat.annotation.UnsupportedAppUsage; 4 | import android.content.Context; 5 | 6 | public class IFAAManagerFactory { 7 | @UnsupportedAppUsage 8 | public static IFAAManager getIFAAManager(Context context, int authType) { 9 | return IFAAManagerImpl.getInstance(context); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /fingerprint/android.hardware.biometrics.fingerprint@2.1-service.ginkgo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.biometrics.fingerprint 4 | hwbinder 5 | 2.1 6 | 7 | IBiometricsFingerprint 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /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 96 DPAD_CENTER 12 | #key 102 HOME 13 | #key 105 DPAD_LEFT 14 | #key 106 DPAD_RIGHT 15 | 16 | -------------------------------------------------------------------------------- /seccomp/mediacodec-seccomp.policy: -------------------------------------------------------------------------------- 1 | # device specific syscalls 2 | # extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy 3 | pselect6: 1 4 | eventfd2: 1 5 | sendto: 1 6 | recvfrom: 1 7 | _llseek: 1 8 | sysinfo: 1 9 | getcwd: 1 10 | getdents64: 1 11 | ARM_cacheflush: 1 12 | inotify_init1: 1 13 | inotify_add_watch: 1 14 | inotify_rm_watch: 1 15 | uname: 1 16 | ueventd: 1 17 | timer_create: 1 18 | timer_settime: 1 19 | rt_sigtimedwait: 1 20 | -------------------------------------------------------------------------------- /idc/uinput-fpc.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-fpc 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | -------------------------------------------------------------------------------- /idc/uinput-goodix.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-gf 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | -------------------------------------------------------------------------------- /configs/thermal/thermal-engine-map.conf: -------------------------------------------------------------------------------- 1 | [0:thermal-engine-normal.conf] 2 | [1:thermal-engine-high.conf] 3 | [2:thermal-engine-extreme.conf] 4 | [8:thermal-engine-phone.conf] 5 | [9:thermal-engine-sgame.conf] 6 | [10:thermal-engine-nolimits.conf] 7 | [11:thermal-engine-class0.conf] 8 | [12:thermal-engine-camera.conf] 9 | [13:thermal-engine-pubgmhd.conf] 10 | [14:thermal-engine-youtobe.conf] 11 | [15:thermal-engine-arvr.conf] 12 | [16:thermal-engine-tgame.conf] 13 | 14 | -------------------------------------------------------------------------------- /keylayout/uinput-goodix.kl: -------------------------------------------------------------------------------- 1 | # 2 | # Goodix fingerprint sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | #key 96 DPAD_CENTER 11 | #key 96 DPAD_CENTER 12 | #key 102 HOME 13 | #key 105 DPAD_LEFT 14 | #key 106 DPAD_RIGHT 15 | -------------------------------------------------------------------------------- /rro_overlays/TetheringOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /fingerprint/android.hardware.biometrics.fingerprint@2.1-service.ginkgo.rc: -------------------------------------------------------------------------------- 1 | on post-fs-data 2 | mkdir /data/vendor/goodix 0770 system system 3 | mkdir /data/vendor/fpc 0770 system system 4 | 5 | service vendor.fps_hal /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.ginkgo 6 | # "class hal" causes a race condition on some devices due to files created 7 | # in /data. As a workaround, postpone startup until later in boot once 8 | # /data is mounted. 9 | class late_start 10 | user system 11 | group system input uhid 12 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/src/org/ifaa/android/manager/IIFAAService.aidl: -------------------------------------------------------------------------------- 1 | package org.ifaa.android.manager; 2 | 3 | interface IIFAAService { 4 | byte[] processCmd_v2(in byte[] param); 5 | int[] getIDList(int bioType); 6 | int faceEnroll(String sessionId, int flags); 7 | int faceUpgrade(int action, String path, int offset, in byte[] data, int data_len); 8 | int faceAuthenticate_v2(String sessionId, int flags); 9 | int faceCancel_v2(String sessionId); 10 | byte[] faceInvokeCommand(in byte[] param); 11 | int faceGetCellinfo(); 12 | } 13 | -------------------------------------------------------------------------------- /gps/geofence/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | 3 | cc_library_shared { 4 | 5 | name: "libgeofencing", 6 | vendor: true, 7 | 8 | sanitize: GNSS_SANITIZE, 9 | 10 | srcs: [ 11 | "GeofenceAdapter.cpp", 12 | "location_geofence.cpp", 13 | ], 14 | 15 | shared_libs: [ 16 | "libutils", 17 | "libcutils", 18 | "libgps.utils", 19 | "liblog", 20 | "libloc_core", 21 | ], 22 | 23 | header_libs: [ 24 | "libgps.utils_headers", 25 | "libloc_core_headers", 26 | "libloc_pla_headers", 27 | "liblocation_api_headers", 28 | ], 29 | 30 | cflags: GNSS_CFLAGS, 31 | } 32 | -------------------------------------------------------------------------------- /gps/batching/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "libbatching", 5 | vendor: true, 6 | 7 | sanitize: GNSS_SANITIZE, 8 | 9 | shared_libs: [ 10 | "libutils", 11 | "libcutils", 12 | "liblog", 13 | "libloc_core", 14 | "libgps.utils", 15 | "libdl", 16 | ], 17 | 18 | srcs: [ 19 | "location_batching.cpp", 20 | "BatchingAdapter.cpp", 21 | ], 22 | 23 | header_libs: [ 24 | "libgps.utils_headers", 25 | "libloc_core_headers", 26 | "libloc_pla_headers", 27 | "liblocation_api_headers", 28 | ], 29 | 30 | cflags: GNSS_CFLAGS, 31 | } 32 | -------------------------------------------------------------------------------- /manifest_willow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.nfc 4 | hwbinder 5 | 1.2 6 | 7 | INfc 8 | default 9 | 10 | 11 | 12 | vendor.nxp.hardware.nfc 13 | hwbinder 14 | 2.0 15 | 16 | INqNfc 17 | default 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /system_ext.prop: -------------------------------------------------------------------------------- 1 | # Bluetooth 2 | bluetooth.device.class_of_device=90,2,12 3 | bluetooth.profile.a2dp.source.enabled=true 4 | bluetooth.profile.asha.central.enabled=true 5 | bluetooth.profile.avrcp.target.enabled=true 6 | bluetooth.profile.bas.client.enabled=true 7 | bluetooth.profile.gatt.enabled=true 8 | bluetooth.profile.hfp.ag.enabled=true 9 | bluetooth.profile.hid.device.enabled=true 10 | bluetooth.profile.hid.host.enabled=true 11 | bluetooth.profile.map.server.enabled=true 12 | bluetooth.profile.opp.enabled=true 13 | bluetooth.profile.pan.nap.enabled=true 14 | bluetooth.profile.pan.panu.enabled=true 15 | bluetooth.profile.pbap.server.enabled=true 16 | bluetooth.profile.sap.server.enabled=true 17 | -------------------------------------------------------------------------------- /gps/location/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "liblocation_api", 5 | vendor: true, 6 | 7 | sanitize: GNSS_SANITIZE, 8 | 9 | shared_libs: [ 10 | "libutils", 11 | "libcutils", 12 | "libgps.utils", 13 | "libdl", 14 | "liblog", 15 | ], 16 | 17 | srcs: [ 18 | "LocationAPI.cpp", 19 | "LocationAPIClientBase.cpp", 20 | ], 21 | 22 | cflags: ["-fno-short-enums"] + GNSS_CFLAGS, 23 | 24 | header_libs: [ 25 | "libloc_pla_headers", 26 | "libgps.utils_headers", 27 | ], 28 | 29 | } 30 | 31 | cc_library_headers { 32 | 33 | name: "liblocation_api_headers", 34 | export_include_dirs: ["."], 35 | vendor: true, 36 | } 37 | -------------------------------------------------------------------------------- /gps/gnss/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | 3 | cc_library_shared { 4 | 5 | name: "libgnss", 6 | vendor: true, 7 | 8 | sanitize: GNSS_SANITIZE, 9 | 10 | shared_libs: [ 11 | "libutils", 12 | "libcutils", 13 | "libdl", 14 | "liblog", 15 | "libloc_core", 16 | "libgps.utils", 17 | ], 18 | 19 | srcs: [ 20 | "location_gnss.cpp", 21 | "GnssAdapter.cpp", 22 | "Agps.cpp", 23 | "XtraSystemStatusObserver.cpp", 24 | ], 25 | 26 | cflags: ["-fno-short-enums"] + GNSS_CFLAGS, 27 | header_libs: [ 28 | "libgps.utils_headers", 29 | "libloc_core_headers", 30 | "libloc_pla_headers", 31 | "liblocation_api_headers", 32 | ], 33 | 34 | } 35 | -------------------------------------------------------------------------------- /aosp.dependencies: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "repository": "device_xiaomi_ginkgo-kernel", 4 | "target_path": "device/xiaomi/ginkgo-kernel", 5 | "branch": "thirteen" 6 | }, 7 | { 8 | "repository": "device_xiaomi_ginkgo-sepolicy", 9 | "target_path": "device/xiaomi/ginkgo-sepolicy", 10 | "branch": "thirteen" 11 | }, 12 | { 13 | "repository": "kernel_xiaomi_ginkgo", 14 | "target_path": "kernel/xiaomi/ginkgo", 15 | "branch": "thirteen" 16 | }, 17 | { 18 | "repository": "vendor_xiaomi_ginkgo", 19 | "target_path": "vendor/xiaomi/ginkgo", 20 | "branch": "thirteen", 21 | "remote": "pixel-devices-blobs" 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /AndroidProducts.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2020-21 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 | PRODUCT_MAKEFILES := \ 18 | $(LOCAL_DIR)/aosp_ginkgo.mk 19 | 20 | COMMON_LUNCH_CHOICES := \ 21 | aosp_ginkgo-userdebug 22 | -------------------------------------------------------------------------------- /rro_overlays/TetheringOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2020 The Android Open-Source Project 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | runtime_resource_overlay { 18 | name: "TetheringConfigOverlay", 19 | theme: "TetheringConfigOverlay", 20 | sdk_version: "current", 21 | product_specific: true 22 | } 23 | -------------------------------------------------------------------------------- /light/android.hardware.light@2.0-service.ginkgo.rc: -------------------------------------------------------------------------------- 1 | on boot 2 | # Backlight 3 | chown system system /sys/class/backlight/panel0-backlight/brightness 4 | chown system system /sys/class/backlight/panel0-backlight/max_brightness 5 | chmod 0644 /sys/class/backlight/panel0-backlight/brightness 6 | chmod 0644 /sys/class/backlight/panel0-backlight/max_brightness 7 | 8 | # Real notification light 9 | chown system system /sys/class/leds/red/brightness 10 | chown system system /sys/class/leds/red/breath 11 | chmod 660 /sys/class/leds/red/brightness 12 | chmod 660 /sys/class/leds/red/breath 13 | 14 | service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.ginkgo 15 | interface android.hardware.light@2.0::ILight default 16 | class hal 17 | user system 18 | group system 19 | # shutting off lights while powering-off 20 | shutdown critical 21 | -------------------------------------------------------------------------------- /setup-makefiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # SPDX-License-Identifier: Apache-2.0 7 | # 8 | 9 | set -e 10 | 11 | # Required! 12 | DEVICE=ginkgo 13 | VENDOR=xiaomi 14 | 15 | # Load extract_utils and do some sanity checks 16 | MY_DIR="${BASH_SOURCE%/*}" 17 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 18 | 19 | ANDROID_ROOT="${MY_DIR}/../../.." 20 | 21 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 22 | if [ ! -f "$HELPER" ]; then 23 | echo "Unable to find helper script at $HELPER" 24 | exit 1 25 | fi 26 | source "${HELPER}" 27 | 28 | # Initialize the helper 29 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" 30 | 31 | # Warning headers and guards 32 | write_headers 33 | 34 | write_makefiles "${MY_DIR}/proprietary-files.txt" true 35 | 36 | # Finish 37 | write_footers 38 | -------------------------------------------------------------------------------- /gps/android/utils/Android.bp: -------------------------------------------------------------------------------- 1 | cc_library_static { 2 | 3 | name: "liblocbatterylistener", 4 | vendor: true, 5 | 6 | sanitize: GNSS_SANITIZE, 7 | 8 | cflags: GNSS_CFLAGS + ["-DBATTERY_LISTENER_ENABLED"], 9 | local_include_dirs: ["."], 10 | 11 | srcs: ["battery_listener.cpp"], 12 | 13 | shared_libs: [ 14 | "liblog", 15 | "libhidlbase", 16 | "libcutils", 17 | "libutils", 18 | "android.hardware.health@1.0", 19 | "android.hardware.health@2.0", 20 | "android.hardware.health@2.1", 21 | "android.hardware.power@1.2", 22 | "libbase", 23 | ], 24 | 25 | static_libs: ["libhealthhalutils"], 26 | 27 | header_libs: [ 28 | "libgps.utils_headers", 29 | "libloc_pla_headers", 30 | ], 31 | } 32 | 33 | cc_library_headers { 34 | 35 | name: "liblocbatterylistener_headers", 36 | export_include_dirs: ["."], 37 | } 38 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/lib/org/ifaa/android/manager/IFAAManagerV3.java: -------------------------------------------------------------------------------- 1 | package org.ifaa.android.manager; 2 | 3 | import android.compat.annotation.UnsupportedAppUsage; 4 | 5 | public abstract class IFAAManagerV3 extends IFAAManagerV2 { 6 | @UnsupportedAppUsage 7 | public static final String KEY_FINGERPRINT_FULLVIEW = "org.ifaa.ext.key.CUSTOM_VIEW"; 8 | @UnsupportedAppUsage 9 | public static final String KEY_GET_SENSOR_LOCATION = "org.ifaa.ext.key.GET_SENSOR_LOCATION"; 10 | @UnsupportedAppUsage 11 | public static final String VALUE_FINGERPRINT_DISABLE = "disable"; 12 | @UnsupportedAppUsage 13 | public static final String VLAUE_FINGERPRINT_ENABLE = "enable"; 14 | 15 | @UnsupportedAppUsage 16 | public abstract String getExtInfo(int authType, String keyExtInfo); 17 | 18 | @UnsupportedAppUsage 19 | public abstract void setExtInfo(int authType, String keyExtInfo, String valExtInfo); 20 | } 21 | -------------------------------------------------------------------------------- /configs/component-overrides.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /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_ginkgo", 19 | recovery_available: true, 20 | srcs: ["init_ginkgo.cpp"], 21 | include_dirs: [ 22 | "system/libbase/include", 23 | "system/core/init" 24 | ], 25 | shared_libs: ["libbase"] 26 | } 27 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | false 23 | 24 | 25 | -------------------------------------------------------------------------------- /gps/etc/lowi.conf: -------------------------------------------------------------------------------- 1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* 2 | # 3 | # LOWI Config file - default 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 = 4 26 | LOWI_USE_LOWI_LP = 0 27 | 28 | -------------------------------------------------------------------------------- /gps/gnss/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | $(LOCPLA_CFLAGS) \ 3 | $(LOCHAL_CFLAGS) \ 4 | $(GPSUTILS_CFLAGS) \ 5 | $(LOCCORE_CFLAGS) \ 6 | -I./ \ 7 | -I../utils \ 8 | -I$(WORKSPACE)/hardware/qcom/gps/core/data-items \ 9 | -I../location \ 10 | -std=c++1y 11 | 12 | libgnss_la_SOURCES = \ 13 | location_gnss.cpp \ 14 | GnssAdapter.cpp \ 15 | XtraSystemStatusObserver.cpp \ 16 | Agps.cpp 17 | 18 | if USE_GLIB 19 | libgnss_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 20 | libgnss_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -avoid-version 21 | libgnss_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 22 | else 23 | libgnss_la_CFLAGS = $(AM_CFLAGS) 24 | libgnss_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 25 | libgnss_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 26 | endif 27 | 28 | libgnss_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) $(LOCCORE_LIBS) 29 | 30 | #Create and Install libraries 31 | lib_LTLIBRARIES = libgnss.la 32 | -------------------------------------------------------------------------------- /configs/media/media_codecs_vendor_audio.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /overlay/frameworks/base/core/res/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 103px 21 | 22 | 23 | 28.0dp 24 | 80.0px 25 | 28.0dp 26 | 27 | -------------------------------------------------------------------------------- /gps/utils/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "libgps.utils", 5 | vendor: true, 6 | 7 | sanitize: GNSS_SANITIZE, 8 | 9 | //# Libs 10 | shared_libs: [ 11 | "libdl", 12 | "libutils", 13 | "libcutils", 14 | "liblog", 15 | "libprocessgroup", 16 | ], 17 | 18 | srcs: [ 19 | "loc_log.cpp", 20 | "loc_cfg.cpp", 21 | "msg_q.c", 22 | "linked_list.c", 23 | "loc_target.cpp", 24 | "LocHeap.cpp", 25 | "LocTimer.cpp", 26 | "LocThread.cpp", 27 | "MsgTask.cpp", 28 | "loc_misc_utils.cpp", 29 | "loc_nmea.cpp", 30 | "LocIpc.cpp", 31 | "LogBuffer.cpp", 32 | ], 33 | 34 | cflags: [ 35 | "-fno-short-enums", 36 | "-D_ANDROID_", 37 | ] + GNSS_CFLAGS, 38 | 39 | //# Includes 40 | ldflags: ["-Wl,--export-dynamic"], 41 | 42 | header_libs: [ 43 | "libutils_headers", 44 | "libloc_pla_headers", 45 | "liblocation_api_headers", 46 | ], 47 | } 48 | 49 | cc_library_headers { 50 | 51 | name: "libgps.utils_headers", 52 | export_include_dirs: ["."], 53 | vendor: true, 54 | } 55 | -------------------------------------------------------------------------------- /gps/Android.bp: -------------------------------------------------------------------------------- 1 | GNSS_CFLAGS = [ 2 | "-Werror", 3 | "-Wno-error=unused-parameter", 4 | "-Wno-error=macro-redefined", 5 | "-Wno-error=reorder", 6 | "-Wno-error=missing-braces", 7 | "-Wno-error=self-assign", 8 | "-Wno-error=enum-conversion", 9 | "-Wno-error=logical-op-parentheses", 10 | "-Wno-error=null-arithmetic", 11 | "-Wno-error=null-conversion", 12 | "-Wno-error=parentheses-equality", 13 | "-Wno-error=undefined-bool-conversion", 14 | "-Wno-error=tautological-compare", 15 | "-Wno-error=switch", 16 | "-Wno-error=date-time", 17 | ] 18 | 19 | /* Activate the following for regression testing */ 20 | GNSS_SANITIZE = { 21 | /* address: true,*/ 22 | cfi: true, 23 | misc_undefined: [ 24 | "bounds", 25 | "null", 26 | "unreachable", 27 | "integer", 28 | ], 29 | } 30 | 31 | /* Activate the following for debug purposes only, 32 | comment out for production */ 33 | GNSS_SANITIZE_DIAG = { 34 | /* 35 | diag: { 36 | cfi: true, 37 | misc_undefined: [ 38 | "bounds", 39 | "null", 40 | "unreachable", 41 | "integer", 42 | ], 43 | }, 44 | */ 45 | } 46 | -------------------------------------------------------------------------------- /light/Android.bp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2019 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.ginkgo", 19 | proprietary: true, 20 | init_rc: ["android.hardware.light@2.0-service.ginkgo.rc"], 21 | vintf_fragments: ["android.hardware.light@2.0-service.ginkgo.xml"], 22 | srcs: ["service.cpp", "Light.cpp"], 23 | shared_libs: [ 24 | "libhardware", 25 | "libhidlbase", 26 | "liblog", 27 | "libutils", 28 | "android.hardware.light@2.0", 29 | ], 30 | } 31 | -------------------------------------------------------------------------------- /gps/core/Android.bp: -------------------------------------------------------------------------------- 1 | 2 | cc_library_shared { 3 | 4 | name: "libloc_core", 5 | vendor: true, 6 | 7 | sanitize: GNSS_SANITIZE, 8 | 9 | shared_libs: [ 10 | "liblog", 11 | "libutils", 12 | "libcutils", 13 | "libgps.utils", 14 | "libdl", 15 | "liblog", 16 | ], 17 | 18 | srcs: [ 19 | "LocApiBase.cpp", 20 | "LocAdapterBase.cpp", 21 | "ContextBase.cpp", 22 | "LocContext.cpp", 23 | "loc_core_log.cpp", 24 | "data-items/DataItemsFactoryProxy.cpp", 25 | "SystemStatusOsObserver.cpp", 26 | "SystemStatus.cpp", 27 | ], 28 | 29 | cflags: [ 30 | "-fno-short-enums", 31 | "-D_ANDROID_", 32 | ] + GNSS_CFLAGS, 33 | 34 | local_include_dirs: [ 35 | "data-items", 36 | "observer", 37 | ], 38 | 39 | header_libs: [ 40 | "libutils_headers", 41 | "libgps.utils_headers", 42 | "libloc_pla_headers", 43 | "liblocation_api_headers", 44 | ], 45 | 46 | } 47 | 48 | cc_library_headers { 49 | 50 | name: "libloc_core_headers", 51 | vendor: true, 52 | export_include_dirs: ["."] + [ 53 | "data-items", 54 | "observer", 55 | ], 56 | } 57 | -------------------------------------------------------------------------------- /rro_overlays/WifiOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 21 | 22 | 27 | 28 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/drawable/rounded.xml: -------------------------------------------------------------------------------- 1 | 15 | 20 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 25 | 26 | 28 | 29 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/Android.bp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017-2020 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | java_library { 18 | name: "org.ifaa.android.manager", 19 | installable: true, 20 | srcs: [ 21 | "lib/**/*.java", 22 | "lib/**/I*.aidl", 23 | ], 24 | libs: [ 25 | "app-compat-annotations", 26 | "unsupportedappusage", 27 | ], 28 | aidl: { 29 | local_include_dirs: ["src"], 30 | }, 31 | } 32 | 33 | 34 | android_app { 35 | name: "IFAAService", 36 | 37 | srcs: ["src/**/*.java"], 38 | 39 | certificate: "platform", 40 | libs: ["org.ifaa.android.manager"], 41 | 42 | platform_apis: true, 43 | optimize: { 44 | enabled: false, 45 | }, 46 | } 47 | -------------------------------------------------------------------------------- /gps/batching/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = \ 2 | $(GPSUTILS_CFLAGS) \ 3 | $(LOCCORE_CFLAGS) \ 4 | -I./ \ 5 | -std=c++1y \ 6 | -D__func__=__PRETTY_FUNCTION__ \ 7 | -fno-short-enums 8 | 9 | ACLOCAL_AMFLAGS = -I m4 10 | 11 | requiredlibs = \ 12 | $(GPSUTILS_LIBS) \ 13 | $(LOCCORE_LIBS) \ 14 | -llog 15 | 16 | h_sources = \ 17 | BatchingAdapter.h 18 | 19 | libbatching_la_SOURCES = \ 20 | location_batching.cpp \ 21 | BatchingAdapter.cpp 22 | 23 | if USE_GLIB 24 | libbatching_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 25 | libbatching_la_LDFLAGS = -lstdc++ -g -Wl,-z,defs -lpthread $(requiredlibs) @GLIB_LIBS@ -shared -version-info 1:0:0 26 | libbatching_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 27 | else 28 | libbatching_la_CFLAGS = $(AM_CFLAGS) 29 | libbatching_la_LDFLAGS = -Wl,-z,defs -lpthread $(requiredlibs) -shared -version-info 1:0:0 30 | libbatching_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 31 | endif 32 | 33 | library_include_HEADERS = $(h_sources) 34 | 35 | library_includedir = $(pkgincludedir) 36 | 37 | #Create and Install libraries 38 | lib_LTLIBRARIES = libbatching.la 39 | 40 | pkgconfigdir = $(libdir)/pkgconfig 41 | pkgconfig_DATA = location-batching.pc 42 | sysconf_DATA = $(WORKSPACE)/hardware/qcom/gps/etc/flp.conf 43 | EXTRA_DIST = $(pkgconfig_DATA) 44 | 45 | -------------------------------------------------------------------------------- /gps/location/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = \ 4 | -I./ \ 5 | -I../utils \ 6 | $(LOCPLA_CFLAGS) \ 7 | $(GPSUTILS_CFLAGS) \ 8 | -std=c++11 9 | 10 | liblocation_api_la_SOURCES = \ 11 | LocationAPI.cpp \ 12 | LocationAPIClientBase.cpp 13 | 14 | if USE_EXTERNAL_AP 15 | AM_CFLAGS += -DFEATURE_EXTERNAL_AP 16 | endif 17 | 18 | if USE_GLIB 19 | liblocation_api_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 20 | liblocation_api_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 21 | liblocation_api_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 22 | else 23 | liblocation_api_la_CFLAGS = $(AM_CFLAGS) 24 | liblocation_api_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 25 | liblocation_api_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 26 | endif 27 | 28 | liblocation_api_la_LIBADD = -lstdc++ -ldl $(GPSUTILS_LIBS) 29 | 30 | library_include_HEADERS = \ 31 | LocationAPI.h \ 32 | LocationAPIClientBase.h \ 33 | location_interface.h \ 34 | LocationDataTypes.h \ 35 | ILocationAPI.h 36 | 37 | #Create and Install libraries 38 | lib_LTLIBRARIES = liblocation_api.la 39 | 40 | library_includedir = $(pkgincludedir) 41 | 42 | pkgconfigdir = $(libdir)/pkgconfig 43 | pkgconfig_DATA = location-api.pc 44 | EXTRA_DIST = $(pkgconfig_DATA) 45 | -------------------------------------------------------------------------------- /fingerprint/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2017-2018 The LineageOS Project 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | cc_binary { 17 | name: "android.hardware.biometrics.fingerprint@2.1-service.ginkgo", 18 | relative_install_path: "hw", 19 | defaults: ["hidl_defaults"], 20 | init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.ginkgo.rc"], 21 | vintf_fragments: ["android.hardware.biometrics.fingerprint@2.1-service.ginkgo.xml"], 22 | srcs: ["service.cpp", "BiometricsFingerprint.cpp"], 23 | shared_libs: [ 24 | "libbase", 25 | "libhardware", 26 | "libhidlbase", 27 | "liblog", 28 | "libutils", 29 | "libcutils", 30 | "android.hardware.biometrics.fingerprint@2.1", 31 | ], 32 | proprietary: true, 33 | } 34 | -------------------------------------------------------------------------------- /gps/geofence/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = -Wundef \ 2 | -Wno-trigraphs \ 3 | -g -O0 \ 4 | -fno-inline \ 5 | -fno-short-enums \ 6 | -fpic \ 7 | ${GPSUTILS_CFLAGS} \ 8 | ${LOCCORE_CFLAGS} \ 9 | $(LOCPLA_CFLAGS) \ 10 | -D__func__=__PRETTY_FUNCTION__ \ 11 | -std=c++1y 12 | 13 | AM_CPPFLAGS = $(AM_CFLAGS) 14 | 15 | ACLOCAL_AMFLAGS = -I m4 16 | 17 | requiredlibs = \ 18 | ${LOCCORE_LIBS} \ 19 | $(GPSUTILS_LIBS) \ 20 | -llog 21 | 22 | h_sources = \ 23 | GeofenceAdapter.h 24 | 25 | c_sources = \ 26 | GeofenceAdapter.cpp \ 27 | location_geofence.cpp 28 | 29 | libgeofencing_la_SOURCES = $(c_sources) 30 | if USE_GLIB 31 | libgeofencing_la_CFLAGS = -DUSE_GLIB @GLIB_CFLAGS@ $(AM_CFLAGS) 32 | libgeofencing_la_CPPFLAGS = -DUSE_GLIB @GLIB_CFLAGS@ $(AM_CFLAGS) $(AM_CPPFLAGS) 33 | libgeofencing_la_LDFLAGS = -lstdc++ -Wl,-z,defs @GLIB_LIBS@ $(requiredlibs) -shared -version-info 1:0:0 34 | libgeofencing_la_LIBDADD = $(requiredlibs) -lstdc++ @GLIB_LIBS@ 35 | else 36 | libgeofencing_la_CFLAGS = $(AM_CFLAGS) 37 | libgeofencing_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 38 | libgeofencing_la_LDFLAGS = -lstdc++ -Wl,-z,defs $(requiredlibs) -shared -version-info 1:0:0 39 | libgeofencing_la_LIBDADD = $(requiredlibs) -lstdc++ 40 | endif 41 | 42 | library_include_HEADERS = $(h_sources) 43 | 44 | library_includedir = $(pkgincludedir) 45 | 46 | lib_LTLIBRARIES = libgeofencing.la 47 | 48 | pkgconfigdir = $(libdir)/pkgconfig 49 | pkgconfig_DATA = location-geofence.pc 50 | EXTRA_DIST = $(pkgconfig_DATA) 51 | -------------------------------------------------------------------------------- /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.xiaomi_ginkgo" 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 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 40px 21 | 22 | 25 | M22,0C19.94,0.01 18.83,0.04 17.73,0.11C16.91,0.17 16.09,0.25 15.3,0.36C14.5,0.48 13.72,0.62 12.95,0.81C11.42,1.19 9.97,1.72 8.65,2.43C7.32,3.14 6.12,4.02 5.08,5.07C4.04,6.11 3.15,7.31 2.44,8.64C1.73,9.97 1.19,11.42 0.82,12.94C0.63,13.7 0.48,14.49 0.37,15.29C0.25,16.09 0.17,16.9 0.12,17.72C0.05,18.82 0.02,19.93 0.01,21.55 26 | 27 | -------------------------------------------------------------------------------- /releasetools.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009 The Android Open Source Project 2 | # Copyright (c) 2011, The Linux Foundation. All rights reserved. 3 | # Copyright (C) 2017-2018 The LineageOS Project 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | import hashlib 18 | import common 19 | import re 20 | 21 | def FullOTA_InstallEnd(info): 22 | OTA_InstallEnd(info) 23 | return 24 | 25 | def IncrementalOTA_InstallEnd(info): 26 | OTA_InstallEnd(info) 27 | return 28 | 29 | def AddImage(info, basename, dest): 30 | path = "IMAGES/" + basename 31 | if path not in info.input_zip.namelist(): 32 | return 33 | 34 | data = info.input_zip.read(path) 35 | common.ZipWriteStr(info.output_zip, basename, data) 36 | info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) 37 | info.script.AppendExtra('package_extract_file("%s", "%s");' % (basename, dest)) 38 | 39 | def OTA_InstallEnd(info): 40 | AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo") 41 | AddImage(info, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta") 42 | return 43 | -------------------------------------------------------------------------------- /gps/Android.mk: -------------------------------------------------------------------------------- 1 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 2 | 3 | # Set required flags 4 | GNSS_CFLAGS := \ 5 | -Werror \ 6 | -Wno-error=unused-parameter \ 7 | -Wno-error=macro-redefined \ 8 | -Wno-error=reorder \ 9 | -Wno-error=missing-braces \ 10 | -Wno-error=self-assign \ 11 | -Wno-error=enum-conversion \ 12 | -Wno-error=logical-op-parentheses \ 13 | -Wno-error=null-arithmetic \ 14 | -Wno-error=null-conversion \ 15 | -Wno-error=parentheses-equality \ 16 | -Wno-error=undefined-bool-conversion \ 17 | -Wno-error=tautological-compare \ 18 | -Wno-error=switch \ 19 | -Wno-error=date-time 20 | 21 | GNSS_HIDL_VERSION = 2.1 22 | 23 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8937 24 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8953 25 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += msm8998 26 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += apq8098_latv 27 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm710 28 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += qcs605 29 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm845 30 | GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST += sdm660 31 | 32 | ifneq (,$(filter $(GNSS_HIDL_LEGACY_MEASURMENTS_TARGET_LIST),$(TARGET_BOARD_PLATFORM))) 33 | GNSS_HIDL_LEGACY_MEASURMENTS = true 34 | endif 35 | 36 | LOCAL_PATH := $(call my-dir) 37 | include $(call all-makefiles-under,$(LOCAL_PATH)) 38 | 39 | GNSS_SANITIZE := cfi bounds null unreachable integer 40 | # Activate the following two lines for regression testing 41 | #GNSS_SANITIZE += address 42 | #GNSS_SANITIZE_DIAG := $(GNSS_SANITIZE) 43 | 44 | endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 45 | -------------------------------------------------------------------------------- /gps/gps_vendor_product.mk: -------------------------------------------------------------------------------- 1 | # HAL packages 2 | ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 3 | 4 | # GPS-HIDL 5 | LOC_BOARD_PLATFORM_LIST += msm8937 6 | LOC_BOARD_PLATFORM_LIST += msm8953 7 | LOC_BOARD_PLATFORM_LIST += msm8998 8 | LOC_BOARD_PLATFORM_LIST += apq8098_latv 9 | LOC_BOARD_PLATFORM_LIST += sdm710 10 | LOC_BOARD_PLATFORM_LIST += qcs605 11 | LOC_BOARD_PLATFORM_LIST += sdm845 12 | LOC_BOARD_PLATFORM_LIST += sdm660 13 | LOC_BOARD_PLATFORM_LIST += msmnile 14 | LOC_BOARD_PLATFORM_LIST += sdmshrike 15 | LOC_BOARD_PLATFORM_LIST += $(MSMSTEPPE) 16 | LOC_BOARD_PLATFORM_LIST += $(TRINKET) 17 | LOC_BOARD_PLATFORM_LIST += kona 18 | LOC_BOARD_PLATFORM_LIST += atoll 19 | LOC_BOARD_PLATFORM_LIST += lito 20 | LOC_BOARD_PLATFORM_LIST += bengal 21 | LOC_BOARD_PLATFORM_LIST += lahaina 22 | LOC_BOARD_PLATFORM_LIST += holi 23 | 24 | # Add product packages 25 | ifneq (,$(filter $(LOC_BOARD_PLATFORM_LIST),$(TARGET_BOARD_PLATFORM))) 26 | 27 | PRODUCT_PACKAGES += gps.conf 28 | PRODUCT_PACKAGES += flp.conf 29 | PRODUCT_PACKAGES += gnss_antenna_info.conf 30 | PRODUCT_PACKAGES += libloc_pla_headers 31 | PRODUCT_PACKAGES += liblocation_api_headers 32 | PRODUCT_PACKAGES += libgps.utils_headers 33 | PRODUCT_PACKAGES += liblocation_api 34 | PRODUCT_PACKAGES += libgps.utils 35 | PRODUCT_PACKAGES += libbatching 36 | PRODUCT_PACKAGES += libgeofencing 37 | PRODUCT_PACKAGES += libloc_core 38 | PRODUCT_PACKAGES += libgnss 39 | 40 | PRODUCT_PACKAGES += android.hardware.gnss@2.1-impl-qti 41 | PRODUCT_PACKAGES += android.hardware.gnss@2.1-service-qti 42 | 43 | endif # ifneq (,$(filter $(LOC_BOARD_PLATFORM_LIST),$(TARGET_BOARD_PLATFORM))) 44 | endif # ifneq ($(BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE),) 45 | -------------------------------------------------------------------------------- /configs/perf/msm_irqbalance.conf: -------------------------------------------------------------------------------- 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 | PRIO=1,1,1,1,0,0,0,0 31 | #arch_timer, arm-pmu, arch_mem_timer, kgsl-3d0, msm_drm 32 | IGNORED_IRQ=19,22,39,209,218 33 | -------------------------------------------------------------------------------- /fingerprint/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-service.ginkgo" 18 | 19 | #include 20 | #include 21 | 22 | #include "BiometricsFingerprint.h" 23 | 24 | // libhwbinder: 25 | using android::hardware::configureRpcThreadpool; 26 | using android::hardware::joinRpcThreadpool; 27 | 28 | // Generated HIDL files 29 | using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint; 30 | using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint; 31 | 32 | int main() { 33 | android::sp service = BiometricsFingerprint::getInstance(); 34 | 35 | if (service == nullptr) { 36 | ALOGE("Instance of BiometricsFingerprint is null"); 37 | return 1; 38 | } 39 | 40 | configureRpcThreadpool(1, true /*callerWillJoin*/); 41 | 42 | android::status_t status = service->registerAsService(); 43 | if (status != android::OK) { 44 | ALOGE("Cannot register BiometricsFingerprint service"); 45 | return 1; 46 | } 47 | 48 | joinRpcThreadpool(); 49 | 50 | return 0; // should never get here 51 | } 52 | -------------------------------------------------------------------------------- /gps/utils/LocLoggerBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2020 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef LOC_LOGGER_BASE_H 30 | #define LOC_LOGGER_BASE_H 31 | 32 | namespace loc_util { 33 | class LocLoggerBase { 34 | public: 35 | virtual void log() {} 36 | }; 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /gps/android/1.0/android.hardware.gnss@1.0-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.0::IGnss/default 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /gps/android/1.1/android.hardware.gnss@1.1-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /overlay/packages/apps/Aperture/app/src/main/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | true 9 | 10 | 11 | 12 | 61 13 | 14 | 15 | 38 | 39 | 40 | 0 sd|hd|fhd|uhd 60 41 | 22 sd|hd|fhd 30 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /gps/android/utils/battery_listener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, The Linux Foundation. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above 10 | * copyright notice, this list of conditions and the following 11 | * disclaimer in the documentation and/or other materials provided 12 | * with the distribution. 13 | * * Neither the name of The Linux Foundation nor the names of its 14 | * contributors may be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | typedef void (* battery_status_change_fn_t)(bool); 30 | void loc_extn_battery_properties_listener_init(battery_status_change_fn_t fn); 31 | void loc_extn_battery_properties_listener_deinit(); 32 | bool loc_extn_battery_properties_is_charging(); 33 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 18 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 19 | 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace gnss { 27 | namespace V1_0 { 28 | namespace implementation { 29 | 30 | using ::android::hardware::gnss::V1_0::IGnssDebug; 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | using ::android::hardware::hidl_vec; 34 | using ::android::hardware::hidl_string; 35 | using ::android::sp; 36 | 37 | /* Interface for GNSS Debug support. */ 38 | struct Gnss; 39 | struct GnssDebug : public IGnssDebug { 40 | GnssDebug(Gnss* gnss); 41 | ~GnssDebug() {}; 42 | 43 | /* 44 | * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. 45 | * These declarations were generated from IGnssDebug.hal. 46 | */ 47 | Return getDebugData(getDebugData_cb _hidl_cb) override; 48 | 49 | private: 50 | Gnss* mGnss = nullptr; 51 | }; 52 | 53 | } // namespace implementation 54 | } // namespace V1_0 55 | } // namespace gnss 56 | } // namespace hardware 57 | } // namespace android 58 | 59 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H 60 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 18 | #define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 19 | 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | namespace hardware { 26 | namespace gnss { 27 | namespace V1_1 { 28 | namespace implementation { 29 | 30 | using ::android::hardware::gnss::V1_0::IGnssDebug; 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | using ::android::hardware::hidl_vec; 34 | using ::android::hardware::hidl_string; 35 | using ::android::sp; 36 | 37 | /* Interface for GNSS Debug support. */ 38 | struct Gnss; 39 | struct GnssDebug : public IGnssDebug { 40 | GnssDebug(Gnss* gnss); 41 | ~GnssDebug() {}; 42 | 43 | /* 44 | * Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow. 45 | * These declarations were generated from IGnssDebug.hal. 46 | */ 47 | Return getDebugData(getDebugData_cb _hidl_cb) override; 48 | 49 | private: 50 | Gnss* mGnss = nullptr; 51 | }; 52 | 53 | } // namespace implementation 54 | } // namespace V1_1 55 | } // namespace gnss 56 | } // namespace hardware 57 | } // namespace android 58 | 59 | #endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H 60 | -------------------------------------------------------------------------------- /gps/etc/seccomp_policy/gnss@2.0-xtwifi-inet-agent.policy: -------------------------------------------------------------------------------- 1 | 2 | #******************************************************************************* 3 | # Copyright (c) 2020 The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above 11 | # copyright notice, this list of conditions and the following 12 | # disclaimer in the documentation and/or other materials provided 13 | # with the distribution. 14 | # * Neither the name of The Linux Foundation, nor the names of its 15 | # contributors may be used to endorse or promote products derived 16 | # from this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 19 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 22 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 25 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 27 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 28 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | #****************************************************************************** 31 | 32 | unlinkat: 1 33 | sched_getaffinity: 1 34 | -------------------------------------------------------------------------------- /gps/android/2.0/android.hardware.gnss@2.0-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | @2.0::IGnss/default 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /gps/android/2.1/android.hardware.gnss@2.1-service-qti.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.hardware.gnss 31 | hwbinder 32 | @1.1::IGnss/default 33 | @2.1::IGnss/default 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/lib/org/ifaa/android/manager/IFAAManager.java: -------------------------------------------------------------------------------- 1 | package org.ifaa.android.manager; 2 | 3 | import android.compat.annotation.UnsupportedAppUsage; 4 | import android.content.Context; 5 | import android.os.Build.VERSION; 6 | import android.os.SystemProperties; 7 | 8 | public abstract class IFAAManager { 9 | private static final int IFAA_VERSION_V2 = 2; 10 | private static final int IFAA_VERSION_V3 = 3; 11 | static int sIfaaVer; 12 | static boolean sIsFod = SystemProperties.getBoolean("ro.hardware.fp.fod", false); 13 | 14 | /** 15 | * 返回手机系统上支持的校验方式,目前IFAF协议1.0版本指纹为0x01、虹膜为0x02 16 | */ 17 | @UnsupportedAppUsage 18 | public abstract int getSupportBIOTypes(Context context); 19 | 20 | /** 21 | * 启动系统的指纹/虹膜管理应用界面,让用户进行指纹录入。指纹录入是在系统的指纹管理应用中实现的, 22 | * 本函数的作用只是将指纹管理应用运行起来,直接进行页面跳转,方便用户录入。 23 | * @param context 24 | * @param authType 生物特征识别类型,指纹为1,虹膜为2 25 | * @return 0,成功启动指纹管理应用;-1,启动指纹管理应用失败。 26 | */ 27 | @UnsupportedAppUsage 28 | public abstract int startBIOManager(Context context, int authType); 29 | 30 | /** 31 | * 通过ifaateeclient的so文件实现REE到TA的通道 32 | * @param context 33 | * @param param 用于传输到IFAA TA的数据buffer 34 | * @return IFAA TA返回给REE数据buffer 35 | */ 36 | @UnsupportedAppUsage 37 | public native byte[] processCmd(Context context, byte[] param); 38 | 39 | /** 40 | * 获取设备型号,同一款机型型号需要保持一致 41 | */ 42 | @UnsupportedAppUsage 43 | public abstract String getDeviceModel(); 44 | 45 | /** 46 | * 获取IFAAManager接口定义版本,目前为1 47 | */ 48 | @UnsupportedAppUsage 49 | public abstract int getVersion(); 50 | 51 | /** 52 | * load so to communicate from REE to TEE 53 | */ 54 | static { 55 | sIfaaVer = 1; 56 | if (sIsFod) { 57 | sIfaaVer = 3; 58 | } else if (VERSION.SDK_INT >= 24) { 59 | sIfaaVer = 2; 60 | } else { 61 | System.loadLibrary("teeclientjni");//teeclientjni for TA test binary //ifaateeclient 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /gps/android/2.0/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 23 | 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V2_0::IGnssDebug; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* Interface for GNSS Debug support. */ 42 | struct Gnss; 43 | struct GnssDebug : public IGnssDebug { 44 | GnssDebug(Gnss* gnss); 45 | ~GnssDebug() {}; 46 | 47 | // Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow 48 | Return getDebugData(getDebugData_cb _hidl_cb) override; 49 | // Methods from ::android::hardware::gnss::V2_0::IGnssDebug follow. 50 | Return getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) override; 51 | 52 | private: 53 | Gnss* mGnss = nullptr; 54 | }; 55 | 56 | } // namespace implementation 57 | } // namespace V2_0 58 | } // namespace gnss 59 | } // namespace hardware 60 | } // namespace android 61 | 62 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 63 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 23 | 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V2_0::IGnssDebug; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* Interface for GNSS Debug support. */ 42 | struct Gnss; 43 | struct GnssDebug : public IGnssDebug { 44 | GnssDebug(Gnss* gnss); 45 | ~GnssDebug() {}; 46 | 47 | // Methods from ::android::hardware::gnss::V1_0::IGnssDebug follow 48 | Return getDebugData(getDebugData_cb _hidl_cb) override; 49 | // Methods from ::android::hardware::gnss::V2_0::IGnssDebug follow. 50 | Return getDebugData_2_0(getDebugData_2_0_cb _hidl_cb) override; 51 | 52 | private: 53 | Gnss* mGnss = nullptr; 54 | }; 55 | 56 | } // namespace implementation 57 | } // namespace V2_1 58 | } // namespace gnss 59 | } // namespace hardware 60 | } // namespace android 61 | 62 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSDEBUG_H 63 | -------------------------------------------------------------------------------- /gps/geofence/configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ(2.61) 2 | AC_INIT([location-geofence], 1.0.0) 3 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 4 | AC_CONFIG_SRCDIR([Makefile.am]) 5 | AC_CONFIG_HEADERS([config.h]) 6 | AC_CONFIG_MACRO_DIR([m4]) 7 | 8 | # Check for programs 9 | AC_PROG_LIBTOOL 10 | AC_PROG_CXX 11 | AC_PROG_CC 12 | AM_PROG_CC_C_O 13 | AC_PROG_AWK 14 | AC_PROG_CPP 15 | AC_PROG_INSTALL 16 | AC_PROG_LN_S 17 | AC_PROG_MAKE_SET 18 | PKG_PROG_PKG_CONFIG 19 | 20 | # Check for libraries 21 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 22 | AC_SUBST([GPSUTILS_CFLAGS]) 23 | AC_SUBST([GPSUTILS_LIBS]) 24 | 25 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 26 | AC_SUBST([LOCCORE_CFLAGS]) 27 | AC_SUBST([LOCCORE_LIBS]) 28 | 29 | AS_CASE([$host], 30 | [arm*], [ARM=yes], 31 | [ARM=no] 32 | ) 33 | 34 | AC_ARG_WITH([locpla_includes], 35 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 36 | [specify the path to locpla-includes in loc-pla_git.bb]), 37 | [locpla_incdir=$withval], 38 | with_locpla_includes=no) 39 | 40 | if test "x$with_locpla_includes" != "xno"; then 41 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 42 | fi 43 | 44 | AC_ARG_WITH([glib], 45 | AC_HELP_STRING([--with-glib], 46 | [enable glib, building HLOS systems which use glib])) 47 | 48 | if (test "x${with_glib}" = "xyes"); then 49 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 50 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 51 | AC_MSG_ERROR(GThread >= 2.16 is required)) 52 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 53 | AC_MSG_ERROR(GLib >= 2.16 is required)) 54 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 55 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 56 | 57 | AC_SUBST(GLIB_CFLAGS) 58 | AC_SUBST(GLIB_LIBS) 59 | fi 60 | 61 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 62 | 63 | AC_SUBST([CFLAGS]) 64 | AC_SUBST([CPPFLAGS]) 65 | AC_SUBST([LIBS]) 66 | 67 | AC_CONFIG_FILES([ \ 68 | Makefile \ 69 | location-geofence.pc 70 | ]) 71 | 72 | AC_OUTPUT 73 | -------------------------------------------------------------------------------- /gps/etc/seccomp_policy/gnss@2.0-xtra-daemon.policy: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2020 The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are 6 | # met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above 10 | # copyright notice, this list of conditions and the following 11 | # disclaimer in the documentation and/or other materials provided 12 | # with the distribution. 13 | # * Neither the name of The Linux Foundation, nor the names of its 14 | # contributors may be used to endorse or promote products derived 15 | # from this software without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | #****************************************************************************** 30 | bind: 1 31 | getrlimit: 1 32 | 33 | pipe2: 1 34 | 35 | sched_getaffinity: 1 36 | timerfd_create: 1 37 | unlinkat: 1 38 | setpriority: 1 39 | 40 | epoll_create1: 1 41 | epoll_ctl: 1 42 | epoll_pwait: 1 43 | timerfd_settime: 1 44 | 45 | fdatasync: 1 46 | madvise: 1 47 | ftruncate: 1 48 | 49 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 32 | 33 | 34 | true 35 | 36 | 37 | true 38 | 39 | 40 | @*android:dimen/status_bar_height_portrait 41 | 42 | -------------------------------------------------------------------------------- /gps/etc/flp.conf: -------------------------------------------------------------------------------- 1 | ################################### 2 | ##### FLP settings ##### 3 | ################################### 4 | 5 | ################################### 6 | # FLP BATCH SIZE 7 | ################################### 8 | # The number of batched locations 9 | # requested to modem. The desired number 10 | # defined below may not be satisfied, as 11 | # the modem can only return the number 12 | # of batched locations that can be allocated, 13 | # which is limited by memory. The default 14 | # batch size defined as 20 as below. 15 | BATCH_SIZE=40 16 | 17 | ################################### 18 | # FLP OUTDOOR TRIP BATCH SIZE 19 | ################################### 20 | # The number of batched locations 21 | # requested to modem for outdoor 22 | # trip batching. The desired number 23 | # defined below may not be satisfied, as 24 | # the modem can only return the number 25 | # of batched locations that can be allocated, 26 | # which is limited by memory. The default 27 | # trip batch size defined as 600 as below. 28 | OUTDOOR_TRIP_BATCH_SIZE=600 29 | 30 | ################################### 31 | # FLP BATCHING SESSION TIMEOUT 32 | ################################### 33 | # Duration with which batch session timeout 34 | # happens in milliseconds. If not specified 35 | # or set to zero, batching session timeout 36 | # defaults to 20 seconds by the modem. 37 | # BATCH_SESSION_TIMEOUT=20000 38 | 39 | ################################### 40 | # FLP BATCHING ACCURACY 41 | ################################### 42 | # Set to one of the defined values below 43 | # to define the accuracy of batching. 44 | # If not specified, accuracy defaults 45 | # to LOW. 46 | # FLP BATCHING ACCURACY values: 47 | # Low accuracy = 0 48 | # Medium accuracy = 1 49 | # High accuracy = 2 50 | ACCURACY=1 51 | 52 | #################################### 53 | # By default if network fixes are not sensor assisted 54 | # these fixes must be dropped. This parameter adds an exception 55 | # for targets where there is no PDR and we still want to 56 | # report out network fixes 57 | # 0: MUST NOT ALLOW NETWORK FIXES 58 | # 1: ALLOW NETWORK FIXES 59 | #################################### 60 | ALLOW_NETWORK_FIXES = 0 61 | -------------------------------------------------------------------------------- /gps/utils/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = -Wundef \ 4 | -MD \ 5 | -Wno-trigraphs \ 6 | -g -O0 \ 7 | -fno-inline \ 8 | -fno-short-enums \ 9 | -fpic \ 10 | -I./ \ 11 | -std=c++14 \ 12 | $(LOCPLA_CFLAGS) 13 | 14 | libgps_utils_la_h_sources = \ 15 | msg_q.h \ 16 | linked_list.h \ 17 | loc_cfg.h \ 18 | loc_log.h \ 19 | loc_target.h \ 20 | loc_timer.h \ 21 | MsgTask.h \ 22 | LocHeap.h \ 23 | LocThread.h \ 24 | LocTimer.h \ 25 | LocIpc.h \ 26 | SkipList.h\ 27 | loc_misc_utils.h \ 28 | loc_nmea.h \ 29 | gps_extended_c.h \ 30 | gps_extended.h \ 31 | loc_gps.h \ 32 | log_util.h \ 33 | LocSharedLock.h \ 34 | LocUnorderedSetMap.h\ 35 | LocLoggerBase.h 36 | 37 | libgps_utils_la_c_sources = \ 38 | linked_list.c \ 39 | msg_q.c \ 40 | loc_cfg.cpp \ 41 | loc_log.cpp \ 42 | loc_target.cpp \ 43 | LocHeap.cpp \ 44 | LocTimer.cpp \ 45 | LocThread.cpp \ 46 | LocIpc.cpp \ 47 | LogBuffer.cpp \ 48 | MsgTask.cpp \ 49 | loc_misc_utils.cpp \ 50 | loc_nmea.cpp 51 | 52 | library_includedir = $(pkgincludedir) 53 | 54 | library_include_HEADERS = $(libgps_utils_la_h_sources) 55 | 56 | libgps_utils_la_SOURCES = $(libgps_utils_la_c_sources) 57 | 58 | if USE_GLIB 59 | libgps_utils_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 60 | libgps_utils_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 61 | libgps_utils_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 62 | else 63 | libgps_utils_la_CFLAGS = $(AM_CFLAGS) 64 | libgps_utils_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 65 | libgps_utils_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 66 | endif 67 | 68 | libgps_utils_la_LIBADD = $(CUTILS_LIBS) -ldl 69 | 70 | #Create and Install libraries 71 | lib_LTLIBRARIES = libgps_utils.la 72 | 73 | pkgconfigdir = $(libdir)/pkgconfig 74 | pkgconfig_DATA = gps-utils.pc 75 | EXTRA_DIST = $(pkgconfig_DATA) 76 | -------------------------------------------------------------------------------- /gps/etc/seccomp_policy/gnss@2.0-xtwifi-client.policy: -------------------------------------------------------------------------------- 1 | 2 | #******************************************************************************* 3 | # Copyright (c) 2020 The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above 11 | # copyright notice, this list of conditions and the following 12 | # disclaimer in the documentation and/or other materials provided 13 | # with the distribution. 14 | # * Neither the name of The Linux Foundation, nor the names of its 15 | # contributors may be used to endorse or promote products derived 16 | # from this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 19 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 22 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 25 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 27 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 28 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | #****************************************************************************** 31 | 32 | fdatasync: 1 33 | getdents64: 1 34 | gettimeofday: 1 35 | #ioctl: arg1 == _IOC(_IOC_NONE || arg1 == _IOC(_IOC_READ || arg1 == VSOC_MAYBE_SEND_INTERRUPT_TO_HOST 36 | lseek: 1 37 | madvise: 1 38 | mkdirat: 1 39 | pwrite64: 1 40 | 41 | timerfd_create: 1 42 | timerfd_settime: 1 43 | epoll_create1: 1 44 | epoll_pwait: 1 45 | epoll_ctl: 1 46 | -------------------------------------------------------------------------------- /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 69 | -------------------------------------------------------------------------------- /rootdir/bin/init.qti.dcvs.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | # 3 | # Copyright (c) 2020, The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above 11 | # copyright notice, this list of conditions and the following 12 | # disclaimer in the documentation and/or other materials provided 13 | # with the distribution. 14 | # * Neither the name of The Linux Foundation nor the names of its 15 | # contributors may be used to endorse or promote products derived 16 | # from this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 19 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 22 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 25 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 27 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 28 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | # 30 | for device in /sys/devices/platform/soc 31 | do 32 | for memlat in $device/*cpu*-lat/devfreq/*cpu*-lat 33 | do 34 | echo "mem_latency" > $memlat/governor 35 | echo 10 > $memlat/polling_interval 36 | echo 400 > $memlat/mem_latency/ratio_ceil 37 | done 38 | 39 | for latfloor in $device/*cpu*-ddr-latfloor*/devfreq/*cpu-ddr-latfloor* 40 | do 41 | echo "compute" > $latfloor/governor 42 | echo 10 > $latfloor/polling_interval 43 | done 44 | done; 45 | -------------------------------------------------------------------------------- /configs/thermal/thermal-engine-normal.conf: -------------------------------------------------------------------------------- 1 | # SENSOR : ALIAS 2 | 3 | #debug 4 | #Conf file: /vendor/etc/thermal-engine-normal.conf (ginkgo) 5 | 6 | [MONITOR-CPU-HOTPLUG] 7 | disable 8 | algo_type monitor 9 | sampling 5000 10 | sensor quiet-therm-adc 11 | thresholds 47000 50000 12 | thresholds_clr 45000 48000 13 | actions hotplug_3+hotplug_4+hotplug_5+hotplug_6 14 | hotplug_3+hotplug_4+hotplug_5+hotplug_6 15 | action_info 0+0+1+1 1+1+1+1 16 | 17 | [SS-QUIET-THERMAL-S1] 18 | algo_type ss 19 | sampling 5000 20 | sensor emmc-ufs-therm-adc 21 | device cpu0 22 | set_point 51000 23 | set_point_clr 50900 24 | time_constant 0 25 | device_max_limit 1420800 26 | 27 | [SS-QUIET-THERMAL-S2] 28 | disable 29 | algo_type ss 30 | sampling 5000 31 | sensor quiet-therm-adc 32 | device cpu0 33 | set_point 47000 34 | set_point_clr 45000 35 | time_constant 0 36 | device_max_limit 1017600 37 | 38 | [SS-QUIET-THERMAL-G1] 39 | algo_type ss 40 | sampling 5000 41 | sensor emmc-ufs-therm-adc 42 | device cpu4 43 | set_point 49000 44 | set_point_clr 48000 45 | time_constant 0 46 | device_max_limit 1401600 47 | 48 | [LCD_MONITOR] 49 | algo_type monitor 50 | sampling 5000 51 | sensor backlight_therm 52 | thresholds 50000 51000 52000 53 | thresholds_clr 48000 49000 50000 54 | actions lcd lcd lcd 55 | action_info 300 500 700 56 | 57 | [BATTERY_CHARGING_STL] 58 | algo_type monitor 59 | sampling 1000 60 | sensor quiet-therm-adc 61 | thresholds 37500 39500 40000 41000 42000 43000 44000 62 | thresholds_clr 35000 37000 38000 39000 40000 41000 42000 63 | actions battery battery battery battery battery battery battery 64 | action_info 1 2 3 4 5 7 8 65 | 66 | [LCD_MONITOR_STATE] 67 | algo_type monitor 68 | sampling 5000 69 | sensor quiet-therm-adc 70 | thresholds 61000 71 | thresholds_clr 58000 72 | actions lcd 73 | action_info 1800 74 | 75 | [CPU_HOTPLUG_MONITOR] 76 | algo_type monitor 77 | sampling 5000 78 | sensor quiet-therm-adc 79 | thresholds 61000 80 | thresholds_clr 58000 81 | actions hotplug_1+hotplug_2+hotplug_3+hotplug_4+hotplug_5+hotplug_6 82 | action_info 1+1+1+1+1+1 83 | 84 | [HIGH_TEMP_STATE] 85 | algo_type monitor 86 | sampling 5000 87 | sensor quiet-therm-adc 88 | thresholds 61000 89 | thresholds_clr 58000 90 | actions temp_state 91 | action_info 4 92 | 93 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 23 | 24 | 0 25 | -1 26 | -1 27 | 28 | 29 | 43 | 3 44 | 45 | -------------------------------------------------------------------------------- /configs/input/excluded-input-devices.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 | -------------------------------------------------------------------------------- /aosp_ginkgo.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2020-21 Raphielscape LLC. and Haruka LLC. 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 | # 18 | # All components inherited here go to system image 19 | # 20 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) 21 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) 22 | 23 | # 24 | # All components inherited here go to system_ext image 25 | # 26 | $(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk) 27 | $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk) 28 | 29 | # 30 | # All components inherited here go to vendor image 31 | # 32 | # TODO(b/136525499): move *_vendor.mk into the vendor makefile later 33 | $(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk) 34 | $(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk) 35 | 36 | # b/189477034: Bypass build time check on uses_libs until vendor fixes all their apps 37 | PRODUCT_BROKEN_VERIFY_USES_LIBRARIES := true 38 | 39 | # Set shipping API level 40 | $(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_p.mk) 41 | 42 | # Inherit from ginkgo device 43 | $(call inherit-product, device/xiaomi/ginkgo/device.mk) 44 | 45 | # Inherit PixelExperience stuff 46 | $(call inherit-product, vendor/aosp/config/common_full_phone.mk) 47 | 48 | # PixelExperience specifics 49 | TARGET_GAPPS_ARCH := arm64 50 | TARGET_BOOT_ANIMATION_RES := 1080 51 | TARGET_INCLUDE_LIVE_WALLPAPERS := false 52 | TARGET_USES_AOSP_RECOVERY := true 53 | TARGET_SUPPORTS_QUICK_TAP := true 54 | 55 | # Device identifiers 56 | PRODUCT_NAME := aosp_ginkgo 57 | PRODUCT_DEVICE := ginkgo 58 | PRODUCT_BRAND := Xiaomi 59 | PRODUCT_MODEL := Redmi Note 8 60 | PRODUCT_MANUFACTURER := Xiaomi 61 | PRODUCT_GMS_CLIENTID_BASE := android-xiaomi 62 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | # Audio 2 | audio.sys.noisy.broadcast.delay=600 3 | audio.sys.offload.pstimeout.secs=3 4 | 5 | # Bluetooth 6 | persist.bluetooth.bqr.event_mask=14 7 | persist.bluetooth.bqr.min_interval_ms=500 8 | persist.vendor.bt.a2dp_offload_cap=sbc-aptx-aptxtws-aptxhd-aac 9 | persist.vendor.bt.a2dp.aac_whitelist=false 10 | persist.vendor.bt.a2dp.hal.implementation=false 11 | persist.vendor.bt.a2dp.mac_whitelist=false 12 | persist.vendor.bt.aac_frm_ctl.enabled=true 13 | persist.vendor.btstack.a2dp_offload_cap=sbc-aptx-aptxtws-aptxhd-aac-ldac 14 | persist.vendor.btstack.absvolfeature=true 15 | persist.vendor.btstack.enable.splita2dp=false 16 | vendor.bluetooth.soc=cherokee 17 | 18 | # Charger 19 | ro.charger.enable_suspend=true 20 | 21 | # CNE/DPM 22 | persist.vendor.cne.feature=1 23 | persist.vendor.dpm.feature=11 24 | persist.vendor.dpmhalservice.enable=1 25 | 26 | # Data 27 | persist.data.df.dev_name=rmnet_usb0 28 | 29 | # Fwk detect 30 | ro.vendor.qti.va_odm.support=1 31 | 32 | # IMS 33 | persist.vendor.ims.disableADBLogs=1 34 | persist.vendor.ims.disableDebugLogs=1 35 | persist.vendor.ims.disableIMSLogs=1 36 | persist.vendor.ims.disableQXDMLogs=1 37 | 38 | # Incremental FS 39 | ro.incremental.enable=1 40 | 41 | # IORap 42 | persist.device_config.runtime_native_boot.iorap_readahead_enable=true 43 | 44 | # NFC 45 | ro.se.type=HCE,UICC 46 | 47 | # Media 48 | debug.stagefright.ccodec=1 49 | debug.stagefright.omx_default_rank=0 50 | media.aac_51_output_enabled=true 51 | media.stagefright.enable-aac=true 52 | media.stagefright.enable-fma2dp=true 53 | media.stagefright.enable-http=true 54 | media.stagefright.enable-player=true 55 | media.stagefright.enable-qcp=true 56 | media.stagefright.enable-scan=true 57 | media.stagefright.thumbnail.prefer_hw_codecs=true 58 | persist.mm.enable.prefetch=true 59 | ro.media.recorder-max-base-layer-fps=60 60 | vendor.mm.enable.qcom_parser=63963135 61 | 62 | # Netflix 63 | ro.netflix.bsp_rev=Q6125-17995-1 64 | 65 | # Shutdown 66 | ro.build.shutdown_timeout=2 67 | 68 | # RIL 69 | persist.sys.fflag.override.settings_provider_model=false 70 | 71 | # WFD 72 | persist.debug.wfd.enable=1 73 | persist.sys.wfd.virtual=0 74 | 75 | # ZRAM 76 | ro.zram.mark_idle_delay_mins=60 77 | ro.zram.first_wb_delay_mins=1440 78 | ro.zram.periodic_wb_delay_hours=24 79 | 80 | # Zygote 81 | persist.device_config.runtime_native.usap_pool_enabled=true 82 | -------------------------------------------------------------------------------- /update-sha1sums.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | import os 20 | import sys 21 | from hashlib import sha1 22 | 23 | device='ginkgo' 24 | vendor='xiaomi' 25 | 26 | with open('proprietary-files.txt', 'r') as f: 27 | lines = f.read().splitlines() 28 | vendorPath = '../../../vendor/' + vendor + '/' + device + '/proprietary' 29 | needSHA1 = False 30 | 31 | 32 | def cleanup(): 33 | for index, line in enumerate(lines): 34 | # Skip empty or commented lines 35 | if len(line) == 0 or line[0] == '#' or '|' not in line: 36 | continue 37 | 38 | # Drop SHA1 hash, if existing 39 | lines[index] = line.split('|')[0] 40 | 41 | 42 | def update(): 43 | for index, line in enumerate(lines): 44 | # Skip empty lines 45 | if len(line) == 0: 46 | continue 47 | 48 | # Check if we need to set SHA1 hash for the next files 49 | if line[0] == '#': 50 | needSHA1 = (' - from' in line) 51 | continue 52 | 53 | if needSHA1: 54 | # Remove existing SHA1 hash 55 | line = line.split('|')[0] 56 | 57 | filePath = line.split(';')[0].split(':')[-1] 58 | if filePath[0] == '-': 59 | filePath = filePath[1:] 60 | 61 | with open(os.path.join(vendorPath, filePath), 'rb') as f: 62 | hash = sha1(f.read()).hexdigest() 63 | 64 | lines[index] = '%s|%s' % (line, hash) 65 | 66 | 67 | if len(sys.argv) == 2 and sys.argv[1] == '-c': 68 | cleanup() 69 | else: 70 | update() 71 | 72 | with open('proprietary-files.txt', 'w') as file: 73 | file.write('\n'.join(lines) + '\n') 74 | -------------------------------------------------------------------------------- /gps/utils/MsgTask.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2013, 2015, 2020 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __MSG_TASK__ 30 | #define __MSG_TASK__ 31 | 32 | #include 33 | #include 34 | 35 | namespace loc_util { 36 | 37 | struct LocMsg { 38 | inline LocMsg() {} 39 | inline virtual ~LocMsg() {} 40 | virtual void proc() const = 0; 41 | inline virtual void log() const {} 42 | }; 43 | 44 | class MsgTask { 45 | const void* mQ; 46 | LocThread mThread; 47 | public: 48 | ~MsgTask() = default; 49 | MsgTask(const char* threadName = NULL); 50 | void sendMsg(const LocMsg* msg) const; 51 | void sendMsg(const std::function runnable) const; 52 | }; 53 | 54 | } // 55 | 56 | #endif //__MSG_TASK__ 57 | -------------------------------------------------------------------------------- /framework_manifest.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | 31 | vendor.qti.hardware.radio.atcmdfwd 32 | hwbinder 33 | 1.0 34 | 35 | IAtCmdFwd 36 | AtCmdFwdService 37 | 38 | 39 | 40 | 41 | vendor.qti.hardware.sigma_miracast 42 | hwbinder 43 | 1.0 44 | 45 | Isigma_miracast 46 | sigmahal 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /configs/media/system_properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /extract-files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # SPDX-License-Identifier: Apache-2.0 7 | 8 | if [ "${BASH_SOURCE[0]}" != "${0}" ]; then 9 | return 10 | fi 11 | 12 | set -e 13 | 14 | # Required! 15 | DEVICE=ginkgo 16 | VENDOR=xiaomi 17 | 18 | # Load extract_utils and do some sanity checks 19 | MY_DIR="${BASH_SOURCE%/*}" 20 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 21 | 22 | ANDROID_ROOT="${MY_DIR}/../../.." 23 | 24 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 25 | if [ ! -f "$HELPER" ]; then 26 | echo "Unable to find helper script at $HELPER" 27 | exit 1 28 | fi 29 | source "${HELPER}" 30 | 31 | # Default to sanitizing the vendor folder before extraction 32 | CLEAN_VENDOR=true 33 | 34 | KANG= 35 | SECTION= 36 | 37 | while [ "${#}" -gt 0 ]; do 38 | case "${1}" in 39 | -n | --no-cleanup ) 40 | CLEAN_VENDOR=false 41 | ;; 42 | -k | --kang ) 43 | KANG="--kang" 44 | ;; 45 | -s | --section ) 46 | SECTION="${2}"; shift 47 | CLEAN_VENDOR=false 48 | ;; 49 | * ) 50 | SRC="${1}" 51 | ;; 52 | esac 53 | shift 54 | done 55 | 56 | if [ -z "${SRC}" ]; then 57 | SRC="adb" 58 | fi 59 | 60 | function blob_fixup() { 61 | case "${1}" in 62 | vendor/bin/mlipayd@1.1 | vendor/lib64/libmlipay.so | vendor/lib64/libmlipay@1.1.so) 63 | "${PATCHELF}" --remove-needed "vendor.xiaomi.hardware.mtdservice@1.0.so" "${2}" 64 | ;; 65 | vendor/etc/camera/camera_config.xml) 66 | # Remove vtcamera for ginkgo 67 | gawk -i inplace '{ p = 1 } //{ t = $0; while (getline > 0) { t = t ORS $0; if (/ginkgo_vtcamera/) p = 0; if (/<\/CameraModuleConfig>/) break } $0 = t } p' "${2}" 68 | ;; 69 | vendor/lib/miwatermark.so) 70 | "${PATCHELF}" --add-needed "libwatermark_shim.so" "${2}" 71 | ;; 72 | esac 73 | } 74 | 75 | # Initialize the helper 76 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" 77 | 78 | extract "${MY_DIR}"/proprietary-files.txt "${SRC}" \ 79 | "${KANG}" --section "${SECTION}" 80 | 81 | DEVICE_BLOB_ROOT="${ANDROID_ROOT}"/vendor/"${VENDOR}"/"${DEVICE}"/proprietary 82 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /configs/thermal/thermal-engine-camera.conf: -------------------------------------------------------------------------------- 1 | # SENSOR : ALIAS 2 | 3 | #debug 4 | #Conf file: /vendor/etc/thermal-engine-camera.conf 5 | 6 | [MONITOR-CPU-HOTPLUG] 7 | disable 8 | algo_type monitor 9 | sampling 5000 10 | sensor quiet-therm-adc 11 | thresholds 47000 50000 12 | thresholds_clr 45000 48000 13 | actions hotplug_3+hotplug_4+hotplug_5+hotplug_6 14 | hotplug_3+hotplug_4+hotplug_5+hotplug_6 15 | action_info 0+0+1+1 1+1+1+1 16 | 17 | [SS-QUIET-THERMAL-S1] 18 | algo_type ss 19 | sampling 5000 20 | sensor emmc-ufs-therm-adc 21 | device cpu0 22 | set_point 51000 23 | set_point_clr 50900 24 | time_constant 0 25 | device_max_limit 1420800 26 | 27 | [SS-QUIET-THERMAL-S2] 28 | disable 29 | algo_type ss 30 | sampling 5000 31 | sensor quiet-therm-adc 32 | device cpu0 33 | set_point 47000 34 | set_point_clr 45000 35 | time_constant 0 36 | device_max_limit 1017600 37 | 38 | [SS-QUIET-THERMAL-G1] 39 | algo_type ss 40 | sampling 5000 41 | sensor emmc-ufs-therm-adc 42 | device cpu4 43 | set_point 49000 44 | set_point_clr 48000 45 | time_constant 0 46 | device_max_limit 1401600 47 | 48 | [LCD_MONITOR] 49 | algo_type monitor 50 | sampling 5000 51 | sensor backlight_therm 52 | thresholds 44000 45000 46000 53 | thresholds_clr 42000 43000 44000 54 | actions lcd lcd lcd 55 | action_info 300 500 700 56 | 57 | [BATTERY_CHARGING_STL] 58 | algo_type monitor 59 | sampling 1000 60 | sensor quiet-therm-adc 61 | thresholds 35000 62 | thresholds_clr 33000 63 | actions battery 64 | action_info 8 65 | 66 | [LCD_MONITOR_STATE] 67 | algo_type monitor 68 | sampling 5000 69 | sensor quiet-therm-adc 70 | thresholds 61000 71 | thresholds_clr 58000 72 | actions lcd 73 | action_info 1800 74 | 75 | [CPU_HOTPLUG_MONITOR] 76 | algo_type monitor 77 | sampling 5000 78 | sensor quiet-therm-adc 79 | thresholds 61000 80 | thresholds_clr 58000 81 | actions hotplug_1+hotplug_2+hotplug_3+hotplug_4+hotplug_5+hotplug_6 82 | action_info 1+1+1+1+1+1 83 | 84 | [HIGH_TEMP_STATE] 85 | algo_type monitor 86 | sampling 5000 87 | sensor quiet-therm-adc 88 | thresholds 61000 89 | thresholds_clr 58000 90 | actions temp_state 91 | action_info 4 92 | 93 | [HIGH_TEMP_STATE_flash] 94 | algo_type monitor 95 | sampling 5000 96 | sensor quiet-therm-adc 97 | thresholds 42000 98 | thresholds_clr 40000 99 | actions temp_state 100 | action_info 3 101 | -------------------------------------------------------------------------------- /gps/batching/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps location-batching 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps location-batching package version 1.0.0 8 | AC_INIT([location-batching],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([Makefile.am]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 37 | AC_SUBST([LOCCORE_CFLAGS]) 38 | AC_SUBST([LOCCORE_LIBS]) 39 | 40 | AC_ARG_WITH([locpla_includes], 41 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 42 | [specify the path to locpla-includes in loc-pla_git.bb]), 43 | [locpla_incdir=$withval], 44 | with_locpla_includes=no) 45 | 46 | if test "x$with_locpla_includes" != "xno"; then 47 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 48 | fi 49 | 50 | AC_ARG_WITH([glib], 51 | AC_HELP_STRING([--with-glib], 52 | [enable glib, building HLOS systems which use glib])) 53 | 54 | if (test "x${with_glib}" = "xyes"); then 55 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 56 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 57 | AC_MSG_ERROR(GThread >= 2.16 is required)) 58 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 59 | AC_MSG_ERROR(GLib >= 2.16 is required)) 60 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 61 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 62 | 63 | AC_SUBST(GLIB_CFLAGS) 64 | AC_SUBST(GLIB_LIBS) 65 | fi 66 | 67 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 68 | 69 | AC_CONFIG_FILES([ \ 70 | Makefile \ 71 | location-batching.pc 72 | ]) 73 | 74 | AC_OUTPUT 75 | -------------------------------------------------------------------------------- /gps/core/Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | 3 | AM_CFLAGS = -I./ \ 4 | $(LOCPLA_CFLAGS) \ 5 | $(GPSUTILS_CFLAGS) \ 6 | -I./data-items/ \ 7 | -I./data-items/common \ 8 | -I./observer \ 9 | -I$(WORKSPACE)/gps-noship/flp \ 10 | -D__func__=__PRETTY_FUNCTION__ \ 11 | -fno-short-enums \ 12 | -std=c++11 13 | 14 | libloc_core_la_h_sources = \ 15 | LocApiBase.h \ 16 | LocAdapterBase.h \ 17 | ContextBase.h \ 18 | LocContext.h \ 19 | LBSProxyBase.h \ 20 | loc_core_log.h \ 21 | LocAdapterProxyBase.h \ 22 | EngineHubProxyBase.h \ 23 | data-items/DataItemId.h \ 24 | data-items/IDataItemCore.h \ 25 | data-items/DataItemConcreteTypesBase.h \ 26 | observer/IDataItemObserver.h \ 27 | observer/IDataItemSubscription.h \ 28 | observer/IFrameworkActionReq.h \ 29 | observer/IOsObserver.h \ 30 | SystemStatusOsObserver.h \ 31 | SystemStatus.h 32 | 33 | libloc_core_la_c_sources = \ 34 | LocApiBase.cpp \ 35 | LocAdapterBase.cpp \ 36 | ContextBase.cpp \ 37 | LocContext.cpp \ 38 | loc_core_log.cpp \ 39 | data-items/DataItemsFactoryProxy.cpp \ 40 | SystemStatusOsObserver.cpp \ 41 | SystemStatus.cpp 42 | 43 | if USE_EXTERNAL_AP 44 | AM_CFLAGS += -DFEATURE_EXTERNAL_AP 45 | endif 46 | 47 | library_includedir = $(pkgincludedir) 48 | 49 | library_include_HEADERS = $(libloc_core_la_h_sources) 50 | 51 | libloc_core_la_SOURCES = $(libloc_core_la_c_sources) 52 | 53 | if USE_GLIB 54 | libloc_core_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ 55 | libloc_core_la_LDFLAGS = -lstdc++ -Wl,-z,defs -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 56 | libloc_core_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ 57 | else 58 | libloc_core_la_CFLAGS = $(AM_CFLAGS) 59 | libloc_core_la_LDFLAGS = -Wl,-z,defs -lpthread -shared -version-info 1:0:0 60 | libloc_core_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) 61 | endif 62 | 63 | if USE_FEATURE_AUTOMOTIVE 64 | AM_CFLAGS += -DFEATURE_AUTOMOTIVE 65 | endif 66 | 67 | libloc_core_la_LIBADD = -ldl $(GPSUTILS_LIBS) 68 | 69 | #Create and Install libraries 70 | lib_LTLIBRARIES = libloc_core.la 71 | 72 | pkgconfigdir = $(libdir)/pkgconfig 73 | pkgconfig_DATA = loc-core.pc 74 | EXTRA_DIST = $(pkgconfig_DATA) 75 | -------------------------------------------------------------------------------- /gps/CleanSpec.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # If you don't need to do a full clean build but would like to touch 17 | # a file or delete some intermediate files, add a clean step to the end 18 | # of the list. These steps will only be run once, if they haven't been 19 | # run before. 20 | # 21 | # E.g.: 22 | # $(call add-clean-step, touch -c external/sqlite/sqlite3.h) 23 | # $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) 24 | # 25 | # Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with 26 | # files that are missing or have been moved. 27 | # 28 | # Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. 29 | # Use $(OUT_DIR) to refer to the "out" directory. 30 | # 31 | # If you need to re-do something that's already mentioned, just copy 32 | # the command and add it to the bottom of the list. E.g., if a change 33 | # that you made last week required touching a file and a change you 34 | # made today requires touching the same file, just copy the old 35 | # touch step and add it to the end of the list. 36 | # 37 | # ************************************************ 38 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 39 | # ************************************************ 40 | 41 | # For example: 42 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) 43 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) 44 | #$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) 45 | #$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) 46 | 47 | # ************************************************ 48 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 49 | # ************************************************ 50 | $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc_api*) 51 | -------------------------------------------------------------------------------- /gps/core/LocContext.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011-2014, 2017-2020 The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef __LOC_CONTEXT__ 30 | #define __LOC_CONTEXT__ 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | namespace loc_core { 38 | 39 | class LocContext : public ContextBase { 40 | static const MsgTask* mMsgTask; 41 | static ContextBase* mContext; 42 | static const MsgTask* getMsgTask(const char* name); 43 | static pthread_mutex_t mGetLocContextMutex; 44 | 45 | protected: 46 | LocContext(const MsgTask* msgTask); 47 | inline virtual ~LocContext() {} 48 | 49 | public: 50 | static const char* mLBSLibName; 51 | static const char* mLocationHalName; 52 | 53 | static ContextBase* getLocContext(const char* name); 54 | 55 | static void injectFeatureConfig(ContextBase *context); 56 | }; 57 | 58 | } 59 | 60 | #endif //__LOC_CONTEXT__ 61 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssConfiguration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | 6 | /* Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | 22 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 23 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssConfiguration; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* 42 | * Interface for passing GNSS configuration info from platform to HAL. 43 | */ 44 | struct Gnss; 45 | struct GnssConfiguration : public IGnssConfiguration { 46 | GnssConfiguration(Gnss* gnss); 47 | ~GnssConfiguration() = default; 48 | 49 | /* 50 | * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow. 51 | * These declarations were generated from IGnssConfiguration.hal. 52 | */ 53 | Return setSuplVersion(uint32_t version) override; 54 | Return setSuplMode(uint8_t mode) override; 55 | Return setSuplEs(bool enabled) override; 56 | Return setLppProfile(uint8_t lppProfileMask) override; 57 | Return setGlonassPositioningProtocol(uint8_t protocol) override; 58 | Return setEmergencySuplPdn(bool enable) override; 59 | Return setGpsLock(uint8_t lock) override; 60 | 61 | private: 62 | Gnss* mGnss = nullptr; 63 | }; 64 | 65 | } // namespace implementation 66 | } // namespace V1_0 67 | } // namespace gnss 68 | } // namespace hardware 69 | } // namespace android 70 | 71 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H 72 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_0 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V1_0 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_1 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V1_1 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/2.0/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V2_0 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V2_0 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssNi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 23 | 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V2_1 { 31 | namespace implementation { 32 | 33 | using ::android::hardware::gnss::V1_0::IGnssNi; 34 | using ::android::hardware::gnss::V1_0::IGnssNiCallback; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | struct Gnss; 42 | struct GnssNi : public IGnssNi { 43 | GnssNi(Gnss* gnss); 44 | ~GnssNi() = default; 45 | 46 | /* 47 | * Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 48 | * These declarations were generated from IGnssNi.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | Return respond(int32_t notifId, 52 | IGnssNiCallback::GnssUserResponseType userResponse) override; 53 | 54 | private: 55 | struct GnssNiDeathRecipient : hidl_death_recipient { 56 | GnssNiDeathRecipient(sp gnssNi) : mGnssNi(gnssNi) { 57 | } 58 | ~GnssNiDeathRecipient() = default; 59 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 60 | sp mGnssNi; 61 | }; 62 | 63 | private: 64 | sp mGnssNiDeathRecipient = nullptr; 65 | sp mGnssNiCbIface = nullptr; 66 | Gnss* mGnss = nullptr; 67 | }; 68 | 69 | } // namespace implementation 70 | } // namespace V2_1 71 | } // namespace gnss 72 | } // namespace hardware 73 | } // namespace android 74 | 75 | #endif // ANDROID_HARDWARE_GNSS_V2_0_GNSSNI_H 76 | -------------------------------------------------------------------------------- /gps/android/2.0/AGnss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::Return; 35 | using ::android::hardware::Void; 36 | using ::android::hardware::hidl_vec; 37 | using ::android::hardware::hidl_string; 38 | using ::android::sp; 39 | 40 | struct Gnss; 41 | struct AGnss : public V2_0::IAGnss { 42 | 43 | AGnss(Gnss* gnss); 44 | ~AGnss(); 45 | /* 46 | * Methods from ::android::hardware::gnss::V2_0::IAGnss interface follow. 47 | * These declarations were generated from IAGnss.hal. 48 | */ 49 | Return setCallback(const sp& callback) override; 50 | 51 | Return dataConnClosed() override; 52 | 53 | Return dataConnFailed() override; 54 | 55 | Return dataConnOpen(uint64_t networkHandle, const hidl_string& apn, 56 | V2_0::IAGnss::ApnIpType apnIpType) override; 57 | 58 | Return setServer(V2_0::IAGnssCallback::AGnssType type, 59 | const hidl_string& hostname, int32_t port) override; 60 | 61 | void statusCb(AGpsExtType type, LocAGpsStatusValue status); 62 | 63 | /* Data call setup callback passed down to GNSS HAL implementation */ 64 | static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); 65 | 66 | private: 67 | Gnss* mGnss = nullptr; 68 | sp mAGnssCbIface = nullptr; 69 | }; 70 | 71 | } // namespace implementation 72 | } // namespace V2_0 73 | } // namespace gnss 74 | } // namespace hardware 75 | } // namespace android 76 | 77 | #endif // ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 78 | -------------------------------------------------------------------------------- /gps/android/1.0/AGnss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IAGnss; 35 | using ::android::hardware::gnss::V1_0::IAGnssCallback; 36 | using ::android::hardware::Return; 37 | using ::android::hardware::Void; 38 | using ::android::hardware::hidl_vec; 39 | using ::android::hardware::hidl_string; 40 | using ::android::sp; 41 | 42 | struct Gnss; 43 | struct AGnss : public IAGnss { 44 | 45 | AGnss(Gnss* gnss); 46 | ~AGnss(); 47 | /* 48 | * Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow. 49 | * These declarations were generated from IAGnss.hal. 50 | */ 51 | Return setCallback(const sp& callback) override; 52 | 53 | Return dataConnClosed() override; 54 | 55 | Return dataConnFailed() override; 56 | 57 | Return dataConnOpen(const hidl_string& apn, 58 | IAGnss::ApnIpType apnIpType) override; 59 | 60 | Return setServer(IAGnssCallback::AGnssType type, 61 | const hidl_string& hostname, int32_t port) override; 62 | 63 | void statusIpV4Cb(AGnssExtStatusIpV4 status); 64 | 65 | /* Data call setup callback passed down to GNSS HAL implementation */ 66 | static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); 67 | 68 | private: 69 | Gnss* mGnss = nullptr; 70 | sp mAGnssCbIface = nullptr; 71 | }; 72 | 73 | } // namespace implementation 74 | } // namespace V1_0 75 | } // namespace gnss 76 | } // namespace hardware 77 | } // namespace android 78 | 79 | #endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H 80 | -------------------------------------------------------------------------------- /gps/android/1.1/AGnss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H 22 | #define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IAGnss; 35 | using ::android::hardware::gnss::V1_0::IAGnssCallback; 36 | using ::android::hardware::Return; 37 | using ::android::hardware::Void; 38 | using ::android::hardware::hidl_vec; 39 | using ::android::hardware::hidl_string; 40 | using ::android::sp; 41 | 42 | struct Gnss; 43 | struct AGnss : public IAGnss { 44 | 45 | AGnss(Gnss* gnss); 46 | ~AGnss(); 47 | /* 48 | * Methods from ::android::hardware::gnss::V1_0::IAGnss interface follow. 49 | * These declarations were generated from IAGnss.hal. 50 | */ 51 | Return setCallback(const sp& callback) override; 52 | 53 | Return dataConnClosed() override; 54 | 55 | Return dataConnFailed() override; 56 | 57 | Return dataConnOpen(const hidl_string& apn, 58 | IAGnss::ApnIpType apnIpType) override; 59 | 60 | Return setServer(IAGnssCallback::AGnssType type, 61 | const hidl_string& hostname, int32_t port) override; 62 | 63 | void statusIpV4Cb(AGnssExtStatusIpV4 status); 64 | 65 | /* Data call setup callback passed down to GNSS HAL implementation */ 66 | static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); 67 | 68 | private: 69 | Gnss* mGnss = nullptr; 70 | sp mAGnssCbIface = nullptr; 71 | }; 72 | 73 | } // namespace implementation 74 | } // namespace V1_1 75 | } // namespace gnss 76 | } // namespace hardware 77 | } // namespace android 78 | 79 | #endif // ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H 80 | -------------------------------------------------------------------------------- /gps/android/2.1/AGnss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 22 | #define ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V2_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::Return; 35 | using ::android::hardware::Void; 36 | using ::android::hardware::hidl_vec; 37 | using ::android::hardware::hidl_string; 38 | using ::android::sp; 39 | using ::android::hardware::gnss::V2_0::IAGnssCallback; 40 | 41 | struct Gnss; 42 | struct AGnss : public V2_0::IAGnss { 43 | 44 | AGnss(Gnss* gnss); 45 | ~AGnss(); 46 | /* 47 | * Methods from ::android::hardware::gnss::V2_0::IAGnss interface follow. 48 | * These declarations were generated from IAGnss.hal. 49 | */ 50 | Return setCallback(const sp& callback) override; 51 | 52 | Return dataConnClosed() override; 53 | 54 | Return dataConnFailed() override; 55 | 56 | Return dataConnOpen(uint64_t networkHandle, const hidl_string& apn, 57 | V2_0::IAGnss::ApnIpType apnIpType) override; 58 | 59 | Return setServer(V2_0::IAGnssCallback::AGnssType type, 60 | const hidl_string& hostname, int32_t port) override; 61 | 62 | void statusCb(AGpsExtType type, LocAGpsStatusValue status); 63 | 64 | /* Data call setup callback passed down to GNSS HAL implementation */ 65 | static void agnssStatusIpV4Cb(AGnssExtStatusIpV4 status); 66 | 67 | private: 68 | Gnss* mGnss = nullptr; 69 | sp mAGnssCbIface = nullptr; 70 | }; 71 | 72 | } // namespace implementation 73 | } // namespace V2_1 74 | } // namespace gnss 75 | } // namespace hardware 76 | } // namespace android 77 | 78 | #endif // ANDROID_HARDWARE_GNSS_V2_0_AGNSS_H 79 | -------------------------------------------------------------------------------- /overlay/packages/services/Telephony/res/xml/telephony_injection.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 27 | 29 | 30 | 33 | 34 | 35 | com.android.internal.telephony.ServiceStateTracker 36 | com.android.internal.telephony.SubscriptionController 37 | com.android.internal.telephony.SubscriptionInfoUpdater 38 | com.android.internal.telephony.GsmCdmaPhone 39 | com.android.internal.telephony.PhoneSwitcher 40 | com.android.internal.telephony.IccPhoneBookInterfaceManager 41 | com.android.internal.telephony.dataconnection.DcTracker 42 | com.android.internal.telephony.RIL 43 | com.android.internal.telephony.TelephonyComponentFactory 44 | com.android.internal.telephony.MultiSimSettingController 45 | 46 | 47 | -------------------------------------------------------------------------------- /gps/android/2.0/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "android.hardware.gnss@2.0-service-qti" 22 | 23 | #include 24 | #include 25 | #include "loc_cfg.h" 26 | #include "loc_misc_utils.h" 27 | 28 | extern "C" { 29 | #include "vndfwk-detect.h" 30 | } 31 | 32 | #ifdef ARCH_ARM_32 33 | #define DEFAULT_HW_BINDER_MEM_SIZE 65536 34 | #endif 35 | 36 | using android::hardware::gnss::V2_0::IGnss; 37 | 38 | using android::hardware::configureRpcThreadpool; 39 | using android::hardware::registerPassthroughServiceImplementation; 40 | using android::hardware::joinRpcThreadpool; 41 | 42 | using android::status_t; 43 | using android::OK; 44 | 45 | typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); 46 | 47 | int main() { 48 | 49 | ALOGI("%s", __FUNCTION__); 50 | 51 | int vendorInfo = getVendorEnhancedInfo(); 52 | bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); 53 | setVendorEnhanced(vendorEnhanced); 54 | 55 | #ifdef ARCH_ARM_32 56 | android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); 57 | #endif 58 | configureRpcThreadpool(1, true); 59 | status_t status; 60 | 61 | status = registerPassthroughServiceImplementation(); 62 | if (status == OK) { 63 | #ifdef LOC_HIDL_VERSION 64 | #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" 65 | 66 | void* libHandle = NULL; 67 | vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) 68 | dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); 69 | if (NULL != vendorEnhancedMainMethod) { 70 | (*vendorEnhancedMainMethod)(0, NULL); 71 | } 72 | #else 73 | ALOGI("LOC_HIDL_VERSION not defined."); 74 | #endif 75 | joinRpcThreadpool(); 76 | } else { 77 | ALOGE("Error while registering IGnss 2.0 service: %d", status); 78 | } 79 | 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /gps/android/2.1/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2_0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2_0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "android.hardware.gnss@2.1-service-qti" 22 | 23 | #include 24 | #include 25 | #include "loc_cfg.h" 26 | #include "loc_misc_utils.h" 27 | 28 | extern "C" { 29 | #include "vndfwk-detect.h" 30 | } 31 | 32 | #ifdef ARCH_ARM_32 33 | #define DEFAULT_HW_BINDER_MEM_SIZE 65536 34 | #endif 35 | 36 | using android::hardware::gnss::V2_1::IGnss; 37 | 38 | using android::hardware::configureRpcThreadpool; 39 | using android::hardware::registerPassthroughServiceImplementation; 40 | using android::hardware::joinRpcThreadpool; 41 | 42 | using android::status_t; 43 | using android::OK; 44 | 45 | typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); 46 | 47 | int main() { 48 | 49 | ALOGI("%s", __FUNCTION__); 50 | 51 | int vendorInfo = getVendorEnhancedInfo(); 52 | bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); 53 | setVendorEnhanced(vendorEnhanced); 54 | 55 | #ifdef ARCH_ARM_32 56 | android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); 57 | #endif 58 | configureRpcThreadpool(1, true); 59 | status_t status; 60 | 61 | status = registerPassthroughServiceImplementation(); 62 | if (status == OK) { 63 | #ifdef LOC_HIDL_VERSION 64 | #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" 65 | 66 | void* libHandle = NULL; 67 | vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) 68 | dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); 69 | if (NULL != vendorEnhancedMainMethod) { 70 | (*vendorEnhancedMainMethod)(0, NULL); 71 | } 72 | #else 73 | ALOGI("LOC_HIDL_VERSION not defined."); 74 | #endif 75 | joinRpcThreadpool(); 76 | } else { 77 | ALOGE("Error while registering IGnss 2.1 service: %d", status); 78 | } 79 | 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /org.ifaa.android.manager/src/org/ifaa/android/manager/IFAAService.java: -------------------------------------------------------------------------------- 1 | package org.ifaa.android.manager; 2 | 3 | import android.app.Service; 4 | import android.content.Intent; 5 | import android.os.HwBinder; 6 | import android.os.HwBlob; 7 | import android.os.HwParcel; 8 | import android.os.IBinder; 9 | import android.os.IHwBinder; 10 | import android.os.RemoteException; 11 | import android.util.Slog; 12 | import java.util.ArrayList; 13 | import java.util.Arrays; 14 | 15 | public class IFAAService extends Service { 16 | private static final boolean DEBUG = false; 17 | private static final String TAG = "IFAAService"; 18 | 19 | private final IBinder mIFAABinder = new IIFAAService.Stub() { 20 | private static final String INTERFACE_DESCRIPTOR = 21 | "vendor.xiaomi.hardware.mlipay@1.0::IMlipayService"; 22 | private static final String SERVICE_NAME = 23 | "vendor.xiaomi.hardware.mlipay@1.0::IMlipayService"; 24 | 25 | private static final int CODE_PROCESS_CMD = 1; 26 | 27 | private IHwBinder mService; 28 | 29 | @Override 30 | public byte[] processCmd_v2(byte[] param) { 31 | HwParcel reply = new HwParcel(); 32 | try { 33 | if (mService == null) { 34 | mService = HwBinder.getService(SERVICE_NAME, "default"); 35 | } 36 | if (mService != null) { 37 | HwParcel data = new HwParcel(); 38 | data.writeInterfaceToken(INTERFACE_DESCRIPTOR); 39 | ArrayList arrayList = new ArrayList(Arrays.asList(HwBlob.wrapArray(param))); 40 | data.writeInt8Vector(arrayList); 41 | data.writeInt32(arrayList.size()); 42 | mService.transact(CODE_PROCESS_CMD, data, reply, 0); 43 | reply.verifySuccess(); 44 | data.releaseTemporaryStorage(); 45 | ArrayList readInt8Vector = reply.readInt8Vector(); 46 | int size = readInt8Vector.size(); 47 | byte[] result = new byte[size]; 48 | for (int i = 0; i < size; i++) { 49 | result[i] = ((Byte) readInt8Vector.get(i)).byteValue(); 50 | } 51 | return result; 52 | } 53 | } catch (RemoteException e) { 54 | if (DEBUG) Slog.e(TAG, "transact failed. " + e); 55 | } finally { 56 | reply.release(); 57 | } 58 | if (DEBUG) Slog.e(TAG, "processCmdV2, return null"); 59 | return null; 60 | } 61 | }; 62 | 63 | @Override 64 | public IBinder onBind(Intent intent) { 65 | return mIFAABinder; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /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/android/1.0/GnssNi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "LocSvc_GnssNiInterface" 22 | 23 | #include 24 | #include "Gnss.h" 25 | #include "GnssNi.h" 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_0 { 31 | namespace implementation { 32 | 33 | void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { 34 | LOC_LOGE("%s] service died. cookie: %llu, who: %p", 35 | __FUNCTION__, static_cast(cookie), &who); 36 | // we do nothing here 37 | // Gnss::GnssDeathRecipient will stop the session 38 | } 39 | 40 | GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { 41 | mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); 42 | } 43 | 44 | // Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 45 | Return GnssNi::setCallback(const sp& callback) { 46 | if (mGnss == nullptr) { 47 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 48 | return Void(); 49 | } 50 | 51 | mGnss->setGnssNiCb(callback); 52 | 53 | if (mGnssNiCbIface != nullptr) { 54 | mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); 55 | } 56 | mGnssNiCbIface = callback; 57 | if (mGnssNiCbIface != nullptr) { 58 | mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); 59 | } 60 | 61 | return Void(); 62 | } 63 | 64 | Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { 65 | if (mGnss == nullptr) { 66 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 67 | return Void(); 68 | } 69 | 70 | GnssAPIClient* api = mGnss->getApi(); 71 | if (api == nullptr) { 72 | LOC_LOGE("%s]: api is nullptr", __FUNCTION__); 73 | return Void(); 74 | } 75 | 76 | api->gnssNiRespond(notifId, userResponse); 77 | 78 | return Void(); 79 | } 80 | 81 | } // namespace implementation 82 | } // namespace V1_0 83 | } // namespace gnss 84 | } // namespace hardware 85 | } // namespace android 86 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssNi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "LocSvc_GnssNiInterface" 22 | 23 | #include 24 | #include "Gnss.h" 25 | #include "GnssNi.h" 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V1_1 { 31 | namespace implementation { 32 | 33 | void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { 34 | LOC_LOGE("%s] service died. cookie: %llu, who: %p", 35 | __FUNCTION__, static_cast(cookie), &who); 36 | // we do nothing here 37 | // Gnss::GnssDeathRecipient will stop the session 38 | } 39 | 40 | GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { 41 | mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); 42 | } 43 | 44 | // Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 45 | Return GnssNi::setCallback(const sp& callback) { 46 | if (mGnss == nullptr) { 47 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 48 | return Void(); 49 | } 50 | 51 | mGnss->setGnssNiCb(callback); 52 | 53 | if (mGnssNiCbIface != nullptr) { 54 | mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); 55 | } 56 | mGnssNiCbIface = callback; 57 | if (mGnssNiCbIface != nullptr) { 58 | mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); 59 | } 60 | 61 | return Void(); 62 | } 63 | 64 | Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { 65 | if (mGnss == nullptr) { 66 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 67 | return Void(); 68 | } 69 | 70 | GnssAPIClient* api = mGnss->getApi(); 71 | if (api == nullptr) { 72 | LOC_LOGE("%s]: api is nullptr", __FUNCTION__); 73 | return Void(); 74 | } 75 | 76 | api->gnssNiRespond(notifId, userResponse); 77 | 78 | return Void(); 79 | } 80 | 81 | } // namespace implementation 82 | } // namespace V1_1 83 | } // namespace gnss 84 | } // namespace hardware 85 | } // namespace android 86 | -------------------------------------------------------------------------------- /gps/android/2.0/GnssNi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "LocSvc_GnssNiInterface" 22 | 23 | #include 24 | #include "Gnss.h" 25 | #include "GnssNi.h" 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V2_0 { 31 | namespace implementation { 32 | 33 | void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { 34 | LOC_LOGE("%s] service died. cookie: %llu, who: %p", 35 | __FUNCTION__, static_cast(cookie), &who); 36 | // we do nothing here 37 | // Gnss::GnssDeathRecipient will stop the session 38 | } 39 | 40 | GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { 41 | mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); 42 | } 43 | 44 | // Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 45 | Return GnssNi::setCallback(const sp& callback) { 46 | if (mGnss == nullptr) { 47 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 48 | return Void(); 49 | } 50 | 51 | mGnss->setGnssNiCb(callback); 52 | 53 | if (mGnssNiCbIface != nullptr) { 54 | mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); 55 | } 56 | mGnssNiCbIface = callback; 57 | if (mGnssNiCbIface != nullptr) { 58 | mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); 59 | } 60 | 61 | return Void(); 62 | } 63 | 64 | Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { 65 | if (mGnss == nullptr) { 66 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 67 | return Void(); 68 | } 69 | 70 | GnssAPIClient* api = mGnss->getApi(); 71 | if (api == nullptr) { 72 | LOC_LOGE("%s]: api is nullptr", __FUNCTION__); 73 | return Void(); 74 | } 75 | 76 | api->gnssNiRespond(notifId, userResponse); 77 | 78 | return Void(); 79 | } 80 | 81 | } // namespace implementation 82 | } // namespace V2_0 83 | } // namespace gnss 84 | } // namespace hardware 85 | } // namespace android 86 | -------------------------------------------------------------------------------- /gps/android/2.1/GnssNi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "LocSvc_GnssNiInterface" 22 | 23 | #include 24 | #include "Gnss.h" 25 | #include "GnssNi.h" 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace gnss { 30 | namespace V2_1 { 31 | namespace implementation { 32 | 33 | void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { 34 | LOC_LOGE("%s] service died. cookie: %llu, who: %p", 35 | __FUNCTION__, static_cast(cookie), &who); 36 | // we do nothing here 37 | // Gnss::GnssDeathRecipient will stop the session 38 | } 39 | 40 | GnssNi::GnssNi(Gnss* gnss) : mGnss(gnss) { 41 | mGnssNiDeathRecipient = new GnssNiDeathRecipient(this); 42 | } 43 | 44 | // Methods from ::android::hardware::gnss::V1_0::IGnssNi follow. 45 | Return GnssNi::setCallback(const sp& callback) { 46 | if (mGnss == nullptr) { 47 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 48 | return Void(); 49 | } 50 | 51 | mGnss->setGnssNiCb(callback); 52 | 53 | if (mGnssNiCbIface != nullptr) { 54 | mGnssNiCbIface->unlinkToDeath(mGnssNiDeathRecipient); 55 | } 56 | mGnssNiCbIface = callback; 57 | if (mGnssNiCbIface != nullptr) { 58 | mGnssNiCbIface->linkToDeath(mGnssNiDeathRecipient, 0 /*cookie*/); 59 | } 60 | 61 | return Void(); 62 | } 63 | 64 | Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseType userResponse) { 65 | if (mGnss == nullptr) { 66 | LOC_LOGE("%s]: mGnss is nullptr", __FUNCTION__); 67 | return Void(); 68 | } 69 | 70 | GnssAPIClient* api = mGnss->getApi(); 71 | if (api == nullptr) { 72 | LOC_LOGE("%s]: api is nullptr", __FUNCTION__); 73 | return Void(); 74 | } 75 | 76 | api->gnssNiRespond(notifId, userResponse); 77 | 78 | return Void(); 79 | } 80 | 81 | } // namespace implementation 82 | } // namespace V2_1 83 | } // namespace gnss 84 | } // namespace hardware 85 | } // namespace android 86 | -------------------------------------------------------------------------------- /gps/configure.ac: -------------------------------------------------------------------------------- 1 | # configure.ac -- Autoconf script for gps loc_hal 2 | # 3 | # Process this file with autoconf to produce a configure script 4 | 5 | # Requires autoconf tool later than 2.61 6 | AC_PREREQ(2.61) 7 | # Initialize the gps loc-hal package version 1.0.0 8 | AC_INIT([loc-hal],1.0.0) 9 | # Does not strictly follow GNU Coding standards 10 | AM_INIT_AUTOMAKE([foreign subdir-objects]) 11 | # Disables auto rebuilding of configure, Makefile.ins 12 | AM_MAINTAINER_MODE 13 | # Verifies the --srcdir is correct by checking for the path 14 | AC_CONFIG_SRCDIR([Makefile.am]) 15 | # defines some macros variable to be included by source 16 | AC_CONFIG_HEADERS([config.h]) 17 | AC_CONFIG_MACRO_DIR([m4]) 18 | 19 | # Checks for programs. 20 | AC_PROG_LIBTOOL 21 | AC_PROG_CXX 22 | AC_PROG_CC 23 | AM_PROG_CC_C_O 24 | AC_PROG_AWK 25 | AC_PROG_CPP 26 | AC_PROG_INSTALL 27 | AC_PROG_LN_S 28 | AC_PROG_MAKE_SET 29 | PKG_PROG_PKG_CONFIG 30 | 31 | # Checks for libraries. 32 | PKG_CHECK_MODULES([GPSUTILS], [gps-utils]) 33 | AC_SUBST([GPSUTILS_CFLAGS]) 34 | AC_SUBST([GPSUTILS_LIBS]) 35 | 36 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) 37 | AC_SUBST([LOCCORE_CFLAGS]) 38 | AC_SUBST([LOCCORE_LIBS]) 39 | 40 | AC_ARG_WITH([core_includes], 41 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], 42 | [Specify the location of the core headers]), 43 | [core_incdir=$withval], 44 | with_core_includes=no) 45 | 46 | if test "x$with_core_includes" != "xno"; then 47 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 48 | fi 49 | 50 | AC_ARG_WITH([locpla_includes], 51 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], 52 | [specify the path to locpla-includes in loc-pla_git.bb]), 53 | [locpla_incdir=$withval], 54 | with_locpla_includes=no) 55 | 56 | if test "x$with_locpla_includes" != "xno"; then 57 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") 58 | fi 59 | 60 | AC_SUBST([CPPFLAGS]) 61 | 62 | AC_ARG_WITH([glib], 63 | AC_HELP_STRING([--with-glib], 64 | [enable glib, building HLOS systems which use glib])) 65 | 66 | if (test "x${with_glib}" = "xyes"); then 67 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 68 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 69 | AC_MSG_ERROR(GThread >= 2.16 is required)) 70 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 71 | AC_MSG_ERROR(GLib >= 2.16 is required)) 72 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 73 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 74 | 75 | AC_SUBST(GLIB_CFLAGS) 76 | AC_SUBST(GLIB_LIBS) 77 | fi 78 | 79 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 80 | 81 | AC_CONFIG_FILES([ \ 82 | Makefile \ 83 | gnss/Makefile \ 84 | loc-hal.pc \ 85 | ]) 86 | 87 | AC_OUTPUT 88 | -------------------------------------------------------------------------------- /overlay/packages/services/Telephony/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 21 | 22 | 24 | 1 25 | 26 | 27 | true 28 | 29 | 30 | true 31 | 32 | 35 | true 36 | 37 | 41 | true 42 | 43 | 44 | true 45 | 46 | 47 | org.codeaurora.ims 48 | 49 | 50 | org.codeaurora.ims 51 | 52 | 53 | com.google.android.gms 54 | 55 | -------------------------------------------------------------------------------- /gps/android/1.0/location_api/LocationUtil.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOCATION_UTIL_H 31 | #define LOCATION_UTIL_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace android { 38 | namespace hardware { 39 | namespace gnss { 40 | namespace V1_0 { 41 | namespace implementation { 42 | 43 | void convertGnssLocation(Location& in, V1_0::GnssLocation& out); 44 | void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); 45 | void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); 46 | void convertGnssSvid(GnssSv& in, int16_t& out); 47 | void convertGnssSvid(GnssMeasurementsData& in, int16_t& out); 48 | void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); 49 | void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); 50 | void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); 51 | 52 | } // namespace implementation 53 | } // namespace V1_0 54 | } // namespace gnss 55 | } // namespace hardware 56 | } // namespace android 57 | #endif // LOCATION_UTIL_H 58 | -------------------------------------------------------------------------------- /gps/android/1.1/location_api/LocationUtil.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | 30 | #ifndef LOCATION_UTIL_H 31 | #define LOCATION_UTIL_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace android { 38 | namespace hardware { 39 | namespace gnss { 40 | namespace V1_1 { 41 | namespace implementation { 42 | 43 | void convertGnssLocation(Location& in, V1_0::GnssLocation& out); 44 | void convertGnssLocation(const V1_0::GnssLocation& in, Location& out); 45 | void convertGnssConstellationType(GnssSvType& in, V1_0::GnssConstellationType& out); 46 | void convertGnssSvid(GnssSv& in, int16_t& out); 47 | void convertGnssSvid(GnssMeasurementsData& in, int16_t& out); 48 | void convertGnssEphemerisType(GnssEphemerisType& in, GnssDebug::SatelliteEphemerisType& out); 49 | void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEphemerisSource& out); 50 | void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); 51 | 52 | } // namespace implementation 53 | } // namespace V1_1 54 | } // namespace gnss 55 | } // namespace hardware 56 | } // namespace android 57 | #endif // LOCATION_UTIL_H 58 | -------------------------------------------------------------------------------- /gps/android/1.0/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "android.hardware.gnss@1.0-service-qti" 22 | 23 | #include 24 | #include 25 | #include "loc_cfg.h" 26 | #include "loc_misc_utils.h" 27 | 28 | extern "C" { 29 | #include "vndfwk-detect.h" 30 | } 31 | 32 | #ifdef ARCH_ARM_32 33 | #define DEFAULT_HW_BINDER_MEM_SIZE 65536 34 | #endif 35 | 36 | using android::hardware::gnss::V1_0::IGnss; 37 | 38 | using android::hardware::configureRpcThreadpool; 39 | using android::hardware::registerPassthroughServiceImplementation; 40 | using android::hardware::joinRpcThreadpool; 41 | 42 | using android::status_t; 43 | using android::OK; 44 | 45 | typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); 46 | 47 | int main() { 48 | 49 | ALOGI("%s", __FUNCTION__); 50 | 51 | int vendorInfo = getVendorEnhancedInfo(); 52 | bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); 53 | setVendorEnhanced(vendorEnhanced); 54 | 55 | #ifdef ARCH_ARM_32 56 | android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); 57 | #endif 58 | configureRpcThreadpool(1, true); 59 | status_t status; 60 | 61 | status = registerPassthroughServiceImplementation(); 62 | if (status == OK) { 63 | if (vendorEnhanced) { 64 | #ifdef LOC_HIDL_VERSION 65 | #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" 66 | 67 | void* libHandle = NULL; 68 | vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) 69 | dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); 70 | if (NULL != vendorEnhancedMainMethod) { 71 | (*vendorEnhancedMainMethod)(0, NULL); 72 | } 73 | #else 74 | ALOGE("LOC_HIDL_VERSION not defined."); 75 | #endif 76 | } 77 | 78 | joinRpcThreadpool(); 79 | 80 | } else { 81 | ALOGE("Error while registering IGnss 1.0 service: %d", status); 82 | } 83 | 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /gps/android/1.1/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #define LOG_TAG "android.hardware.gnss@1.1-service-qti" 22 | 23 | #include 24 | #include 25 | #include "loc_cfg.h" 26 | #include "loc_misc_utils.h" 27 | 28 | extern "C" { 29 | #include "vndfwk-detect.h" 30 | } 31 | 32 | #ifdef ARCH_ARM_32 33 | #define DEFAULT_HW_BINDER_MEM_SIZE 65536 34 | #endif 35 | 36 | using android::hardware::gnss::V1_1::IGnss; 37 | 38 | using android::hardware::configureRpcThreadpool; 39 | using android::hardware::registerPassthroughServiceImplementation; 40 | using android::hardware::joinRpcThreadpool; 41 | 42 | using android::status_t; 43 | using android::OK; 44 | 45 | typedef int vendorEnhancedServiceMain(int /* argc */, char* /* argv */ []); 46 | 47 | int main() { 48 | 49 | ALOGI("%s", __FUNCTION__); 50 | 51 | int vendorInfo = getVendorEnhancedInfo(); 52 | bool vendorEnhanced = ( 1 == vendorInfo || 3 == vendorInfo ); 53 | setVendorEnhanced(vendorEnhanced); 54 | 55 | #ifdef ARCH_ARM_32 56 | android::hardware::ProcessState::initWithMmapSize((size_t)(DEFAULT_HW_BINDER_MEM_SIZE)); 57 | #endif 58 | configureRpcThreadpool(1, true); 59 | status_t status; 60 | 61 | status = registerPassthroughServiceImplementation(); 62 | if (status == OK) { 63 | if (vendorEnhanced) { 64 | #ifdef LOC_HIDL_VERSION 65 | #define VENDOR_ENHANCED_LIB "vendor.qti.gnss@" LOC_HIDL_VERSION "-service.so" 66 | 67 | void* libHandle = NULL; 68 | vendorEnhancedServiceMain* vendorEnhancedMainMethod = (vendorEnhancedServiceMain*) 69 | dlGetSymFromLib(libHandle, VENDOR_ENHANCED_LIB, "main"); 70 | if (NULL != vendorEnhancedMainMethod) { 71 | (*vendorEnhancedMainMethod)(0, NULL); 72 | } 73 | #else 74 | ALOGE("LOC_HIDL_VERSION not defined."); 75 | #endif 76 | } 77 | 78 | joinRpcThreadpool(); 79 | 80 | } else { 81 | ALOGE("Error while registering IGnss 1.1 service: %d", status); 82 | } 83 | 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /gps/core/LBSProxyBase.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. 2 | * 3 | * Redistribution and use in source and binary forms, with or without 4 | * modification, are permitted provided that the following conditions are 5 | * met: 6 | * * Redistributions of source code must retain the above copyright 7 | * notice, this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above 9 | * copyright notice, this list of conditions and the following 10 | * disclaimer in the documentation and/or other materials provided 11 | * with the distribution. 12 | * * Neither the name of The Linux Foundation, nor the names of its 13 | * contributors may be used to endorse or promote products derived 14 | * from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | */ 29 | #ifndef IZAT_PROXY_BASE_H 30 | #define IZAT_PROXY_BASE_H 31 | #include 32 | 33 | namespace loc_core { 34 | 35 | class LocApiBase; 36 | class LocAdapterBase; 37 | class ContextBase; 38 | 39 | class LBSProxyBase { 40 | friend class ContextBase; 41 | inline virtual LocApiBase* 42 | getLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask, 43 | ContextBase* context) const { 44 | 45 | (void)exMask; 46 | (void)context; 47 | return NULL; 48 | } 49 | protected: 50 | inline LBSProxyBase() {} 51 | public: 52 | inline virtual ~LBSProxyBase() {} 53 | inline virtual bool hasAgpsExtendedCapabilities() const { return false; } 54 | inline virtual void modemPowerVote(bool power) const { 55 | 56 | (void)power; 57 | } 58 | virtual void injectFeatureConfig(ContextBase* context) const { 59 | 60 | (void)context; 61 | } 62 | inline virtual bool hasNativeXtraClient() const { return false; } 63 | inline virtual IzatDevId_t getIzatDevId() const { return 0; } 64 | }; 65 | 66 | typedef LBSProxyBase* (getLBSProxy_t)(); 67 | 68 | } // namespace loc_core 69 | 70 | #endif // IZAT_PROXY_BASE_H 71 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssMeasurement.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssMeasurement; 35 | using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback; 36 | using ::android::hardware::Return; 37 | using ::android::hardware::Void; 38 | using ::android::hardware::hidl_vec; 39 | using ::android::hardware::hidl_string; 40 | using ::android::sp; 41 | 42 | class MeasurementAPIClient; 43 | struct GnssMeasurement : public IGnssMeasurement { 44 | GnssMeasurement(); 45 | ~GnssMeasurement(); 46 | 47 | /* 48 | * Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow. 49 | * These declarations were generated from IGnssMeasurement.hal. 50 | */ 51 | Return setCallback( 52 | const sp& callback) override; 53 | Return close() override; 54 | 55 | private: 56 | struct GnssMeasurementDeathRecipient : hidl_death_recipient { 57 | GnssMeasurementDeathRecipient(sp gnssMeasurement) : 58 | mGnssMeasurement(gnssMeasurement) { 59 | } 60 | ~GnssMeasurementDeathRecipient() = default; 61 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 62 | sp mGnssMeasurement; 63 | }; 64 | 65 | private: 66 | sp mGnssMeasurementDeathRecipient = nullptr; 67 | sp mGnssMeasurementCbIface = nullptr; 68 | MeasurementAPIClient* mApi; 69 | }; 70 | 71 | } // namespace implementation 72 | } // namespace V1_0 73 | } // namespace gnss 74 | } // namespace hardware 75 | } // namespace android 76 | 77 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H 78 | -------------------------------------------------------------------------------- /gps/android/1.1/GnssConfiguration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | 6 | /* Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | 22 | #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H 23 | #define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H 24 | 25 | #include 26 | #include 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_1 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_1::IGnssConfiguration; 35 | using ::android::hardware::Return; 36 | using ::android::hardware::Void; 37 | using ::android::hardware::hidl_vec; 38 | using ::android::hardware::hidl_string; 39 | using ::android::sp; 40 | 41 | /* 42 | * Interface for passing GNSS configuration info from platform to HAL. 43 | */ 44 | struct Gnss; 45 | struct GnssConfiguration : public IGnssConfiguration { 46 | GnssConfiguration(Gnss* gnss); 47 | ~GnssConfiguration() = default; 48 | 49 | /* 50 | * Methods from ::android::hardware::gnss::V1_0::IGnssConfiguration follow. 51 | * These declarations were generated from IGnssConfiguration.hal. 52 | */ 53 | Return setSuplVersion(uint32_t version) override; 54 | Return setSuplMode(uint8_t mode) override; 55 | Return setSuplEs(bool enabled) override; 56 | Return setLppProfile(uint8_t lppProfileMask) override; 57 | Return setGlonassPositioningProtocol(uint8_t protocol) override; 58 | Return setEmergencySuplPdn(bool enable) override; 59 | Return setGpsLock(uint8_t lock) override; 60 | 61 | // Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow. 62 | Return setBlacklist( 63 | const hidl_vec& blacklist) override; 64 | 65 | private: 66 | Gnss* mGnss = nullptr; 67 | bool setBlacklistedSource( 68 | GnssSvIdSource& copyToSource, 69 | const GnssConfiguration::BlacklistedSource& copyFromSource); 70 | }; 71 | 72 | } // namespace implementation 73 | } // namespace V1_1 74 | } // namespace gnss 75 | } // namespace hardware 76 | } // namespace android 77 | 78 | #endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H 79 | -------------------------------------------------------------------------------- /gps/android/1.0/GnssBatching.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 3 | * Not a Contribution 4 | */ 5 | /* 6 | * Copyright (C) 2016 The Android Open Source Project 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H 22 | #define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H 23 | 24 | #include 25 | #include 26 | 27 | 28 | namespace android { 29 | namespace hardware { 30 | namespace gnss { 31 | namespace V1_0 { 32 | namespace implementation { 33 | 34 | using ::android::hardware::gnss::V1_0::IGnssBatching; 35 | using ::android::hardware::gnss::V1_0::IGnssBatchingCallback; 36 | using ::android::hidl::base::V1_0::IBase; 37 | using ::android::hardware::hidl_array; 38 | using ::android::hardware::hidl_memory; 39 | using ::android::hardware::hidl_string; 40 | using ::android::hardware::hidl_vec; 41 | using ::android::hardware::Return; 42 | using ::android::hardware::Void; 43 | using ::android::sp; 44 | 45 | class BatchingAPIClient; 46 | struct GnssBatching : public IGnssBatching { 47 | GnssBatching(); 48 | ~GnssBatching(); 49 | 50 | // Methods from ::android::hardware::gnss::V1_0::IGnssBatching follow. 51 | Return init(const sp& callback) override; 52 | Return getBatchSize() override; 53 | Return start(const IGnssBatching::Options& options ) override; 54 | Return flush() override; 55 | Return stop() override; 56 | Return cleanup() override; 57 | 58 | private: 59 | struct GnssBatchingDeathRecipient : hidl_death_recipient { 60 | GnssBatchingDeathRecipient(sp gnssBatching) : 61 | mGnssBatching(gnssBatching) { 62 | } 63 | ~GnssBatchingDeathRecipient() = default; 64 | virtual void serviceDied(uint64_t cookie, const wp& who) override; 65 | sp mGnssBatching; 66 | }; 67 | 68 | private: 69 | sp mGnssBatchingDeathRecipient = nullptr; 70 | sp mGnssBatchingCbIface = nullptr; 71 | BatchingAPIClient* mApi = nullptr; 72 | }; 73 | 74 | } // namespace implementation 75 | } // namespace V1_0 76 | } // namespace gnss 77 | } // namespace hardware 78 | } // namespace android 79 | 80 | #endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H 81 | --------------------------------------------------------------------------------