├── Android.bp ├── README.md ├── sepolicy └── vendor │ ├── nfc.te │ ├── appdomain.te │ ├── sensors.te │ ├── tee.te │ ├── lkmd.te │ ├── proc_net.te │ ├── mediacodec.te │ ├── wcnss_service.te │ ├── mediaprovider.te │ ├── vold.te │ ├── hal_wifi_default.te │ ├── hal_secure_element_default.te │ ├── ueventd.te │ ├── vendor_vppservice.te │ ├── zygote.te │ ├── hal_wifi_hostapd_default.te │ ├── poweroffalarm_app.te │ ├── thermal-engine.te │ ├── device.te │ ├── hal_light_default.te │ ├── oppo_display_default.te │ ├── radio.te │ ├── hwservice.te │ ├── dataservice_app.te │ ├── hwservicemanager.te │ ├── hal_sensors_default.te │ ├── hal_lineage_touch_default.te │ ├── property.te │ ├── rmt_storage.te │ ├── adsprpcd.te │ ├── fsck.te │ ├── system_server.te │ ├── hal_power_default.te │ ├── hal_lineage_fod_default.te │ ├── platform_app.te │ ├── rild.te │ ├── system_app.te │ ├── file.te │ ├── qti_init_shell.te │ ├── priv_app.te │ ├── hal_audio_default.te │ ├── hwservice_contexts │ ├── init.te │ ├── genfs_contexts │ ├── vendor_init.te │ ├── hal_fingerprint_default.te │ ├── hal_camera_default.te │ ├── property_contexts │ └── file_contexts ├── board-info.txt ├── odm.prop ├── RealmeParts ├── proguard.flags ├── Android.mk ├── res │ ├── drawable │ │ └── switchbar_background.xml │ ├── values-night │ │ └── colors.xml │ ├── values │ │ ├── colors.xml │ │ ├── styles.xml │ │ └── strings.xml │ ├── color │ │ └── switch_bar_bg.xml │ ├── layout │ │ ├── doze.xml │ │ ├── switch_bar.xml │ │ ├── preference_category_material_settings.xml │ │ └── preference_material_settings.xml │ └── xml │ │ └── doze_settings.xml ├── src │ └── org │ │ └── lineageos │ │ └── settings │ │ ├── doze │ │ ├── DozeSettingsActivity.java │ │ ├── AmdSensor.java │ │ ├── DozeService.java │ │ └── ProximitySensor.java │ │ └── BootCompletedReceiver.java └── AndroidManifest.xml ├── wlan ├── hostapd.deny ├── p2p_supplicant_overlay.conf ├── wpa_supplicant_overlay.conf ├── hostapd.accept └── icm.conf ├── interfaces ├── Android.bp └── biometrics │ └── fingerprint │ └── 2.1 │ ├── Android.bp │ ├── IBiometricsFingerprintClientCallback.hal │ ├── IBiometricsFingerprint.hal │ └── types.hal ├── AndroidProducts.mk ├── overlay ├── packages │ ├── apps │ │ ├── Settings │ │ │ └── res │ │ │ │ └── values │ │ │ │ ├── config.xml │ │ │ │ └── arrays.xml │ │ └── DocumentsUI │ │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ └── services │ │ └── Telephony │ │ └── res │ │ └── xml │ │ └── telephony_injection.xml └── frameworks │ └── base │ └── packages │ ├── SystemUI │ └── res │ │ └── values │ │ ├── dimens.xml │ │ └── config.xml │ └── SettingsProvider │ └── res │ └── values │ └── defaults.xml ├── rootdir ├── etc │ ├── init.oppo.fingerprints.sh │ ├── init.qcom.sensors.sh │ ├── fstab.qcom │ ├── init.recovery.qcom.rc │ ├── init.oppo.reserve.rc │ └── init.class_main.sh └── Android.mk ├── light ├── android.hardware.light@2.0-service.realme_sdm710.rc ├── Android.bp ├── service.cpp ├── Light.h └── Light.cpp ├── recovery ├── Android.mk └── recovery_updater.cpp ├── configs ├── public.libraries.txt ├── media │ └── system_properties.xml ├── privapp-permissions-qti.xml └── nfc │ └── libnfc-nci.conf ├── fingerprint ├── android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710.xml ├── Android.bp ├── service.cpp ├── android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710.rc └── BiometricsFingerprint.h ├── seccomp └── mediacodec-seccomp.policy ├── fod ├── vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.realme_sdm710.xml ├── FodExtension.cpp ├── vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.realme_sdm710.rc ├── Android.bp ├── service.cpp ├── FingerprintInscreen.h └── FingerprintInscreen.cpp ├── overlay-lineage ├── packages │ └── apps │ │ ├── Settings │ │ └── res │ │ │ └── values │ │ │ ├── dimens.xml │ │ │ └── lineage_config.xml │ │ ├── Dialer │ │ └── java │ │ │ └── com │ │ │ └── android │ │ │ └── dialer │ │ │ └── callrecord │ │ │ └── res │ │ │ └── values │ │ │ └── config.xml │ │ └── Snap │ │ └── res │ │ └── values │ │ └── config.xml ├── frameworks │ └── base │ │ └── packages │ │ └── SystemUI │ │ └── res │ │ └── values-port │ │ └── dimens.xml └── lineage-sdk │ └── lineage │ └── res │ └── res │ └── values │ └── config.xml ├── audio └── bluetooth_hearing_aid_audio_policy_configuration.xml ├── gps ├── lowi.conf ├── flp.conf └── xtwifi.conf ├── sensors ├── Android.bp ├── multihal.h ├── SensorEventQueue.cpp ├── Sensors.h └── SensorEventQueue.h ├── superior_RMX1921.mk ├── bluetooth └── bdroid_buildcfg.h ├── setup-makefiles.sh ├── libhidl └── Android.mk ├── keylayout └── gpio-keys.kl ├── extract-files.sh ├── releasetools.py ├── compatibility_matrix.xml ├── system.prop └── config.fs /Android.bp: -------------------------------------------------------------------------------- 1 | soong_namespace { 2 | } 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Device tree for Realme XT 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/nfc.te: -------------------------------------------------------------------------------- 1 | get_prop(nfc, theme_prop); 2 | -------------------------------------------------------------------------------- /board-info.txt: -------------------------------------------------------------------------------- 1 | require version-trustzone=TZ.XF.5.0.2-247669 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/appdomain.te: -------------------------------------------------------------------------------- 1 | get_prop(appdomain, camera_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/sensors.te: -------------------------------------------------------------------------------- 1 | get_prop(sensors, sensors_dbg_prop); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | allow tee persist_file:lnk_file read; 2 | -------------------------------------------------------------------------------- /odm.prop: -------------------------------------------------------------------------------- 1 | # QC framework value-adds 2 | ro.vendor.qti.va_odm.support=1 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/lkmd.te: -------------------------------------------------------------------------------- 1 | allow lmkd self:capability2 block_suspend; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/proc_net.te: -------------------------------------------------------------------------------- 1 | allow proc_net proc:filesystem associate; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/mediacodec.te: -------------------------------------------------------------------------------- 1 | get_prop(mediacodec, vendor_mpctl_prop); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/wcnss_service.te: -------------------------------------------------------------------------------- 1 | set_prop(wcnss_service, oppo_wlan_prop); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/mediaprovider.te: -------------------------------------------------------------------------------- 1 | allow mediaprovider sdcardfs:lnk_file getattr; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vold.te: -------------------------------------------------------------------------------- 1 | allow vold mnt_vendor_file:dir { open read ioctl }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_wifi_default.te: -------------------------------------------------------------------------------- 1 | set_prop(hal_wifi_default, vendor_wifi_prop) 2 | -------------------------------------------------------------------------------- /RealmeParts/proguard.flags: -------------------------------------------------------------------------------- 1 | -keep class org.lineageos.settings.doze.* { 2 | *; 3 | } 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_secure_element_default.te: -------------------------------------------------------------------------------- 1 | add_hwservice(hal_secure_element_default, nfc_hwservice); 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/ueventd.te: -------------------------------------------------------------------------------- 1 | allow ueventd debugfs:dir { open read }; 2 | allow ueventd debugfs:file { getattr }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_vppservice.te: -------------------------------------------------------------------------------- 1 | allow vendor_vppservice hal_capabilityconfigstore_qti_default:binder call; 2 | -------------------------------------------------------------------------------- /wlan/hostapd.deny: -------------------------------------------------------------------------------- 1 | # List of MAC addresses that are not allowed to authenticate (IEEE 802.11) 2 | # with the AP. 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/zygote.te: -------------------------------------------------------------------------------- 1 | allow zygote vendor_file:file { execute getattr open read }; 2 | get_prop(zygote, theme_prop); 3 | -------------------------------------------------------------------------------- /wlan/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 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_wifi_hostapd_default.te: -------------------------------------------------------------------------------- 1 | allow hal_wifi_hostapd_default wifi_vendor_data_file:dir { rw_dir_perms remove_name }; 2 | -------------------------------------------------------------------------------- /interfaces/Android.bp: -------------------------------------------------------------------------------- 1 | hidl_package_root { 2 | name: "vendor.oppo.hardware", 3 | path: "device/realme/RMX1921/interfaces", 4 | } 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/poweroffalarm_app.te: -------------------------------------------------------------------------------- 1 | allow poweroffalarm_app cgroup:file write; 2 | allow poweroffalarm_app vendor_mpctl_prop:file read; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/thermal-engine.te: -------------------------------------------------------------------------------- 1 | allow thermal-engine sysfs:dir { open read }; 2 | allow thermal-engine sysfs_devfreq:dir { search read }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/device.te: -------------------------------------------------------------------------------- 1 | # Goodix device 2 | type goodix_device, dev_type; 3 | 4 | # Mdmreason device 5 | type mdmreason_device, dev_type; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_light_default.te: -------------------------------------------------------------------------------- 1 | allow hal_light_default sysfs:file { getattr open write }; 2 | allow hal_light_default sysfs:file write; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/oppo_display_default.te: -------------------------------------------------------------------------------- 1 | type oppo_display_default, domain; 2 | type oppo_display_default_exec, exec_type, file_type, vendor_file_type; 3 | -------------------------------------------------------------------------------- /wlan/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 | -------------------------------------------------------------------------------- /sepolicy/vendor/radio.te: -------------------------------------------------------------------------------- 1 | allow radio gpuservice:binder call; 2 | allow radio vendor_file:file { execute read }; 3 | allow radio vendor_mpctl_prop:file read; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice.te: -------------------------------------------------------------------------------- 1 | type nfc_hwservice, hwservice_manager_type; 2 | type dcs_hwservice, hwservice_manager_type; 3 | type opporadio_hwservice, hwservice_manager_type; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/dataservice_app.te: -------------------------------------------------------------------------------- 1 | allow dataservice_app vendor_file:file { execute read }; 2 | allow qtidataservices_app qtidataservices_app:socket { create ioctl write read }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservicemanager.te: -------------------------------------------------------------------------------- 1 | allow hwservicemanager init:dir search; 2 | allow hwservicemanager init:file { open read }; 3 | allow hwservicemanager init:process getattr; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_sensors_default.te: -------------------------------------------------------------------------------- 1 | get_prop(hal_sensors_default, oppo_debug_prop); 2 | 3 | r_dir_file(hal_sensors_default, proc_touchpanel); 4 | 5 | get_prop(hal_sensors_default, sensors_dbg_prop); 6 | -------------------------------------------------------------------------------- /AndroidProducts.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2020 The LineageOS Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | PRODUCT_MAKEFILES := \ 8 | $(LOCAL_DIR)/superior_RMX1921.mk 9 | 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_lineage_touch_default.te: -------------------------------------------------------------------------------- 1 | allow hal_lineage_touch_default proc_touchpanel:dir search; 2 | allow hal_lineage_touch_default proc_touchpanel:file rw_file_perms; 3 | allow hal_lineage_touch_default sysfs:file { write read open }; 4 | -------------------------------------------------------------------------------- /wlan/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 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | # Wifi 2 | type vendor_wifi_prop, property_type; 3 | 4 | # Oppo props 5 | type oppo_debug_prop, property_type; 6 | type oppo_fingerprint_prop, property_type; 7 | type oppo_wlan_prop, property_type; 8 | 9 | # Camera 10 | type vendor_camera_prop, property_type; 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/rmt_storage.te: -------------------------------------------------------------------------------- 1 | allow rmt_storage mdmreason_device:chr_file rw_file_perms; 2 | allow rmt_storage proc_oppoversion:dir search; 3 | allow rmt_storage proc_oppoversion:file { open read write }; 4 | 5 | get_prop(rmt_storage, oppo_debug_prop); 6 | get_prop(rmt_storage, default_prop); 7 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.lineageos.settings/org.lineageos.settings.doze.DozeSettingsActivity 5 | 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/adsprpcd.te: -------------------------------------------------------------------------------- 1 | allow adsprpcd sensors_persist_file:file create_file_perms; 2 | 3 | r_dir_file(adsprpcd, proc_oppoversion); 4 | 5 | allow adsprpcd persist_file:lnk_file read; 6 | allow adsprpcd sysfs_oppo_display:dir search; 7 | allow adsprpcd sysfs_oppo_display:file { getattr open read }; 8 | -------------------------------------------------------------------------------- /rootdir/etc/init.oppo.fingerprints.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | chown system:system /dev/homekey 3 | chmod 0666 /dev/homekey 4 | chown system:system /proc/fp_unlock/lcd_status 5 | chmod 0666 /proc/fp_unlock/lcd_status 6 | chown system:system /proc/fp_unlock/lcdoff_status 7 | chmod 0666 /proc/fp_unlock/lcdoff_status 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/fsck.te: -------------------------------------------------------------------------------- 1 | dontaudit fsck self:capability { dac_override dac_read_search }; 2 | allow fsck block_device:blk_file { open read write ioctl }; 3 | allow fsck tmpfs:blk_file getattr; 4 | allow fsck mnt_vendor_file:dir getattr; 5 | allow fsck modem_efs_partition_device:blk_file { ioctl open read write }; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_server.te: -------------------------------------------------------------------------------- 1 | get_prop(system_server, persist_camera_prop); 2 | get_prop(system_server, vendor_default_prop); 3 | 4 | allow system_server sysfs:file { getattr open read write }; 5 | allow system_server vendor_file:file { open read }; 6 | allow system_server dcs_hwservice:hwservice_manager { add find }; 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | allow hal_power_default input_device:dir search; 2 | allow hal_power_default input_device:chr_file rw_file_perms; 3 | allow hal_power_default proc_touchpanel:dir search; 4 | allow hal_power_default proc_touchpanel:file rw_file_perms; 5 | 6 | get_prop(hal_power_default, vendor_mpctl_prop); 7 | -------------------------------------------------------------------------------- /light/android.hardware.light@2.0-service.realme_sdm710.rc: -------------------------------------------------------------------------------- 1 | service light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.realme_sdm710 2 | interface android.hardware.light@2.0::ILight default 3 | class hal 4 | user system 5 | group system 6 | # shutting off lights while powering-off 7 | shutdown critical 8 | -------------------------------------------------------------------------------- /recovery/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_C_INCLUDES := \ 5 | bootable/recovery \ 6 | bootable/recovery/edify/include \ 7 | bootable/recovery/otautil/include 8 | LOCAL_SRC_FILES := recovery_updater.cpp 9 | LOCAL_MODULE := librecovery_updater_RMX1921 10 | include $(BUILD_STATIC_LIBRARY) 11 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_lineage_fod_default.te: -------------------------------------------------------------------------------- 1 | allow hal_lineage_fod_default sysfs_oppo_display:dir search; 2 | allow hal_lineage_fod_default sysfs_oppo_display:file rw_file_perms; 3 | allow hal_lineage_fod_default default_prop:file { getattr }; 4 | allow hal_lineage_fod_default proc_touchpanel:dir { search }; 5 | allow hal_lineage_fod_default proc_touchpanel:file { read open getattr }; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/platform_app.te: -------------------------------------------------------------------------------- 1 | 2 | allow platform_app time_daemon:unix_stream_socket connectto; 3 | allow platform_app vendor_file:file { execute read }; 4 | 5 | get_prop(platform_app, vendor_default_prop); 6 | 7 | allow platform_app vendor_default_prop:file { read open getattr }; 8 | allow platform_app sysfs_fps:file { getattr open read }; 9 | allow platform_app sysfs_graphics:dir search; 10 | 11 | -------------------------------------------------------------------------------- /configs/public.libraries.txt: -------------------------------------------------------------------------------- 1 | libqti-perfd-client.so 2 | libadsprpc.so 3 | libcdsprpc.so 4 | libsdsprpc.so 5 | libfastcvopt.so 6 | liblistenjni.so 7 | liblistensoundmodel2.so 8 | libOpenCL.so 9 | libnpu.so 10 | libhta_controller.so 11 | libhta_hexagon_runtime.so 12 | unnhal-acc-hta.so 13 | liboddi.so 14 | libnativehelpers.so 15 | libOppoAlgoClient.so 16 | vendor.oppo.hardware.camera.oppoAlgoProcessService@1.0.so 17 | libOppoAPSMemMgr.so 18 | -------------------------------------------------------------------------------- /fingerprint/android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | android.hardware.biometrics.fingerprint 4 | hwbinder 5 | 2.1 6 | 7 | IBiometricsFingerprint 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /seccomp/mediacodec-seccomp.policy: -------------------------------------------------------------------------------- 1 | # device specific syscalls 2 | # extension of services/mediacodec/minijail/seccomp_policy/mediacodec-seccomp-arm.policy 3 | pselect6: 1 4 | eventfd2: 1 5 | sendto: 1 6 | recvfrom: 1 7 | _llseek: 1 8 | sysinfo: 1 9 | getcwd: 1 10 | getdents64: 1 11 | 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 | -------------------------------------------------------------------------------- /fod/vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.realme_sdm710.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | vendor.lineage.biometrics.fingerprint.inscreen 4 | hwbinder 5 | 1.0 6 | 7 | IFingerprintInscreen 8 | default 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /interfaces/biometrics/fingerprint/2.1/Android.bp: -------------------------------------------------------------------------------- 1 | // This file is autogenerated by hidl-gen -Landroidbp. 2 | 3 | hidl_interface { 4 | name: "vendor.oppo.hardware.biometrics.fingerprint@2.1", 5 | root: "vendor.oppo.hardware", 6 | srcs: [ 7 | "IBiometricsFingerprint.hal", 8 | "IBiometricsFingerprintClientCallback.hal", 9 | "types.hal", 10 | ], 11 | interfaces: [ 12 | "android.hidl.base@1.0", 13 | ], 14 | gen_java: false, 15 | } 16 | -------------------------------------------------------------------------------- /sepolicy/vendor/rild.te: -------------------------------------------------------------------------------- 1 | get_prop(rild, oppo_debug_prop); 2 | 3 | r_dir_file(rild, proc_devinfo); 4 | 5 | allow rild cache_file:dir { add_name getattr create search write }; 6 | allow rild cache_file:file { create open write }; 7 | allow rild system_data_file:dir getattr; 8 | allow rild block_device:dir search; 9 | allow rild default_prop:property_service set; 10 | allow rild system_prop:property_service set; 11 | allow rild oppo_debug_prop:property_service set; 12 | allow rild opporadio_hwservice:hwservice_manager add; 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app hal_rcsservice:binder { call transfer }; 2 | allow system_app system_data_file:dir { add_name create setattr write }; 3 | allow system_app vendor_file:file { execute read }; 4 | allow system_app sysfs_zram:dir search; 5 | allow system_app init:binder call; 6 | allow system_app sysfs_zram:file { open read }; 7 | allow system_app selinuxfs:file { open read }; 8 | 9 | get_prop(system_app, oppo_debug_prop); 10 | get_prop(system_app, persist_camera_prop); 11 | get_prop(system_app, vendor_mpctl_prop); 12 | get_prop(system_app, vendor_default_prop); 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/file.te: -------------------------------------------------------------------------------- 1 | # Oppo display 2 | type sysfs_oppo_display, fs_type, sysfs_type; 3 | 4 | # Touchpanel 5 | type proc_touchpanel, fs_type, proc_type; 6 | 7 | # Oppo Project version 8 | type proc_oppoversion, fs_type, proc_type; 9 | 10 | # Oppo FP 11 | type proc_oppo_fp, fs_type, proc_type; 12 | 13 | # Camera 14 | type persist_camera_file, file_type; 15 | 16 | # Devinfo 17 | type proc_devinfo, fs_type, proc_type; 18 | 19 | # Audio 20 | type persist_audio_file, file_type , vendor_persist_type; 21 | type proc_audio_file, file_type, data_file_type, core_data_file_type; 22 | 23 | # FPS Info 24 | type sysfs_fps, sysfs_type, fs_type; 25 | 26 | -------------------------------------------------------------------------------- /sepolicy/vendor/qti_init_shell.te: -------------------------------------------------------------------------------- 1 | dontaudit qti_init_shell self:capability dac_override; 2 | allow qti_init_shell configfs:dir { add_name create write }; 3 | allow qti_init_shell configfs:file create; 4 | allow qti_init_shell configfs:lnk_file create; 5 | allow qti_init_shell persist_file:lnk_file read; 6 | allow qti_init_shell sensors_persist_file:fifo_file { getattr setattr }; 7 | allow qti_init_shell qti_init_shell:capability { dac_read_search }; 8 | allow qti_init_shell proc_devinfo:dir { search }; 9 | allow qti_init_shell sysfs:file { setattr }; 10 | allow qti_init_shell proc_devinfo:file {open read getattr }; 11 | 12 | get_prop(qti_init_shell, oppo_debug_prop); 13 | get_prop(qti_init_shell, default_prop); 14 | -------------------------------------------------------------------------------- /sepolicy/vendor/priv_app.te: -------------------------------------------------------------------------------- 1 | allow priv_app device:dir open; 2 | allow priv_app proc_interrupts:file open; 3 | allow priv_app proc_modules:file open; 4 | allow priv_app proc_net:file { getattr open read }; 5 | allow priv_app sysfs:dir open; 6 | 7 | get_prop(priv_app, oppo_debug_prop); 8 | get_prop(priv_app, vendor_camera_prop); 9 | get_prop(priv_app, vendor_default_prop); 10 | get_prop(priv_app, vendor_mpctl_prop); 11 | 12 | dontaudit priv_app bt_firmware_file:filesystem getattr; 13 | dontaudit priv_app firmware_file:filesystem getattr; 14 | dontaudit priv_app sysfs_android_usb:file open; 15 | dontaudit priv_app proc:file open; 16 | dontaudit priv_app mnt_vendor_file:dir search; 17 | dontaudit priv_app vendor_file:file { execute read }; 18 | -------------------------------------------------------------------------------- /RealmeParts/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017-2018 The LineageOS Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | LOCAL_PATH := $(call my-dir) 8 | 9 | include $(CLEAR_VARS) 10 | 11 | LOCAL_MODULE_TAGS := optional 12 | 13 | LOCAL_SRC_FILES := $(call all-java-files-under, src) 14 | 15 | LOCAL_PACKAGE_NAME := RealmeParts 16 | LOCAL_CERTIFICATE := platform 17 | LOCAL_PRIVATE_PLATFORM_APIS := true 18 | LOCAL_PRIVILEGED_MODULE := true 19 | 20 | LOCAL_USE_AAPT2 := true 21 | 22 | LOCAL_STATIC_ANDROID_LIBRARIES := \ 23 | androidx.core_core \ 24 | androidx.preference_preference 25 | 26 | LOCAL_RESOURCE_DIR := \ 27 | $(LOCAL_PATH)/res 28 | 29 | LOCAL_PROGUARD_FLAG_FILES := proguard.flags 30 | 31 | include frameworks/base/packages/SettingsLib/common.mk 32 | 33 | include $(BUILD_PACKAGE) 34 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | r_dir_file(hal_audio_default, proc_oppoversion); 2 | get_prop(hal_audio_default, vendor_mpctl_prop); 3 | get_prop(hal_audio_default, oppo_debug_prop); 4 | get_prop(hal_audio_default, bluetooth_prop); 5 | 6 | allow hal_audio_default sysfs:dir read; 7 | hal_client_domain(hal_audio_default, hal_power); 8 | userdebug_or_eng(` 9 | allow hal_audio diag_device:chr_file rw_file_perms; 10 | '); 11 | allow hal_audio_default mnt_vendor_file:dir search; 12 | allow hal_audio_default persist_audio_file:dir search; 13 | allow hal_audio_default persist_audio_file:lnk_file read; 14 | r_dir_file(hal_audio_default, persist_audio_file); 15 | get_prop(hal_audio_default, vendor_audio_prop); 16 | allow hal_audio_default sysfs:dir { read open }; 17 | allow hal_audio_default proc_audio_file:file { read }; 18 | get_prop(hal_audio_default, default_prop); 19 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | # Camera 2 | vendor.oppo.hardware.camera.oppoAlgoProcessService::IOppoAlgoProcessService u:object_r:hal_camera_hwservice:s0 3 | vendor.oppo.hardware.camera.oppopostproc::ICameraPostProc u:object_r:hal_camera_hwservice:s0 4 | 5 | # Fingerprint 6 | vendor.oppo.hardware.biometrics.fingerprint::IBiometricsFingerprint u:object_r:hal_fingerprint_hwservice:s0 7 | 8 | # NFC 9 | vendor.nxp.nxpnfc::INxpNfc u:object_r:nfc_hwservice:s0 10 | vendor.nxp.nxpese::INxpEse u:object_r:nfc_hwservice:s0 11 | 12 | # Dcs 13 | vendor.oppo.hardware.commondcs::ICommonDcsHalService u:object_r:dcs_hwservice:s0 14 | 15 | # Radio 16 | vendor.oppo.hardware.radio.oppoappradio::IOppoAppRadio u:object_r:opporadio_hwservice:s0 17 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Settings/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 78% 16 | 17 | -------------------------------------------------------------------------------- /audio/bluetooth_hearing_aid_audio_policy_configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /fingerprint/Android.bp: -------------------------------------------------------------------------------- 1 | cc_binary { 2 | name: "android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710", 3 | defaults: ["hidl_defaults"], 4 | init_rc: ["android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710.rc"], 5 | vintf_fragments: ["android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710.xml"], 6 | proprietary: true, 7 | relative_install_path: "hw", 8 | srcs: [ 9 | "BiometricsFingerprint.cpp", 10 | "service.cpp", 11 | ], 12 | cflags: [ 13 | "-Wno-unused-parameter", 14 | ], 15 | shared_libs: [ 16 | "libcutils", 17 | "liblog", 18 | "libhidlbase", 19 | "libhidltransport", 20 | "libhardware", 21 | "libutils", 22 | "libbase", 23 | "android.hardware.biometrics.fingerprint@2.1", 24 | "vendor.oppo.hardware.biometrics.fingerprint@2.1", 25 | ], 26 | } 27 | -------------------------------------------------------------------------------- /fod/FodExtension.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 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 | #include 18 | 19 | uint32_t getFodZOrder(uint32_t z, bool touched) { 20 | return touched ? 1090519091 : z; 21 | } 22 | 23 | uint64_t getFodUsageBits(uint64_t usageBits, bool) { 24 | return usageBits; 25 | } -------------------------------------------------------------------------------- /RealmeParts/res/drawable/switchbar_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /RealmeParts/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | @android:color/black 19 | #82000000 20 | 21 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 36px 20 | 16dp 21 | 22 | -------------------------------------------------------------------------------- /overlay/packages/apps/DocumentsUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | true 20 | 21 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | true 19 | 4 20 | 21 | -------------------------------------------------------------------------------- /sepolicy/vendor/init.te: -------------------------------------------------------------------------------- 1 | allow init system_file:file execute_no_trans; 2 | allow init persist_file:lnk_file read; 3 | allow init socket_device:sock_file { create setattr }; 4 | allow init sysfs_battery_supply:file setattr; 5 | allow init vendor_file:file { execute execute_no_trans }; 6 | allow init vendor_toolbox_exec:file execute_no_trans; 7 | allow init sysfs_oppo_display:file rw_file_perms; 8 | allow init sysfs_oppo_display:file setattr; 9 | allow init hwservicemanager:binder transfer; 10 | allow init hidl_base_hwservice:hwservice_manager add; 11 | allow init ion_device:chr_file { ioctl open read }; 12 | allow init same_process_hal_file:file execute; 13 | allow init self:socket create; 14 | allow init proc_touchpanel:file setattr; 15 | allow init sysfs:file setattr; 16 | allow init sysfs_oppo_display:file rw_file_perms; 17 | allow init sysfs_oppo_display:file setattr; 18 | allow init bt_firmware_file:filesystem getattr; 19 | allow init firmware_file:filesystem getattr; 20 | -------------------------------------------------------------------------------- /overlay-lineage/frameworks/base/packages/SystemUI/res/values-port/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 469px 20 | 21 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | true 22 | 23 | -------------------------------------------------------------------------------- /gps/lowi.conf: -------------------------------------------------------------------------------- 1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====* 2 | # 3 | # LOWI Config file 4 | # 5 | # GENERAL DESCRIPTION 6 | # This file contains the config params for LOWI 7 | # 8 | # Copyright (c) 2019 Qualcomm Technologies, Inc. 9 | # All Rights Reserved. 10 | # Confidential and Proprietary - Qualcomm Technologies, Inc. 11 | # 12 | # 2012-2013 Qualcomm Atheros, Inc. 13 | # All Rights Reserved. 14 | # Qualcomm Atheros Confidential and Proprietary. 15 | # 16 | # Export of this technology or software is regulated by the U.S. Government. 17 | # Diversion contrary to U.S. law prohibited. 18 | #=============================================================================*/ 19 | 20 | # X86 ONLY - UBUNTU: 21 | # Copy this file in the same directory where the executable is 22 | 23 | # Log level 24 | # EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100 25 | LOWI_LOG_LEVEL = 3 26 | LOWI_USE_LOWI_LP = 0 27 | 28 | -------------------------------------------------------------------------------- /sepolicy/vendor/genfs_contexts: -------------------------------------------------------------------------------- 1 | # Oppo display 2 | genfscon sysfs /kernel/oppo_display u:object_r:sysfs_oppo_display:s0 3 | genfscon sysfs /devices/pnp0/00:00/rtc u:object_r:sysfs_rtc:s0 4 | genfscon sysfs /devices/platform/GFSH0007:00/rtc u:object_r:sysfs_rtc:s0 5 | 6 | # Touchpanel 7 | genfscon proc /touchpanel u:object_r:proc_touchpanel:s0 8 | 9 | # Oppo Project Version 10 | genfscon proc /oppoVersion u:object_r:proc_oppoversion:s0 11 | 12 | # Oppo FP 13 | genfscon proc /fp_id u:object_r:proc_oppo_fp:s0 14 | 15 | # Power supply 16 | genfscon sysfs /devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm660@0:qcom,qpnp-smb2/power_supply/ac u:object_r:sysfs_batteryinfo:s0 17 | 18 | # Devinfo 19 | genfscon proc /devinfo u:object_r:proc_devinfo:s0 20 | 21 | # FPS info 22 | genfscon sysfs /devices/platform/soc/ae00000.qcom,mdss_mdp/drm/card0/sde-crtc-0/measured_fps u:object_r:sysfs_graphics:s0 23 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | typeattribute vendor_init data_between_core_and_vendor_violators; 2 | 3 | allow vendor_init { 4 | system_data_file 5 | tombstone_data_file 6 | nfc_data_file 7 | }:dir { create_dir_perms relabelfrom }; 8 | 9 | allow vendor_init persist_file:lnk_file read; 10 | allow vendor_init default_prop:property_service set; 11 | allow vendor_init audio_prop:property_service set; 12 | allow vendor_init reschedule_service_prop:property_service set; 13 | allow vendor_init vendor_video_prop:property_service set; 14 | allow vendor_init freq_prop:property_service set; 15 | allow vendor_init block_device:lnk_file setattr; 16 | allow vendor_init default_prop:file read; 17 | allow vendor_init oppo_debug_prop:file read; 18 | allow vendor_init persist_debug_prop:file read; 19 | allow vendor_init media_rw_data_file:file getattr; 20 | allow vendor_init proc_touchpanel:file write; 21 | 22 | set_prop(vendor_init, vendor_camera_prop) 23 | set_prop(vendor_init, persist_camera_prop) 24 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint_default.te: -------------------------------------------------------------------------------- 1 | binder_call(hal_fingerprint_default, hal_fingerprint_default) 2 | 3 | allow hal_fingerprint_default tee_device:chr_file rw_file_perms; 4 | allow hal_fingerprint_default goodix_device:chr_file rw_file_perms; 5 | allow hal_fingerprint_default qdsp_device:chr_file rw_file_perms; 6 | 7 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl; 8 | 9 | allow hal_fingerprint_default proc_oppo_fp:file r_file_perms; 10 | 11 | allow hal_fingerprint_default proc_touchpanel:dir search; 12 | allow hal_fingerprint_default proc_touchpanel:file rw_file_perms; 13 | 14 | get_prop(hal_fingerprint_default, oppo_debug_prop); 15 | 16 | set_prop(hal_fingerprint_default, oppo_fingerprint_prop); 17 | 18 | get_prop(hal_fingerprint_default, default_prop); 19 | get_prop(hal_fingerprint_default, adsprpc_prop); 20 | 21 | allow hal_fingerprint_default default_prop:property_service set; 22 | allow hal_fingerprint_default dcs_hwservice:hwservice_manager find; 23 | -------------------------------------------------------------------------------- /RealmeParts/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | @*android:color/material_grey_600 19 | @android:color/white 20 | #BFFFFFFF 21 | 22 | -------------------------------------------------------------------------------- /fod/vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.realme_sdm710.rc: -------------------------------------------------------------------------------- 1 | on boot 2 | chmod 0660 /sys/kernel/oppo_display/notify_fppress 3 | chmod 0660 /sys/kernel/oppo_display/dimlayer_hbm 4 | chmod 0660 /sys/kernel/oppo_display/notify_panel_blank 5 | chmod 0660 /sys/kernel/oppo_display/aod_light_mode_set 6 | chmod 0444 /proc/touchpanel/DOZE_STATUS 7 | chown system system /sys/kernel/oppo_display/notify_fppress 8 | chown system system /sys/kernel/oppo_display/dimlayer_hbm 9 | chown system system /sys/kernel/oppo_display/notify_panel_blank 10 | chown system system /sys/kernel/oppo_display/aod_light_mode_set 11 | chown system system /proc/touchpanel/DOZE_STATUS 12 | 13 | service fingerprint-inscreen-1-0 /vendor/bin/hw/vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.realme_sdm710 14 | interface vendor.lineage.biometrics.fingerprint.inscreen@1.0::IFingerprintInscreen default 15 | class hal 16 | user system 17 | group system 18 | shutdown critical 19 | -------------------------------------------------------------------------------- /RealmeParts/res/color/switch_bar_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /RealmeParts/res/layout/doze.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Snap/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 17 | 18 | 19 | true 20 | 21 | -------------------------------------------------------------------------------- /overlay/packages/apps/Settings/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 23 | 24 | 0 25 | -1 26 | -1 27 | 28 | 29 | -------------------------------------------------------------------------------- /overlay-lineage/packages/apps/Settings/res/values/lineage_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 23 | 1 24 | 25 | 26 | -------------------------------------------------------------------------------- /sensors/Android.bp: -------------------------------------------------------------------------------- 1 | cc_library_shared { 2 | name: "android.hardware.sensors@1.0-impl.realme_sdm710", 3 | defaults: ["hidl_defaults"], 4 | proprietary: true, 5 | relative_install_path: "hw", 6 | srcs: ["Sensors.cpp"], 7 | shared_libs: [ 8 | "liblog", 9 | "libcutils", 10 | "libhardware", 11 | "libbase", 12 | "libutils", 13 | "libhidlbase", 14 | "libhidltransport", 15 | "android.hardware.sensors@1.0", 16 | ], 17 | static_libs: [ 18 | "android.hardware.sensors@1.0-convert", 19 | "multihal_realme_sdm710", 20 | ], 21 | } 22 | 23 | cc_library_static { 24 | name: "multihal_realme_sdm710", 25 | proprietary: true, 26 | srcs: [ 27 | "multihal.cpp", 28 | "SensorEventQueue.cpp", 29 | ], 30 | header_libs: [ 31 | "libhardware_headers", 32 | ], 33 | shared_libs: [ 34 | "liblog", 35 | "libcutils", 36 | "libutils", 37 | "libdl", 38 | ], 39 | export_include_dirs: ["."], 40 | cflags: [ 41 | "-Wall", 42 | "-Werror", 43 | ], 44 | } 45 | 46 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | allow hal_camera_default persist_camera_file:file rw_file_perms; 2 | allow hal_camera_default persist_camera_file:dir { add_name search write }; 3 | allow hal_camera_default persist_camera_file:file { setattr create }; 4 | allow hal_camera_default proc:file rw_file_perms; 5 | 6 | get_prop(hal_camera_default, vendor_camera_prop); 7 | get_prop(hal_camera_default, oppo_debug_prop); 8 | get_prop(hal_camera_default, radio_prop); 9 | get_prop(hal_camera_default, apexd_prop); 10 | get_prop(hal_camera_default, audio_prop); 11 | 12 | r_dir_file(hal_camera_default, sysfs_net); 13 | 14 | set_prop(hal_camera_default, vendor_camera_prop); 15 | 16 | allow hal_camera_default vendor_default_prop:property_service set; 17 | allow hal_camera_default proc_oppoversion:dir search; 18 | allow hal_camera_default debugfs:file { getattr open read }; 19 | allow hal_camera_default proc_meminfo:file { getattr open read }; 20 | allow hal_camera_default proc_oppoversion:file { open read }; 21 | allow hal_camera_default hal_camera_default:tcp_socket { create }; 22 | allow hal_camera_default vendor_file:file execute_no_trans; 23 | allow hal_camera_default vendor_shell_exec:file execute_no_trans; 24 | -------------------------------------------------------------------------------- /superior_RMX1921.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2020 The LineageOS Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | # Inherit some common Superior stuff. 8 | $(call inherit-product, vendor/superior/config/common.mk) 9 | 10 | # Inherit from RMX1921 device. 11 | $(call inherit-product, $(LOCAL_PATH)/device.mk) 12 | 13 | #boot animation 14 | TARGET_BOOT_ANIMATION_RES := 1080 15 | 16 | # Def Launcher 17 | TARGET_LAUNCHER := lawnchair 18 | 19 | # Device identifier. This must come after all inclusions. 20 | PRODUCT_DEVICE := RMX1921 21 | PRODUCT_NAME := superior_RMX1921 22 | PRODUCT_BRAND := Realme 23 | PRODUCT_MODEL := Realme XT 24 | PRODUCT_MANUFACTURER := Realme 25 | 26 | PRODUCT_GMS_CLIENTID_BASE := android-realme 27 | 28 | PRODUCT_BUILD_PROP_OVERRIDES += \ 29 | PRIVATE_BUILD_DESC="sdm710-user 9 PKQ1.190101.001 eng.root.20190718.013112 release-keys" 30 | 31 | BUILD_FINGERPRINT := "google/coral/coral:10/QQ3A.200805.001/6578210:user/release-keys" 32 | 33 | PRODUCT_BUILD_PROP_OVERRIDES += \ 34 | PRODUCT_NAME="RMX1921" \ 35 | TARGET_DEVICE="RMX1921" 36 | 37 | # Maintainer SuperiorOS for RMX1921 38 | PRODUCT_PROPERTY_OVERRIDES += \ 39 | ro.superior.maintainer=Amrish 40 | -------------------------------------------------------------------------------- /light/Android.bp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2018 The LineageOS Project 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | cc_binary { 16 | relative_install_path: "hw", 17 | defaults: ["hidl_defaults"], 18 | name: "android.hardware.light@2.0-service.realme_sdm710", 19 | init_rc: ["android.hardware.light@2.0-service.realme_sdm710.rc"], 20 | srcs: ["service.cpp", "Light.cpp"], 21 | vendor: true, 22 | shared_libs: [ 23 | "libbase", 24 | "libhardware", 25 | "libhidlbase", 26 | "libhidltransport", 27 | "liblog", 28 | "libhwbinder", 29 | "libutils", 30 | "android.hardware.light@2.0", 31 | ], 32 | } 33 | -------------------------------------------------------------------------------- /sensors/multihal.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 | #ifndef HARDWARE_LIBHARDWARE_MODULES_SENSORS_MULTIHAL_H_ 17 | #define HARDWARE_LIBHARDWARE_MODULES_SENSORS_MULTIHAL_H_ 18 | 19 | #include 20 | #include 21 | 22 | static const char* MULTI_HAL_CONFIG_FILE_PATH = "/vendor/etc/sensors/hals.conf"; 23 | 24 | // Depracated because system partition HAL config file does not satisfy treble requirements. 25 | static const char* DEPRECATED_MULTI_HAL_CONFIG_FILE_PATH = "/system/etc/sensors/hals.conf"; 26 | 27 | struct sensors_module_t *get_multi_hal_module_info(void); 28 | 29 | #endif // HARDWARE_LIBHARDWARE_MODULES_SENSORS_MULTIHAL_H_ 30 | -------------------------------------------------------------------------------- /RealmeParts/src/org/lineageos/settings/doze/DozeSettingsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2016 The CyanogenMod Project 3 | * 2017 The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.lineageos.settings.doze; 19 | 20 | import android.os.Bundle; 21 | import android.preference.PreferenceActivity; 22 | 23 | public class DozeSettingsActivity extends PreferenceActivity { 24 | 25 | private static final String TAG_DOZE = "doze"; 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | 31 | getFragmentManager().beginTransaction().replace(android.R.id.content, 32 | new DozeSettingsFragment(), TAG_DOZE).commit(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /bluetooth/bdroid_buildcfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. 4 | * Not a Contribution, Apache license notifications and license are retained 5 | * for attribution purposes only. 6 | * 7 | * Copyright (C) 2012 The Android Open Source Project 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef _BDROID_BUILDCFG_H 23 | #define _BDROID_BUILDCFG_H 24 | #define BTM_DEF_LOCAL_NAME "Realme XT" 25 | // Disables read remote device feature 26 | #define MAX_ACL_CONNECTIONS 16 27 | #define MAX_L2CAP_CHANNELS 16 28 | #define BLE_VND_INCLUDED TRUE 29 | // skips conn update at conn completion 30 | #define BT_CLEAN_TURN_ON_DISABLED 1 31 | 32 | /* Increasing SEPs to 12 from 6 to support SHO/MCast i.e. two streams per codec */ 33 | #define AVDT_NUM_SEPS 12 34 | #endif 35 | -------------------------------------------------------------------------------- /setup-makefiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2020 The LineageOS Project 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | set -e 19 | 20 | DEVICE=RMX1921 21 | VENDOR=realme 22 | 23 | INITIAL_COPYRIGHT_YEAR=2019 24 | 25 | # Load extract_utils and do some sanity checks 26 | MY_DIR="${BASH_SOURCE%/*}" 27 | if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi 28 | 29 | LINEAGE_ROOT="$MY_DIR"/../../.. 30 | 31 | HELPER="$LINEAGE_ROOT"/vendor/lineage/build/tools/extract_utils.sh 32 | if [ ! -f "$HELPER" ]; then 33 | echo "Unable to find helper script at $HELPER" 34 | exit 1 35 | fi 36 | . "$HELPER" 37 | 38 | # Initialize the helper 39 | setup_vendor "$DEVICE" "$VENDOR" "$LINEAGE_ROOT" 40 | 41 | # Copyright headers and guards 42 | write_headers 43 | 44 | write_makefiles "$MY_DIR"/proprietary-files.txt 45 | 46 | # Finish 47 | write_footers 48 | -------------------------------------------------------------------------------- /RealmeParts/src/org/lineageos/settings/BootCompletedReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The CyanogenMod Project 3 | * 2017-2019 The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.lineageos.settings; 19 | 20 | import android.content.BroadcastReceiver; 21 | import android.content.Context; 22 | import android.content.Intent; 23 | import android.util.Log; 24 | 25 | import org.lineageos.settings.doze.DozeUtils; 26 | 27 | public class BootCompletedReceiver extends BroadcastReceiver { 28 | 29 | private static final boolean DEBUG = false; 30 | private static final String TAG = "RealmeParts"; 31 | 32 | @Override 33 | public void onReceive(final Context context, Intent intent) { 34 | if (DEBUG) Log.d(TAG, "Received boot completed intent"); 35 | DozeUtils.checkDozeService(context); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /overlay-lineage/lineage-sdk/lineage/res/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | true 20 | 100 21 | true 22 | 23 | 24 | true 25 | 26 | 27 | true 28 | 29 | -------------------------------------------------------------------------------- /overlay/frameworks/base/packages/SystemUI/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 22 | 23 | 24 | true 25 | 26 | 27 | false 28 | 29 | 30 | /sys/class/drm/sde-crtc-0/measured_fps 31 | 32 | 33 | true 34 | 40 35 | 36 | 37 | -------------------------------------------------------------------------------- /light/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 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.realme_sdm710" 18 | 19 | #include 20 | #include 21 | 22 | #include "Light.h" 23 | 24 | using android::hardware::configureRpcThreadpool; 25 | using android::hardware::joinRpcThreadpool; 26 | 27 | using android::hardware::light::V2_0::ILight; 28 | using android::hardware::light::V2_0::implementation::Light; 29 | 30 | using android::OK; 31 | using android::status_t; 32 | 33 | int main() { 34 | android::sp service = new Light(); 35 | 36 | configureRpcThreadpool(1, true); 37 | 38 | status_t status = service->registerAsService(); 39 | if (status != OK) { 40 | LOG(ERROR) << "Cannot register Light HAL service."; 41 | return 1; 42 | } 43 | 44 | LOG(INFO) << "Light HAL service ready."; 45 | 46 | joinRpcThreadpool(); 47 | 48 | LOG(ERROR) << "Light HAL service failed to join thread pool."; 49 | return 1; 50 | } 51 | -------------------------------------------------------------------------------- /fod/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 | cc_binary { 17 | relative_install_path: "hw", 18 | defaults: ["hidl_defaults"], 19 | vintf_fragments: ["vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.realme_sdm710.xml"], 20 | name: "vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.realme_sdm710", 21 | init_rc: ["vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.realme_sdm710.rc"], 22 | srcs: ["service.cpp", "FingerprintInscreen.cpp"], 23 | proprietary: true, 24 | shared_libs: [ 25 | "libbase", 26 | "libhardware", 27 | "libhidlbase", 28 | "libhidltransport", 29 | "liblog", 30 | "libhwbinder", 31 | "libutils", 32 | "vendor.lineage.biometrics.fingerprint.inscreen@1.0", 33 | ], 34 | } 35 | 36 | cc_library_static { 37 | name: "libfod_extension.RMX1921", 38 | srcs: ["FodExtension.cpp"], 39 | include_dirs: [ 40 | "frameworks/native/services/surfaceflinger/CompositionEngine/include" 41 | ], 42 | } 43 | -------------------------------------------------------------------------------- /fod/service.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #define LOG_TAG "vendor.lineage.biometrics.fingerprint.inscreen@1.0-service.realme_sdm710" 18 | 19 | #include 20 | #include 21 | 22 | #include "FingerprintInscreen.h" 23 | 24 | using android::hardware::configureRpcThreadpool; 25 | using android::hardware::joinRpcThreadpool; 26 | 27 | using vendor::lineage::biometrics::fingerprint::inscreen::V1_0::IFingerprintInscreen; 28 | using vendor::lineage::biometrics::fingerprint::inscreen::V1_0::implementation::FingerprintInscreen; 29 | 30 | using android::OK; 31 | using android::status_t; 32 | 33 | int main() { 34 | android::sp service = new FingerprintInscreen(); 35 | 36 | configureRpcThreadpool(1, true); 37 | 38 | status_t status = service->registerAsService(); 39 | if (status != OK) { 40 | LOG(ERROR) << "Cannot register FOD HAL service."; 41 | return 1; 42 | } 43 | 44 | LOG(INFO) << "FOD HAL service ready."; 45 | 46 | joinRpcThreadpool(); 47 | 48 | LOG(ERROR) << "FOD HAL service failed to join thread pool."; 49 | return 1; 50 | } 51 | -------------------------------------------------------------------------------- /libhidl/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2017 The LineageOS Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | include $(CLEAR_VARS) 17 | LOCAL_SHARED_LIBRARIES := libhidltransport 18 | LOCAL_MODULE := android.hidl.base@1.0 19 | LOCAL_MODULE_TAGS := optional 20 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 21 | LOCAL_VENDOR_MODULE := true 22 | include $(BUILD_SHARED_LIBRARY) 23 | 24 | include $(CLEAR_VARS) 25 | LOCAL_SHARED_LIBRARIES := libhidltransport 26 | LOCAL_MODULE := android.hidl.manager@1.0 27 | LOCAL_MODULE_TAGS := optional 28 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 29 | LOCAL_VENDOR_MODULE := true 30 | include $(BUILD_SHARED_LIBRARY) 31 | 32 | include $(CLEAR_VARS) 33 | LOCAL_SHARED_LIBRARIES := libhidltransport 34 | LOCAL_MODULE := android.hidl.base@1.0_system 35 | LOCAL_INSTALLED_MODULE_STEM := android.hidl.base@1.0.so 36 | LOCAL_MODULE_TAGS := optional 37 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 38 | include $(BUILD_SHARED_LIBRARY) 39 | 40 | include $(CLEAR_VARS) 41 | LOCAL_SHARED_LIBRARIES := libhidltransport 42 | LOCAL_MODULE := android.hidl.manager@1.0_system 43 | LOCAL_INSTALLED_MODULE_STEM := android.hidl.manager@1.0.so 44 | LOCAL_MODULE_TAGS := optional 45 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES 46 | include $(BUILD_SHARED_LIBRARY) 47 | -------------------------------------------------------------------------------- /keylayout/gpio-keys.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013, 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 | 27 | key 115 VOLUME_UP WAKE_DROPPED 28 | key 114 VOLUME_DOWN WAKE_DROPPED 29 | key 102 HOME WAKE_DROPPED 30 | key 528 FOCUS WAKE_DROPPED 31 | key 766 CAMERA WAKE_DROPPED 32 | -------------------------------------------------------------------------------- /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 | #ifndef ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H 17 | #define ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace android { 26 | namespace hardware { 27 | namespace light { 28 | namespace V2_0 { 29 | namespace implementation { 30 | 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | using ::android::hardware::hidl_vec; 34 | using ::android::hardware::light::V2_0::ILight; 35 | using ::android::hardware::light::V2_0::LightState; 36 | using ::android::hardware::light::V2_0::Status; 37 | using ::android::hardware::light::V2_0::Type; 38 | 39 | class Light : public ILight { 40 | public: 41 | Light(); 42 | 43 | Return setLight(Type type, const LightState& state) override; 44 | Return getSupportedTypes(getSupportedTypes_cb _hidl_cb) override; 45 | 46 | private: 47 | void handleBacklight(const LightState& state); 48 | 49 | std::mutex mLock; 50 | std::unordered_map> mLights; 51 | }; 52 | 53 | } // namespace implementation 54 | } // namespace V2_0 55 | } // namespace light 56 | } // namespace hardware 57 | } // namespace android 58 | 59 | #endif // ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H 60 | -------------------------------------------------------------------------------- /extract-files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2020 The LineageOS Project 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | set -e 19 | 20 | DEVICE=RMX1921 21 | VENDOR=realme 22 | 23 | # Load extract_utils and do some sanity checks 24 | MY_DIR="${BASH_SOURCE%/*}" 25 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 26 | 27 | LINEAGE_ROOT="${MY_DIR}/../../.." 28 | 29 | HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh" 30 | if [ ! -f "${HELPER}" ]; then 31 | echo "Unable to find helper script at ${HELPER}" 32 | exit 1 33 | fi 34 | source "${HELPER}" 35 | 36 | # Default to sanitizing the vendor folder before extraction 37 | CLEAN_VENDOR=true 38 | SECTION= 39 | KANG= 40 | 41 | while [ "$1" != "" ]; do 42 | case "$1" in 43 | -n | --no-cleanup ) CLEAN_VENDOR=false 44 | ;; 45 | -k | --kang) KANG="--kang" 46 | ;; 47 | -s | --section ) shift 48 | SECTION="$1" 49 | CLEAN_VENDOR=false 50 | ;; 51 | * ) SRC="$1" 52 | ;; 53 | esac 54 | shift 55 | done 56 | 57 | if [ -z "${SRC}" ]; then 58 | SRC=adb 59 | fi 60 | 61 | # Initialize the helper 62 | setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" false "${CLEAN_VENDOR}" 63 | 64 | extract "${MY_DIR}/proprietary-files.txt" "${SRC}" ${KANG} --section "${SECTION}" 65 | 66 | "${MY_DIR}/setup-makefiles.sh" 67 | -------------------------------------------------------------------------------- /configs/media/system_properties.xml: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /rootdir/etc/init.qcom.sensors.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | # Copyright (c) 2015,2018 The Linux Foundation. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of The Linux Foundation nor 12 | # the names of its contributors may be used to endorse or promote 13 | # products derived from this software without specific prior written 14 | # permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | 29 | # 30 | # Function to start sensors for SSC enabled platforms 31 | # 32 | start_sensors() 33 | { 34 | 35 | chmod -h 664 /persist/sensors/sensors_settings 36 | chown -h -R system.system /persist/sensors 37 | start vendor.sensors.qti 38 | 39 | # Only for SLPI 40 | if [ -c /dev/msm_dsps -o -c /dev/sensors ] ; then 41 | start vendor.sensors 42 | fi 43 | } 44 | 45 | start_sensors 46 | -------------------------------------------------------------------------------- /gps/flp.conf: -------------------------------------------------------------------------------- 1 | ################################### 2 | ##### FLP settings ##### 3 | ################################### 4 | 5 | ################################### 6 | # FLP BATCH SIZE 7 | ################################### 8 | # The number of batched locations 9 | # requested to modem. The desired number 10 | # defined below may not be satisfied, as 11 | # the modem can only return the number 12 | # of batched locations that can be allocated, 13 | # which is limited by memory. The default 14 | # batch size defined as 20 as below. 15 | BATCH_SIZE=20 16 | 17 | ################################### 18 | # FLP OUTDOOR TRIP BATCH SIZE 19 | ################################### 20 | # The number of batched locations 21 | # requested to modem for outdoor 22 | # trip batching. The desired number 23 | # defined below may not be satisfied, as 24 | # the modem can only return the number 25 | # of batched locations that can be allocated, 26 | # which is limited by memory. The default 27 | # trip batch size defined as 600 as below. 28 | OUTDOOR_TRIP_BATCH_SIZE=600 29 | 30 | ################################### 31 | # FLP BATCHING SESSION TIMEOUT 32 | ################################### 33 | # Duration with which batch session timeout 34 | # happens in milliseconds. If not specified 35 | # or set to zero, batching session timeout 36 | # defaults to 20 seconds by the modem. 37 | # BATCH_SESSION_TIMEOUT=20000 38 | 39 | ################################### 40 | # FLP BATCHING ACCURACY 41 | ################################### 42 | # Set to one of the defined values below 43 | # to define the accuracy of batching. 44 | # If not specified, accuracy defaults 45 | # to LOW. 46 | # FLP BATCHING ACCURACY values: 47 | # Low accuracy = 0 48 | # Medium accuracy = 1 49 | # High accuracy = 2 50 | ACCURACY=1 51 | 52 | #################################### 53 | # By default if network fixes are not sensor assisted 54 | # these fixes must be dropped. This parameter adds an exception 55 | # for targets where there is no PDR and we still want to 56 | # report out network fixes 57 | # 0: MUST NOT ALLOW NETWORK FIXES 58 | # 1: ALLOW NETWORK FIXES 59 | #################################### 60 | ALLOW_NETWORK_FIXES = 0 61 | -------------------------------------------------------------------------------- /RealmeParts/res/layout/switch_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 27 | 28 | 41 | 42 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /interfaces/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.hal: -------------------------------------------------------------------------------- 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 | package vendor.oppo.hardware.biometrics.fingerprint@2.1; 18 | 19 | /* This HAL interface communicates asynchronous results from the 20 | fingerprint driver in response to user actions on the fingerprint sensor 21 | */ 22 | interface IBiometricsFingerprintClientCallback { 23 | 24 | oneway onEnrollResult(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining); 25 | 26 | oneway onAcquired(uint64_t deviceId, FingerprintAcquiredInfo acquiredInfo, int32_t vendorCode); 27 | 28 | oneway onAuthenticated(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, vec token); 29 | 30 | oneway onError(uint64_t deviceId, FingerprintError error, int32_t vendorCode); 31 | 32 | oneway onRemoved(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining); 33 | 34 | oneway onEnumerate(uint64_t deviceId, uint32_t fingerId, uint32_t groupId, uint32_t remaining); 35 | 36 | oneway onTouchDown(uint64_t deviceId); 37 | oneway onTouchUp(uint64_t deviceId); 38 | oneway onMonitorEventTriggered(uint32_t type, string data); 39 | oneway onImageInfoAcquired(uint32_t type, uint32_t quality, uint32_t match_score); 40 | oneway onSyncTemplates(uint64_t deviceId, vec fingerId, uint32_t remaining); 41 | oneway onEngineeringInfoUpdated(uint32_t length, vec keys, vec values); 42 | oneway onFingerprintCmd(int32_t deviceId, vec groupId, uint32_t remaining); 43 | oneway onUIReady(int64_t deviceId); 44 | }; 45 | -------------------------------------------------------------------------------- /RealmeParts/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 47 | 48 | 49 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /configs/privapp-permissions-qti.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 23 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /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-2020 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 common 18 | import re 19 | 20 | def FullOTA_InstallEnd(info): 21 | OTA_InstallEnd(info) 22 | return 23 | 24 | def IncrementalOTA_InstallEnd(info): 25 | OTA_InstallEnd(info) 26 | return 27 | 28 | def FullOTA_Assertions(info): 29 | AddTrustZoneAssertion(info, info.input_zip) 30 | return 31 | 32 | def IncrementalOTA_Assertions(info): 33 | AddTrustZoneAssertion(info, info.target_zip) 34 | return 35 | 36 | def AddImage(info, basename, dest): 37 | path = "IMAGES/" + basename 38 | if path not in info.input_zip.namelist(): 39 | return 40 | 41 | data = info.input_zip.read(path) 42 | common.ZipWriteStr(info.output_zip, basename, data) 43 | info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) 44 | info.script.AppendExtra('package_extract_file("%s", "%s");' % (basename, dest)) 45 | 46 | def OTA_InstallEnd(info): 47 | AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo") 48 | AddImage(info, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta") 49 | return 50 | 51 | def AddTrustZoneAssertion(info, input_zip): 52 | android_info = info.input_zip.read("OTA/android-info.txt") 53 | m = re.search(r'require\s+version-trustzone\s*=\s*(\S+)', android_info) 54 | if m: 55 | versions = m.group(1).split('|') 56 | if len(versions) and '*' not in versions: 57 | cmd = 'assert(RMX1921.verify_trustzone(' + ','.join(['"%s"' % tz for tz in versions]) + ') == "1" || abort("ERROR: This package requires firmware from an Android 10 based Realme UI build. Please upgrade firmware and retry!"););' 58 | info.script.AppendExtra(cmd) 59 | return 60 | -------------------------------------------------------------------------------- /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.realme_sdm710" 18 | 19 | #include 20 | #include 21 | 22 | #include "BiometricsFingerprint.h" 23 | 24 | using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint; 25 | using android::hardware::biometrics::fingerprint::V2_1::implementation::BiometricsFingerprint; 26 | using android::hardware::configureRpcThreadpool; 27 | using android::hardware::joinRpcThreadpool; 28 | using android::OK; 29 | using android::sp; 30 | using android::status_t; 31 | 32 | int main() { 33 | sp biometricsFingerprint; 34 | status_t status; 35 | 36 | LOG(INFO) << "Fingerprint HAL Adapter service is starting."; 37 | 38 | biometricsFingerprint = new BiometricsFingerprint(); 39 | if (biometricsFingerprint == nullptr) { 40 | LOG(ERROR) << "Can not create an instance of Fingerprint HAL Adapter BiometricsFingerprint Iface, exiting."; 41 | goto shutdown; 42 | } 43 | 44 | configureRpcThreadpool(1, true /*callerWillJoin*/); 45 | 46 | status = biometricsFingerprint->registerAsService(); 47 | if (status != OK) { 48 | LOG(ERROR) << "Could not register service for Fingerprint HAL Adapter BiometricsFingerprint Iface (" 49 | << status << ")"; 50 | goto shutdown; 51 | } 52 | 53 | LOG(INFO) << "Fingerprint HAL Adapter service is ready."; 54 | joinRpcThreadpool(); 55 | // Should not pass this line 56 | 57 | shutdown: 58 | // In normal operation, we don't expect the thread pool to shutdown 59 | LOG(ERROR) << "Fingerprint HAL Adapter service is shutting down."; 60 | return 1; 61 | } 62 | -------------------------------------------------------------------------------- /fingerprint/android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710.rc: -------------------------------------------------------------------------------- 1 | on boot 2 | # Goodix FP 3 | chown system system /dev/goodix_fp 4 | 5 | # Egis FP 6 | chown system system /dev/esfp0 7 | 8 | # FPC FP 9 | chown system system /dev/uinput 10 | chown system system /sys/devices/platform/soc/soc:fpc_fpc1020/irq 11 | chown system system /sys/devices/platform/soc/soc:fpc_fpc1020/irq_enable 12 | chown system system /sys/devices/platform/soc/soc:fpc_fpc1020/wakelock_enable 13 | chmod 0660 /sys/devices/platform/soc/soc:fpc_fpc1020/irq 14 | chmod 0660 /sys/devices/platform/soc/soc:fpc_fpc1020/irq_enable 15 | chmod 0660 /sys/devices/platform/soc/soc:fpc_fpc1020/wakelock_enable 16 | 17 | on post-fs-data 18 | # Goodix FP 19 | mkdir /data/gf_data 0700 system system 20 | mkdir /data/system/gf_data 0700 system system 21 | mkdir /data/images 0700 system system 22 | 23 | # FPC FP 24 | chown system system /sys/bus/platform/devices/fpc_interrupt/clk_enable 25 | chown system system /sys/bus/platform/devices/fpc_interrupt/wakelock_enable 26 | chown system system /sys/bus/platform/devices/fpc_interrupt/irq 27 | chown system system /sys/bus/platform/devices/fpc_interrupt/irq_enable 28 | chown system system /sys/bus/platform/devices/fpc_interrupt/irq_unexpected 29 | chmod 0200 /sys/bus/platform/devices/fpc_interrupt/irq_enable 30 | chmod 0200 /sys/bus/platform/devices/fpc_interrupt/clk_enable 31 | chmod 0200 /sys/bus/platform/devices/fpc_interrupt/wakelock_enable 32 | chmod 0600 /sys/bus/platform/devices/fpc_interrupt/irq 33 | chmod 0660 /sys/bus/platform/devices/fpc_interrupt/irq_unexpected 34 | 35 | # For FOD (Common) 36 | mkdir /data/vendor/fingerprint 0770 system system 37 | mkdir /mnt/vendor/persist/fingerprint 0770 system system 38 | chown system system /sys/kernel/oppo_display/hbm 39 | 40 | # For Silead FOD 41 | mkdir /data/system/silead 0770 system system 42 | mkdir /persist/silead 0770 system system 43 | mkdir /data/vendor/silead 0770 system system 44 | mkdir /mnt/vendor/persist/fingerprint/silead 0770 system system 45 | 46 | # For Egis FOD 47 | mkdir /data/vendor/optical_fingerprint 0770 system system 48 | 49 | service vendor.fps_hal.realme_sdm710 /vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service.realme_sdm710 50 | class late_start 51 | user system 52 | group system input 53 | 54 | service oppo_fingerprints_sh /vendor/bin/sh /vendor/bin/init.oppo.fingerprints.sh 55 | class main 56 | user root 57 | oneshot 58 | -------------------------------------------------------------------------------- /RealmeParts/res/xml/doze_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 26 | 27 | 30 | 31 | 36 | 37 | 43 | 44 | 45 | 46 | 49 | 50 | 55 | 56 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /fod/FingerprintInscreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef VENDOR_LINEAGE_BIOMETRICS_FINGERPRINT_INSCREEN_V1_0_FINGERPRINTINSCREEN_H 18 | #define VENDOR_LINEAGE_BIOMETRICS_FINGERPRINT_INSCREEN_V1_0_FINGERPRINTINSCREEN_H 19 | 20 | #include 21 | 22 | namespace vendor { 23 | namespace lineage { 24 | namespace biometrics { 25 | namespace fingerprint { 26 | namespace inscreen { 27 | namespace V1_0 { 28 | namespace implementation { 29 | 30 | using ::android::sp; 31 | using ::android::hardware::Return; 32 | using ::android::hardware::Void; 33 | 34 | class FingerprintInscreen : public IFingerprintInscreen { 35 | public: 36 | FingerprintInscreen(); 37 | Return getPositionX() override; 38 | Return getPositionY() override; 39 | Return getSize() override; 40 | Return onStartEnroll() override; 41 | Return onFinishEnroll() override; 42 | Return onPress() override; 43 | Return onRelease() override; 44 | Return onShowFODView() override; 45 | Return onHideFODView() override; 46 | Return handleAcquired(int32_t acquiredInfo, int32_t vendorCode) override; 47 | Return handleError(int32_t error, int32_t vendorCode) override; 48 | Return setLongPressEnabled(bool enabled) override; 49 | Return getDimAmount(int32_t brightness) override; 50 | Return shouldBoostBrightness() override; 51 | Return setCallback(const sp<::vendor::lineage::biometrics::fingerprint::inscreen::V1_0::IFingerprintInscreenCallback>& callback) override; 52 | 53 | private: 54 | bool isDreamState; 55 | std::mutex mCallbackLock; 56 | sp mCallback; 57 | }; 58 | 59 | } // namespace implementation 60 | } // namespace V1_0 61 | } // namespace inscreen 62 | } // namespace fingerprint 63 | } // namespace biometrics 64 | } // namespace lineage 65 | } // namespace vendor 66 | 67 | #endif // VENDOR_LINEAGE_BIOMETRICS_FINGERPRINT_INSCREEN_V1_0_FINGERPRINTINSCREEN_H 68 | -------------------------------------------------------------------------------- /interfaces/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal: -------------------------------------------------------------------------------- 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 | package vendor.oppo.hardware.biometrics.fingerprint@2.1; 18 | 19 | import IBiometricsFingerprintClientCallback; 20 | 21 | interface IBiometricsFingerprint { 22 | 23 | setNotify(IBiometricsFingerprintClientCallback clientCallback) generates (uint64_t deviceId); 24 | 25 | preEnroll() generates (uint64_t authChallenge); 26 | 27 | enroll(uint8_t[69] hat, uint32_t gid, uint32_t timeoutSec) generates (RequestStatus debugErrno); 28 | 29 | postEnroll() generates (RequestStatus debugErrno); 30 | 31 | getAuthenticatorId() generates (uint64_t AuthenticatorId); 32 | 33 | cancel() generates (RequestStatus debugErrno); 34 | 35 | enumerate() generates (RequestStatus debugErrno); 36 | 37 | remove(uint32_t gid, uint32_t fid) generates (RequestStatus debugErrno); 38 | 39 | setActiveGroup(uint32_t gid, string storePath) generates (RequestStatus debugErrno); 40 | 41 | authenticate(uint64_t operationId, uint32_t gid) generates (RequestStatus debugErrno); 42 | authenticateAsType(uint64_t auth, uint32_t type, FingerprintAuthType AuthType) generates (RequestStatus debugErrno); 43 | cleanUp() generates (RequestStatus debugErrno); 44 | pauseEnroll() generates (RequestStatus debugErrno); 45 | continueEnroll() generates (RequestStatus debugErrno); 46 | setTouchEventListener() generates (RequestStatus debugErrno); 47 | dynamicallyConfigLog(uint32_t log) generates (RequestStatus debugErrno); 48 | pauseIdentify() generates (RequestStatus debugErrno); 49 | continueIdentify() generates (RequestStatus debugErrno); 50 | getAlikeyStatus() generates (RequestStatus debugErrno); 51 | getEnrollmentTotalTimes() generates (RequestStatus debugErrno); 52 | setScreenState(FingerprintScreenState ScreenState); 53 | getEngineeringInfo(uint32_t info) generates (RequestStatus debugErrno); 54 | touchDown() generates (RequestStatus debugErrno); 55 | touchUp() generates (RequestStatus debugErrno); 56 | sendFingerprintCmd(int32_t cmd, vec CmdId) generates (RequestStatus debugErrno); 57 | }; 58 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | # Wlan 2 | vendor.wlan. u:object_r:vendor_wifi_prop:s0 3 | wifi.active.interface u:object_r:exported_wifi_prop:s0 4 | 5 | # Oppo Audio props 6 | persist.oppo.mm.pcmdump u:object_r:vendor_audio_prop:s0 7 | sys.oppo.mm.record.type u:object_r:vendor_audio_prop:s0 8 | sys.oppo.mm.voice.record u:object_r:vendor_audio_prop:s0 9 | 10 | # Oppo FP props 11 | persist.vendor.fingerprint. u:object_r:oppo_fingerprint_prop:s0 12 | oppo.optical. u:object_r:oppo_fingerprint_prop:s0 13 | vendor.fingerprint.optical. u:object_r:oppo_fingerprint_prop:s0 14 | 15 | # Camera 16 | oppo.camera. u:object_r:vendor_camera_prop:s0 17 | persist.front.skipdisplay.enable u:object_r:vendor_camera_prop:s0 18 | persist.aec.manual.mode u:object_r:vendor_camera_prop:s0 19 | persist.camera. u:object_r:vendor_camera_prop:s0 20 | ro.camera. u:object_r:vendor_camera_prop:s0 21 | persist.oppo.camera. u:object_r:vendor_camera_prop:s0 22 | 23 | # Radio props 24 | gsm.operator.numeric u:object_r:radio_prop:s0 25 | 26 | # Oppo debug props 27 | persist.ipe.debug u:object_r:oppo_debug_prop:s0 28 | persist.sys.oppo u:object_r:oppo_debug_prop:s0 29 | persist.sys.assert. u:object_r:oppo_debug_prop:s0 30 | ro.build.flavor u:object_r:oppo_debug_prop:s0 31 | ro.oppo. u:object_r:oppo_debug_prop:s0 32 | persist.sys.log. u:object_r:oppo_debug_prop:s0 33 | sys.oppo_ftm_mode u:object_r:oppo_debug_prop:s0 34 | sys.oppo.bsp.drm.widevine.info u:object_r:oppo_debug_prop:s0 35 | oppo.tof. u:object_r:oppo_debug_prop:s0 36 | persist.serial.enable u:object_r:oppo_debug_prop:s0 37 | ro.sys.reserve.integrate u:object_r:oppo_debug_prop:s0 38 | ro.vendor.aware_available u:object_r:oppo_debug_prop:s0 39 | sys.build.display.full_id u:object_r:oppo_debug_prop:s0 40 | ro.rf_version u:object_r:oppo_debug_prop:s0 41 | 42 | # Oppo wlan prop 43 | persist.oppo.wlan. u:object_r:oppo_wlan_prop:s0 44 | 45 | # Audio 46 | audio.volume.listener.dump u:object_r:vendor_audio_prop:s0 47 | audio.volume.headset.gain.depcal u:object_r:vendor_audio_prop:s0 48 | audio_hal.in_period_size u:object_r:vendor_audio_prop:s0 49 | audio_hal.period_multiplier u:object_r:vendor_audio_prop:s0 50 | audio_hal.period_size u:object_r:vendor_audio_prop:s0 51 | persist.audio.dualmic.config u:object_r:vendor_audio_prop:s0 52 | -------------------------------------------------------------------------------- /interfaces/biometrics/fingerprint/2.1/types.hal: -------------------------------------------------------------------------------- 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 | package vendor.oppo.hardware.biometrics.fingerprint@2.1; 18 | 19 | enum RequestStatus : int32_t { 20 | SYS_UNKNOWN = 1, 21 | SYS_OK = 0, 22 | SYS_ENOENT = -2, 23 | SYS_EINTR = -4, 24 | SYS_EIO = -5, 25 | SYS_EAGAIN = -11, 26 | SYS_ENOMEM = -12, 27 | SYS_EACCES = -13, 28 | SYS_EFAULT = -14, 29 | SYS_EBUSY = -16, 30 | SYS_EINVAL = -22, 31 | SYS_ENOSPC = -28, 32 | SYS_ETIMEDOUT = -110, 33 | }; 34 | 35 | enum FingerprintError : int32_t { 36 | ERROR_NO_ERROR = 0, 37 | ERROR_HW_UNAVAILABLE = 1, 38 | ERROR_UNABLE_TO_PROCESS = 2, 39 | ERROR_TIMEOUT = 3, 40 | ERROR_NO_SPACE = 4, 41 | ERROR_CANCELED = 5, 42 | ERROR_UNABLE_TO_REMOVE = 6, 43 | ERROR_LOCKOUT = 7, 44 | ERROR_VENDOR = 8 45 | }; 46 | 47 | enum FingerprintAcquiredInfo : int32_t { 48 | ACQUIRED_GOOD = 0, 49 | ACQUIRED_PARTIAL = 1, 50 | ACQUIRED_INSUFFICIENT = 2, 51 | ACQUIRED_IMAGER_DIRTY = 3, 52 | ACQUIRED_TOO_SLOW = 4, 53 | ACQUIRED_TOO_FAST = 5, 54 | ACQUIRED_VENDOR = 6 55 | }; 56 | 57 | struct FingerprintFingerId { 58 | uint32_t gid; 59 | uint32_t fid; 60 | }; 61 | 62 | struct FingerprintEnroll { 63 | FingerprintFingerId finger; 64 | uint32_t samplesRemaining; uint64_t msg; 65 | }; 66 | 67 | struct FingerprintIterator { 68 | FingerprintFingerId finger; 69 | uint32_t remainingTemplates; 70 | }; 71 | 72 | typedef FingerprintIterator FingerprintEnumerated; 73 | typedef FingerprintIterator FingerprintRemoved; 74 | 75 | struct FingerprintAcquired { 76 | FingerprintAcquiredInfo acquiredInfo; 77 | }; 78 | 79 | struct FingerprintAuthenticated { 80 | FingerprintFingerId finger; 81 | uint8_t[69] hat; 82 | }; 83 | 84 | enum FingerprintMsgType : int32_t { 85 | ERROR = -1, 86 | ACQUIRED = 1, 87 | TEMPLATE_ENROLLING = 3, 88 | TEMPLATE_REMOVED = 4, 89 | AUTHENTICATED = 5, 90 | TEMPLATE_ENUMERATING = 6, 91 | }; 92 | 93 | enum FingerprintScreenState : int32_t { 94 | FINGERPRINT_SCREEN_OFF = 0, 95 | FINGERPRINT_SCREEN_ON = 1, 96 | }; 97 | 98 | enum FingerprintAuthType : int32_t { 99 | TYPE_KEYGUARD = 1, 100 | TYPE_PAY = 2, 101 | TYPE_OTHER = 3, 102 | }; 103 | 104 | -------------------------------------------------------------------------------- /sensors/SensorEventQueue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | #include "SensorEventQueue.h" 25 | 26 | SensorEventQueue::SensorEventQueue(int capacity) { 27 | mCapacity = capacity; 28 | 29 | mStart = 0; 30 | mSize = 0; 31 | mData = new sensors_event_t[mCapacity]; 32 | pthread_cond_init(&mSpaceAvailableCondition, NULL); 33 | } 34 | 35 | SensorEventQueue::~SensorEventQueue() { 36 | delete[] mData; 37 | mData = NULL; 38 | pthread_cond_destroy(&mSpaceAvailableCondition); 39 | } 40 | 41 | int SensorEventQueue::getWritableRegion(int requestedLength, sensors_event_t** out) { 42 | if (mSize == mCapacity || requestedLength <= 0) { 43 | *out = NULL; 44 | return 0; 45 | } 46 | // Start writing after the last readable record. 47 | int firstWritable = (mStart + mSize) % mCapacity; 48 | 49 | int lastWritable = firstWritable + requestedLength - 1; 50 | 51 | // Don't go past the end of the data array. 52 | if (lastWritable > mCapacity - 1) { 53 | lastWritable = mCapacity - 1; 54 | } 55 | // Don't go into the readable region. 56 | if (firstWritable < mStart && lastWritable >= mStart) { 57 | lastWritable = mStart - 1; 58 | } 59 | *out = &mData[firstWritable]; 60 | return lastWritable - firstWritable + 1; 61 | } 62 | 63 | void SensorEventQueue::markAsWritten(int count) { 64 | mSize += count; 65 | } 66 | 67 | int SensorEventQueue::getSize() { 68 | return mSize; 69 | } 70 | 71 | sensors_event_t* SensorEventQueue::peek() { 72 | if (mSize == 0) return NULL; 73 | return &mData[mStart]; 74 | } 75 | 76 | void SensorEventQueue::dequeue() { 77 | if (mSize == 0) return; 78 | if (mSize == mCapacity) { 79 | pthread_cond_broadcast(&mSpaceAvailableCondition); 80 | } 81 | mSize--; 82 | mStart = (mStart + 1) % mCapacity; 83 | } 84 | 85 | // returns true if it waited, or false if it was a no-op. 86 | bool SensorEventQueue::waitForSpace(pthread_mutex_t* mutex) { 87 | bool waited = false; 88 | while (mSize == mCapacity) { 89 | waited = true; 90 | pthread_cond_wait(&mSpaceAvailableCondition, mutex); 91 | } 92 | return waited; 93 | } 94 | -------------------------------------------------------------------------------- /RealmeParts/res/layout/preference_category_material_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 20 | 27 | 28 | 34 | 41 | 42 | 43 | 48 | 56 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /sepolicy/vendor/file_contexts: -------------------------------------------------------------------------------- 1 | # Audio 2 | /mnt/vendor/persist/audio(/.*)? u:object_r:persist_audio_file:s0 3 | /proc/asound/card0/codecs(/.*)? u:object_r:proc_audio_file:s0 4 | 5 | # FOD Hal 6 | /(vendor|system/vendor)/bin/hw/vendor\.lineage\.biometrics\.fingerprint\.inscreen@1.0-service\.realme_sdm710 u:object_r:hal_lineage_fod_default_exec:s0 7 | 8 | # Goodix Fingerprint device 9 | /dev/goodix_fp u:object_r:goodix_device:s0 10 | 11 | # Biometrics 12 | /(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.1-service\.realme_sdm710 u:object_r:hal_fingerprint_default_exec:s0 13 | /(vendor|system/vendor)/bin/hw/vendor\.oppo\.hardware\.biometrics\.fingerprint@2\.1-service u:object_r:hal_fingerprint_default_exec:s0 14 | 15 | # Light Hal 16 | /(vendor|system/vendor)/bin/hw/android\.hardware\.light@2\.0-service\.realme_sdm710 u:object_r:hal_light_default_exec:s0 17 | 18 | # Oppo HIDL hals 19 | /(vendor|system/vendor)/bin/hw/vendor\.oppo\.hardware\.camera\.oppoAlgoProcessService@1\.0-service u:object_r:hal_camera_default_exec:s0 20 | /(vendor|system/vendor)/bin/hw/vendor\.oppo\.hardware\.mmdisplayfeature@1\.0-service u:object_r:oppo_display_default_exec:s0 21 | 22 | # Rootfs files 23 | /bt_firmware(/.*)? u:object_r:bt_firmware_file:s0 24 | /firmware(/.*)? u:object_r:firmware_file:s0 25 | /persist(/.*)? u:object_r:persist_file:s0 26 | 27 | # Neural Networks Hal 28 | /(vendor|system/vendor)/bin/hw/android\.hardware\.neuralnetworks@1\.1-service-qti u:object_r:hal_neuralnetworks_default_exec:s0 29 | 30 | # Camera 31 | /mnt/vendor/persist/camera(/.*)? u:object_r:persist_camera_file:s0 32 | 33 | # Sensors 34 | /persist/sensors(/.*)? u:object_r:sensors_persist_file:s0 35 | 36 | # Oppo Partitions 37 | /dev/block/platform/soc/1d84000.ufshc/by-name/oppodycnvbk u:object_r:modem_efs_partition_device:s0 38 | /dev/block/platform/soc/1d84000.ufshc/by-name/oppostanvbk u:object_r:modem_efs_partition_device:s0 39 | /dev/block/platform/soc/1d84000.ufshc/by-name/opporeserve[0-9] u:object_r:modem_efs_partition_device:s0 40 | /dev/block/platform/soc/1d84000.ufshc/by-name/oppo_sec u:object_r:modem_efs_partition_device:s0 41 | 42 | # mdmreason device 43 | /dev/mdmreason u:object_r:mdmreason_device:s0 44 | 45 | # sysfs uio 46 | /sys/devices(/platform)?/soc/[a-f0-9]+.qcom,oembackup_sharedmem/uio/uio[0-9]+(/.*)? u:object_r:sysfs_uio_file:s0 47 | 48 | # FPS Info 49 | /sys/class/drm/sde-crtc-0/measured_fps u:object_r:sysfs_fps:s0 50 | -------------------------------------------------------------------------------- /sensors/Sensors.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 HARDWARE_INTERFACES_SENSORS_V1_0_DEFAULT_SENSORS_H_ 18 | 19 | #define HARDWARE_INTERFACES_SENSORS_V1_0_DEFAULT_SENSORS_H_ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace android { 27 | namespace hardware { 28 | namespace sensors { 29 | namespace V1_0 { 30 | namespace implementation { 31 | 32 | 33 | struct Sensors : public ::android::hardware::sensors::V1_0::ISensors { 34 | Sensors(); 35 | 36 | status_t initCheck() const; 37 | 38 | Return getSensorsList(getSensorsList_cb _hidl_cb) override; 39 | 40 | Return setOperationMode(OperationMode mode) override; 41 | 42 | Return activate( 43 | int32_t sensor_handle, bool enabled) override; 44 | 45 | Return poll(int32_t maxCount, poll_cb _hidl_cb) override; 46 | 47 | Return batch( 48 | int32_t sensor_handle, 49 | int64_t sampling_period_ns, 50 | int64_t max_report_latency_ns) override; 51 | 52 | Return flush(int32_t sensor_handle) override; 53 | 54 | Return injectSensorData(const Event& event) override; 55 | 56 | Return registerDirectChannel( 57 | const SharedMemInfo& mem, registerDirectChannel_cb _hidl_cb) override; 58 | 59 | Return unregisterDirectChannel(int32_t channelHandle) override; 60 | 61 | Return configDirectReport( 62 | int32_t sensorHandle, int32_t channelHandle, RateLevel rate, 63 | configDirectReport_cb _hidl_cb) override; 64 | 65 | private: 66 | static constexpr int32_t kPollMaxBufferSize = 128; 67 | status_t mInitCheck; 68 | sensors_module_t *mSensorModule; 69 | sensors_poll_device_1_t *mSensorDevice; 70 | std::mutex mPollLock; 71 | 72 | int32_t mSensorHandleProximityWakeup; 73 | int32_t mSensorHandleProximity; 74 | 75 | bool isProximity(int32_t sensor_handle); 76 | 77 | int getHalDeviceVersion() const; 78 | 79 | void convertFromSensorEvents( 80 | size_t count, const sensors_event_t *src, hidl_vec *dst); 81 | 82 | DISALLOW_COPY_AND_ASSIGN(Sensors); 83 | }; 84 | 85 | extern "C" ISensors *HIDL_FETCH_ISensors(const char *name); 86 | 87 | } // namespace implementation 88 | } // namespace V1_0 89 | } // namespace sensors 90 | } // namespace hardware 91 | } // namespace android 92 | 93 | #endif // HARDWARE_INTERFACES_SENSORS_V1_0_DEFAULT_SENSORS_H_ 94 | -------------------------------------------------------------------------------- /sensors/SensorEventQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 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 SENSOREVENTQUEUE_H_ 18 | #define SENSOREVENTQUEUE_H_ 19 | 20 | #include 21 | #include 22 | 23 | /* 24 | * Fixed-size circular queue, with an API developed around the sensor HAL poll() method. 25 | * Poll() takes a pointer to a buffer, which is written by poll() before it returns. 26 | * This class can provide a pointer to a spot in its internal buffer for poll() to 27 | * write to, instead of using an intermediate buffer and a memcpy. 28 | * 29 | * Thread safety: 30 | * Reading can be done safely after grabbing the mutex lock, while poll() writing in a separate 31 | * thread without a mutex lock. But there can only be one writer at a time. 32 | */ 33 | class SensorEventQueue { 34 | int mCapacity; 35 | int mStart; // start of readable region 36 | int mSize; // number of readable items 37 | sensors_event_t* mData; 38 | pthread_cond_t mSpaceAvailableCondition; 39 | 40 | public: 41 | explicit SensorEventQueue(int capacity); 42 | ~SensorEventQueue(); 43 | 44 | // Returns length of region, between zero and min(capacity, requestedLength). If there is any 45 | // writable space, it will return a region of at least one. Because it must return 46 | // a pointer to a contiguous region, it may return smaller regions as we approach the end of 47 | // the data array. 48 | // Only call while holding the lock. 49 | // The region is not marked internally in any way. Subsequent calls may return overlapping 50 | // regions. This class expects there to be exactly one writer at a time. 51 | int getWritableRegion(int requestedLength, sensors_event_t** out); 52 | 53 | // After writing to the region returned by getWritableRegion(), call this to indicate how 54 | // many records were actually written. 55 | // This increases size() by count. 56 | // Only call while holding the lock. 57 | void markAsWritten(int count); 58 | 59 | // Gets the number of readable records. 60 | // Only call while holding the lock. 61 | int getSize(); 62 | 63 | // Returns pointer to the first readable record, or NULL if size() is zero. 64 | // Only call this while holding the lock. 65 | sensors_event_t* peek(); 66 | 67 | // This will decrease the size by one, freeing up the oldest readable event's slot for writing. 68 | // Only call while holding the lock. 69 | void dequeue(); 70 | 71 | // Blocks until space is available. No-op if there is already space. 72 | // Returns true if it had to wait. 73 | bool waitForSpace(pthread_mutex_t* mutex); 74 | }; 75 | 76 | #endif // SENSOREVENTQUEUE_H_ 77 | -------------------------------------------------------------------------------- /rootdir/etc/fstab.qcom: -------------------------------------------------------------------------------- 1 | # Android fstab file. 2 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 3 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 4 | 5 | #TODO: Add 'check' as fs_mgr_flags with data partition. 6 | # Currently we dont have e2fsck compiled. So fs check would failed. 7 | 8 | # 9 | /dev/block/bootdevice/by-name/system / ext4 ro,barrier=1,discard wait,avb 10 | /dev/block/bootdevice/by-name/cache /cache ext4 nosuid,noatime,nodev,barrier=1,discard wait,check 11 | /dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,noatime,nodev,barrier=1,noauto_da_alloc,discard,lazytime,errors=panic latemount,wait,check,fileencryption=ice,quota,reservedsize=128M 12 | /devices/platform/soc/8804000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto 13 | /devices/platform/soc/1da4000.ufshc_card/host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto 14 | /dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait 15 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1,discard wait 16 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 nosuid,noatime,nodev,barrier=1,discard wait,check 17 | /dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait 18 | 19 | # Need to have this entry in here even though the mount point itself is no longer needed. 20 | # The update_engine code looks for this entry in order to determine the boot device address 21 | # and fails if it does not find it. 22 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults 23 | 24 | # OTG storage 25 | /devices/platform/soc/a600000.ssusb/a600000.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto 26 | 27 | # Opporeserve partition 28 | /dev/block/bootdevice/by-name/opporeserve2 /mnt/vendor/opporeserve ext4 nosuid,nodev,noatime,barrier=1,discard wait,check 29 | 30 | # Recovery only 31 | /dev/block/bootdevice/by-name/vendor /vendor ext4 ro,barrier=1 wait,recoveryonly 32 | /dev/block/bootdevice/by-name/boot /boot emmc defaults recoveryonly 33 | /dev/block/bootdevice/by-name/recovery /recovery emmc defaults recoveryonly 34 | -------------------------------------------------------------------------------- /wlan/icm.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 | # icm configuration file 29 | 30 | #number of devices 31 | num_devices=1 32 | 33 | # Number of Radios 34 | num_radios=1 35 | 36 | # Communication interface with driver 37 | # options: ioctl OR cfg 38 | walflag=cfg 39 | 40 | # enable daemon 41 | # 0 - disable 42 | # 1 - enable 43 | daemon=0 44 | 45 | # enable server_mode 46 | # 0 - disable 47 | # 1 - enable 48 | server_mode=0 49 | 50 | # debug level 51 | # 1 - minor 52 | # 2 - default 53 | # 3 - major 54 | # 4 - critical 55 | debug_level=2 56 | 57 | # debug mask 58 | # 0x01 - ICM main module 59 | # 0x02 - ICM SCAN module 60 | # 0x04 - ICM_SELELCTOR module 61 | # 0x08 - ICM_UTIL module 62 | # 0x10 - ICM Test module 63 | # 0xFF - Default 64 | debug_module_bitmap=255 65 | 66 | # socket interface type 67 | # 0 - TCP socket 68 | # 1 - UDP socket 69 | sock_type=1 70 | 71 | #### Below this, configuration are per interface starting with id_* #### 72 | 73 | # radio interface name 74 | id_0_radio_ifname=phy0 75 | #id_1_radio_ifname=phy1 76 | #id_2_radio_ifname=wifi2 77 | 78 | # device interface name 79 | id_0_dev_ifname=softap0 80 | #id_1_dev_ifname=p2p0 81 | #id_2_dev_ifname=ath2 82 | 83 | # operating band 84 | # 0 - 2.4 GHz band 85 | # 1 - 5 GHz band 86 | id_0_band=0 87 | id_1_band=1 88 | #id_2_band=1 89 | 90 | # PHY specification 91 | # 0 - 11A 92 | # 1 - 11B 93 | # 2 - 11G 94 | # 3 - FH 95 | # 4 - TURBO_A 96 | # 5 - TURBO_G 97 | # 6 - 11NA 98 | # 7 - 11NG 99 | # 8 - 11AC 100 | id_0_phy_spec=7 101 | id_1_phy_spec=6 102 | #id_2_physpec=8 103 | 104 | # channel width 105 | # 0 - HT20 106 | # 1 - HT40MINUS 107 | # 2 - HT40PLUS 108 | # 3 - HT40 109 | id_0_channel_width=0 110 | id_1_channel_width=2 111 | #id_2_channel_width=0 112 | 113 | # channel 114 | id_0_channel=6 115 | id_1_channel=44 116 | #id_2_channel=36 117 | -------------------------------------------------------------------------------- /light/Light.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, 2017-2018 The Linux Foundation. All rights reserved. 3 | * Not a contribution 4 | * Copyright (C) 2008 The Android Open Source Project 5 | * Copyright (C) 2018 The LineageOS Project 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #define LOG_TAG "LightsService" 21 | 22 | #include "Light.h" 23 | #include 24 | #include 25 | #include 26 | 27 | namespace android { 28 | namespace hardware { 29 | namespace light { 30 | namespace V2_0 { 31 | namespace implementation { 32 | 33 | /* 34 | * Write value to path and close file. 35 | */ 36 | template 37 | static void set(const std::string& path, const T& value) { 38 | std::ofstream file(path); 39 | file << value; 40 | } 41 | 42 | template 43 | static T get(const std::string& path, const T& def) { 44 | std::ifstream file(path); 45 | T result; 46 | 47 | file >> result; 48 | return file.fail() ? def : result; 49 | } 50 | 51 | static int rgbToBrightness(const LightState& state) { 52 | int color = state.color & 0x00ffffff; 53 | return ((77 * ((color >> 16) & 0x00ff)) 54 | + (150 * ((color >> 8) & 0x00ff)) 55 | + (29 * (color & 0x00ff))) >> 8; 56 | } 57 | 58 | Light::Light() { 59 | mLights.emplace(Type::BACKLIGHT, std::bind(&Light::handleBacklight, this, std::placeholders::_1)); 60 | } 61 | 62 | void Light::handleBacklight(const LightState& state) { 63 | int maxBrightness = get("/sys/class/backlight/panel0-backlight/max_brightness", -1); 64 | if (maxBrightness < 0) { 65 | maxBrightness = 1023; 66 | } 67 | int sentBrightness = rgbToBrightness(state); 68 | int brightness = sentBrightness * maxBrightness / 255; 69 | LOG(DEBUG) << "Writing backlight brightness " << brightness 70 | << " (orig " << sentBrightness << ")"; 71 | set("/sys/class/backlight/panel0-backlight/brightness", brightness); 72 | } 73 | 74 | Return Light::setLight(Type type, const LightState& state) { 75 | auto it = mLights.find(type); 76 | 77 | if (it == mLights.end()) { 78 | return Status::LIGHT_NOT_SUPPORTED; 79 | } 80 | 81 | /* 82 | * Lock global mutex until light state is updated. 83 | */ 84 | std::lock_guard lock(mLock); 85 | 86 | it->second(state); 87 | 88 | return Status::SUCCESS; 89 | } 90 | 91 | Return Light::getSupportedTypes(getSupportedTypes_cb _hidl_cb) { 92 | std::vector types; 93 | 94 | for (auto const& light : mLights) { 95 | types.push_back(light.first); 96 | } 97 | 98 | _hidl_cb(types); 99 | 100 | return Void(); 101 | } 102 | 103 | } // namespace implementation 104 | } // namespace V2_0 105 | } // namespace light 106 | } // namespace hardware 107 | } // namespace android 108 | -------------------------------------------------------------------------------- /fingerprint/BiometricsFingerprint.h: -------------------------------------------------------------------------------- 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 | #ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H 18 | #define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace android { 31 | namespace hardware { 32 | namespace biometrics { 33 | namespace fingerprint { 34 | namespace V2_1 { 35 | namespace implementation { 36 | 37 | using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint; 38 | using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback; 39 | using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus; 40 | using ::android::hardware::Return; 41 | using ::android::hardware::Void; 42 | using ::android::hardware::hidl_vec; 43 | using ::android::hardware::hidl_string; 44 | using ::android::OK; 45 | using ::android::sp; 46 | using ::android::status_t; 47 | 48 | class OppoClientCallback; 49 | struct BiometricsFingerprint : public IBiometricsFingerprint { 50 | public: 51 | BiometricsFingerprint(); 52 | 53 | // Methods from ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint follow. 54 | Return setNotify(const sp& clientCallback) override; 55 | Return preEnroll() override; 56 | Return enroll(const hidl_array& hat, uint32_t gid, uint32_t timeoutSec) override; 57 | Return postEnroll() override; 58 | Return getAuthenticatorId() override; 59 | Return cancel() override; 60 | Return enumerate() override; 61 | Return remove(uint32_t gid, uint32_t fid) override; 62 | Return setActiveGroup(uint32_t gid, const hidl_string& storePath) override; 63 | Return authenticate(uint64_t operationId, uint32_t gid) override; 64 | 65 | private: 66 | sp mOppoBiometricsFingerprint; 67 | sp mOppoClientCallback; 68 | static Return OppoToAOSPRequestStatus(vendor::oppo::hardware::biometrics::fingerprint::V2_1::RequestStatus req); 69 | }; 70 | 71 | } // namespace implementation 72 | } // namespace V2_1 73 | } // namespace fingerprint 74 | } // namespace biometrics 75 | } // namespace hardware 76 | } // namespace android 77 | 78 | #endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H 79 | -------------------------------------------------------------------------------- /rootdir/etc/init.recovery.qcom.rc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # * Redistributions of source code must retain the above copyright 6 | # notice, this list of conditions and the following disclaimer. 7 | # * Redistributions in binary form must reproduce the above copyright 8 | # notice, this list of conditions and the following disclaimer in the 9 | # documentation and/or other materials provided with the distribution. 10 | # * Neither the name of The Linux Foundation nor 11 | # the names of its contributors may be used to endorse or promote 12 | # products derived from this software without specific prior written 13 | # permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | on init 29 | write /sys/class/backlight/panel0-backlight/brightness 200 30 | 31 | mkdir /config 32 | mount configfs none /config 33 | mkdir /config/usb_gadget/g1 0770 shell shell 34 | write /config/usb_gadget/g1/bcdUSB 0x0200 35 | write /config/usb_gadget/g1/idVendor 0x18d1 36 | write /config/usb_gadget/g1/idProduct 0xd001 37 | mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell 38 | write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} 39 | write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} 40 | write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} 41 | mkdir /config/usb_gadget/g1/functions/ffs.adb 42 | write /config/usb_gadget/g1/os_desc/use 1 43 | write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 44 | write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" 45 | setprop sys.usb.configfs 1 46 | 47 | on property:ro.boot.usbconfigfs=false 48 | setprop sys.usb.configfs 0 49 | 50 | on property:ro.boot.recover_usb=* 51 | write /sys/bus/platform/devices/a600000.ssusb/mode "peripheral" 52 | 53 | on property:ro.boot.usbcontroller=* 54 | setprop sys.usb.controller ${ro.boot.usbcontroller} 55 | 56 | on property:sys.usb.ffs.ready=1 57 | mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell 58 | symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 59 | mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell 60 | write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb" 61 | symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1 62 | write /config/usb_gadget/g1/UDC ${sys.usb.controller} 63 | 64 | on fs 65 | wait /dev/block/platform/soc/${ro.boot.bootdevice} 66 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice 67 | -------------------------------------------------------------------------------- /RealmeParts/src/org/lineageos/settings/doze/AmdSensor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The CyanogenMod Project 3 | * 2017-2018 The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.lineageos.settings.doze; 19 | 20 | import android.content.Context; 21 | import android.hardware.Sensor; 22 | import android.hardware.SensorEvent; 23 | import android.hardware.SensorEventListener; 24 | import android.hardware.SensorManager; 25 | import android.os.SystemClock; 26 | import android.os.PowerManager; 27 | import android.os.PowerManager.WakeLock; 28 | import android.util.Log; 29 | 30 | import java.util.concurrent.ExecutorService; 31 | import java.util.concurrent.Executors; 32 | import java.util.concurrent.Future; 33 | 34 | public class AmdSensor implements SensorEventListener { 35 | 36 | private static final boolean DEBUG = true; 37 | private static final String TAG = "AmdSensor"; 38 | 39 | private static final String AMD_SENSOR = "qti.sensor.amd"; 40 | 41 | private static final int WAKELOCK_TIMEOUT_MS = 3000; 42 | 43 | private SensorManager mSensorManager; 44 | private Sensor mSensor; 45 | private Context mContext; 46 | private ExecutorService mExecutorService; 47 | private PowerManager mPowerManager; 48 | private WakeLock mWakeLock; 49 | 50 | public AmdSensor(Context context) { 51 | mContext = context; 52 | mSensorManager = mContext.getSystemService(SensorManager.class); 53 | mSensor = DozeUtils.getSensor(mSensorManager, AMD_SENSOR); 54 | mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); 55 | mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG); 56 | mExecutorService = Executors.newSingleThreadExecutor(); 57 | } 58 | 59 | private Future submit(Runnable runnable) { 60 | return mExecutorService.submit(runnable); 61 | } 62 | 63 | @Override 64 | public void onSensorChanged(SensorEvent event) { 65 | boolean isRaiseToWake = DozeUtils.isRaiseToWakeEnabled(mContext); 66 | if (DEBUG) Log.d(TAG, "Got sensor event: " + event.values[0]); 67 | 68 | if (event.values[0] == 2.0f) { 69 | if (isRaiseToWake) { 70 | mWakeLock.acquire(WAKELOCK_TIMEOUT_MS); 71 | mPowerManager.wakeUp(SystemClock.uptimeMillis(), 72 | PowerManager.WAKE_REASON_GESTURE, TAG); 73 | } else { 74 | DozeUtils.launchDozePulse(mContext); 75 | } 76 | } 77 | } 78 | 79 | @Override 80 | public void onAccuracyChanged(Sensor sensor, int accuracy) { 81 | /* Empty */ 82 | } 83 | 84 | protected void enable() { 85 | if (DEBUG) Log.d(TAG, "Enabling"); 86 | submit(() -> { 87 | mSensorManager.registerListener(this, mSensor, 88 | SensorManager.SENSOR_DELAY_NORMAL); 89 | }); 90 | } 91 | 92 | protected void disable() { 93 | if (DEBUG) Log.d(TAG, "Disabling"); 94 | submit(() -> { 95 | mSensorManager.unregisterListener(this, mSensor); 96 | }); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /RealmeParts/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 28 | 29 | 30 | 31 | 36 | 37 | 40 | 41 | 47 | 48 | 53 | 54 | 57 | 58 | 59 | 60 | 64 | 65 | 72 | 73 | -------------------------------------------------------------------------------- /RealmeParts/res/layout/preference_material_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 29 | 30 | 40 | 46 | 47 | 48 | 54 | 55 | 63 | 64 | 74 | 75 | 76 | 77 | 78 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /gps/xtwifi.conf: -------------------------------------------------------------------------------- 1 | #GTP AP Project client core config file 2 | # 3 | #GENERAL DESCRIPTION 4 | #This is used by client core 5 | # 6 | #Copyright (c) 2012-2014 Qualcomm Atheros, Inc. 7 | #All Rights Reserved. 8 | #Qualcomm Atheros Confidential and Proprietary. 9 | # 10 | #Copyright (c) 2017 Qualcomm Technologies, Inc. 11 | #All Rights Reserved. 12 | #Confidential and Proprietary - Qualcomm Technologies, Inc. 13 | 14 | ############################################################################## 15 | # non-IOT devices configuration items # 16 | # For non-IOT devices, configure below configuration items # 17 | # according to the app note: 80-NK218-1 and remove the configuration items # 18 | # in section of "IOT devices configuration items". # 19 | ############################################################################## 20 | 21 | # ASN URI v2 to be used by some GTP AP modules that 22 | # need to run with ASN URI v2 protocol. 23 | XT_SERVER_ROOT_URL = https://gtp1.izatcloud.net:443/uds/v2 24 | 25 | # ASN URI v3 to be used by GTP AP modules that 26 | # can support ASN URI v3 protocol. 27 | XT_SERVER_ROOT_URL_V3 = https://gtp1.izatcloud.net:443/uds/v3 28 | 29 | # size, in bytes, of the cache on device 30 | SIZE_BYTE_TOTAL_CACHE = 5000000 31 | 32 | ############################################################################## 33 | # IOT devices configuration items # 34 | # For IOT devices, configure below configuration items # 35 | # according to the app note and remove the configuration items in section of # 36 | # "non-IOT devices configuration items". # 37 | ############################################################################## 38 | 39 | # ASN URI v3 to be used by GTP AP modules that 40 | # can support ASN URI v3 protocol. 41 | # XT_SERVER_ROOT_URL_V3 = https://gtpma1.izatcloud.net:443/uds/v3 42 | 43 | # 3: Wi-Fi APDB injection via Izat SDK. GTP server is not accessed 44 | # for any GTP requests, instead notification is sent to Izat SDK. 45 | # WiFi crowdsourcing module is disabled. 46 | # 4: Wi-Fi APDB injection via Izat SDK. GTP server is not accessed 47 | # for any GTP requests, instead notification is sent to Izat SDK. 48 | # WiFi crowdsourcing module is active, also accessed via Izat SDK. 49 | # GTP_AP_MODE = 4 50 | 51 | # 1: MP cell features relies on GTP AP for either download or upload 52 | # 0: MP cell features does not rely on GTP AP 53 | # GTP_AP_NEEDED_BY_MP_CELL = 1 54 | 55 | ############################################################################## 56 | # Configuration items applicable to all devices # 57 | ############################################################################## 58 | 59 | # Log verbosity control for most of the GTP WiFi system, including native and 60 | # Java componenets 61 | # OFF = 0, ERROR = 1, WARNING = 2, INFO = 3, DEBUG = 4, VERBOSE = 5, ALL = 100 62 | DEBUG_GLOBAL_LOG_LEVEL = 2 63 | 64 | # this is used at the server side to distinguish uploads from different maker/model 65 | # default "Qualcomm" 66 | OEM_ID_IN_REQUEST_TO_SERVER = "Qualcomm" 67 | 68 | # this is used at the server side to distinguish uploads from different maker/model 69 | # default "UNKNOWN" 70 | MODEL_ID_IN_REQUEST_TO_SERVER = "UNKNOWN" 71 | 72 | ############################################################################## 73 | # Qualcomm Network Location Provider config # 74 | ############################################################################## 75 | 76 | # Accuracy Threshold for NLP position. Position exceeds thsi threshold will be filtered out. 77 | # Default is 25000 meters. 78 | LARGE_ACCURACY_THRESHOLD_TO_FILTER_NLP_POSITION = 25000 79 | -------------------------------------------------------------------------------- /RealmeParts/src/org/lineageos/settings/doze/DozeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The CyanogenMod Project 3 | * 2017-2018 The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.lineageos.settings.doze; 19 | 20 | import android.app.Service; 21 | import android.content.BroadcastReceiver; 22 | import android.content.Context; 23 | import android.content.Intent; 24 | import android.content.IntentFilter; 25 | import android.os.IBinder; 26 | import android.util.Log; 27 | 28 | public class DozeService extends Service { 29 | private static final String TAG = "DozeService"; 30 | private static final boolean DEBUG = false; 31 | 32 | private ProximitySensor mProximitySensor; 33 | private AmdSensor mAmdSensor; 34 | 35 | @Override 36 | public void onCreate() { 37 | if (DEBUG) Log.d(TAG, "Creating service"); 38 | mProximitySensor = new ProximitySensor(this); 39 | mAmdSensor = new AmdSensor(this); 40 | 41 | IntentFilter screenStateFilter = new IntentFilter(); 42 | screenStateFilter.addAction(Intent.ACTION_SCREEN_ON); 43 | screenStateFilter.addAction(Intent.ACTION_SCREEN_OFF); 44 | registerReceiver(mScreenStateReceiver, screenStateFilter); 45 | } 46 | 47 | @Override 48 | public int onStartCommand(Intent intent, int flags, int startId) { 49 | if (DEBUG) Log.d(TAG, "Starting service"); 50 | return START_STICKY; 51 | } 52 | 53 | @Override 54 | public void onDestroy() { 55 | if (DEBUG) Log.d(TAG, "Destroying service"); 56 | super.onDestroy(); 57 | this.unregisterReceiver(mScreenStateReceiver); 58 | mProximitySensor.disable(); 59 | mAmdSensor.disable(); 60 | } 61 | 62 | @Override 63 | public IBinder onBind(Intent intent) { 64 | return null; 65 | } 66 | 67 | private void onDisplayOn() { 68 | if (DEBUG) Log.d(TAG, "Display on"); 69 | if (DozeUtils.isPickUpEnabled(this) || 70 | DozeUtils.isRaiseToWakeEnabled(this)) { 71 | mAmdSensor.disable(); 72 | } 73 | if (DozeUtils.isHandwaveGestureEnabled(this) || 74 | DozeUtils.isPocketGestureEnabled(this)) { 75 | mProximitySensor.disable(); 76 | } 77 | } 78 | 79 | private void onDisplayOff() { 80 | if (DEBUG) Log.d(TAG, "Display off"); 81 | if (DozeUtils.isPickUpEnabled(this) || 82 | DozeUtils.isRaiseToWakeEnabled(this)) { 83 | mAmdSensor.enable(); 84 | } 85 | if (DozeUtils.isHandwaveGestureEnabled(this) || 86 | DozeUtils.isPocketGestureEnabled(this)) { 87 | mProximitySensor.enable(); 88 | } 89 | } 90 | 91 | private BroadcastReceiver mScreenStateReceiver = new BroadcastReceiver() { 92 | @Override 93 | public void onReceive(Context context, Intent intent) { 94 | if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) { 95 | onDisplayOn(); 96 | } else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { 97 | onDisplayOff(); 98 | } 99 | } 100 | }; 101 | } 102 | -------------------------------------------------------------------------------- /compatibility_matrix.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.frameworks.schedulerservice 31 | 1.0 32 | 33 | ISchedulingPolicyService 34 | default 35 | 36 | 37 | 38 | android.frameworks.sensorservice 39 | 1.0 40 | 41 | ISensorManager 42 | default 43 | 44 | 45 | 46 | android.hidl.allocator 47 | 1.0 48 | 49 | IAllocator 50 | ashmem 51 | 52 | 53 | 54 | android.hidl.manager 55 | 1.0 56 | 57 | IServiceManager 58 | default 59 | 60 | 61 | 62 | android.hidl.memory 63 | 1.0 64 | 65 | IMapper 66 | ashmem 67 | 68 | 69 | 70 | android.hidl.token 71 | 1.0 72 | 73 | ITokenManager 74 | default 75 | 76 | 77 | 78 | android.system.wifi.keystore 79 | 1.0 80 | 81 | IKeystore 82 | default 83 | 84 | 85 | 86 | vendor.qti.hardware.sigma_miracast 87 | hwbinder 88 | 1.0 89 | 90 | Isigma_miracast 91 | sigmahal 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /rootdir/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE := fstab.qcom 5 | LOCAL_MODULE_TAGS := optional 6 | LOCAL_MODULE_CLASS := ETC 7 | LOCAL_SRC_FILES := etc/fstab.qcom 8 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC) 9 | include $(BUILD_PREBUILT) 10 | 11 | include $(CLEAR_VARS) 12 | LOCAL_MODULE := init.class_main.sh 13 | LOCAL_MODULE_TAGS := optional 14 | LOCAL_MODULE_CLASS := ETC 15 | LOCAL_SRC_FILES := etc/init.class_main.sh 16 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/bin 17 | include $(BUILD_PREBUILT) 18 | 19 | include $(CLEAR_VARS) 20 | LOCAL_MODULE := init.oppo.reserve.rc 21 | LOCAL_MODULE_TAGS := optional 22 | LOCAL_MODULE_CLASS := ETC 23 | LOCAL_SRC_FILES := etc/init.oppo.reserve.rc 24 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 25 | include $(BUILD_PREBUILT) 26 | 27 | include $(CLEAR_VARS) 28 | LOCAL_MODULE := init.msm.usb.configfs.rc 29 | LOCAL_MODULE_TAGS := optional 30 | LOCAL_MODULE_CLASS := ETC 31 | LOCAL_SRC_FILES := etc/init.msm.usb.configfs.rc 32 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 33 | include $(BUILD_PREBUILT) 34 | 35 | include $(CLEAR_VARS) 36 | LOCAL_MODULE := init.oppo.fingerprints.sh 37 | LOCAL_MODULE_TAGS := optional 38 | LOCAL_MODULE_CLASS := ETC 39 | LOCAL_SRC_FILES := etc/init.oppo.fingerprints.sh 40 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/bin 41 | include $(BUILD_PREBUILT) 42 | 43 | include $(CLEAR_VARS) 44 | LOCAL_MODULE := init.qcom.early_boot.sh 45 | LOCAL_MODULE_TAGS := optional 46 | LOCAL_MODULE_CLASS := ETC 47 | LOCAL_SRC_FILES := etc/init.qcom.early_boot.sh 48 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 49 | include $(BUILD_PREBUILT) 50 | 51 | include $(CLEAR_VARS) 52 | LOCAL_MODULE := init.qcom.post_boot.sh 53 | LOCAL_MODULE_TAGS := optional 54 | LOCAL_MODULE_CLASS := ETC 55 | LOCAL_SRC_FILES := etc/init.qcom.post_boot.sh 56 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 57 | include $(BUILD_PREBUILT) 58 | 59 | include $(CLEAR_VARS) 60 | LOCAL_MODULE := init.qcom.rc 61 | LOCAL_MODULE_TAGS := optional 62 | LOCAL_MODULE_CLASS := ETC 63 | LOCAL_SRC_FILES := etc/init.qcom.rc 64 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 65 | include $(BUILD_PREBUILT) 66 | 67 | include $(CLEAR_VARS) 68 | LOCAL_MODULE := init.qcom.sensors.sh 69 | LOCAL_MODULE_TAGS := optional 70 | LOCAL_MODULE_CLASS := ETC 71 | LOCAL_SRC_FILES := etc/init.qcom.sensors.sh 72 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 73 | include $(BUILD_PREBUILT) 74 | 75 | include $(CLEAR_VARS) 76 | LOCAL_MODULE := init.qcom.sh 77 | LOCAL_MODULE_TAGS := optional 78 | LOCAL_MODULE_CLASS := ETC 79 | LOCAL_SRC_FILES := etc/init.qcom.sh 80 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 81 | include $(BUILD_PREBUILT) 82 | 83 | include $(CLEAR_VARS) 84 | LOCAL_MODULE := init.qcom.usb.rc 85 | LOCAL_MODULE_TAGS := optional 86 | LOCAL_MODULE_CLASS := ETC 87 | LOCAL_SRC_FILES := etc/init.qcom.usb.rc 88 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 89 | include $(BUILD_PREBUILT) 90 | 91 | include $(CLEAR_VARS) 92 | LOCAL_MODULE := init.qcom.usb.sh 93 | LOCAL_MODULE_TAGS := optional 94 | LOCAL_MODULE_CLASS := ETC 95 | LOCAL_SRC_FILES := etc/init.qcom.usb.sh 96 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) 97 | include $(BUILD_PREBUILT) 98 | 99 | include $(CLEAR_VARS) 100 | LOCAL_MODULE := init.target.rc 101 | LOCAL_MODULE_TAGS := optional 102 | LOCAL_MODULE_CLASS := ETC 103 | LOCAL_SRC_FILES := etc/init.target.rc 104 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw 105 | include $(BUILD_PREBUILT) 106 | 107 | include $(CLEAR_VARS) 108 | LOCAL_MODULE := ueventd.qcom.rc 109 | LOCAL_MODULE_STEM := ueventd.rc 110 | LOCAL_MODULE_TAGS := optional 111 | LOCAL_MODULE_CLASS := ETC 112 | LOCAL_SRC_FILES := etc/ueventd.qcom.rc 113 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR) 114 | include $(BUILD_PREBUILT) 115 | -------------------------------------------------------------------------------- /RealmeParts/src/org/lineageos/settings/doze/ProximitySensor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The CyanogenMod Project 3 | * 2017-2018 The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.lineageos.settings.doze; 19 | 20 | import android.content.Context; 21 | import android.hardware.Sensor; 22 | import android.hardware.SensorEvent; 23 | import android.hardware.SensorEventListener; 24 | import android.hardware.SensorManager; 25 | import android.util.Log; 26 | 27 | import java.util.concurrent.ExecutorService; 28 | import java.util.concurrent.Executors; 29 | import java.util.concurrent.Future; 30 | 31 | public class ProximitySensor implements SensorEventListener { 32 | 33 | private static final boolean DEBUG = false; 34 | private static final String TAG = "ProximitySensor"; 35 | 36 | // Maximum time for the hand to cover the sensor: 1s 37 | private static final int HANDWAVE_MAX_DELTA_NS = 1000 * 1000 * 1000; 38 | 39 | // Minimum time until the device is considered to have been in the pocket: 2s 40 | private static final int POCKET_MIN_DELTA_NS = 2000 * 1000 * 1000; 41 | 42 | private SensorManager mSensorManager; 43 | private Sensor mSensor; 44 | private Context mContext; 45 | private ExecutorService mExecutorService; 46 | 47 | private boolean mSawNear = false; 48 | private long mInPocketTime = 0; 49 | 50 | public ProximitySensor(Context context) { 51 | mContext = context; 52 | mSensorManager = mContext.getSystemService(SensorManager.class); 53 | mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY, false); 54 | mExecutorService = Executors.newSingleThreadExecutor(); 55 | } 56 | 57 | private Future submit(Runnable runnable) { 58 | return mExecutorService.submit(runnable); 59 | } 60 | 61 | @Override 62 | public void onSensorChanged(SensorEvent event) { 63 | boolean isNear = event.values[0] < mSensor.getMaximumRange(); 64 | if (mSawNear && !isNear) { 65 | if (shouldPulse(event.timestamp)) { 66 | DozeUtils.launchDozePulse(mContext); 67 | } 68 | } else { 69 | mInPocketTime = event.timestamp; 70 | } 71 | mSawNear = isNear; 72 | } 73 | 74 | private boolean shouldPulse(long timestamp) { 75 | long delta = timestamp - mInPocketTime; 76 | 77 | if (DozeUtils.isHandwaveGestureEnabled(mContext) && 78 | DozeUtils.isPocketGestureEnabled(mContext)) { 79 | return true; 80 | } else if (DozeUtils.isHandwaveGestureEnabled(mContext)) { 81 | return delta < HANDWAVE_MAX_DELTA_NS; 82 | } else if (DozeUtils.isPocketGestureEnabled(mContext)) { 83 | return delta >= POCKET_MIN_DELTA_NS; 84 | } 85 | return false; 86 | } 87 | 88 | @Override 89 | public void onAccuracyChanged(Sensor sensor, int accuracy) { 90 | /* Empty */ 91 | } 92 | 93 | protected void enable() { 94 | if (DEBUG) Log.d(TAG, "Enabling"); 95 | submit(() -> { 96 | mSensorManager.registerListener(this, mSensor, 97 | SensorManager.SENSOR_DELAY_NORMAL); 98 | }); 99 | } 100 | 101 | protected void disable() { 102 | if (DEBUG) Log.d(TAG, "Disabling"); 103 | submit(() -> { 104 | mSensorManager.unregisterListener(this, mSensor); 105 | }); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /system.prop: -------------------------------------------------------------------------------- 1 | # Audio 2 | audio.deep_buffer.media=true 3 | audio.offload.min.duration.secs=30 4 | audio.offload.video=true 5 | ro.af.client_heap_size_kbyte=7168 6 | audio.sys.noisy.broadcast.delay=600 7 | audio.sys.offload.pstimeout.secs=3 8 | 9 | # Bluetooth 10 | ro.bluetooth.wipower=false 11 | ro.bluetooth.emb_wp_mode=false 12 | persist.vendor.bt.a2dp_offload_cap=sbc-aptx-aptxhd-aac-ldac 13 | vendor.bluetooth.soc=cherokee 14 | 15 | # Camera 16 | ro.camera.hfr.enable=1 17 | ro.camera.relight.enable=0 18 | ro.camera.attr.detect.enable=1 19 | ro.camera.notify_nfc=1 20 | ro.camera.temperature.limit=470 21 | camera.disable_zsl_mode=true 22 | vendor.camera.aux.packagelist=org.codeaurora.snapcam,com.android.camera,org.lineageos.snap 23 | 24 | # CNE 25 | persist.vendor.cne.feature=1 26 | 27 | # Data modules 28 | persist.data.df.dev_name=rmnet_usb0 29 | persist.vendor.data.mode=concurrent 30 | ro.vendor.use_data_netmgrd=true 31 | persist.data.df.agg.dl_pkt=10 32 | persist.data.df.agg.dl_size=4096 33 | persist.data.df.dl_mode=5 34 | persist.data.df.iwlan_mux=9 35 | persist.data.df.mux_count=8 36 | persist.data.df.ul_mode=5 37 | persist.data.netmgrd.qos.enable=true 38 | persist.data.profile_update=true 39 | persist.data.wda.enable=true 40 | persist.rmnet.data.enable=true 41 | 42 | # Display - oppo 43 | persist.sys.enable.rc=1 44 | ro.display.rc.size=108,108,111,111 45 | ro.lcd.backlight.samsung_tenbit=10,517,103,303,355,457,563,676,805,883,1023 46 | ro.lcd.backlight.config_dsjm=11,958,13,334,517,794,1055,1325,1617,1770,1989,2047 47 | ro.vendor.display.backlightapp=1 48 | ro.display.underscreenfingerprint=1 49 | ro.display.underscreen.lightsensor.support=1 50 | ro.lcd.display.screen.underlightsensor.region=624,28,672,76 51 | ro.display.underscreen.lightsensor.screenshot.period=50 52 | persist.debug.wfd.enable=1 53 | ro.oppo.screen.heteromorphism=444,0:636,76 54 | 55 | # Display post-processing 56 | ro.qualcomm.cabl=0 57 | ro.vendor.display.ad=1 58 | ro.vendor.display.ad.sdr_calib_data=/vendor/etc/OPPO_OLED_AD_calib.cfg 59 | ro.vendor.display.sensortype=2 60 | 61 | # DPM 62 | persist.vendor.dpm.feature=1 63 | persist.vendor.dpm.loglevel=0 64 | persist.vendor.dpm.nsrm.bkg.evt=3955 65 | 66 | # Graphics 67 | debug.sf.disable_backpressure=1 68 | debug.sf.latch_unsignaled=1 69 | debug.sf.enable_hwc_vds=1 70 | persist.demo.hdmirotationlock=false 71 | persist.sys.sf.color_saturation=1.0 72 | persist.sys.sf.native_mode=0 73 | 74 | # IMS 75 | persist.vendor.ims.disableUserAgent=0 76 | persist.data.iwlan.enable=true 77 | persist.dbg.ims_volte_enable=1 78 | 79 | # Media 80 | media.settings.xml=/vendor/etc/media_profiles_vendor.xml 81 | 82 | # Memory optimizations 83 | ro.vendor.qti.sys.fw.bservice_enable=true 84 | 85 | # Netflix custom property 86 | ro.netflix.bsp_rev=Q670-14477-1 87 | 88 | # QC framework value-adds 89 | ro.vendor.qti.va_aosp.support=1 90 | 91 | # NFC 92 | ro.hardware.nfc_nci=nqx.default 93 | ro.nfc.port=I2C 94 | 95 | # RCS 96 | persist.rcs.supported=1 97 | 98 | # RIL 99 | DEVICE_PROVISIONED=1 100 | persist.radio.multisim.config=dsds 101 | persist.sys.fflag.override.settings_network_and_internet_v2=true 102 | persist.vendor.radio.apm_sim_not_pwdn=1 103 | persist.vendor.radio.custom_ecc=1 104 | persist.vendor.radio.flexmap_type=none 105 | persist.vendor.radio.force_on_dc=true 106 | persist.vendor.radio.procedure_bytes=SKIP 107 | persist.vendor.radio.rat_on=combine 108 | persist.vendor.radio.redir_party_num=1 109 | persist.vendor.radio.report_codec=1 110 | persist.vendor.radio.sib16_support=1 111 | persist.radio.atfwd.start=true 112 | persist.vendor.radio.lte_vrte_ltd=1 113 | persist.vendor.radio.cs_srv_type=1 114 | persist.radio.VT_ENABLE=1 115 | persist.radio.volte.dan_support=true 116 | persist.data.iwlan=1 117 | persist.data.iwlan.ipsec.ap=1 118 | persist.sys.cust.lte_config=true 119 | service.qti.ims.enabled=1 120 | persist.vendor.qti.telephony.vt_cam_interface=2 121 | ro.telephony.iwlan_operation_mode=legacy 122 | ril.subscription.types=NV,RUIM 123 | rild.libpath=/vendor/lib64/libril-qc-hal-qmi.so 124 | ro.com.android.dataroaming=true 125 | ro.telephony.default_network=22,22 126 | telephony.lteOnCdmaDevice=1 127 | 128 | # Sensors 129 | persist.sys.oppo.fusionlight=true 130 | persist.sys.oppo.proximity=true 131 | 132 | # Thermal 133 | persist.sys.enable.oscar=0 134 | persist.sys.oscar.dc=1 135 | -------------------------------------------------------------------------------- /rootdir/etc/init.oppo.reserve.rc: -------------------------------------------------------------------------------- 1 | ################################################################################## 2 | ### VENDOR_EDIT, OPPO All rights reserved. 3 | ### 4 | ### File: - init.oppo.reserve.rc 5 | ### 6 | ### ------------------------------- Revision History: ---------------------------- 7 | ### 8 | ### ------------------------------------------------------------------------------ 9 | ### Runsheng.Pei@PSW.AD.Storage.ReservePartition.1207580, 2017/12/29, Add for new reserve partition 10 | ### Xuefeng.Peng@PSW.AD.Storage.ReservePartition.1207580, 2018/11/19, Add for change opporeserve mount point for google GSI test 11 | ################################################################################## 12 | on post-fs-data 13 | chown system system /mnt/vendor/opporeserve 14 | chmod 0771 /mnt/vendor/opporeserve 15 | mkdir /mnt/vendor/opporeserve/radio 16 | chown radio system /mnt/vendor/opporeserve/radio 17 | chmod 0771 /mnt/vendor/opporeserve/radio 18 | mkdir /mnt/vendor/opporeserve/system 19 | chown system system /mnt/vendor/opporeserve/system 20 | chmod 0771 /mnt/vendor/opporeserve/system 21 | mkdir /mnt/vendor/opporeserve/system/config 22 | chown system system /mnt/vendor/opporeserve/system/config 23 | chmod 0771 /mnt/vendor/opporeserve/system/config 24 | mkdir /mnt/vendor/opporeserve/media 25 | chown system system /mnt/vendor/opporeserve/media 26 | chmod 0771 /mnt/vendor/opporeserve/media 27 | # mount sdcardfs /dev/block/bootdevice/by-name/mnt/vendor/opporeserve2 /mnt/vendor/opporeserve/media reserved_mb=24 28 | mkdir /mnt/vendor/opporeserve/media/dropbox 29 | chown system system /mnt/vendor/opporeserve/media/dropbox 30 | chmod 0771 /mnt/vendor/opporeserve/media/dropbox 31 | mkdir /mnt/vendor/opporeserve/media/log 32 | chown system system /mnt/vendor/opporeserve/media/log 33 | chmod 0771 /mnt/vendor/opporeserve/media/log 34 | mkdir /mnt/vendor/opporeserve/media/log/usage 35 | chown system system /mnt/vendor/opporeserve/media/log/usage 36 | chmod 0771 /mnt/vendor/opporeserve/media/log/usage 37 | mkdir /mnt/vendor/opporeserve/media/log/usage/cache 38 | chown system system /mnt/vendor/opporeserve/media/log/usage/cache 39 | chmod 0771 /mnt/vendor/opporeserve/media/log/usage/cache 40 | mkdir /mnt/vendor/opporeserve/media/log/usage/persist 41 | chown system system /mnt/vendor/opporeserve/media/log/usage/persist 42 | chmod 0771 /mnt/vendor/opporeserve/media/log/usage/persist 43 | mkdir /mnt/vendor/opporeserve/media/log/criticalLog 44 | chown system system /mnt/vendor/opporeserve/media/log/criticalLog 45 | chmod 0771 /mnt/vendor/opporeserve/media/log/criticalLog 46 | mkdir /mnt/vendor/opporeserve/media/log/criticalLog/persist 47 | chown system system /mnt/vendor/opporeserve/media/log/criticalLog/persist 48 | chmod 0771 /mnt/vendor/opporeserve/media/log/criticalLog/persist 49 | mkdir /mnt/vendor/opporeserve/media/log/criticalLog/cache 50 | chown system system /mnt/vendor/opporeserve/media/log/criticalLog/cache 51 | chmod 0771 /mnt/vendor/opporeserve/media/log/criticalLog/cache 52 | mkdir /mnt/vendor/opporeserve/media/engineermode 53 | chown system system /mnt/vendor/opporeserve/media/engineermode 54 | chmod 0771 /mnt/vendor/opporeserve/media/engineermode 55 | mkdir /mnt/vendor/opporeserve/media/ColorOS 56 | chown system system /mnt/vendor/opporeserve/media/ColorOS 57 | chmod 0771 /mnt/vendor/opporeserve/media/ColorOS 58 | mkdir /mnt/vendor/opporeserve/media/Camera 59 | chown system system /mnt/vendor/opporeserve/media/Camera 60 | chmod 0771 /mnt/vendor/opporeserve/media/Camera 61 | 62 | mkdir /mnt/vendor/opporeserve/media/ColorOS/HeytapID 63 | chown system system /mnt/vendor/opporeserve/media/ColorOS/HeytapID 64 | chmod 0771 /mnt/vendor/opporeserve/media/ColorOS/HeytapID 65 | 66 | restorecon_recursive /mnt/vendor/opporeserve 67 | 68 | ##ifdef VENDOR_EDIT 69 | #wenjie.Liu@CN.NFC.Basic.Felica.1334855,add for: Felica Nvram store in opporeserve 70 | mkdir /mnt/vendor/opporeserve/media/nfclock 0771 71 | chown system system /mnt/vendor/opporeserve/media/nfclock 72 | mkdir /mnt/vendor/opporeserve/connectivity 0771 73 | chown nfc system /mnt/vendor/opporeserve/connectivity 74 | mkdir /mnt/vendor/opporeserve/connectivity/felicalock 0771 75 | chown nfc system /mnt/vendor/opporeserve/connectivity/felicalock 76 | ##endif VENDOR_EDIT 77 | -------------------------------------------------------------------------------- /RealmeParts/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | On 24 | 25 | 26 | Off 27 | 28 | 29 | Advanced settings 30 | 31 | 32 | Ambient display 33 | Ambient display 34 | Wake screen when you receive notifications 35 | Ambient display gestures 36 | Additional gestures to wake the screen 37 | Wake screen when you receive notifications 38 | Screen will wake when you receive notifications 39 | Screen will not wake when you receive notifications 40 | Always on 41 | Show time, notification icons, and other info. Increased battery usage. 42 | 43 | 44 | Tilt sensor 45 | 46 | 47 | Pickup sensor 48 | 49 | 50 | Proximity sensor 51 | 52 | 53 | Hand wave 54 | Pulse notifications on hand wave 55 | Detect orientation 56 | Pulse only if the phone is lying face up on a flat surface 57 | 58 | 59 | Pick-up 60 | Pulse notifications on pick-up 61 | 62 | 63 | Pocket 64 | Pulse notifications on removal from pocket 65 | 66 | 67 | Raise to wake 68 | Wake up the device instead of pulsing notification 69 | 70 | 71 | Proximity wake 72 | Proximity wake 73 | Wake device on hand wave 74 | 75 | 76 | OK 77 | 78 | 79 | Help 80 | These features use sensor events to launch a doze notification pulse. The chosen sensor is only enabled when the device receives a notification, this helps to reduce battery usage. There is also an option to enable the chosen sensor as soon as the screen turns off, this will cause higher battery usage. 81 | 82 | 83 | -------------------------------------------------------------------------------- /config.fs: -------------------------------------------------------------------------------- 1 | [AID_VENDOR_QTI_DIAG] 2 | value:2901 3 | 4 | [AID_VENDOR_QDSS] 5 | value:2902 6 | 7 | [AID_VENDOR_RFS] 8 | value:2903 9 | 10 | [AID_VENDOR_RFS_SHARED] 11 | value:2904 12 | 13 | [AID_VENDOR_ADPL_ODL] 14 | value:2905 15 | 16 | [AID_VENDOR_QRTR] 17 | value:2906 18 | 19 | [AID_VENDOR_THERMAL] 20 | value:2907 21 | 22 | [vendor/bin/wcnss_filter] 23 | mode: 0755 24 | user: AID_BLUETOOTH 25 | group: AID_BLUETOOTH 26 | caps: BLOCK_SUSPEND 27 | 28 | [system/vendor/bin/wcnss_filter] 29 | mode: 0755 30 | user: AID_BLUETOOTH 31 | group: AID_BLUETOOTH 32 | caps: BLOCK_SUSPEND 33 | 34 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti] 35 | mode: 0755 36 | user: AID_BLUETOOTH 37 | group: AID_BLUETOOTH 38 | caps: BLOCK_SUSPEND NET_ADMIN 39 | 40 | [system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti] 41 | mode: 0755 42 | user: AID_SYSTEM 43 | group: AID_SYSTEM 44 | caps: BLOCK_SUSPEND NET_ADMIN 45 | 46 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy] 47 | mode: 0755 48 | user: AID_BLUETOOTH 49 | group: AID_BLUETOOTH 50 | caps: BLOCK_SUSPEND NET_ADMIN 51 | 52 | [system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy] 53 | mode: 0755 54 | user: AID_SYSTEM 55 | group: AID_SYSTEM 56 | caps: BLOCK_SUSPEND NET_ADMIN 57 | 58 | [system/bin/cnss-daemon] 59 | mode: 0755 60 | user: AID_BLUETOOTH 61 | group: AID_BLUETOOTH 62 | caps: NET_BIND_SERVICE 63 | 64 | [vendor/bin/pm-service] 65 | mode: 0755 66 | user: AID_SYSTEM 67 | group: AID_SYSTEM 68 | caps: NET_BIND_SERVICE SYS_BOOT 69 | 70 | [system/vendor/bin/pm-service] 71 | mode: 0755 72 | user: AID_SYSTEM 73 | group: AID_SYSTEM 74 | caps: NET_BIND_SERVICE SYS_BOOT 75 | 76 | [system/bin/pm-service] 77 | mode: 0755 78 | user: AID_SYSTEM 79 | group: AID_SYSTEM 80 | caps: NET_BIND_SERVICE SYS_BOOT 81 | 82 | [vendor/bin/pd-mapper] 83 | mode: 0755 84 | user: AID_SYSTEM 85 | group: AID_SYSTEM 86 | caps: NET_BIND_SERVICE 87 | 88 | [system/vendor/bin/pd-mapper] 89 | mode: 0755 90 | user: AID_SYSTEM 91 | group: AID_SYSTEM 92 | caps: NET_BIND_SERVICE 93 | 94 | [system/bin/pd-mapper] 95 | mode: 0755 96 | user: AID_SYSTEM 97 | group: AID_SYSTEM 98 | caps: NET_BIND_SERVICE 99 | 100 | [vendor/bin/imsdatadaemon] 101 | mode: 0755 102 | user: AID_RADIO 103 | group: AID_RADIO 104 | caps: NET_BIND_SERVICE 105 | 106 | [system/vendor/bin/imsdatadaemon] 107 | mode: 0755 108 | user: AID_RADIO 109 | group: AID_RADIO 110 | caps: NET_BIND_SERVICE 111 | 112 | [vendor/bin/ims_rtp_daemon] 113 | mode: 0755 114 | user: AID_RADIO 115 | group: AID_RADIO 116 | caps: NET_BIND_SERVICE 117 | 118 | [system/vendor/bin/ims_rtp_daemon] 119 | mode: 0755 120 | user: AID_RADIO 121 | group: AID_RADIO 122 | caps: NET_BIND_SERVICE 123 | 124 | [vendor/bin/imsrcsd] 125 | mode: 0755 126 | user: AID_RADIO 127 | group: AID_RADIO 128 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 129 | 130 | [system/vendor/bin/imsrcsd] 131 | mode: 0755 132 | user: AID_RADIO 133 | group: AID_RADIO 134 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 135 | 136 | [vendor/bin/cnd] 137 | mode: 0755 138 | user: AID_SYSTEM 139 | group: AID_SYSTEM 140 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN 141 | 142 | [system/vendor/bin/cnd] 143 | mode: 0755 144 | user: AID_SYSTEM 145 | group: AID_SYSTEM 146 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN 147 | 148 | [vendor/bin/slim_daemon] 149 | mode: 0755 150 | user: AID_GPS 151 | group: AID_GPS 152 | caps: NET_BIND_SERVICE 153 | 154 | [system/vendor/bin/slim_daemon] 155 | mode: 0755 156 | user: AID_GPS 157 | group: AID_GPS 158 | caps: NET_BIND_SERVICE 159 | 160 | [vendor/bin/loc_launcher] 161 | mode: 0755 162 | user: AID_GPS 163 | group: AID_GPS 164 | caps: SETUID SETGID 165 | 166 | [system/vendor/bin/loc_launcher] 167 | mode: 0755 168 | user: AID_GPS 169 | group: AID_GPS 170 | caps: SETUID SETGID 171 | 172 | [vendor/bin/xtwifi-client] 173 | mode: 0755 174 | user: AID_GPS 175 | group: AID_GPS 176 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 177 | 178 | [vendor/bin/sensors.qti] 179 | mode: 0755 180 | user: AID_SYSTEM 181 | group: AID_SYSTEM 182 | caps: NET_BIND_SERVICE 183 | 184 | [firmware/] 185 | mode: 0771 186 | user: AID_SYSTEM 187 | group: AID_SYSTEM 188 | caps: 0 189 | 190 | [firmware/image/*] 191 | mode: 0771 192 | user: AID_SYSTEM 193 | group: AID_SYSTEM 194 | caps: 0 195 | 196 | [vendor/firmware_mnt/image/*] 197 | mode: 0771 198 | user: AID_SYSTEM 199 | group: AID_SYSTEM 200 | caps: 0 201 | 202 | [bt_firmware/] 203 | mode: 0771 204 | user: AID_SYSTEM 205 | group: AID_SYSTEM 206 | caps: 0 207 | 208 | [persist/] 209 | mode: 0771 210 | user: AID_SYSTEM 211 | group: AID_SYSTEM 212 | caps: 0 213 | 214 | [dsp/] 215 | mode: 0771 216 | user: AID_MEDIA 217 | group: AID_MEDIA 218 | caps: 0 219 | -------------------------------------------------------------------------------- /fod/FingerprintInscreen.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #define LOG_TAG "FingerprintInscreenService" 18 | 19 | #include "FingerprintInscreen.h" 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | /* Hardcoded stuffs */ 27 | #define FP_PRESS_PATH "/sys/kernel/oppo_display/notify_fppress" 28 | #define DIMLAYER_PATH "/sys/kernel/oppo_display/dimlayer_hbm" 29 | #define X_POS 445 30 | #define Y_POS 1967 31 | #define NOTIFY_BLANK_PATH "/sys/kernel/oppo_display/notify_panel_blank" 32 | #define AOD_MODE_PATH "/sys/kernel/oppo_display/aod_light_mode_set" 33 | #define DOZE_STATUS "/proc/touchpanel/DOZE_STATUS" 34 | #define FP_SIZE 196 35 | #define FP_BEGIN 1 36 | #define FP_ENDIT 0 37 | 38 | namespace { 39 | 40 | template 41 | static inline void set(const std::string& path, const T& value) { 42 | std::ofstream file(path); 43 | file << value; 44 | //LOG(INFO) << "wrote path: " << path << ", value: " << value << "\n"; 45 | } 46 | 47 | template 48 | static inline T get(const std::string& path, const T& def) { 49 | std::ifstream file(path); 50 | T result; 51 | 52 | file >> result; 53 | return file.fail() ? def : result; 54 | } 55 | 56 | } // anonymous namespace 57 | 58 | namespace vendor { 59 | namespace lineage { 60 | namespace biometrics { 61 | namespace fingerprint { 62 | namespace inscreen { 63 | namespace V1_0 { 64 | namespace implementation { 65 | 66 | FingerprintInscreen::FingerprintInscreen():isDreamState{false}{ 67 | } 68 | 69 | Return FingerprintInscreen::getPositionX() { 70 | return X_POS; 71 | } 72 | 73 | Return FingerprintInscreen::getPositionY() { 74 | return Y_POS; 75 | } 76 | 77 | Return FingerprintInscreen::getSize() { 78 | return FP_SIZE; 79 | } 80 | 81 | Return FingerprintInscreen::onStartEnroll() { 82 | return Void(); 83 | } 84 | 85 | Return FingerprintInscreen::onFinishEnroll() { 86 | return Void(); 87 | } 88 | 89 | Return FingerprintInscreen::onPress() { 90 | if(isDreamState){ 91 | set(DIMLAYER_PATH, FP_BEGIN); 92 | std::thread([this]() { 93 | std::this_thread::sleep_for(std::chrono::milliseconds(60)); 94 | if (isDreamState) { 95 | set(FP_PRESS_PATH, FP_BEGIN); 96 | } 97 | }).detach(); 98 | } else { 99 | set(FP_PRESS_PATH, FP_BEGIN); 100 | } 101 | return Void(); 102 | } 103 | 104 | Return FingerprintInscreen::onRelease() { 105 | set(FP_PRESS_PATH, FP_ENDIT); 106 | if(isDreamState) 107 | set(DIMLAYER_PATH, FP_ENDIT); 108 | return Void(); 109 | } 110 | 111 | Return FingerprintInscreen::onShowFODView() { 112 | if(get(DOZE_STATUS, FP_ENDIT)) { 113 | isDreamState = true; 114 | set(NOTIFY_BLANK_PATH, FP_BEGIN); 115 | set(AOD_MODE_PATH, FP_BEGIN); 116 | } else { 117 | isDreamState = false; 118 | set(DIMLAYER_PATH, FP_BEGIN); 119 | } 120 | return Void(); 121 | } 122 | 123 | Return FingerprintInscreen::onHideFODView() { 124 | if(!isDreamState) 125 | set(DIMLAYER_PATH, FP_ENDIT); 126 | return Void(); 127 | } 128 | 129 | Return FingerprintInscreen::handleAcquired(int32_t /* acquiredInfo */, int32_t /* vendorCode */) { 130 | return false; 131 | } 132 | 133 | Return FingerprintInscreen::handleError(int32_t /* error */, int32_t /* vendorCode */) { 134 | return false; 135 | } 136 | 137 | Return FingerprintInscreen::setLongPressEnabled(bool) { 138 | return Void(); 139 | } 140 | 141 | Return FingerprintInscreen::getDimAmount(int32_t /* brightness */) { 142 | return 0; 143 | } 144 | 145 | Return FingerprintInscreen::shouldBoostBrightness() { 146 | return false; 147 | } 148 | 149 | Return FingerprintInscreen::setCallback(const sp<::vendor::lineage::biometrics::fingerprint::inscreen::V1_0::IFingerprintInscreenCallback>& callback) { 150 | { 151 | std::lock_guard _lock(mCallbackLock); 152 | mCallback = callback; 153 | } 154 | return Void(); 155 | } 156 | 157 | } // namespace implementation 158 | } // namespace V1_0 159 | } // namespace inscreen 160 | } // namespace fingerprint 161 | } // namespace biometrics 162 | } // namespace lineage 163 | } // namespace vendor -------------------------------------------------------------------------------- /configs/nfc/libnfc-nci.conf: -------------------------------------------------------------------------------- 1 | ###################### Start of libnfc-nci.conf ####################### 2 | 3 | ############################################################################### 4 | # Application options 5 | APPL_TRACE_LEVEL=0xFF 6 | PROTOCOL_TRACE_LEVEL=0xFFFFFFFF 7 | 8 | NFC_DEBUG_ENABLED=0x01 9 | 10 | ############################################################################### 11 | # File used for NFA storage 12 | NFA_STORAGE="/data/nfc" 13 | 14 | ############################################################################### 15 | # Force UICC to only listen to the following technology(s). 16 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. 17 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | NFA_TECHNOLOGY_MASK_F 18 | UICC_LISTEN_TECH_MASK=0x07 19 | 20 | ############################################################################### 21 | # Configure the default Destination Gate used by HCI (the default is 4, which 22 | # is the ETSI loopback gate. 23 | NFA_HCI_DEFAULT_DEST_GATE=0xF0 24 | 25 | ############################################################################### 26 | # Forcing HOST to listen for a selected protocol 27 | # 0x00 : Disable Host Listen 28 | # 0x01 : Enable Host to Listen (A) for ISO-DEP tech A 29 | # 0x02 : Enable Host to Listen (B) for ISO-DEP tech B 30 | # 0x04 : Enable Host to Listen (F) for T3T Tag Type Protocol tech F 31 | # 0x07 : Enable Host to Listen (ABF)for ISO-DEP tech AB & T3T Tag Type Protocol tech F 32 | HOST_LISTEN_TECH_MASK=0x07 33 | 34 | ############################################################################### 35 | # Enabling/Disabling Forward functionality 36 | # Disable 0x00 37 | # Enable 0x01 38 | NXP_FWD_FUNCTIONALITY_ENABLE=0x00 39 | 40 | ############################################################################### 41 | # AID for Empty Select command 42 | # If specified, this AID will be substituted when an Empty SELECT command is 43 | # detected. The first byte is the length of the AID. Maximum length is 16. 44 | AID_FOR_EMPTY_SELECT={08:A0:00:00:01:51:00:00:00} 45 | 46 | ############################################################################### 47 | # When screen is turned off, specify the desired power state of the controller. 48 | # 0: power-off-sleep state; DEFAULT 49 | # 1: full-power state 50 | # 2: screen-off card-emulation (CE4/CE3/CE1 modes are used) 51 | SCREEN_OFF_POWER_STATE=1 52 | 53 | ############################################################################### 54 | # Firmware patch format, Only 1 and 5 should be set 55 | # 0 -> NFC Default 56 | # 1 -> EMVCO Default 57 | # 3 -> EMVCO Polling, DISC_IDLE = POWER_OFF, DISC DEACTIVATE = Removal process 58 | # 5 -> EMVCO Cert Polling, DISC_IDLE = Removal process , DISC DEACTIVATE = POWER_OFF 59 | # 7 -> EMVCO Polling, DISC_IDLE = POWER_OFF, DISC DEACTIVATE = POWER_OFF 60 | NFA_CONFIG_FORMAT=1 61 | 62 | ############################################################################### 63 | # Default poll duration (in ms) 64 | # The default is 500ms if not set (see nfc_target.h) 65 | #NFA_DM_DISC_DURATION_POLL=333 66 | 67 | ############################################################################### 68 | # Force tag polling for the following technology(s). 69 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. 70 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B | 71 | # NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 | 72 | # NFA_TECHNOLOGY_MASK_B_PRIME | NFA_TECHNOLOGY_MASK_KOVIO | 73 | # NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE. 74 | # 75 | # Notable bits: 76 | # NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */ 77 | # NFA_TECHNOLOGY_MASK_B 0x02 /* NFC Technology B */ 78 | # NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */ 79 | # NFA_TECHNOLOGY_MASK_ISO15693 0x08 /* Proprietary Technology */ 80 | # NFA_TECHNOLOGY_MASK_KOVIO 0x20 /* Proprietary Technology */ 81 | # NFA_TECHNOLOGY_MASK_A_ACTIVE 0x40 /* NFC Technology A active mode */ 82 | # NFA_TECHNOLOGY_MASK_F_ACTIVE 0x80 /* NFC Technology F active mode */ 83 | POLLING_TECH_MASK=0xEF 84 | 85 | ############################################################################### 86 | # Force P2P to only listen for the following technology(s). 87 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h. 88 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F | 89 | # NFA_TECHNOLOGY_MASK_A_ACTIVE | NFA_TECHNOLOGY_MASK_F_ACTIVE 90 | # 91 | # Notable bits: 92 | # NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */ 93 | # NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */ 94 | # NFA_TECHNOLOGY_MASK_A_ACTIVE 0x40 /* NFC Technology A active mode */ 95 | # NFA_TECHNOLOGY_MASK_F_ACTIVE 0x80 /* NFC Technology F active mode */ 96 | P2P_LISTEN_TECH_MASK=0xC4 97 | 98 | PRESERVE_STORAGE=0x01 99 | 100 | ############################################################################### 101 | # Deactivate notification wait time out in seconds used in ETSI Reader mode 102 | # 0 - Infinite wait 103 | NFA_DM_DISC_NTF_TIMEOUT=0 104 | 105 | ############################################################################### 106 | # AID_MATCHING constants 107 | # AID_MATCHING_EXACT_ONLY 0x00 108 | # AID_MATCHING_EXACT_OR_PREFIX 0x01 109 | # AID_MATCHING_PREFIX_ONLY 0x02 110 | AID_MATCHING_MODE=0x01 111 | 112 | ############################################################################### -------------------------------------------------------------------------------- /recovery/recovery_updater.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016, The CyanogenMod Project 3 | * Copyright (C) 2017, The LineageOS Project 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | #include "edify/expr.h" 33 | #include "otautil/error_code.h" 34 | 35 | #define MAX(a, b) (((a) > (b)) ? (a) : (b)) 36 | 37 | #define ALPHABET_LEN 256 38 | 39 | #define TZ_PART_PATH "/dev/block/bootdevice/by-name/tz" 40 | #define TZ_VER_STR "QC_IMAGE_VERSION_STRING=" 41 | #define TZ_VER_STR_LEN 24 42 | #define TZ_VER_BUF_LEN 255 43 | 44 | /* Boyer-Moore string search implementation from Wikipedia */ 45 | 46 | /* Return longest suffix length of suffix ending at str[p] */ 47 | static int max_suffix_len(const char *str, size_t str_len, size_t p) { 48 | uint32_t i; 49 | 50 | for (i = 0; (str[p - i] == str[str_len - 1 - i]) && (i < p); ) { 51 | i++; 52 | } 53 | 54 | return i; 55 | } 56 | 57 | /* Generate table of distance between last character of pat and rightmost 58 | * occurrence of character c in pat 59 | */ 60 | static void bm_make_delta1(int *delta1, const char *pat, size_t pat_len) { 61 | uint32_t i; 62 | for (i = 0; i < ALPHABET_LEN; i++) { 63 | delta1[i] = pat_len; 64 | } 65 | for (i = 0; i < pat_len - 1; i++) { 66 | uint8_t idx = (uint8_t) pat[i]; 67 | delta1[idx] = pat_len - 1 - i; 68 | } 69 | } 70 | 71 | /* Generate table of next possible full match from mismatch at pat[p] */ 72 | static void bm_make_delta2(int *delta2, const char *pat, size_t pat_len) { 73 | int p; 74 | uint32_t last_prefix = pat_len - 1; 75 | 76 | for (p = pat_len - 1; p >= 0; p--) { 77 | /* Compare whether pat[p-pat_len] is suffix of pat */ 78 | if (strncmp(pat + p, pat, pat_len - p) == 0) { 79 | last_prefix = p + 1; 80 | } 81 | delta2[p] = last_prefix + (pat_len - 1 - p); 82 | } 83 | 84 | for (p = 0; p < (int) pat_len - 1; p++) { 85 | /* Get longest suffix of pattern ending on character pat[p] */ 86 | int suf_len = max_suffix_len(pat, pat_len, p); 87 | if (pat[p - suf_len] != pat[pat_len - 1 - suf_len]) { 88 | delta2[pat_len - 1 - suf_len] = pat_len - 1 - p + suf_len; 89 | } 90 | } 91 | } 92 | 93 | static char * bm_search(const char *str, size_t str_len, const char *pat, 94 | size_t pat_len) { 95 | int delta1[ALPHABET_LEN]; 96 | int delta2[pat_len]; 97 | int i; 98 | 99 | bm_make_delta1(delta1, pat, pat_len); 100 | bm_make_delta2(delta2, pat, pat_len); 101 | 102 | if (pat_len == 0) { 103 | return (char *) str; 104 | } 105 | 106 | i = pat_len - 1; 107 | while (i < (int) str_len) { 108 | int j = pat_len - 1; 109 | while (j >= 0 && (str[i] == pat[j])) { 110 | i--; 111 | j--; 112 | } 113 | if (j < 0) { 114 | return (char *) (str + i + 1); 115 | } 116 | i += MAX(delta1[(uint8_t) str[i]], delta2[j]); 117 | } 118 | 119 | return NULL; 120 | } 121 | 122 | static int get_tz_version(char *ver_str, size_t len) { 123 | int ret = 0; 124 | int fd; 125 | int tz_size; 126 | char *tz_data = NULL; 127 | char *offset = NULL; 128 | 129 | fd = open(TZ_PART_PATH, O_RDONLY); 130 | if (fd < 0) { 131 | ret = errno; 132 | goto err_ret; 133 | } 134 | 135 | tz_size = lseek64(fd, 0, SEEK_END); 136 | if (tz_size == -1) { 137 | ret = errno; 138 | goto err_fd_close; 139 | } 140 | 141 | tz_data = (char *) mmap(NULL, tz_size, PROT_READ, MAP_PRIVATE, fd, 0); 142 | if (tz_data == (char *)-1) { 143 | ret = errno; 144 | goto err_fd_close; 145 | } 146 | 147 | /* Do Boyer-Moore search across TZ data */ 148 | offset = bm_search(tz_data, tz_size, TZ_VER_STR, TZ_VER_STR_LEN); 149 | if (offset != NULL) { 150 | strncpy(ver_str, offset + TZ_VER_STR_LEN, len); 151 | } else { 152 | ret = -ENOENT; 153 | } 154 | 155 | munmap(tz_data, tz_size); 156 | err_fd_close: 157 | close(fd); 158 | err_ret: 159 | return ret; 160 | } 161 | 162 | /* verify_trustzone("TZ_VERSION", "TZ_VERSION", ...) */ 163 | Value * VerifyTrustZoneFn(const char *name, State *state, 164 | const std::vector>& argv) { 165 | char current_tz_version[TZ_VER_BUF_LEN]; 166 | int ret; 167 | 168 | ret = get_tz_version(current_tz_version, TZ_VER_BUF_LEN); 169 | if (ret) { 170 | return ErrorAbort(state, kVendorFailure, 171 | "%s() failed to read current TZ version: %d", name, ret); 172 | } 173 | 174 | std::vector args; 175 | if (!ReadArgs(state, argv, &args)) { 176 | return ErrorAbort(state, kArgsParsingFailure, 177 | "%s() error parsing arguments", name); 178 | } 179 | 180 | ret = 0; 181 | for (auto& tz_version : args) { 182 | if (strncmp(tz_version.c_str(), current_tz_version, strlen(tz_version.c_str())) == 0) { 183 | ret = 1; 184 | break; 185 | } 186 | } 187 | 188 | return StringValue(strdup(ret ? "1" : "0")); 189 | } 190 | 191 | void Register_librecovery_updater_RMX1921() { 192 | RegisterFunction("RMX1921.verify_trustzone", VerifyTrustZoneFn); 193 | } 194 | -------------------------------------------------------------------------------- /rootdir/etc/init.class_main.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | 3 | # Copyright (c) 2013-2014, 2019 The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | # 31 | # start ril-daemon only for targets on which radio is present 32 | # 33 | baseband=`getprop ro.baseband` 34 | sgltecsfb=`getprop persist.vendor.radio.sglte_csfb` 35 | datamode=`getprop persist.vendor.data.mode` 36 | qcrild_status=true 37 | 38 | case "$baseband" in 39 | "apq" | "sda" | "qcs" ) 40 | setprop ro.vendor.radio.noril yes 41 | stop ril-daemon 42 | stop vendor.ril-daemon 43 | stop vendor.qcrild 44 | esac 45 | 46 | case "$baseband" in 47 | "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx" | "sm6") 48 | 49 | # For older modem packages launch ril-daemon. 50 | if [ -f /vendor/firmware_mnt/verinfo/ver_info.txt ]; then 51 | modem=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | 52 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | 53 | sed 's/.*MPSS.\(.*\)/\1/g' | cut -d \. -f 1` 54 | if [ "$modem" = "AT" ]; then 55 | version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | 56 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | 57 | sed 's/.*AT.\(.*\)/\1/g' | cut -d \- -f 1` 58 | if [ ! -z $version ]; then 59 | if [ "$version" \< "3.1" ]; then 60 | qcrild_status=false 61 | fi 62 | fi 63 | elif [ "$modem" = "TA" ]; then 64 | version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | 65 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | 66 | sed 's/.*TA.\(.*\)/\1/g' | cut -d \- -f 1` 67 | if [ ! -z $version ]; then 68 | if [ "$version" \< "3.0" ]; then 69 | qcrild_status=false 70 | fi 71 | fi 72 | elif [ "$modem" = "JO" ]; then 73 | version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | 74 | sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | 75 | sed 's/.*JO.\(.*\)/\1/g' | cut -d \- -f 1` 76 | if [ ! -z $version ]; then 77 | if [ "$version" \< "3.2" ]; then 78 | qcrild_status=false 79 | fi 80 | fi 81 | elif [ "$modem" = "TH" ]; then 82 | qcrild_status=false 83 | fi 84 | fi 85 | 86 | if [ "$qcrild_status" = "true" ]; then 87 | # Make sure both rild, qcrild are not running at same time. 88 | # This is possible with vanilla aosp system image. 89 | stop ril-daemon 90 | stop vendor.ril-daemon 91 | 92 | start vendor.qcrild 93 | else 94 | start ril-daemon 95 | start vendor.ril-daemon 96 | fi 97 | 98 | case "$baseband" in 99 | "svlte2a" | "csfb") 100 | start qmiproxy 101 | ;; 102 | "sglte" | "sglte2" ) 103 | if [ "x$sgltecsfb" != "xtrue" ]; then 104 | start qmiproxy 105 | else 106 | setprop persist.vendor.radio.voice.modem.index 0 107 | fi 108 | ;; 109 | esac 110 | 111 | multisim=`getprop persist.radio.multisim.config` 112 | 113 | if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then 114 | if [ "$qcrild_status" = "true" ]; then 115 | start vendor.qcrild2 116 | else 117 | start vendor.ril-daemon2 118 | fi 119 | elif [ "$multisim" = "tsts" ]; then 120 | if [ "$qcrild_status" = "true" ]; then 121 | start vendor.qcrild2 122 | start vendor.qcrild3 123 | else 124 | start vendor.ril-daemon2 125 | start vendor.ril-daemon3 126 | fi 127 | fi 128 | 129 | case "$datamode" in 130 | "tethered") 131 | start vendor.dataqti 132 | start vendor.dataadpl 133 | ;; 134 | "concurrent") 135 | start vendor.dataqti 136 | start vendor.dataadpl 137 | ;; 138 | *) 139 | ;; 140 | esac 141 | esac 142 | 143 | # 144 | # Allow persistent faking of bms 145 | # User needs to set fake bms charge in persist.vendor.bms.fake_batt_capacity 146 | # 147 | fake_batt_capacity=`getprop persist.vendor.bms.fake_batt_capacity` 148 | case "$fake_batt_capacity" in 149 | "") ;; #Do nothing here 150 | * ) 151 | echo "$fake_batt_capacity" > /sys/class/power_supply/battery/capacity 152 | ;; 153 | esac 154 | --------------------------------------------------------------------------------