├── Android.bp
├── Android.mk
├── AndroidProducts.mk
├── BoardConfig.mk
├── README.md
├── RealmeParts
├── Android.mk
├── AndroidManifest.xml
├── proguard.flags
├── res
│ ├── color-night
│ │ ├── switchbar_switch_thumb_tint.xml
│ │ └── switchbar_switch_track_tint.xml
│ ├── color
│ │ ├── switch_bar_bg.xml
│ │ ├── switchbar_switch_thumb_tint.xml
│ │ └── switchbar_switch_track_tint.xml
│ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ ├── drawable-xxhdpi
│ │ └── calibration_png.png
│ ├── drawable
│ │ ├── ic_dc_tile.xml
│ │ ├── ic_game_tile.xml
│ │ ├── ic_hbm_tile.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_otg_tile.xml
│ │ ├── ic_proper_seekbar_minus.xml
│ │ ├── ic_proper_seekbar_plus.xml
│ │ ├── ic_proper_seekbar_reset.xml
│ │ ├── ic_realmeparts.xml
│ │ ├── ic_restore.xml
│ │ ├── ic_settings_reset.xml
│ │ └── switchbar_background.xml
│ ├── layout
│ │ ├── display_cal.xml
│ │ ├── preference_category_material_settings.xml
│ │ ├── preference_material_settings.xml
│ │ ├── preference_proper_seekbar.xml
│ │ ├── preference_seek_bar.xml
│ │ ├── slider_preference.xml
│ │ └── switch_bar.xml
│ ├── menu
│ │ └── kcal_menu.xml
│ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ ├── mipmap-anydpi
│ │ └── ic_launcher.xml
│ ├── mipmap-hdpi
│ │ ├── ic_background.png
│ │ ├── ic_foreground.png
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ │ ├── ic_background.png
│ │ ├── ic_foreground.png
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ │ ├── ic_background.png
│ │ ├── ic_foreground.png
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ │ ├── ic_background.png
│ │ ├── ic_foreground.png
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ │ ├── ic_background.png
│ │ ├── ic_foreground.png
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ ├── raw
│ │ └── clear_speaker_sound.mp3
│ ├── values-es
│ │ └── strings.xml
│ ├── values-it
│ │ ├── proper_seekbar_strings.xml
│ │ └── strings.xml
│ ├── values-ru
│ │ └── strings.xml
│ ├── values
│ │ ├── arrays.xml
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── proper_seekbar_attrs.xml
│ │ ├── proper_seekbar_strings.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── xml
│ │ ├── Realme_preferences.xml
│ │ ├── clear_speaker_settings.xml
│ │ ├── display_calibration.xml
│ │ ├── screen_off_gesture.xml
│ │ ├── soundcontrol_settings.xml
│ │ └── vibration_setting.xml
└── src
│ └── org
│ └── device
│ └── RealmeParts
│ ├── AutoHighBrightnessModeService.java
│ ├── DCModeTileService.java
│ ├── FileUtils.java
│ ├── GameModeTileService.java
│ ├── HBMAutobrightnessThresholdPreference.java
│ ├── HBMModeTileService.java
│ ├── KernelControl.java
│ ├── KeyHandler.java
│ ├── ModeSwitch
│ ├── DCModeSwitch.java
│ ├── GameModeSwitch.java
│ ├── HBMModeSwitch.java
│ └── OTGModeSwitch.java
│ ├── OtgToggleService.java
│ ├── ProperSeekBarPreference.java
│ ├── RealmeParts.java
│ ├── RealmePartsActivity.java
│ ├── Startup.java
│ ├── Touch
│ ├── ScreenOffGesture.java
│ ├── ScreenOffGestureSettings.java
│ └── util
│ │ ├── Action.java
│ │ ├── ActionConstants.java
│ │ ├── AppHelper.java
│ │ ├── ShortcutPickerHelper.java
│ │ └── Utils.java
│ ├── Utils.java
│ ├── audio
│ ├── SoundControlFileUtils.java
│ ├── SoundControlSettings.java
│ ├── SoundControlSettingsActivity.java
│ └── utils
│ │ ├── CustomSeekBarPreference.java
│ │ ├── SecureSettingCustomSeekBarPreference.java
│ │ └── SecureSettingsStore.java
│ ├── kcal
│ ├── DisplayCalibration.java
│ ├── KcalPresets.java
│ ├── KcalService.java
│ ├── Utils.java
│ └── utils
│ │ ├── FileUtils.java
│ │ ├── NonScrollListView.java
│ │ └── SeekBarPreference.java
│ ├── speaker
│ ├── ClearSpeakerActivity.java
│ └── ClearSpeakerFragment.java
│ └── vibrator
│ ├── VibratorSettings.java
│ ├── VibratorSettingsActivity.java
│ └── utils
│ ├── SecureSettingVibrationSeekBarPreference.java
│ ├── SecureSettingsStore.java
│ ├── VibrateFileUtils.java
│ └── VibrationSeekBarPreference.java
├── audio
├── audio_effects.xml
├── audio_platform_info.xml
├── audio_platform_info_intcodec.xml
├── audio_policy_configuration.xml
├── audio_policy_configuration_a2dp_offload_disabled.xml
└── mixer_paths.xml
├── config.fs
├── configs
├── component-overrides.xml
├── media
│ ├── media_codecs.xml
│ ├── media_codecs_performance.xml
│ ├── media_profiles.xml
│ ├── media_profiles_vendor.xml
│ └── system_properties.xml
├── nfc
│ └── libnfc-nxp.conf
├── permissions
│ └── privapp_whitelist_org.device.Realmeparts.xml
├── powerhint.json
├── public.libraries.txt
├── qti_whitelist.xml
├── qti_whitelist_system_ext.xml
├── sec_config
└── system_ext-privapp-permissions-qti.xml
├── derp_RMX1921.mk
├── device.mk
├── doze
├── Android.mk
├── AndroidManifest.xml
├── proguard.flags
├── res
│ ├── layout
│ │ ├── preference_category_material_settings.xml
│ │ └── preference_material_settings.xml
│ ├── values-hi
│ │ └── strings.xml
│ ├── values-it
│ │ └── strings.xml
│ ├── values-ru
│ │ └── strings.xml
│ ├── values
│ │ └── strings.xml
│ └── xml
│ │ └── doze_settings.xml
└── src
│ └── org
│ └── lineageos
│ └── settings
│ ├── BootCompletedReceiver.java
│ └── doze
│ ├── AmdSensor.java
│ ├── DozeService.java
│ ├── DozeSettingsActivity.java
│ ├── DozeSettingsFragment.java
│ ├── DozeUtils.java
│ ├── MoveDetectSensor.java
│ ├── ProximitySensor.java
│ └── TiltSensor.java
├── extract-files.sh
├── fingerprint
├── Android.bp
├── BiometricsFingerprint.cpp
├── BiometricsFingerprint.h
├── UdfpsExtension.cpp
├── android.hardware.biometrics.fingerprint@2.3-service.xt.rc
├── android.hardware.biometrics.fingerprint@2.3-service.xt.xml
└── service.cpp
├── framework_compatibility_matrix.xml
├── gps
├── flp.conf
├── gps.conf
├── izat.conf
├── lowi.conf
├── sap.conf
└── xtwifi.conf
├── init
├── Android.bp
└── init_RMX1921.cpp
├── interfaces
└── vendor
│ ├── Android.bp
│ ├── hardware
│ └── biometrics
│ │ └── fingerprint
│ │ └── 2.1
│ │ ├── Android.bp
│ │ ├── IBiometricsFingerprint.hal
│ │ ├── IBiometricsFingerprintClientCallback.hal
│ │ └── types.hal
│ └── update-makefiles.sh
├── keylayout
└── gpio-keys.kl
├── light
├── Android.bp
├── Light.cpp
├── Light.h
├── android.hardware.lights-service.realme_sdm710.rc
├── lights.xml
└── service.cpp
├── manifest.xml
├── odm.prop
├── odm_manifests
├── manifest_RMX1921.xml
└── manifest_RMX1921EU.xml
├── overlay-lineage
├── frameworks
│ └── base
│ │ └── packages
│ │ └── SystemUI
│ │ └── res
│ │ └── values
│ │ └── lineage_config.xml
└── packages
│ └── apps
│ ├── Dialer
│ └── java
│ │ └── com
│ │ └── android
│ │ ├── dialer
│ │ └── callrecord
│ │ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ │ └── incallui
│ │ └── res
│ │ └── values
│ │ └── aosip_config.xml
│ ├── Flash
│ └── app
│ │ └── src
│ │ └── main
│ │ └── res
│ │ └── values
│ │ └── config.xml
│ └── Settings
│ └── res
│ └── values
│ └── dimens.xml
├── overlay
├── frameworks
│ └── base
│ │ ├── core
│ │ └── res
│ │ │ └── res
│ │ │ ├── values
│ │ │ ├── config.xml
│ │ │ └── dimens.xml
│ │ │ └── xml
│ │ │ └── power_profile.xml
│ │ └── packages
│ │ ├── SettingsProvider
│ │ └── res
│ │ │ └── values
│ │ │ └── defaults.xml
│ │ └── SystemUI
│ │ └── res
│ │ ├── drawable-nodpi
│ │ └── udfps_icon_pressed.png
│ │ ├── drawable
│ │ ├── rounded.xml
│ │ ├── rounded_corner_bottom.xml
│ │ └── rounded_corner_top.xml
│ │ └── values
│ │ ├── config.xml
│ │ ├── dimens.xml
│ │ └── integers.xml
└── packages
│ ├── apps
│ ├── CarrierConfig
│ │ └── res
│ │ │ └── xml
│ │ │ └── vendor.xml
│ ├── DocumentsUI
│ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ ├── FaceUnlockService
│ │ └── app
│ │ │ └── src
│ │ │ └── main
│ │ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ ├── Settings
│ │ └── res
│ │ │ └── values
│ │ │ ├── arrays.xml
│ │ │ ├── derp_config.xml
│ │ │ └── derp_strings.xml
│ └── SimpleDeviceConfig
│ │ └── res
│ │ └── values
│ │ └── config.xml
│ └── services
│ ├── DeviceAsWebcam
│ └── res
│ │ ├── raw
│ │ └── ignored_v4l2_nodes.json
│ │ └── values
│ │ └── config.xml
│ └── Telephony
│ └── res
│ └── values
│ └── config.xml
├── product.prop
├── proprietary-files.txt
├── proximityservice
├── Android.bp
├── AndroidManifest.xml
├── LICENSE.txt
├── Readme.md
├── proguard.flags
└── src
│ └── co
│ └── hyper
│ └── proximityservice
│ ├── BootCompletedReceiver.java
│ ├── DisplayStateHelper.java
│ ├── FileHelper.java
│ ├── InfraredSensor.java
│ └── RealmeProximityHelperService.java
├── releasetools.py
├── remove_packages
└── Android.mk
├── reorder-libs.py
├── rootdir
├── Android.mk
├── bin
│ ├── init.qcom.early_boot.sh
│ ├── init.qcom.post_boot.sh
│ ├── init.qcom.sh
│ └── init.qti.chg_policy.sh
├── etc
│ ├── fstab.qcom
│ ├── init.RealmeParts.rc
│ ├── init.oppo.display.rc
│ ├── init.oppo.rc
│ ├── init.qcom.power.rc
│ ├── init.qcom.rc
│ ├── init.recovery.qcom.rc
│ └── init.target.rc
└── ueventd.qcom.rc
├── rro_overlays
├── TetheringOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
└── WifiOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ └── values
│ └── config.xml
├── seccomp
├── mediacodec-seccomp.policy
├── mediaextractor.policy
└── mediaswcodec.policy
├── sensors
├── Android.bp
├── HalProxy.cpp
├── HalProxyCallback.cpp
├── android.hardware.sensors@2.0-multihal.xml
├── android.hardware.sensors@2.0-service-multihal.rc
└── service.cpp
├── sepolicy
├── private
│ ├── art_boot.te
│ ├── dontaudit.te
│ ├── fsverity_init.te
│ ├── linkerconfig.te
│ ├── odrefresh.te
│ ├── permissioncontroller_app.te
│ ├── platform_app.te
│ ├── radio.te
│ ├── system_app.te
│ └── vendor_boringssl_self_test.te
└── vendor
│ ├── adbd.te
│ ├── adpl.te
│ ├── adsprpcd.te
│ ├── app.te
│ ├── cdsprpcd.te
│ ├── cnd.te
│ ├── device.te
│ ├── file.te
│ ├── file_contexts
│ ├── fsck.te
│ ├── genfs_contexts
│ ├── gmscore_app.te
│ ├── gpuservice.te
│ ├── hal_audio_default.te
│ ├── hal_bluetooth_qti.te
│ ├── hal_camera_default.te
│ ├── hal_capabilityconfigstore_qti_default.te
│ ├── hal_fingerprint_default.te
│ ├── hal_gnss_qti.te
│ ├── hal_graphics_composer_default.te
│ ├── hal_imsrtp.te
│ ├── hal_light_default.te
│ ├── hal_neuralnetworks_default.te
│ ├── hal_nfc_default.te
│ ├── hal_power_default.te
│ ├── hal_power_stats_default.te
│ ├── hal_rcsservice.te
│ ├── hal_secure_element_default.te
│ ├── hal_sensors_default.te
│ ├── hal_thermal_default.te
│ ├── hal_wifi_default.te
│ ├── hal_wifi_hostapd_default.te
│ ├── hal_wifi_supplicant_default.te
│ ├── hwservice.te
│ ├── hwservice_contexts
│ ├── ims.te
│ ├── init.te
│ ├── irsc_util.te
│ ├── isolated_app.te
│ ├── kernel.te
│ ├── lkmd.te
│ ├── location.te
│ ├── mediacodec.te
│ ├── mediaprovider.te
│ ├── netmgrd.te
│ ├── netutils_wrapper.te
│ ├── oppo_display_default.te
│ ├── platform_app.te
│ ├── priv_app.te
│ ├── proc_touchpanel.te
│ ├── property.te
│ ├── property_contexts
│ ├── qti.te
│ ├── qti_init_shell.te
│ ├── qtidataservices_app.te
│ ├── radio.te
│ ├── rfs_access.te
│ ├── rild.te
│ ├── rmt_storage.te
│ ├── seapp_contexts
│ ├── sensors.te
│ ├── surfaceflinger.te
│ ├── system_app.te
│ ├── system_server.te
│ ├── tee.te
│ ├── thermal-engine.te
│ ├── ueventd.te
│ ├── usbd.te
│ ├── vdc.te
│ ├── vendor_dataservice_app.te
│ ├── vendor_dpmd.te
│ ├── vendor_init.te
│ ├── vendor_modprobe.te
│ ├── vendor_msm_irqbalanced.te
│ ├── vendor_pd_mapper.te
│ ├── vendor_ssr_setup.te
│ ├── vendor_vppservice.te
│ ├── vold.te
│ ├── vold_prepare_subdirs.te
│ ├── wcnss_service.te
│ └── zygote.te
├── setup-makefiles.sh
├── system.prop
├── system_ext.prop
├── update-sha1sums.py
├── vendor.prop
└── wifi
├── WCNSS_qcom_cfg.ini
├── p2p_supplicant_overlay.conf
└── wpa_supplicant_overlay.conf
/Android.bp:
--------------------------------------------------------------------------------
1 | soong_namespace {
2 | imports: [
3 | "bootable/deprecated-ota",
4 | "hardware/google/interfaces",
5 | "hardware/google/pixel",
6 | "hardware/lineage/interfaces/power-libperfmgr",
7 | "hardware/qcom-caf/common/libqti-perfd-client",
8 | ],
9 | }
10 |
11 | install_symlink {
12 | name: "firmware_WCNSS_qcom_cfg.ini_symlink",
13 | vendor: true,
14 | installed_location: "firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini",
15 | symlink_target: "/vendor/etc/wifi/WCNSS_qcom_cfg.ini",
16 | }
17 |
18 | install_symlink {
19 | name: "firmware_wlan_mac.bin_symlink",
20 | vendor: true,
21 | installed_location: "firmware/wlan/qca_cld/wlan_mac.bin",
22 | symlink_target: "/mnt/vendor/persist/wlan_mac.bin",
23 | }
24 |
--------------------------------------------------------------------------------
/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018-2024 The LineageOS Project
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | LOCAL_PATH := $(call my-dir)
8 | ifeq ($(TARGET_DEVICE),RMX1921)
9 | include $(call all-makefiles-under,$(LOCAL_PATH))
10 | include $(CLEAR_VARS)
11 |
12 | # A/B builds require us to create the mount points at compile time.
13 | # Just creating it for all cases since it does not hurt.
14 | FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/firmware_mnt
15 | $(FIRMWARE_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
16 | @echo "Creating $(FIRMWARE_MOUNT_POINT)"
17 | @mkdir -p $(TARGET_OUT_VENDOR)/firmware_mnt
18 |
19 | BT_FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/bt_firmware
20 | $(BT_FIRMWARE_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
21 | @echo "Creating $(BT_FIRMWARE_MOUNT_POINT)"
22 | @mkdir -p $(TARGET_OUT_VENDOR)/bt_firmware
23 |
24 | DSP_MOUNT_POINT := $(TARGET_OUT_VENDOR)/dsp
25 | $(DSP_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE)
26 | @echo "Creating $(DSP_MOUNT_POINT)"
27 | @mkdir -p $(TARGET_OUT_VENDOR)/dsp
28 |
29 | ALL_DEFAULT_INSTALLED_MODULES += $(FIRMWARE_MOUNT_POINT) $(BT_FIRMWARE_MOUNT_POINT) $(DSP_MOUNT_POINT)
30 |
31 | endif
32 |
--------------------------------------------------------------------------------
/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)/derp_RMX1921.mk
9 |
10 | COMMON_LUNCH_CHOICES := \
11 | derp_RMX1921-userdebug \
12 | derp_RMX1921-eng
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Device tree for Realme XT
2 |
--------------------------------------------------------------------------------
/RealmeParts/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2013 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 | LOCAL_PATH := $(call my-dir)
19 | include $(CLEAR_VARS)
20 |
21 | LOCAL_SRC_FILES := $(call all-java-files-under, src)
22 | LOCAL_CERTIFICATE := platform
23 | LOCAL_PRIVATE_PLATFORM_APIS := true
24 | LOCAL_PRIVILEGED_MODULE := true
25 | LOCAL_PACKAGE_NAME := RealmeParts
26 |
27 | LOCAL_USE_AAPT2 := true
28 |
29 | LOCAL_STATIC_ANDROID_LIBRARIES := \
30 | SettingsLib
31 |
32 | LOCAL_RESOURCE_DIR := \
33 | $(LOCAL_PATH)/res
34 |
35 | package_resource_overlays := $(strip \
36 | $(wildcard $(foreach dir, $(PRODUCT_PACKAGE_OVERLAYS), \
37 | $(addprefix $(dir)/, packages/apps/RealmeParts/res))) \
38 | $(wildcard $(foreach dir, $(DEVICE_PACKAGE_OVERLAYS), \
39 | $(addprefix $(dir)/, packages/apps/RealmeParts/res))))
40 |
41 | LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR)
42 | LOCAL_PROGUARD_FLAG_FILES := proguard.flags
43 | LOCAL_MODULE_TAGS := optional
44 | include $(BUILD_PACKAGE)
45 |
--------------------------------------------------------------------------------
/RealmeParts/proguard.flags:
--------------------------------------------------------------------------------
1 | -keep class org.device.RealmeParts.* {
2 | *;
3 | }
4 |
--------------------------------------------------------------------------------
/RealmeParts/res/color-night/switchbar_switch_thumb_tint.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/RealmeParts/res/color-night/switchbar_switch_track_tint.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/RealmeParts/res/color/switch_bar_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/RealmeParts/res/color/switchbar_switch_thumb_tint.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/RealmeParts/res/color/switchbar_switch_track_tint.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable-xxhdpi/calibration_png.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/drawable-xxhdpi/calibration_png.png
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/ic_dc_tile.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/ic_game_tile.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/ic_hbm_tile.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/ic_otg_tile.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/ic_proper_seekbar_minus.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/ic_proper_seekbar_plus.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/ic_proper_seekbar_reset.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
24 |
25 |
28 |
29 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/ic_realmeparts.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
36 |
37 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/ic_restore.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/ic_settings_reset.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/RealmeParts/res/drawable/switchbar_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/RealmeParts/res/layout/display_cal.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
19 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/RealmeParts/res/layout/switch_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
27 |
28 |
40 |
41 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/RealmeParts/res/menu/kcal_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-anydpi/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-hdpi/ic_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-hdpi/ic_background.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-hdpi/ic_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-hdpi/ic_foreground.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-mdpi/ic_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-mdpi/ic_background.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-mdpi/ic_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-mdpi/ic_foreground.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xhdpi/ic_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xhdpi/ic_background.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xhdpi/ic_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xhdpi/ic_foreground.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xxhdpi/ic_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xxhdpi/ic_background.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xxhdpi/ic_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xxhdpi/ic_foreground.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xxxhdpi/ic_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xxxhdpi/ic_background.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xxxhdpi/ic_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xxxhdpi/ic_foreground.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/RealmeParts/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/RealmeParts/res/raw/clear_speaker_sound.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/RealmeParts/res/raw/clear_speaker_sound.mp3
--------------------------------------------------------------------------------
/RealmeParts/res/values-it/proper_seekbar_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Valore: %s
4 | di default
5 | Il valore di default: %s\nPremi a lungo per impostare
6 | Il valore di default è stato ripristinato
7 |
8 |
--------------------------------------------------------------------------------
/RealmeParts/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/RealmeParts/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 | #66000000
20 |
21 |
22 |
--------------------------------------------------------------------------------
/RealmeParts/res/values/proper_seekbar_attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/RealmeParts/res/values/proper_seekbar_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Value: %s
4 | Default
5 | Default value: %s\nLong press to set
6 | Default value is set
7 |
8 |
--------------------------------------------------------------------------------
/RealmeParts/res/xml/clear_speaker_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/RealmeParts/res/xml/soundcontrol_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/RealmeParts/res/xml/vibration_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
16 |
17 |
23 |
24 |
30 |
31 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/HBMAutobrightnessThresholdPreference.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The OmniROM Project
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | */
18 | package org.device.RealmeParts;
19 |
20 | import android.content.Context;
21 | import android.content.SharedPreferences;
22 | import android.os.Bundle;
23 | import android.util.AttributeSet;
24 | import android.util.Log;
25 | import androidx.preference.Preference;
26 | import androidx.preference.PreferenceManager;
27 | import androidx.preference.PreferenceViewHolder;
28 |
29 | import org.device.RealmeParts.ProperSeekBarPreference;
30 |
31 | import org.device.RealmeParts.R;
32 |
33 | public class HBMAutobrightnessThresholdPreference extends ProperSeekBarPreference {
34 |
35 | private static int mMinVal = 0;
36 | private static int mMaxVal = 60000;
37 | private static int mDefVal = 20000;
38 |
39 | public HBMAutobrightnessThresholdPreference(Context context, AttributeSet attrs) {
40 | super(context, attrs);
41 |
42 | mInterval = 1000;
43 | mShowSign = false;
44 | mUnits = "";
45 | mContinuousUpdates = false;
46 | mMinValue = mMinVal;
47 | mMaxValue = mMaxVal;
48 | mDefaultValueExists = true;
49 | mDefaultValue = mDefVal;
50 | SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
51 | mValue = Integer.parseInt(sharedPrefs.getString(RealmeParts.KEY_HBM_AUTOBRIGHTNESS_THRESHOLD, "20000"));
52 |
53 | setPersistent(false);
54 | }
55 |
56 | @Override
57 | protected void changeValue(int newValue) {
58 | SharedPreferences.Editor prefChange = PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
59 | prefChange.putString(RealmeParts.KEY_HBM_AUTOBRIGHTNESS_THRESHOLD, String.valueOf(newValue)).commit();
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/KernelControl.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 SlimRoms Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.device.RealmeParts;
18 |
19 | import org.device.RealmeParts.Touch.util.Utils;
20 | import java.io.File;
21 |
22 | /*
23 | * Very ugly class which enables or disables for now
24 | * all gesture controls on kernel level.
25 | * We need to do it this way for now to do not break 3rd party kernel.
26 | * Kernel should have a better per gesture control but as long
27 | * this is not changed by the manufacture we would break gesture control on every
28 | * 3rd party kernel. Hence we do it this way for now.
29 | */
30 |
31 | public final class KernelControl {
32 |
33 | private static String GESTURE_PATH = "/proc/touchpanel/gesture_enable";
34 | private static String DT2W_PATH = "/proc/touchpanel/double_tap_enable";
35 |
36 | private KernelControl() {
37 | // this class is not supposed to be instantiated
38 | }
39 |
40 | /**
41 | * Enable or disable gesture control.
42 | */
43 | public static void enableGestures(boolean enable) {
44 | if (new File(GESTURE_PATH).exists()) {
45 | Utils.writeLine(GESTURE_PATH, enable ? "1" : "0");
46 | }
47 | }
48 |
49 | public static void enableDt2w(boolean enable) {
50 | if (new File(GESTURE_PATH).exists()) {
51 | Utils.writeLine(DT2W_PATH, enable ? "1" : "0");
52 | }
53 | }
54 |
55 | /**
56 | * Do we have touch control at all?
57 | */
58 | public static boolean hasTouchscreenGestures() {
59 | return new File(GESTURE_PATH).exists();
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/ModeSwitch/DCModeSwitch.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The OmniROM Project
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | */
18 |
19 | package org.device.RealmeParts;
20 |
21 | import android.content.Context;
22 | import android.content.SharedPreferences;
23 | import androidx.preference.Preference;
24 | import androidx.preference.Preference.OnPreferenceChangeListener;
25 | import androidx.preference.PreferenceManager;
26 |
27 | import org.device.RealmeParts.RealmeParts;
28 |
29 | public class DCModeSwitch implements OnPreferenceChangeListener {
30 |
31 | private static final String FILE = "/sys/kernel/oppo_display/dimlayer_bl_en";
32 |
33 | public static String getFile() {
34 | if (Utils.fileWritable(FILE)) {
35 | return FILE;
36 | }
37 | return null;
38 | }
39 |
40 | public static boolean isSupported() {
41 | return Utils.fileWritable(getFile());
42 | }
43 |
44 | public static boolean isCurrentlyEnabled(Context context) {
45 | return Utils.getFileValueAsBoolean(getFile(), false);
46 | }
47 |
48 | @Override
49 | public boolean onPreferenceChange(Preference preference, Object newValue) {
50 | Boolean enabled = (Boolean) newValue;
51 | Utils.writeValue(getFile(), enabled ? "1" : "0");
52 | return true;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/ModeSwitch/GameModeSwitch.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 The LineageOS Project
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | */
18 |
19 | package org.device.RealmeParts.ModeSwitch;
20 |
21 | import androidx.preference.Preference;
22 | import android.util.Log;
23 | import android.content.Context;
24 |
25 | import androidx.preference.Preference.OnPreferenceChangeListener;
26 | import androidx.preference.PreferenceManager;
27 |
28 | import org.device.RealmeParts.Utils;
29 |
30 | public class GameModeSwitch implements Preference.OnPreferenceChangeListener {
31 |
32 | private static final String FILE = "/proc/touchpanel/game_switch_enable";
33 | private static final String TAG = Utils.class.getSimpleName();
34 |
35 | public static String getFile() {
36 | if (Utils.fileWritable(FILE)) {
37 | return FILE;
38 | }
39 | return null;
40 | }
41 |
42 | public static boolean isSupported() {
43 | return Utils.fileWritable(getFile());
44 | }
45 |
46 | public static boolean isCurrentlyEnabled(Context context) {
47 | return Utils.getFileValueAsBoolean(getFile(), false);
48 | }
49 |
50 | @Override
51 | public boolean onPreferenceChange(Preference preference, Object newValue) {
52 | Boolean enabled = (Boolean) newValue;
53 | Utils.writeValue(getFile(), enabled ? "1" : "0");
54 | Utils.writeValue(org.device.RealmeParts.RealmeParts.TP_LIMIT_ENABLE, enabled ? "0" : "1" );
55 | Utils.writeValue(org.device.RealmeParts.RealmeParts.TP_DIRECTION, enabled ? "1" : "0" );
56 | Log.e(TAG, "game mode set to " + enabled);
57 | return true;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/ModeSwitch/HBMModeSwitch.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The OmniROM Project
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | */
18 |
19 | package org.device.RealmeParts;
20 |
21 | import android.content.Context;
22 | import android.content.SharedPreferences;
23 | import androidx.preference.Preference;
24 | import androidx.preference.Preference.OnPreferenceChangeListener;
25 | import androidx.preference.PreferenceManager;
26 |
27 | import org.device.RealmeParts.RealmeParts;
28 |
29 | public class HBMModeSwitch implements OnPreferenceChangeListener {
30 |
31 | private static final String FILE = "/sys/kernel/oppo_display/hbm";
32 |
33 | public static String getFile() {
34 | if (Utils.fileWritable(FILE)) {
35 | return FILE;
36 | }
37 | return null;
38 | }
39 |
40 | public static boolean isSupported() {
41 | return Utils.fileWritable(getFile());
42 | }
43 |
44 | public static boolean isCurrentlyEnabled(Context context) {
45 | return Utils.getFileValueAsBoolean(getFile(), false);
46 | }
47 |
48 | @Override
49 | public boolean onPreferenceChange(Preference preference, Object newValue) {
50 | Boolean enabled = (Boolean) newValue;
51 | Utils.writeValue(getFile(), enabled ? "1" : "0");
52 | return true;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/ModeSwitch/OTGModeSwitch.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 The LineageOS Project
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | */
18 | package org.device.RealmeParts;
19 |
20 | import android.content.Context;
21 | import android.content.SharedPreferences;
22 | import androidx.preference.Preference;
23 | import androidx.preference.Preference.OnPreferenceChangeListener;
24 | import androidx.preference.PreferenceManager;
25 |
26 | import org.device.RealmeParts.RealmeParts;
27 |
28 | public class OTGModeSwitch implements OnPreferenceChangeListener {
29 |
30 | private static final String FILE = "/sys/class/power_supply/usb/otg_switch";
31 |
32 | public static String getFile() {
33 | if (Utils.fileWritable(FILE)) {
34 | return FILE;
35 | }
36 | return null;
37 | }
38 |
39 | public static boolean isSupported() {
40 | return Utils.fileWritable(getFile());
41 | }
42 |
43 | public static boolean isCurrentlyEnabled(Context context) {
44 | return Utils.getFileValueAsBoolean(getFile(), false);
45 | }
46 |
47 | @Override
48 | public boolean onPreferenceChange(Preference preference, Object newValue) {
49 | Boolean enabled = (Boolean) newValue;
50 | Utils.writeValue(getFile(), enabled ? "1" : "0");
51 | return true;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/OtgToggleService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The OmniROM Project
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | */
18 |
19 | package org.device.RealmeParts;
20 |
21 | import android.annotation.TargetApi;
22 | import android.content.Intent;
23 | import android.content.SharedPreferences;
24 | import android.service.quicksettings.Tile;
25 | import android.service.quicksettings.TileService;
26 | import androidx.preference.PreferenceManager;
27 |
28 | import org.device.RealmeParts.RealmeParts;
29 |
30 | @TargetApi(24)
31 | public class OtgToggleService extends TileService {
32 | private boolean enabled = false;
33 |
34 | @Override
35 | public void onDestroy() {
36 | super.onDestroy();
37 | }
38 |
39 | @Override
40 | public void onTileAdded() {
41 | super.onTileAdded();
42 | }
43 |
44 | @Override
45 | public void onTileRemoved() {
46 | super.onTileRemoved();
47 | }
48 |
49 | @Override
50 | public void onStartListening() {
51 | super.onStartListening();
52 | SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
53 | enabled = OTGModeSwitch.isCurrentlyEnabled(this);
54 | getQsTile().setState(enabled ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
55 | getQsTile().updateTile();
56 |
57 | }
58 |
59 | @Override
60 | public void onStopListening() {
61 | super.onStopListening();
62 | }
63 |
64 | @Override
65 | public void onClick() {
66 | super.onClick();
67 | SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
68 | enabled = OTGModeSwitch.isCurrentlyEnabled(this);
69 | Utils.writeValue(OTGModeSwitch.getFile(), enabled ? "0" : "1");
70 | sharedPrefs.edit().putBoolean(RealmeParts.KEY_OTG_SWITCH, enabled ? false : true).commit();
71 | getQsTile().setState(enabled ? Tile.STATE_INACTIVE : Tile.STATE_ACTIVE);
72 | getQsTile().updateTile();
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/RealmePartsActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The OmniROM Project
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 2 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | *
17 | */
18 | package org.device.RealmeParts;
19 |
20 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
21 | import android.app.AlertDialog;
22 | import android.app.Dialog;
23 | import android.app.DialogFragment;
24 | import android.app.Fragment;
25 | import android.content.DialogInterface;
26 | import android.os.Bundle;
27 | import android.view.Menu;
28 | import android.view.MenuInflater;
29 | import android.view.MenuItem;
30 | import androidx.preference.PreferenceFragment;
31 | import androidx.preference.PreferenceManager;
32 |
33 | public class RealmePartsActivity extends CollapsingToolbarBaseActivity {
34 |
35 | private RealmeParts mRealmePartsFragment;
36 |
37 | @Override
38 | protected void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 |
41 | getActionBar().setDisplayHomeAsUpEnabled(true);
42 |
43 | Fragment fragment = getFragmentManager().findFragmentById(com.android.settingslib.collapsingtoolbar.R.id.content_frame);
44 | if (fragment == null) {
45 | mRealmePartsFragment = new RealmeParts();
46 | getFragmentManager().beginTransaction()
47 | .add(com.android.settingslib.collapsingtoolbar.R.id.content_frame, mRealmePartsFragment)
48 | .commit();
49 | } else {
50 | mRealmePartsFragment = (RealmeParts) fragment;
51 | }
52 | }
53 |
54 | @Override
55 | public boolean onOptionsItemSelected(MenuItem item) {
56 | switch (item.getItemId()) {
57 | case android.R.id.home:
58 | finish();
59 | return true;
60 | default:
61 | break;
62 | }
63 | return super.onOptionsItemSelected(item);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/Touch/ScreenOffGestureSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 Slimroms
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.device.RealmeParts.Touch;
18 |
19 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
20 | import android.os.Bundle;
21 | import android.view.MenuItem;
22 |
23 | public class ScreenOffGestureSettings extends CollapsingToolbarBaseActivity {
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 |
29 | getFragmentManager().beginTransaction().replace(
30 | com.android.settingslib.collapsingtoolbar.R.id.content_frame,
31 | new ScreenOffGesture()).commit();
32 | getActionBar().setDisplayHomeAsUpEnabled(true);
33 | }
34 |
35 | @Override
36 | public boolean onOptionsItemSelected(MenuItem item) {
37 | switch (item.getItemId()) {
38 | case android.R.id.home:
39 | finish();
40 | return true;
41 | default:
42 | return super.onOptionsItemSelected(item);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/Touch/util/ActionConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 SlimRoms Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.device.RealmeParts.Touch.util;
18 |
19 | public class ActionConstants {
20 |
21 | // key must fit with the values arrays from Settings to use
22 | // SlimActions.java actions
23 | public static final String ACTION_CAMERA = "**camera**";
24 | public static final String ACTION_ASSIST = "**assist**";
25 | public static final String ACTION_VIB = "**ring_vib**";
26 | public static final String ACTION_SILENT = "**ring_silent**";
27 | public static final String ACTION_VIB_SILENT = "**ring_vib_silent**";
28 | public static final String ACTION_TORCH = "**torch**";
29 | public static final String ACTION_MEDIA_PREVIOUS = "**media_previous**";
30 | public static final String ACTION_MEDIA_NEXT = "**media_next**";
31 | public static final String ACTION_MEDIA_PLAY_PAUSE = "**media_play_pause**";
32 | public static final String ACTION_WAKE_DEVICE = "**wake_device**";
33 | public static final String ACTION_AMBIENT_DISPLAY = "**ambient**";
34 | public static final String ACTION_VOLUME_DOWN = "**vol_down**";
35 | public static final String ACTION_VOLUME_UP = "**vol_up**";
36 |
37 | // no action
38 | public static final String ACTION_NULL = "**null**";
39 |
40 | // this shorcut constant is only used to identify if the user
41 | // selected in settings a custom app...after it is choosed intent uri
42 | // is saved in the ButtonConfig object
43 | public static final String ACTION_APP = "**app**";
44 |
45 | public static final String ICON_EMPTY = "empty";
46 | public static final String SYSTEM_ICON_IDENTIFIER = "system_shortcut=";
47 | public static final String ACTION_DELIMITER = "|";
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/audio/SoundControlSettingsActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Asus-SDM660 Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License
15 | */
16 |
17 | package org.device.RealmeParts.audio;
18 |
19 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
20 | import android.app.Fragment;
21 | import android.os.Bundle;
22 | import android.view.MenuItem;
23 |
24 | public class SoundControlSettingsActivity extends CollapsingToolbarBaseActivity {
25 |
26 | private SoundControlSettings mSoundControlSettingsFragment;
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 |
32 | getActionBar().setDisplayHomeAsUpEnabled(true);
33 |
34 | Fragment fragment = getFragmentManager().findFragmentById(com.android.settingslib.collapsingtoolbar.R.id.content_frame);
35 | if (fragment == null) {
36 | mSoundControlSettingsFragment = new SoundControlSettings();
37 | getFragmentManager().beginTransaction()
38 | .add(com.android.settingslib.collapsingtoolbar.R.id.content_frame, mSoundControlSettingsFragment)
39 | .commit();
40 | } else {
41 | mSoundControlSettingsFragment = (SoundControlSettings) fragment;
42 | }
43 | }
44 |
45 | @Override
46 | public boolean onOptionsItemSelected(MenuItem item) {
47 | if (item.getItemId() == android.R.id.home) {
48 | finish();
49 | return true;
50 | }
51 | return super.onOptionsItemSelected(item);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/audio/utils/SecureSettingCustomSeekBarPreference.java:
--------------------------------------------------------------------------------
1 | package org.device.RealmeParts.audio.utils;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 |
6 | public class SecureSettingCustomSeekBarPreference extends CustomSeekBarPreference {
7 |
8 | public SecureSettingCustomSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
9 | super(context, attrs, defStyleAttr, defStyleRes);
10 | setPreferenceDataStore(new SecureSettingsStore(context.getContentResolver()));
11 | }
12 |
13 | public SecureSettingCustomSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr) {
14 | super(context, attrs, defStyleAttr);
15 | setPreferenceDataStore(new SecureSettingsStore(context.getContentResolver()));
16 | }
17 |
18 | public SecureSettingCustomSeekBarPreference(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | setPreferenceDataStore(new SecureSettingsStore(context.getContentResolver()));
21 | }
22 |
23 | public SecureSettingCustomSeekBarPreference(Context context) {
24 | super(context);
25 | setPreferenceDataStore(new SecureSettingsStore(context.getContentResolver()));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/kcal/KcalService.java:
--------------------------------------------------------------------------------
1 | package org.device.RealmeParts.kcal;
2 |
3 | import android.app.Service;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.SharedPreferences;
7 | import android.os.IBinder;
8 | import androidx.preference.PreferenceManager;
9 |
10 | import org.device.RealmeParts.kcal.DisplayCalibration;
11 |
12 | public class KcalService extends Service {
13 |
14 | @Override
15 | public void onCreate() {
16 | // Code to execute when the service is first created
17 | }
18 |
19 | @Override
20 | public int onStartCommand(Intent intent, int flags, int startId) {
21 | Context context = getApplicationContext();
22 | DisplayCalibration.restore(context);
23 | return START_NOT_STICKY;
24 | }
25 |
26 | @Override
27 | public IBinder onBind(Intent intent) {
28 | return null;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/kcal/utils/NonScrollListView.java:
--------------------------------------------------------------------------------
1 | package org.device.RealmeParts.kcal.utils;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.ListView;
8 |
9 | public class NonScrollListView extends ListView {
10 |
11 | public NonScrollListView(Context context) {
12 | super(context);
13 | }
14 | public NonScrollListView(Context context, AttributeSet attrs) {
15 | super(context, attrs);
16 | }
17 | public NonScrollListView(Context context, AttributeSet attrs, int defStyle) {
18 | super(context, attrs, defStyle);
19 | }
20 | @Override
21 | public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
22 | int heightMeasureSpec_custom = View.MeasureSpec.makeMeasureSpec(
23 | Integer.MAX_VALUE >> 2, View.MeasureSpec.AT_MOST);
24 | super.onMeasure(widthMeasureSpec, heightMeasureSpec_custom);
25 | ViewGroup.LayoutParams params = getLayoutParams();
26 | params.height = getMeasuredHeight();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/speaker/ClearSpeakerActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 Paranoid Android
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.device.RealmeParts.speaker;
18 |
19 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
20 | import android.app.Fragment;
21 | import android.os.Bundle;
22 | import android.view.MenuItem;
23 |
24 | public class ClearSpeakerActivity extends CollapsingToolbarBaseActivity {
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 |
30 | Fragment fragment = getFragmentManager().findFragmentById(com.android.settingslib.collapsingtoolbar.R.id.content_frame);
31 | ClearSpeakerFragment clearSpeakerFragment;
32 | if (fragment == null) {
33 | clearSpeakerFragment = new ClearSpeakerFragment();
34 | getFragmentManager().beginTransaction()
35 | .add(com.android.settingslib.collapsingtoolbar.R.id.content_frame, clearSpeakerFragment)
36 | .commit();
37 | }
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/vibrator/VibratorSettingsActivity.java:
--------------------------------------------------------------------------------
1 | package org.device.RealmeParts.vibrator;
2 |
3 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
4 | import android.app.Fragment;
5 | import android.os.Bundle;
6 | import android.view.MenuItem;
7 |
8 | public class VibratorSettingsActivity extends CollapsingToolbarBaseActivity {
9 |
10 | private VibratorSettings mVibrateSettingsFragment;
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 |
16 | Fragment fragment = getFragmentManager().findFragmentById(com.android.settingslib.collapsingtoolbar.R.id.content_frame);
17 | if (fragment == null) {
18 | mVibrateSettingsFragment = new VibratorSettings();
19 | getFragmentManager().beginTransaction()
20 | .add(com.android.settingslib.collapsingtoolbar.R.id.content_frame, mVibrateSettingsFragment)
21 | .commit();
22 | } else {
23 | mVibrateSettingsFragment = (VibratorSettings) fragment;
24 | }
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/vibrator/utils/SecureSettingVibrationSeekBarPreference.java:
--------------------------------------------------------------------------------
1 | package org.device.RealmeParts.vibrator.utils;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 |
6 | public class SecureSettingVibrationSeekBarPreference extends VibrationSeekBarPreference {
7 |
8 | public SecureSettingVibrationSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
9 | super(context, attrs, defStyleAttr, defStyleRes);
10 | setPreferenceDataStore(new SecureSettingsStore(context.getContentResolver()));
11 | }
12 |
13 | public SecureSettingVibrationSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr) {
14 | super(context, attrs, defStyleAttr);
15 | setPreferenceDataStore(new SecureSettingsStore(context.getContentResolver()));
16 | }
17 |
18 | public SecureSettingVibrationSeekBarPreference(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | setPreferenceDataStore(new SecureSettingsStore(context.getContentResolver()));
21 | }
22 |
23 | public SecureSettingVibrationSeekBarPreference(Context context) {
24 | super(context);
25 | setPreferenceDataStore(new SecureSettingsStore(context.getContentResolver()));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/vibrator/utils/SecureSettingsStore.java:
--------------------------------------------------------------------------------
1 | package org.device.RealmeParts.vibrator.utils;
2 |
3 | import android.content.ContentResolver;
4 | import android.preference.PreferenceDataStore;
5 | import android.provider.Settings;
6 |
7 | public class SecureSettingsStore extends androidx.preference.PreferenceDataStore
8 | implements PreferenceDataStore {
9 |
10 | private final ContentResolver mContentResolver;
11 |
12 | public SecureSettingsStore(ContentResolver contentResolver) {
13 | mContentResolver = contentResolver;
14 | }
15 |
16 | public boolean getBoolean(String key, boolean defValue) {
17 | return getInt(key, defValue ? 1 : 0) != 0;
18 | }
19 |
20 | public float getFloat(String key, float defValue) {
21 | return Settings.Secure.getFloat(mContentResolver, key, defValue);
22 | }
23 |
24 | public int getInt(String key, int defValue) {
25 | return Settings.Secure.getInt(mContentResolver, key, defValue);
26 | }
27 |
28 | public long getLong(String key, long defValue) {
29 | return Settings.Secure.getLong(mContentResolver, key, defValue);
30 | }
31 |
32 | public String getString(String key, String defValue) {
33 | String result = Settings.Secure.getString(mContentResolver, key);
34 | return result == null ? defValue : result;
35 | }
36 |
37 | public void putBoolean(String key, boolean value) {
38 | putInt(key, value ? 1 : 0);
39 | }
40 |
41 | public void putFloat(String key, float value) {
42 | Settings.Secure.putFloat(mContentResolver, key, value);
43 | }
44 |
45 | public void putInt(String key, int value) {
46 | Settings.Secure.putInt(mContentResolver, key, value);
47 | }
48 |
49 | public void putLong(String key, long value) {
50 | Settings.Secure.putLong(mContentResolver, key, value);
51 | }
52 |
53 | public void putString(String key, String value) {
54 | Settings.Secure.putString(mContentResolver, key, value);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/RealmeParts/src/org/device/RealmeParts/vibrator/utils/VibrateFileUtils.java:
--------------------------------------------------------------------------------
1 | package org.device.RealmeParts.vibrator.utils;
2 |
3 | import java.io.File;
4 | import java.io.FileOutputStream;
5 | import java.io.IOException;
6 |
7 | public final class VibrateFileUtils {
8 |
9 | public static boolean fileWritable(String filename) {
10 | return fileExists(filename) && new File(filename).canWrite();
11 | }
12 |
13 | public static boolean fileExists(String filename) {
14 | if (filename == null) {
15 | return false;
16 | }
17 | return new File(filename).exists();
18 | }
19 |
20 | public static void setValue(String path, int value) {
21 | if (fileWritable(path)) {
22 | if (path == null) {
23 | return;
24 | }
25 | try {
26 | FileOutputStream fos = new FileOutputStream(new File(path));
27 | fos.write(Integer.toString(value).getBytes());
28 | fos.flush();
29 | fos.close();
30 | } catch (IOException e) {
31 | e.printStackTrace();
32 | }
33 | }
34 | }
35 |
36 | public static void setValue(String path, double value) {
37 | if (fileWritable(path)) {
38 | if (path == null) {
39 | return;
40 | }
41 | try {
42 | FileOutputStream fos = new FileOutputStream(new File(path));
43 | fos.write(Long.toString(Math.round(value)).getBytes());
44 | fos.flush();
45 | fos.close();
46 | } catch (IOException e) {
47 | e.printStackTrace();
48 | }
49 | }
50 | }
51 |
52 | public static void setValue(String path, String value) {
53 | if (fileWritable(path)) {
54 | if (path == null) {
55 | return;
56 | }
57 | try {
58 | FileOutputStream fos = new FileOutputStream(new File(path));
59 | fos.write(value.getBytes());
60 | fos.flush();
61 | fos.close();
62 | } catch (IOException e) {
63 | e.printStackTrace();
64 | }
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/configs/component-overrides.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/configs/media/system_properties.xml:
--------------------------------------------------------------------------------
1 |
2 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/configs/permissions/privapp_whitelist_org.device.Realmeparts.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
22 |
23 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/configs/public.libraries.txt:
--------------------------------------------------------------------------------
1 | libadsprpc.so
2 | libcdsprpc.so
3 | libsdsprpc.so
4 | libfastcvopt.so
5 | liblistensoundmodel2.so
6 | libOpenCL.so
7 | libOppoAlgoClient.so
8 | vendor.oppo.hardware.camera.oppoAlgoProcessService@1.0.so
9 | libOppoAPSMemMgr.so
10 | libstdc++.so
11 | libmidasserviceintf.so
12 |
--------------------------------------------------------------------------------
/configs/qti_whitelist_system_ext.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/derp_RMX1921.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2021-2022 The LineageOS Project
3 | #
4 | # SPDX-License-Identifier: Apache-2.0
5 | #
6 |
7 | # Inherit some common DerpFest stuff
8 | TARGET_BOOT_ANIMATION_RES := 1080
9 | EXTRA_UDFPS_ICONS := true
10 | $(call inherit-product, vendor/derp/config/common_full_phone.mk)
11 |
12 | # Official-ify
13 | DERP_BUILDTYPE := Official
14 |
15 | # Inherit from RMX1921 device
16 | $(call inherit-product, $(LOCAL_PATH)/device.mk)
17 |
18 | PRODUCT_BRAND := realme
19 | PRODUCT_DEVICE := RMX1921
20 | PRODUCT_MANUFACTURER := realme
21 | PRODUCT_NAME := derp_RMX1921
22 | PRODUCT_MODEL := RMX1921
23 |
24 | PRODUCT_GMS_CLIENTID_BASE := android-oppo
25 |
26 | PRODUCT_BUILD_PROP_OVERRIDES += \
27 | BuildDesc="RMX1921-user 11 RKQ1.201217.002 1651205774457 release-keys" \
28 | BuildFingerprint=realme/RMX1921/RMX1921:11/RKQ1.201217.002/1651205774457:user/release-keys \
29 | DeviceName=RMX1921 \
30 | DeviceProduct=RMX1921 \
31 | SystemDevice=RMX1921 \
32 | SystemName=RMX1921
33 |
--------------------------------------------------------------------------------
/doze/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 := RealmeDoze
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 | SettingsLib
24 |
25 | LOCAL_RESOURCE_DIR := \
26 | $(LOCAL_PATH)/res
27 |
28 | LOCAL_PROGUARD_FLAG_FILES := proguard.flags
29 |
30 | include $(BUILD_PACKAGE)
31 |
--------------------------------------------------------------------------------
/doze/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
33 |
34 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
46 |
47 |
48 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/doze/proguard.flags:
--------------------------------------------------------------------------------
1 | -keep class ** extends androidx.preference.PreferenceFragment
2 | -keep class org.lineageos.settings.doze.* {
3 | *;
4 | }
5 |
--------------------------------------------------------------------------------
/doze/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 = "RealmeDoze";
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 |
--------------------------------------------------------------------------------
/doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015-2016 The CyanogenMod Project
3 | * 2017 The LineageOS Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.lineageos.settings.doze;
19 |
20 | import android.os.Bundle;
21 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
22 |
23 | public class DozeSettingsActivity extends CollapsingToolbarBaseActivity {
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(
32 | com.android.settingslib.collapsingtoolbar.R.id.content_frame,
33 | new DozeSettingsFragment(), TAG_DOZE).commit();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/extract-files.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # SPDX-FileCopyrightText: 2016 The CyanogenMod Project
4 | # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | set -e
9 |
10 | DEVICE=RMX1921
11 | VENDOR=realme
12 |
13 | # Load extract_utils and do some sanity checks
14 | MY_DIR="${BASH_SOURCE%/*}"
15 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
16 |
17 | ANDROID_ROOT="${MY_DIR}/../../.."
18 |
19 | export TARGET_ENABLE_CHECKELF=false
20 |
21 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
22 | if [ ! -f "${HELPER}" ]; then
23 | echo "Unable to find helper script at ${HELPER}"
24 | exit 1
25 | fi
26 | source "${HELPER}"
27 |
28 | # Default to sanitizing the vendor folder before extraction
29 | CLEAN_VENDOR=true
30 |
31 | KANG=
32 | SECTION=
33 |
34 | while [ "${#}" -gt 0 ]; do
35 | case "${1}" in
36 | -n | --no-cleanup )
37 | CLEAN_VENDOR=false
38 | ;;
39 | -k | --kang )
40 | KANG="--kang"
41 | ;;
42 | -s | --section )
43 | SECTION="${2}"; shift
44 | CLEAN_VENDOR=false
45 | ;;
46 | * )
47 | SRC="${1}"
48 | ;;
49 | esac
50 | shift
51 | done
52 |
53 | if [ -z "${SRC}" ]; then
54 | SRC="adb"
55 | fi
56 |
57 | function blob_fixup() {
58 | case "${1}" in
59 | odm/lib64/mediadrm/libwvdrmengine.so|odm/lib64/libwvhidl.so)
60 | [ "$2" = "" ] && return 0
61 | grep -q libcrypto_shim.so "${2}" || "${PATCHELF}" --add-needed "libcrypto_shim.so" "${2}"
62 | ;;
63 | vendor/etc/seccomp_policy/atfwd@2.0.policy)
64 | [ "$2" = "" ] && return 0
65 | echo 'gettid: 1' >> ${2}
66 | ;;
67 | vendor/lib64/hw/camera.qcom.so)
68 | [ "$2" = "" ] && return 0
69 | grep -q libcamera_metadata_shim.so "${2}" || "${PATCHELF}" --add-needed libcamera_metadata_shim.so "${2}"
70 | ;;
71 | *)
72 | return 1
73 | ;;
74 | esac
75 |
76 | return 0
77 | }
78 |
79 | function blob_fixup_dry() {
80 | blob_fixup "$1" ""
81 | }
82 |
83 | # Initialize the helper
84 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}"
85 |
86 | extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
87 |
88 | "${MY_DIR}/setup-makefiles.sh"
89 |
--------------------------------------------------------------------------------
/fingerprint/Android.bp:
--------------------------------------------------------------------------------
1 | cc_binary {
2 | name: "android.hardware.biometrics.fingerprint@2.3-service.xt",
3 | defaults: ["hidl_defaults"],
4 | init_rc: ["android.hardware.biometrics.fingerprint@2.3-service.xt.rc"],
5 | vintf_fragments: ["android.hardware.biometrics.fingerprint@2.3-service.xt.xml"],
6 | relative_install_path: "hw",
7 | srcs: [
8 | "BiometricsFingerprint.cpp",
9 | "service.cpp",
10 | ],
11 | cflags: [
12 | "-Wno-unused-parameter",
13 | ],
14 | shared_libs: [
15 | "libcutils",
16 | "liblog",
17 | "libhidlbase",
18 | "libhardware",
19 | "libutils",
20 | "libbase",
21 | "android.hardware.biometrics.fingerprint@2.1",
22 | "android.hardware.biometrics.fingerprint@2.2",
23 | "android.hardware.biometrics.fingerprint@2.3",
24 | "vendor.oppo.hardware.biometrics.fingerprint@2.1",
25 | ],
26 | vendor: true,
27 | }
28 |
29 | cc_library_static {
30 | name: "libudfps_extension.xt",
31 | srcs: ["UdfpsExtension.cpp"],
32 | include_dirs: [
33 | "frameworks/native/services/surfaceflinger/CompositionEngine/include",
34 | ],
35 | header_libs: [
36 | "generated_kernel_headers",
37 | ],
38 | }
39 |
--------------------------------------------------------------------------------
/fingerprint/UdfpsExtension.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 | #include
19 |
20 | uint32_t getUdfpsDimZOrder(uint32_t z) {
21 | return z;
22 | }
23 |
24 | uint32_t getUdfpsZOrder(uint32_t z, bool touched) {
25 | return touched ? z | FOD_PRESSED_LAYER_ZORDER : z;
26 | }
27 |
28 | uint64_t getUdfpsUsageBits(uint64_t usageBits, bool) {
29 | return usageBits;
30 | }
31 |
--------------------------------------------------------------------------------
/fingerprint/android.hardware.biometrics.fingerprint@2.3-service.xt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.biometrics.fingerprint
4 | hwbinder
5 | @2.3::IBiometricsFingerprint/default
6 |
7 |
8 |
--------------------------------------------------------------------------------
/fingerprint/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 "android.hardware.biometrics.fingerprint@2.3-service.xt"
18 |
19 | #include
20 | #include
21 |
22 | #include "BiometricsFingerprint.h"
23 |
24 | using android::hardware::biometrics::fingerprint::V2_3::IBiometricsFingerprint;
25 | using android::hardware::biometrics::fingerprint::V2_3::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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/gps/gps.conf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/gps/gps.conf
--------------------------------------------------------------------------------
/gps/lowi.conf:
--------------------------------------------------------------------------------
1 | #*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
2 | #
3 | # LOWI Config file - default
4 | #
5 | # GENERAL DESCRIPTION
6 | # This file contains the config params for LOWI
7 | #
8 | # Copyright (c) 2019 Qualcomm Technologies, Inc.
9 | # All Rights Reserved.
10 | # Confidential and Proprietary - Qualcomm Technologies, Inc.
11 | #
12 | # 2012-2013 Qualcomm Atheros, Inc.
13 | # All Rights Reserved.
14 | # Qualcomm Atheros Confidential and Proprietary.
15 | #
16 | # Export of this technology or software is regulated by the U.S. Government.
17 | # Diversion contrary to U.S. law prohibited.
18 | #=============================================================================*/
19 |
20 | # X86 ONLY - UBUNTU:
21 | # Copy this file in the same directory where the executable is
22 |
23 | # Log level
24 | # EL_LOG_OFF = 0, EL_ERROR = 1, EL_WARNING = 2, EL_INFO = 3, EL_DEBUG = 4, EL_VERBOSE = 5, EL_LOG_ALL = 100
25 | LOWI_LOG_LEVEL = 3
26 | LOWI_USE_LOWI_LP = 0
27 |
28 |
--------------------------------------------------------------------------------
/init/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2019 The LineageOS Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | cc_library_static {
18 | name: "libinit_RMX1921",
19 | recovery_available: true,
20 | srcs: ["init_RMX1921.cpp"],
21 | whole_static_libs: ["libbase"],
22 | include_dirs: [
23 | "system/libbase/include",
24 | "system/core/init"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/interfaces/vendor/Android.bp:
--------------------------------------------------------------------------------
1 | hidl_package_root {
2 | name: "vendor.oppo",
3 | path: "device/realme/RMX1921/interfaces/vendor",
4 | }
5 |
--------------------------------------------------------------------------------
/interfaces/vendor/hardware/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",
6 | srcs: [
7 | "IBiometricsFingerprint.hal",
8 | "IBiometricsFingerprintClientCallback.hal",
9 | "types.hal",
10 | ],
11 | interfaces: [
12 | "android.hidl.base@1.0",
13 | ],
14 | gen_java: true,
15 | }
16 |
--------------------------------------------------------------------------------
/interfaces/vendor/hardware/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 | };
44 |
--------------------------------------------------------------------------------
/interfaces/vendor/update-makefiles.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | source $ANDROID_BUILD_TOP/system/tools/hidl/update-makefiles-helper.sh
4 |
5 | do_makefiles_update \
6 | "vendor.oppo:device/realme/RMX1921/interfaces/vendor"
7 |
--------------------------------------------------------------------------------
/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/Android.bp:
--------------------------------------------------------------------------------
1 | cc_binary {
2 | name: "android.hardware.lights-service.realme_sdm710",
3 | init_rc: ["android.hardware.lights-service.realme_sdm710.rc"],
4 | vintf_fragments: ["lights.xml"],
5 | relative_install_path: "hw",
6 | shared_libs: [
7 | "libbase",
8 | "libbinder_ndk",
9 | "android.hardware.light-V2-ndk",
10 | ],
11 | srcs: [
12 | "Light.cpp",
13 | "service.cpp",
14 | ],
15 | proprietary: true,
16 | overrides: [
17 | "lights.qcom",
18 | "android.hardware.lights-service.qti",
19 | ],
20 | }
21 |
--------------------------------------------------------------------------------
/light/Light.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #pragma once
18 |
19 | #include
20 |
21 | using ::aidl::android::hardware::light::HwLightState;
22 | using ::aidl::android::hardware::light::HwLight;
23 | using ::aidl::android::hardware::light::LightType;
24 | using ::aidl::android::hardware::light::BnLights;
25 |
26 | namespace aidl {
27 | namespace android {
28 | namespace hardware {
29 | namespace light {
30 |
31 | class Lights : public BnLights {
32 | public:
33 | ndk::ScopedAStatus setLightState(int id, const HwLightState& state) override;
34 | ndk::ScopedAStatus getLights(std::vector* types) override;
35 | private:
36 | uint32_t RgbaToBrightness(uint32_t color);
37 | bool WriteToFile(const std::string& path, uint32_t content);
38 | };
39 |
40 | } // namespace light
41 | } // namespace hardware
42 | } // namespace android
43 | } // namespace aidl
44 |
--------------------------------------------------------------------------------
/light/android.hardware.lights-service.realme_sdm710.rc:
--------------------------------------------------------------------------------
1 | service vendor.lights /vendor/bin/hw/android.hardware.lights-service.realme_sdm710
2 | class hal
3 | user system
4 | group system
5 | shutdown critical
6 |
--------------------------------------------------------------------------------
/light/lights.xml:
--------------------------------------------------------------------------------
1 |
28 |
29 |
30 | android.hardware.light
31 | 2
32 | ILights/default
33 |
34 |
35 |
--------------------------------------------------------------------------------
/light/service.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include "Light.h"
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | using ::aidl::android::hardware::light::Lights;
24 |
25 | int main() {
26 | ABinderProcess_setThreadPoolMaxThreadCount(0);
27 | std::shared_ptr lights = ndk::SharedRefBase::make();
28 |
29 | const std::string instance = std::string() + Lights::descriptor + "/default";
30 | binder_status_t status = AServiceManager_addService(lights->asBinder().get(), instance.c_str());
31 | CHECK(status == STATUS_OK);
32 |
33 | ABinderProcess_joinThreadPool();
34 | return EXIT_FAILURE; // should not reached
35 | }
36 |
--------------------------------------------------------------------------------
/odm.prop:
--------------------------------------------------------------------------------
1 | # QC framework value-adds
2 | ro.vendor.qti.va_odm.support=1
3 |
--------------------------------------------------------------------------------
/odm_manifests/manifest_RMX1921.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | android.hardware.secure_element
5 | hwbinder
6 | 1.2
7 | ISecureElement
8 | SIM1
9 | SIM2
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/odm_manifests/manifest_RMX1921EU.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.nfc
4 | hwbinder
5 | 1.2
6 |
7 | INfc
8 | default
9 |
10 |
11 |
12 | vendor.nxp.hardware.nfc
13 | hwbinder
14 | 1.1
15 |
16 | INqNfc
17 | default
18 |
19 |
20 |
21 | vendor.nxp.nxpnfc
22 | hwbinder
23 | 1.0
24 |
25 | INxpNfc
26 | default
27 |
28 |
29 |
30 | vendor.nxp.nxpese
31 | hwbinder
32 | 1.0
33 |
34 | INxpEse
35 | default
36 |
37 |
38 |
39 | android.hardware.secure_element
40 | hwbinder
41 | 1.2
42 |
43 | ISecureElement
44 | SIM1
45 | SIM2
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/overlay-lineage/frameworks/base/packages/SystemUI/res/values/lineage_config.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 | #00ffffff
17 |
18 |
19 | 1
20 |
21 |
22 |
--------------------------------------------------------------------------------
/overlay-lineage/packages/apps/Dialer/java/com/android/dialer/callrecord/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | true
19 | 4
20 |
21 |
--------------------------------------------------------------------------------
/overlay-lineage/packages/apps/Dialer/java/com/android/incallui/res/values/aosip_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | false
20 |
21 |
--------------------------------------------------------------------------------
/overlay-lineage/packages/apps/Flash/app/src/main/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | true
9 |
10 |
11 |
12 | - 5
13 | - 6
14 | - 7
15 |
16 |
17 |
40 |
41 | - 0
- sd|hd|fhd|uhd
- 60
42 | - 1
- sd|hd|fhd
- 30
43 | - 2
- sd|hd|fhd
- 30
44 |
45 |
46 |
--------------------------------------------------------------------------------
/overlay-lineage/packages/apps/Settings/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | - 78.59%
16 |
17 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/core/res/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 16dp
20 |
21 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 | true
22 |
23 |
24 | realme XT
25 |
26 |
27 | true
28 |
29 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/drawable-nodpi/udfps_icon_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DerpFest-Devices/device_realme_RMX1921/b394c8cc69bd84a1b7d1823f5502f9c26aa3a7f8/overlay/frameworks/base/packages/SystemUI/res/drawable-nodpi/udfps_icon_pressed.png
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded_corner_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded_corner_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | 13dp
22 |
23 | 50.0px
24 |
25 |
26 | 25dp
27 |
28 |
29 | 250dp
30 | 6dp
31 |
32 |
33 | 860px
34 |
35 |
37 | - 63.17
38 |
39 |
40 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
21 |
22 |
23 | 6
24 |
25 | 6
26 |
27 | 6
28 |
29 |
--------------------------------------------------------------------------------
/overlay/packages/apps/DocumentsUI/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 | true
20 |
21 |
--------------------------------------------------------------------------------
/overlay/packages/apps/FaceUnlockService/app/src/main/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 |
5 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Settings/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
23 |
24 | - 0
25 | - -1
26 | - -1
27 |
28 |
29 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Settings/res/values/derp_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
22 |
23 |
24 |
25 | false
26 |
27 |
41 | 3
42 |
43 |
44 | 105
45 |
46 |
47 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Settings/res/values/derp_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | Kader Bava (@Bava7325)
16 | https://t.me/Bava7325
17 |
18 |
19 |
--------------------------------------------------------------------------------
/overlay/packages/apps/SimpleDeviceConfig/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 | - activity_manager/use_compaction=true
18 |
19 |
20 | - activity_manager/max_cached_processes=64
21 |
22 |
23 |
--------------------------------------------------------------------------------
/overlay/packages/services/DeviceAsWebcam/res/raw/ignored_v4l2_nodes.json:
--------------------------------------------------------------------------------
1 | [
2 | "/dev/video0",
3 | "/dev/video1",
4 | "/dev/video2",
5 | "/dev/video32",
6 | "/dev/video33"
7 | ]
8 |
--------------------------------------------------------------------------------
/overlay/packages/services/DeviceAsWebcam/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 | true
19 |
20 |
--------------------------------------------------------------------------------
/overlay/packages/services/Telephony/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 |
20 |
22 | 1
23 |
24 |
25 | true
26 |
27 |
28 | true
29 |
30 |
33 | true
34 |
35 |
39 |
40 | true
41 |
42 |
43 | org.codeaurora.ims
44 |
45 |
46 | vendor.qti.imsrcs
47 |
48 |
49 | false
50 |
51 |
--------------------------------------------------------------------------------
/product.prop:
--------------------------------------------------------------------------------
1 | # App Launch Blur
2 | ro.launcher.blur.appLaunch=0
3 |
4 | # IMS
5 | ro.telephony.block_binder_thread_on_incoming_calls=false
6 |
7 | # Seamless transfer
8 | sys.fflag.override.settings_seamless_transfer=true
9 |
--------------------------------------------------------------------------------
/proximityservice/Android.bp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 Harshit Jain
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 | android_app {
18 | name: "RealmeProximityHelper",
19 |
20 | srcs: ["src/**/*.java"],
21 |
22 | manifest: "AndroidManifest.xml",
23 |
24 | platform_apis: true,
25 | certificate: "platform",
26 | privileged: true,
27 |
28 | optimize: {
29 | proguard_flags_files: ["proguard.flags"],
30 | },
31 | }
--------------------------------------------------------------------------------
/proximityservice/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/proximityservice/Readme.md:
--------------------------------------------------------------------------------
1 | ### STK_ST2x2x Proximity (Infrared) sensor helper service
2 | This repository contains source code implemented as a service to handle the events
3 | from Sensortek's stk_st2x2x proximity sensor on events like incall-ui and the other
4 | possible cases where a fake panel blank is applied by the android framework and the
5 | touchpanel proximity sensor (tp_proximity) stops sending event due to the suspended touchpanel caused by powermanager framework setting a non interactive state.
--------------------------------------------------------------------------------
/proximityservice/proguard.flags:
--------------------------------------------------------------------------------
1 | -keep class co.hyper.proximityservice.* {
2 | *;
3 | }
4 |
--------------------------------------------------------------------------------
/proximityservice/src/co/hyper/proximityservice/BootCompletedReceiver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020 Harshit Jain
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 | * Purpose: BootCompleteReciever bootstrap class, allows RealmeProximityService
17 | * class to hook in and start the required listeners.
18 | *
19 | */
20 |
21 | package co.hyper.proximityservice;
22 |
23 | import android.content.BroadcastReceiver;
24 | import android.content.Context;
25 | import android.content.Intent;
26 | import android.util.Log;
27 |
28 | public class BootCompletedReceiver extends BroadcastReceiver {
29 | private static final String TAG = "RealmeProximityHelper";
30 | private static final boolean DEBUG = false;
31 |
32 | @Override
33 | public void onReceive(final Context context, Intent intent) {
34 | if (DEBUG) Log.d(TAG, "Starting");
35 | context.startService(new Intent(context, RealmeProximityHelperService.class));
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/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_Assertions(info):
21 | OTA_Assertions(info)
22 | return
23 |
24 | def IncrementalOTA_Assertions(info):
25 | OTA_Assertions(info)
26 | return
27 |
28 | def FullOTA_InstallEnd(info):
29 | OTA_InstallEnd(info)
30 | return
31 |
32 | def IncrementalOTA_InstallEnd(info):
33 | OTA_InstallEnd(info)
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_Assertions(info):
47 | info.script.AppendExtra('assert(getprop("ro.device.latest_fw") == "true" || abort("Older firmware detected. Kindly update firmware to realme UI 2 and retry flashing."););');
48 | return
49 |
50 | def OTA_InstallEnd(info):
51 | AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo")
52 | AddImage(info, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta")
53 | return
54 |
--------------------------------------------------------------------------------
/remove_packages/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 | LOCAL_MODULE := RemovePackages
5 | LOCAL_MODULE_CLASS := APPS
6 | LOCAL_MODULE_TAGS := optional
7 | LOCAL_OVERRIDES_PACKAGES := GoogleCamera CalendarGoogle Drive Maps Photos Gmail2 FilesGoogle PersonalSafety talkback YouTube
8 | LOCAL_UNINSTALLABLE_MODULE := true
9 | LOCAL_CERTIFICATE := PRESIGNED
10 | LOCAL_SRC_FILES := /dev/null
11 | include $(BUILD_PREBUILT)
12 |
--------------------------------------------------------------------------------
/reorder-libs.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # Copyright (C) 2021 The LineageOS Project
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | from functools import cmp_to_key
9 | from locale import LC_ALL, setlocale, strcoll
10 | from pathlib import Path
11 |
12 | FILES = [Path(file) for file in [
13 | "proprietary-files.txt",
14 | ]]
15 |
16 | setlocale(LC_ALL, "C")
17 |
18 | def strcoll_extract_utils(string1: str, string2: str) -> int:
19 | # Skip logic if one of the string if empty
20 | if not string1 or not string2:
21 | return strcoll(string1, string2)
22 |
23 | # Remove '-' from strings if there,
24 | # it is used to indicate a build target
25 | string1 = string1.removeprefix('-')
26 | string2 = string2.removeprefix('-')
27 |
28 | # If no directories, compare normally
29 | if not "/" in string1 and not "/" in string2:
30 | return strcoll(string1, string2)
31 |
32 | string1_dir = string1.rsplit("/", 1)[0] + "/"
33 | string2_dir = string2.rsplit("/", 1)[0] + "/"
34 | if string1_dir == string2_dir:
35 | # Same directory, compare normally
36 | return strcoll(string1, string2)
37 |
38 | if string1_dir.startswith(string2_dir):
39 | # First string dir is a subdirectory of the second one,
40 | # return string1 > string2
41 | return -1
42 |
43 | if string2_dir.startswith(string1_dir):
44 | # Second string dir is a subdirectory of the first one,
45 | # return string2 > string1
46 | return 1
47 |
48 | # Compare normally
49 | return strcoll(string1, string2)
50 |
51 | for file in FILES:
52 | if not file.is_file():
53 | print(f"File {str(file)} not found")
54 | continue
55 |
56 | with open(file, 'r') as f:
57 | sections = f.read().split("\n\n")
58 |
59 | ordered_sections = []
60 | for section in sections:
61 | section_list = [line.strip() for line in section.splitlines()]
62 | section_list.sort(key=cmp_to_key(strcoll_extract_utils))
63 | ordered_sections.append("\n".join(section_list))
64 |
65 | with open(file, 'w') as f:
66 | f.write("\n\n".join(ordered_sections).strip() + "\n")
67 |
--------------------------------------------------------------------------------
/rootdir/bin/init.qcom.early_boot.sh:
--------------------------------------------------------------------------------
1 | #! /vendor/bin/sh
2 |
3 | # Copyright (c) 2012-2013,2016,2018-2020 The Linux Foundation. All rights reserved.
4 | #
5 | # Redistribution and use in source and binary forms, with or without
6 | # modification, are permitted provided that the following conditions are 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 | boot_reason=`cat /proc/sys/kernel/boot_reason`
31 | reboot_reason=`getprop ro.boot.alarmboot`
32 | if [ "$boot_reason" = "3" ] || [ "$reboot_reason" = "true" ]; then
33 | setprop ro.vendor.alarm_boot true
34 | else
35 | setprop ro.vendor.alarm_boot false
36 | fi
37 |
--------------------------------------------------------------------------------
/rootdir/bin/init.qti.chg_policy.sh:
--------------------------------------------------------------------------------
1 | #! /vendor/bin/sh
2 |
3 | #
4 | # Copyright (c) 2019-2020 Qualcomm Technologies, Inc.
5 | # All Rights Reserved.
6 | # Confidential and Proprietary - Qualcomm Technologies, Inc.
7 | #
8 | # Copyright (c) 2019 The Linux Foundation. All rights reserved.
9 | #
10 |
11 | export PATH=/vendor/bin
12 |
13 | soc_id=`getprop ro.vendor.qti.soc_id`
14 | if [ "$soc_id" -eq 415 ] || [ "$soc_id" -eq 439 ] || [ "$soc_id" -eq 450 ] || [ "$soc_id" -eq 475 ]; then
15 | setprop persist.vendor.hvdcp_opti.start 2
16 | exit 0
17 | fi
18 |
19 | if [ "$soc_id" -eq 441 ] || [ "$soc_id" -eq 471 ]; then
20 | #Scuba does not support usb-pd or charge pumps
21 | find /sys/class/power_supply/battery/ -type f -maxdepth 1 | xargs chown system.system
22 | find /sys/class/power_supply/bms/ -type f -maxdepth 1 | xargs chown system.system
23 | find /sys/class/power_supply/main/ -type f -maxdepth 1 | xargs chown system.system
24 | find /sys/class/power_supply/usb/ -type f -maxdepth 1 | xargs chown system.system
25 | else
26 | find /sys/class/power_supply/battery/ -type f -maxdepth 1 | xargs chown system.system
27 | find /sys/class/power_supply/bms/ -type f -maxdepth 1 | xargs chown system.system
28 | find /sys/class/power_supply/main/ -type f -maxdepth 1 | xargs chown system.system
29 | find /sys/class/power_supply/usb/ -type f -maxdepth 1 | xargs chown system.system
30 | find /sys/class/power_supply/charge_pump_master/ -type f -maxdepth 1 | xargs chown system.system
31 | find /sys/class/power_supply/pc_port/ -type f -maxdepth 1 | xargs chown system.system
32 | find /sys/class/power_supply/dc/ -type f -maxdepth 1 | xargs chown system.system
33 | find /sys/class/power_supply/parallel/ -type f -maxdepth 1 | xargs chown system.system
34 | find /sys/class/usbpd/usbpd0/ -type f -maxdepth 1 | xargs chown system.system
35 | find /sys/class/qc-vdm/ -type f -maxdepth 1 | xargs chown system.system
36 | find /sys/class/charge_pump/ -type f -maxdepth 1 | xargs chown system.system
37 | find /sys/class/qcom-battery/ -type f -maxdepth 1 | xargs chown system.system
38 |
39 | for i in 0 1 2 3 4 5 6 7 8 9
40 | do
41 | devname=`cat /sys/bus/iio/devices/iio:device$i/name`
42 | if [[ "$devname" == *smb* ]] || [[ "$devname" == *qg* ]] || [[ "$devname" == *div2_cp* ]]; then
43 | find /sys/bus/iio/devices/iio:device$i/ -type f -maxdepth 1 | xargs chown system.system
44 | fi
45 | done
46 | fi
47 |
48 | setprop persist.vendor.hvdcp_opti.start 1
49 |
--------------------------------------------------------------------------------
/rootdir/etc/init.oppo.rc:
--------------------------------------------------------------------------------
1 | on boot
2 | # Disable edge limit control interface
3 | chmod 0660 /proc/touchpanel/oplus_tp_limit_enable
4 | chmod 0660 /proc/touchpanel/oplus_tp_direction
5 | chmod 0660 /proc/touchpanel/game_switch_enable
6 | chown system system /proc/touchpanel/oplus_tp_limit_enable
7 | chown system system /proc/touchpanel/oplus_tp_direction
8 | chown system system /proc/touchpanel/game_switch_enable
9 | write /proc/touchpanel/oplus_tp_limit_enable 0
10 | write /proc/touchpanel/oplus_tp_direction 1
11 | write /proc/touchpanel/game_switch_enable 1
12 |
13 | # Enable OTG by default
14 | write /sys/class/power_supply/usb/otg_switch 1
15 |
16 | # TP FW Update
17 | write /proc/touchpanel/tp_fw_update 0
18 |
19 | # Charger
20 | chown system system /sys/class/power_supply/battery/mmi_charging_enable
21 |
22 | # FPC Fingerprint 16051 config
23 | chown system system /sys/bus/platform/devices/soc:fpc_fpc1020*/irq
24 | chown system system /sys/bus/platform/devices/soc:fpc_fpc1020*/irq_enable
25 | chown system system /sys/bus/platform/devices/soc:fpc_fpc1020*/wakelock_enable
26 |
27 | # FPC Fingerprint 16037 config
28 | chown system system /sys/bus/platform/devices/fpc_fpc1020*/irq
29 | chown system system /sys/bus/platform/devices/fpc_fpc1020*/irq_enable
30 | chown system system /sys/bus/platform/devices/fpc_fpc1020*/wakelock_enable
31 |
32 | # Silead Fingerprint
33 | chown system system /dev/silead_fp
34 | chmod 0666 /dev/silead_fp
35 |
36 | service vendor.sensors-hal-2-0-multihal /vendor/bin/hw/android.hardware.sensors@2.0-service.multihal
37 | override
38 | class hal
39 | user system
40 | group system wakelock context_hub input
41 | writepid /dev/cpuset/system-background/tasks
42 | capabilities BLOCK_SUSPEND
43 | rlimit rtprio 10 10
44 |
--------------------------------------------------------------------------------
/rootdir/etc/init.recovery.qcom.rc:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2017-2018,2020-2021 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 | setprop sys.usb.configfs 1
31 |
32 | on property:ro.boot.prjname=*
33 | # Asserts for stock ROM flash
34 | setprop ro.separate.soft ${ro.boot.prjname}
35 |
36 | on property:ro.boot.usbcontroller=*
37 | setprop sys.usb.controller ${ro.boot.usbcontroller}
38 | wait /sys/bus/platform/devices/${ro.boot.usb.dwc3_msm:-a600000.ssusb}/mode
39 | write /sys/bus/platform/devices/${ro.boot.usb.dwc3_msm:-a600000.ssusb}/mode peripheral
40 | wait /sys/class/udc/${ro.boot.usbcontroller} 1
41 |
42 | on fs
43 | wait /dev/block/platform/soc/${ro.boot.bootdevice}
44 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
45 |
--------------------------------------------------------------------------------
/rro_overlays/TetheringOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2020 The Android Open-Source Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | runtime_resource_overlay {
18 | name: "TetheringConfigOverlay",
19 | theme: "TetheringConfigOverlay",
20 | product_specific: true
21 | }
22 |
--------------------------------------------------------------------------------
/rro_overlays/TetheringOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/rro_overlays/WifiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | runtime_resource_overlay {
2 | name: "WifiOverlay",
3 | theme: "WifiOverlay",
4 | product_specific: true
5 | }
6 |
--------------------------------------------------------------------------------
/rro_overlays/WifiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/seccomp/mediaextractor.policy:
--------------------------------------------------------------------------------
1 | # device specific syscalls.
2 | # extension of services/mediaextractor/minijail/seccomp_policy/mediaextractor-seccomp-arm.policy
3 | readlinkat: 1
4 | pread64: 1
5 |
--------------------------------------------------------------------------------
/seccomp/mediaswcodec.policy:
--------------------------------------------------------------------------------
1 | # device specific syscalls
2 | # extension of frameworks/av/services/mediacodec/seccomp_policy/mediaswcodec-arm.policy
3 | sysinfo: 1
4 |
--------------------------------------------------------------------------------
/sensors/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2019 The Android Open Source Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | cc_binary {
17 | name: "android.hardware.sensors@2.0-service.multihal.xt",
18 | stem: "android.hardware.sensors@2.0-service.multihal",
19 | defaults: [
20 | "hidl_defaults",
21 | ],
22 | vendor: true,
23 | relative_install_path: "hw",
24 | srcs: [
25 | "HalProxy.cpp",
26 | "HalProxyCallback.cpp",
27 | "service.cpp",
28 | ],
29 | init_rc: ["android.hardware.sensors@2.0-service-multihal.rc"],
30 | vintf_fragments: ["android.hardware.sensors@2.0-multihal.xml"],
31 | header_libs: [
32 | "android.hardware.sensors@2.X-multihal.header",
33 | "android.hardware.sensors@2.X-shared-utils",
34 | ],
35 | shared_libs: [
36 | "android.hardware.sensors@2.0",
37 | "android.hardware.sensors@2.0-ScopedWakelock",
38 | "android.hardware.sensors@2.1",
39 | "libbase",
40 | "libcutils",
41 | "libfmq",
42 | "libhidlbase",
43 | "liblog",
44 | "libpower",
45 | "libutils",
46 | ],
47 | static_libs: [
48 | "android.hardware.sensors@1.0-convert",
49 | ],
50 | }
51 |
--------------------------------------------------------------------------------
/sensors/android.hardware.sensors@2.0-multihal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | android.hardware.sensors
4 | hwbinder
5 | 2.0
6 |
7 | ISensors
8 | default
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/sensors/android.hardware.sensors@2.0-service-multihal.rc:
--------------------------------------------------------------------------------
1 | service vendor.sensors-hal-2-0-multihal /vendor/bin/hw/android.hardware.sensors@2.0-service.multihal
2 | class hal
3 | user system
4 | group system wakelock context_hub input
5 | writepid /dev/cpuset/system-background/tasks
6 | capabilities BLOCK_SUSPEND
7 | rlimit rtprio 10 10
8 |
--------------------------------------------------------------------------------
/sensors/service.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 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 | #include
19 | #include
20 | #include
21 | #include "HalProxy.h"
22 |
23 | using android::hardware::configureRpcThreadpool;
24 | using android::hardware::joinRpcThreadpool;
25 | using android::hardware::sensors::V2_0::ISensors;
26 | using android::hardware::sensors::V2_1::implementation::HalProxyV2_0;
27 |
28 | int main(int /* argc */, char** /* argv */) {
29 | configureRpcThreadpool(1, true);
30 |
31 | android::sp halProxy = new HalProxyV2_0();
32 | if (halProxy->registerAsService() != ::android::OK) {
33 | ALOGE("Failed to register Sensors HAL instance");
34 | return -1;
35 | }
36 |
37 | joinRpcThreadpool();
38 | return 1; // joinRpcThreadpool shouldn't exit
39 | }
40 |
--------------------------------------------------------------------------------
/sepolicy/private/art_boot.te:
--------------------------------------------------------------------------------
1 | allow art_boot self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/private/dontaudit.te:
--------------------------------------------------------------------------------
1 | # b/148033913
2 | dontaudit fsck self:capability kill;
3 |
4 | # b/151195350
5 | dontaudit linkerconfig self:capability kill;
6 |
7 | # b/152468658
8 | dontaudit vdc self:capability kill;
9 |
10 | # Apps are no longer allowed open access to /dev/ashmem, unless they
11 | # target API level < Q.
12 | dontaudit untrusted_app ashmem_device:chr_file open;
13 |
--------------------------------------------------------------------------------
/sepolicy/private/fsverity_init.te:
--------------------------------------------------------------------------------
1 | allow fsverity_init self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/private/linkerconfig.te:
--------------------------------------------------------------------------------
1 | allow linkerconfig self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/private/odrefresh.te:
--------------------------------------------------------------------------------
1 | allow odrefresh self:capability { kill sys_admin };
2 |
--------------------------------------------------------------------------------
/sepolicy/private/permissioncontroller_app.te:
--------------------------------------------------------------------------------
1 | allow permissioncontroller_app tethering_service:service_manager find;
2 |
--------------------------------------------------------------------------------
/sepolicy/private/platform_app.te:
--------------------------------------------------------------------------------
1 | r_dir_file(platform_app, sysfs_zram)
2 | allow platform_app config_gz:file r_file_perms;
3 |
4 | # allow systemui to set boot animation colors
5 | set_prop(platform_app, bootanim_system_prop)
6 |
--------------------------------------------------------------------------------
/sepolicy/private/radio.te:
--------------------------------------------------------------------------------
1 | allow radio vendor_dpmd_socket:sock_file write;
2 |
--------------------------------------------------------------------------------
/sepolicy/private/system_app.te:
--------------------------------------------------------------------------------
1 | allow system_app vendor_wfd_service_prop:property_service {set};
2 |
--------------------------------------------------------------------------------
/sepolicy/private/vendor_boringssl_self_test.te:
--------------------------------------------------------------------------------
1 | allow vendor_boringssl_self_test self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/adbd.te:
--------------------------------------------------------------------------------
1 | allow adbd self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/adpl.te:
--------------------------------------------------------------------------------
1 | allow adpl diag_device:chr_file rw_file_perms;
2 |
--------------------------------------------------------------------------------
/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 | allow adsprpcd sysfs:file { getattr open read };
9 |
--------------------------------------------------------------------------------
/sepolicy/vendor/app.te:
--------------------------------------------------------------------------------
1 | get_prop(appdomain, vendor_camera_prop)
2 | get_prop(appdomain, persist_camera_prop)
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/cdsprpcd.te:
--------------------------------------------------------------------------------
1 | allow cdsprpcd xdsp_device:chr_file r_file_perms;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/cnd.te:
--------------------------------------------------------------------------------
1 | allow cnd diag_device:chr_file rw_file_perms;
2 | get_prop(cnd, wifi_hal_prop)
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/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 | # LED/LCD
27 | type sysfs_led_file, sysfs_type, fs_type;
28 | type sysfs_lcd_file, sysfs_type, fs_type;
29 |
30 | # Wakelock stats
31 | type proc_wakelocks, fs_type, proc_type;
32 |
33 | # Power stats
34 | type sysfs_iio, sysfs_type, fs_type;
35 | type sysfs_restart, sysfs_type, fs_type;
36 |
37 | # Smart Charging
38 | type sysfs_scharge, sysfs_type, fs_type;
39 |
40 | # Kcal
41 | type proc_kcal_file, sysfs_type, fs_type;
42 |
43 | # Audio control
44 | type sysfs_hgain, sysfs_type, fs_type;
45 | type sysfs_mgain, sysfs_type, fs_type;
46 |
47 | # Vibrator
48 | type proc_vibration_file, sysfs_type, fs_type;
49 |
50 | # I/O Scheduler
51 | type sysfs_io_sched_tuneable, fs_type, sysfs_type;
52 |
--------------------------------------------------------------------------------
/sepolicy/vendor/fsck.te:
--------------------------------------------------------------------------------
1 | dontaudit fsck self:capability { dac_override dac_read_search };
2 | allow fsck tmpfs:blk_file getattr;
3 | allow fsck modem_efs_partition_device:blk_file { ioctl open read write };
4 | allow fsck self:capability { sys_admin };
5 | allow fsck sysfs:file getattr;
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/gmscore_app.te:
--------------------------------------------------------------------------------
1 | allow gmscore_app vendor_default_prop:file { getattr map };
2 | binder_call(gmscore_app, hal_memtrack_default);
3 | dontaudit gmscore_app hal_memtrack_hwservice:hwservice_manager find;
4 | dontaudit gmscore_app hal_memtrack_hwservice:binder call;
5 |
--------------------------------------------------------------------------------
/sepolicy/vendor/gpuservice.te:
--------------------------------------------------------------------------------
1 | allow gpuservice graphics_config_prop:file read;
2 |
--------------------------------------------------------------------------------
/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, vendor_audio_prop);
5 |
6 | allow hal_audio_default sysfs:dir read;
7 | hal_client_domain(hal_audio_default, hal_power);
8 | allow hal_audio diag_device:chr_file rw_file_perms;
9 | allow hal_audio_default mnt_vendor_file:dir search;
10 | allow hal_audio_default persist_audio_file:dir search;
11 | allow hal_audio_default persist_audio_file:lnk_file read;
12 | r_dir_file(hal_audio_default, persist_audio_file);
13 | allow hal_audio_default sysfs:dir { read open };
14 | allow hal_audio_default proc_audio_file:file { read };
15 |
16 | dontaudit hal_audio_default default_prop:file { read open getattr };
17 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_bluetooth_qti.te:
--------------------------------------------------------------------------------
1 | allow hal_bluetooth_qti diag_device:chr_file rw_file_perms;
2 | allow hal_bluetooth_qti ramdump_vendor_data_file:dir rw_dir_perms;
3 |
--------------------------------------------------------------------------------
/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 open getattr };
3 | allow hal_camera_default persist_camera_file:file { setattr create open getattr };
4 | allow hal_camera_default proc:file rw_file_perms;
5 | allow hal_camera_default diag_device:chr_file rw_file_perms;
6 |
7 | get_prop(hal_camera_default, vendor_camera_prop);
8 | set_prop(hal_camera_default, vendor_camera_prop);
9 | r_dir_file(hal_camera_default, sysfs_net);
10 |
11 | allow hal_camera_default proc_oppoversion:dir search;
12 | allow hal_camera_default proc_meminfo:file { getattr open read };
13 | allow hal_camera_default proc_oppoversion:file { open read getattr };
14 | allow hal_camera_default unlabeled:dir { search };
15 | allow hal_camera_default oppo_debug_prop:file { read open getattr };
16 | allow hal_camera_default oppo_fingerprint_prop:file { read open getattr };
17 | allow hal_camera_default default_prop:file { map getattr };
18 | allow hal_camera_default radio_prop:file { getattr };
19 | dontaudit hal_camera_default radio_prop:file read;
20 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_capabilityconfigstore_qti_default.te:
--------------------------------------------------------------------------------
1 | allow hal_capabilityconfigstore_qti_default vendor_cap_configstore_dbg_prop:file { read open getattr };
2 |
--------------------------------------------------------------------------------
/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 | allow hal_fingerprint_default xdsp_device:chr_file r_file_perms;
7 |
8 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl;
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 | allow hal_fingerprint_default sysfs_graphics:dir search;
15 | allow hal_fingerprint_default sysfs_graphics:file rw_file_perms;
16 |
17 | get_prop(hal_fingerprint_default, oppo_debug_prop);
18 | get_prop(hal_fingerprint_default, adsprpc_prop);
19 |
20 | set_prop(hal_fingerprint_default, oppo_fingerprint_prop);
21 | set_prop(hal_fingerprint_default, oppo_debug_prop);
22 |
23 | allow hal_fingerprint_default dcs_hwservice:hwservice_manager find;
24 | allow hal_fingerprint_default sysfs_oppo_display:dir search;
25 | dontaudit hal_fingerprint_default default_android_hwservice:hwservice_manager find;
26 | dontaudit hal_fingerprint_default default_prop:file read;
27 | allow hal_fingerprint_default oppo_debug_prop:property_service set;
28 | allow hal_fingerprint_default sysfs_oppo_display:file { read open getattr write };
29 | allow hal_fingerprint_default system_suspend_hwservice:hwservice_manager find;
30 | allow hal_fingerprint_default system_suspend_hwservice:binder { call transfer };
31 | wakelock_use(hal_fingerprint_default)
32 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_gnss_qti.te:
--------------------------------------------------------------------------------
1 | allow hal_gnss_qti vendor_pd_locater_dbg_prop:file { read open getattr };
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_graphics_composer_default.te:
--------------------------------------------------------------------------------
1 | allow hal_graphics_composer_default diag_device:chr_file rw_file_perms;
2 | allow hal_graphics_composer_default bootanim_system_prop:file read;
3 | get_prop(hal_graphics_composer_default, bootanim_system_prop)
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_imsrtp.te:
--------------------------------------------------------------------------------
1 | allow hal_imsrtp diag_device:chr_file rw_file_perms;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_light_default.te:
--------------------------------------------------------------------------------
1 | allow hal_light_default sysfs:file { getattr open read write };
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_neuralnetworks_default.te:
--------------------------------------------------------------------------------
1 | get_prop(hal_neuralnetworks_default, oppo_debug_prop)
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_nfc_default.te:
--------------------------------------------------------------------------------
1 | dontaudit hal_nfc_default nfc_hwservice:hwservice_manager { find add };
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_power_default.te:
--------------------------------------------------------------------------------
1 | typeattribute hal_power_default mlstrustedsubject;
2 |
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 | allow hal_power_default appdomain:process { getsched setsched };
8 | allow hal_power_default self:capability sys_nice;
9 | allow hal_power_default system_server:process setsched;
10 | allow hal_power_default proc:{ file lnk_file } rw_file_perms;
11 | allow hal_power_default device_latency:chr_file rw_file_perms;
12 | allow hal_power_default sysfs_devices_system_cpu:{ file lnk_file } rw_file_perms;
13 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_power_stats_default.te:
--------------------------------------------------------------------------------
1 | allow hal_power_stats_default sysfs_iio:dir { open read getattr search };
2 | allow hal_power_stats_default sysfs_iio:file { open read getattr write };
3 | allow hal_power_stats_default sysfs_iio:lnk_file { open read getattr write };
4 | get_prop(hal_power_stats_default, wifi_hal_prop)
5 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_rcsservice.te:
--------------------------------------------------------------------------------
1 | allow hal_rcsservice diag_device:chr_file rw_file_perms;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_secure_element_default.te:
--------------------------------------------------------------------------------
1 | add_hwservice(hal_secure_element_default, nfc_hwservice);
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_sensors_default.te:
--------------------------------------------------------------------------------
1 | get_prop(hal_sensors_default, oppo_debug_prop)
2 | r_dir_file(hal_sensors_default, proc_touchpanel)
3 | get_prop(hal_sensors_default, sensors_prop)
4 | allow hal_sensors_default proc_touchpanel:file write;
5 | allow hal_sensors_default diag_device:chr_file rw_file_perms;
6 |
7 | # Read and write factory calibration and sensor configuration data
8 | allow hal_sensors_default persist_file:dir search;
9 | allow hal_sensors_default persist_file:lnk_file read;
10 | allow hal_sensors_default mnt_vendor_file:dir search;
11 | r_dir_file(hal_sensors_default, sensors_persist_file)
12 | allow hal_sensors_default sensors_vendor_data_file:dir create_dir_perms;
13 | allow hal_sensors_default sensors_vendor_data_file:file create_file_perms;
14 |
15 | # Interact with the sensors low power island (SLPI/ADSP) CPU
16 | allow hal_sensors_default self:qipcrtr_socket create_socket_perms_no_ioctl;
17 |
18 | vndbinder_use(hal_sensors_default);
19 | allow hal_sensors_default sysfs_ssr:file r_file_perms;
20 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_thermal_default.te:
--------------------------------------------------------------------------------
1 | allow hal_thermal_default sysfs_thermal:dir r_dir_perms;
2 | allow hal_thermal_default sysfs_thermal:file rw_file_perms;
3 | allow hal_thermal_default proc_stat:file r_file_perms;
4 |
5 | allow hal_thermal_default self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
6 |
7 | # read thermal config
8 | get_prop(hal_thermal_default, vendor_thermal_prop)
9 | allow hal_thermal_default self:capability sys_admin;
10 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_wifi_default.te:
--------------------------------------------------------------------------------
1 | set_prop(hal_wifi_default, vendor_wifi_prop)
2 | allow hal_wifi_default vendor_tombstone_data_file:dir { open search read };
3 | allow hal_wifi_default persist_vendor_debug_wifi_prop:file { open read getattr };
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_wifi_hostapd_default.te:
--------------------------------------------------------------------------------
1 | allow hal_wifi_hostapd_default wifi_vendor_data_file:dir { rw_dir_perms remove_name };
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/hal_wifi_supplicant_default.te:
--------------------------------------------------------------------------------
1 | allow hal_wifi_supplicant_default self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/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 | type hal_diag_hwservice, hwservice_manager_type;
5 |
--------------------------------------------------------------------------------
/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.oplus.hardware.appradio::IOplusAppRadio u:object_r:opporadio_hwservice:s0
17 | vendor.oplus.hardware.radio::IOplusRadio u:object_r:opporadio_hwservice:s0
18 | vendor.oplus.hardware.ims::IOplusImsRadio u:object_r:opporadio_hwservice:s0
19 |
20 | # Diaghal
21 | vendor.qti.diaghal::Idiag u:object_r:hal_diag_hwservice:s0
22 |
--------------------------------------------------------------------------------
/sepolicy/vendor/ims.te:
--------------------------------------------------------------------------------
1 | allow ims diag_device:chr_file { read write open getattr ioctl };
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/init.te:
--------------------------------------------------------------------------------
1 | allow init persist_file:lnk_file read;
2 | allow init socket_device:sock_file { create setattr unlink };
3 | allow init sysfs_battery_supply:file setattr;
4 | allow init sysfs_oppo_display:file rw_file_perms;
5 | allow init sysfs_oppo_display:file setattr;
6 | allow init hidl_base_hwservice:hwservice_manager add;
7 | allow init ion_device:chr_file { ioctl open read };
8 | allow init same_process_hal_file:file execute;
9 | allow init proc_touchpanel:file { setattr getattr open read write };
10 | allow init proc_oppoversion:dir search;
11 | allow init proc_oppoversion:file setattr;
12 | allow init proc_oppoversion:file rw_file_perms;
13 | allow init sysfs:file setattr;
14 | allow init bt_firmware_file:filesystem getattr;
15 | allow init firmware_file:filesystem getattr;
16 | allow init self:socket create;
17 | allow init oppo_debug_prop:file { read open getattr setattr };
18 | allow init sysfs_usb_supply:file setattr;
19 | allow init sysfs_usb_supply:file rw_file_perms;
20 | set_prop(init, oppo_debug_prop)
21 |
22 | allow init netutils_wrapper_exec:file { execute read open getattr };
23 | allow init init:netlink_route_socket { read getattr };
24 | allow init apex_metadata_file:lnk_file read;
25 | allow init hwservicemanager:binder { call transfer };
26 | allow init proc:file { write };
27 |
28 | allow init sysfs_dm:dir relabelfrom;
29 | allow init sysfs_dm:file relabelfrom;
30 | allow init sysfs_io_sched_tuneable:file { setattr w_file_perms };
31 |
--------------------------------------------------------------------------------
/sepolicy/vendor/irsc_util.te:
--------------------------------------------------------------------------------
1 | allow irsc_util self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/isolated_app.te:
--------------------------------------------------------------------------------
1 | allow isolated_app_all app_data_file:file setattr;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/kernel.te:
--------------------------------------------------------------------------------
1 | allow kernel self:socket create;
2 | allow kernel kernel:capability { kill };
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/lkmd.te:
--------------------------------------------------------------------------------
1 | allow lmkd self:capability2 block_suspend;
2 | allow lmkd self:capability { sys_admin };
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/location.te:
--------------------------------------------------------------------------------
1 | allow location fwk_sensor_service:service_manager find;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/mediacodec.te:
--------------------------------------------------------------------------------
1 | get_prop(mediacodec, vendor_mpctl_prop);
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/mediaprovider.te:
--------------------------------------------------------------------------------
1 | allow mediaprovider sdcardfs:lnk_file getattr;
2 | allow mediaprovider mnt_media_rw_file:dir getattr;
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/netmgrd.te:
--------------------------------------------------------------------------------
1 | allow netmgrd diag_device:chr_file rw_file_perms;
2 | allow netmgrd self:capability sys_admin;
3 | allow netmgrd property_socket:sock_file write;
4 | allow netmgrd init:unix_stream_socket connectto;
5 | set_prop(netmgrd, oppo_debug_prop)
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/netutils_wrapper.te:
--------------------------------------------------------------------------------
1 | dontaudit netutils_wrapper self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/sepolicy/vendor/platform_app.te:
--------------------------------------------------------------------------------
1 | allow platform_app sysfs_fps:file { getattr open read };
2 | allow platform_app sysfs_graphics:dir search;
3 | allow platform_app sysfs_graphics:file { getattr open read };
4 |
5 | get_prop(platform_app, oppo_debug_prop);
6 | get_prop(platform_app, boottime_prop);
7 | get_prop(platform_app, audio_config_prop)
8 | get_prop(platform_app, camera_prop)
9 |
10 | allow platform_app sysfs_battery_supply:dir search;
11 | allow platform_app sysfs_battery_supply:file { getattr open read };
12 | allow platform_app sysfs_kgsl:file { getattr open read };
13 |
--------------------------------------------------------------------------------
/sepolicy/vendor/priv_app.te:
--------------------------------------------------------------------------------
1 | get_prop(priv_app, oppo_debug_prop);
2 | get_prop(priv_app, vendor_camera_prop);
3 | get_prop(priv_app, vendor_mpctl_prop);
4 | get_prop(priv_app, persist_camera_prop);
5 |
6 | dontaudit priv_app bt_firmware_file:filesystem getattr;
7 | dontaudit priv_app firmware_file:filesystem getattr;
8 | dontaudit priv_app adsprpcd_file:filesystem getattr;
9 |
--------------------------------------------------------------------------------
/sepolicy/vendor/proc_touchpanel.te:
--------------------------------------------------------------------------------
1 | allow proc_touchpanel proc:filesystem associate;
2 |
--------------------------------------------------------------------------------
/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 |
12 | # Thermal
13 | type vendor_thermal_prop, property_type;
14 |
--------------------------------------------------------------------------------
/sepolicy/vendor/qti.te:
--------------------------------------------------------------------------------
1 | allow qti diag_device:chr_file rw_file_perms;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/qti_init_shell.te:
--------------------------------------------------------------------------------
1 | dontaudit qti_init_shell self:capability { dac_override dac_read_search };
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 proc_devinfo:dir search;
8 | allow qti_init_shell proc_devinfo:file { getattr open read };
9 |
10 | get_prop(qti_init_shell, oppo_debug_prop);
11 |
12 | allow qti_init_shell sysfs_led_file:file { getattr setattr };
13 | allow qti_init_shell sysfs_lcd_file:file { getattr setattr };
14 | allow qti_init_shell ctl_start_prop:property_service set;
15 | allow qti_init_shell ctl_stop_prop:property_service set;
16 | allow qti_init_shell { sysfs sysfs_dm }:file write;
17 | allow qti_init_shell proc_page_cluster:file rw_file_perms;
18 | allow qti_init_shell proc_watermark_scale_factor:file w_file_perms;
19 |
--------------------------------------------------------------------------------
/sepolicy/vendor/qtidataservices_app.te:
--------------------------------------------------------------------------------
1 | allow qtidataservices_app self:socket create_socket_perms;
2 | allowxperm qtidataservices_app self:socket ioctl msm_sock_ipc_ioctls;
3 |
4 | allow qtidataservices_app system_data_file:dir search;
5 | allow qtidataservices_app user_profile_root_file:dir search;
6 |
--------------------------------------------------------------------------------
/sepolicy/vendor/radio.te:
--------------------------------------------------------------------------------
1 | allow radio { hal_datafactory_hwservice hal_iwlan_hwservice hal_imsrcsd_hwservice }:hwservice_manager find;
2 | allow radio { cameraserver_service mediaextractor_service mediaserver_service mediametrics_service drmserver_service audioserver_service }:service_manager find;
3 |
4 | binder_call(radio, cnd)
5 | binder_call(radio, hal_rcsservice)
6 | allow radio hal_cacert_hwservice:hwservice_manager find;
7 | allow radio qcom_ims_prop:file { read open getattr };
8 |
--------------------------------------------------------------------------------
/sepolicy/vendor/rfs_access.te:
--------------------------------------------------------------------------------
1 | allow rfs_access self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/rild.te:
--------------------------------------------------------------------------------
1 | get_prop(rild, oppo_debug_prop)
2 | set_prop(rild, oppo_debug_prop)
3 | r_dir_file(rild, proc_devinfo)
4 |
5 | allow rild block_device:dir search;
6 | allow rild opporadio_hwservice:hwservice_manager { add find };
7 | allow rild vendor_pd_locater_dbg_prop:file { read open getattr };
8 | allow rild diag_device:chr_file rw_file_perms;
9 | dontaudit rild system_data_file:dir { search getattr write add_name };
10 | dontaudit rild system_data_file:file { create write open };
11 | dontaudit rild cache_file:dir { create search getattr write add_name };
12 | dontaudit rild cache_file:file { create write open };
13 | allow rild mnt_vendor_file:dir search;
14 | allow rild mnt_vendor_file:file { read write open };
15 | binder_call(rild, qtidataservices_app)
16 |
--------------------------------------------------------------------------------
/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 | get_prop(rmt_storage, oppo_debug_prop);
5 | dontaudit rmt_storage default_prop:file { read open getattr };
6 | dontaudit rmt_storage self:capability { dac_override dac_read_search };
7 | allow rmt_storage self:capability sys_admin;
8 | allow rmt_storage proc:file { read open };
9 | allow rmt_storage sysfs_socinfo_sensitive:file r_file_perms;
10 |
--------------------------------------------------------------------------------
/sepolicy/vendor/seapp_contexts:
--------------------------------------------------------------------------------
1 | user=radio seinfo=platform name=.qtidataservices domain=qtidataservices_app type=radio_data_file
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/sensors.te:
--------------------------------------------------------------------------------
1 | get_prop(sensors, sensors_prop)
2 | allow sensors diag_device:chr_file rw_file_perms;
3 | allow sensors sensors_persist_file:fifo_file { read open getattr };
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/surfaceflinger.te:
--------------------------------------------------------------------------------
1 | allow surfaceflinger hal_graphics_composer_default:dir search;
2 | allow surfaceflinger hal_graphics_composer_default:file { read open getattr };
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/system_app.te:
--------------------------------------------------------------------------------
1 | allow system_app proc_touchpanel:dir search;
2 | allow system_app sysfs_usb_supply:dir search;
3 | allow system_app sysfs_battery_supply:dir search;
4 | allow system_app sysfs_battery_supply:file { getattr open read };
5 | allow system_app proc_touchpanel:file { read write open getattr setattr };
6 | allow system_app vendor_default_prop:file { map getattr };
7 | get_prop(system_app,oppo_debug_prop)
8 |
9 | # FPS Info
10 | allow system_app sysfs_fps:file rw_file_perms;
11 |
12 | # Realme Parts
13 | allow system_app sysfs_scharge:file { getattr open read write };
14 | allow system_app sysfs_usb_supply:file { getattr open read write };
15 | allow system_app sysfs_oppo_display:dir search;
16 | allow system_app sysfs_oppo_display:file { getattr open read write };
17 | allow system_app proc_vmallocinfo:file r_file_perms;
18 | allow system_app proc_pagetypeinfo:file r_file_perms;
19 | allow system_app sysfs_zram:dir search;
20 | allow system_app sysfs_zram:file r_file_perms;
21 | allow system_app proc_kcal_file:file { getattr open read write };
22 | allow system_app proc_kcal_file:dir search;
23 | allow system_app {
24 | sysfs_hgain
25 | sysfs_mgain
26 | proc_vibration_file
27 | }:file rw_file_perms;
28 | allow system_app sysfs_leds:dir search;
29 | allow system_app proc_vibration_file:dir search;
30 | allow system_app sysfs_leds:lnk_file { getattr open read write };
31 |
--------------------------------------------------------------------------------
/sepolicy/vendor/system_server.te:
--------------------------------------------------------------------------------
1 | get_prop(system_server, persist_camera_prop);
2 | get_prop(system_server, vendor_camera_prop);
3 | get_prop(system_server, vendor_display_notch_prop);
4 |
5 | allow system_server sysfs_battery_supply:file { getattr open read write };
6 | allow system_server dcs_hwservice:hwservice_manager { add find };
7 | allow system_server media_rw_data_file:dir { write remove_name };
8 | allow system_server media_rw_data_file:file { unlink };
9 | allow system_server sysfs_rtc:file { open read };
10 | dontaudit system_server default_android_hwservice:hwservice_manager find;
11 | allow system_server app_zygote:process { getpgid };
12 | allow system_server proc_devinfo:dir { search };
13 | allow system_server proc_touchpanel:dir { search };
14 | allow system_server proc_oppoversion:dir { search };
15 | allow system_server proc_oppo_fp:file r_file_perms;
16 | allow system_server proc_touchpanel:file rw_file_perms;
17 |
18 | allow system_server proc_wakelocks:file { getattr open read };
19 |
--------------------------------------------------------------------------------
/sepolicy/vendor/tee.te:
--------------------------------------------------------------------------------
1 | allow tee persist_file:lnk_file read;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/thermal-engine.te:
--------------------------------------------------------------------------------
1 | allow thermal-engine sysfs:dir { open read };
2 | allow thermal-engine sysfs_devfreq:dir { search read };
3 | allow thermal-engine self:capability sys_admin;
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/ueventd.te:
--------------------------------------------------------------------------------
1 | allow ueventd debugfs:dir read;
2 | allow ueventd self:capability sys_admin;
3 | allow ueventd metadata_file:dir { read search };
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/usbd.te:
--------------------------------------------------------------------------------
1 | allow usbd self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vdc.te:
--------------------------------------------------------------------------------
1 | allow vdc self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_dataservice_app.te:
--------------------------------------------------------------------------------
1 | allow vendor_dataservice_app user_profile_root_file:dir search;
2 | allow vendor_dataservice_app system_data_file:dir search;
3 | allow vendor_dataservice_app vendor_hal_imsfactory_hwservice:hwservice_manager find;
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_dpmd.te:
--------------------------------------------------------------------------------
1 | allow vendor_dpmd diag_device:chr_file rw_file_perms;
2 | allow vendor_dpmd self:capability sys_admin;
3 | allow vendor_dpmd hal_diag_hwservice:hwservice_manager find;
4 |
--------------------------------------------------------------------------------
/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 | camera_data_file
6 | media_rw_data_file
7 | wifi_data_file
8 | dhcp_data_file
9 | tombstone_data_file
10 | nfc_data_file
11 | }:dir { create_dir_perms relabelfrom };
12 |
13 | allow vendor_init persist_file:lnk_file read;
14 | allow vendor_init freq_prop:property_service set;
15 | allow vendor_init block_device:lnk_file setattr;
16 | allow vendor_init media_rw_data_file:file getattr;
17 | allow vendor_init proc_touchpanel:file write;
18 | set_prop(vendor_init, oppo_debug_prop)
19 | set_prop(vendor_init, vendor_camera_prop)
20 | set_prop(vendor_init, vendor_video_prop)
21 | allow vendor_init oppo_wlan_prop:file { open read getattr };
22 | get_prop(vendor_init, persist_debug_prop)
23 | allow vendor_init proc:file w_file_perms;
24 | get_prop(vendor_init, oppo_debug_prop)
25 | allow vendor_init system_data_file:lnk_file create;
26 | allow vendor_init proc_security:file write;
27 | allow vendor_init proc_sched:file w_file_perms;
28 |
29 | # Allow vendor_init to change watermark_scale_factor
30 | allow vendor_init proc_watermark_scale_factor:file w_file_perms;
31 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_modprobe.te:
--------------------------------------------------------------------------------
1 | allow vendor_modprobe self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_msm_irqbalanced.te:
--------------------------------------------------------------------------------
1 | allow vendor_msm_irqbalanced vendor_msm_irqbalanced:capability { sys_admin };
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_pd_mapper.te:
--------------------------------------------------------------------------------
1 | # Wlan
2 | allow vendor_pd_mapper property_socket:sock_file { write };
3 | allow vendor_pd_mapper init:unix_stream_socket { connectto };
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_ssr_setup.te:
--------------------------------------------------------------------------------
1 | allow vendor_ssr_setup sysfs_restart:file { write open };
2 | allow vendor_ssr_setup sysfs:file { write open };
3 | allow vendor_ssr_setup self:capability sys_admin;
4 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vendor_vppservice.te:
--------------------------------------------------------------------------------
1 | allow vendor_vppservice hal_vpp_hwservice:hwservice_manager { add };
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vold.te:
--------------------------------------------------------------------------------
1 | allow vold mnt_vendor_file:dir { open read ioctl };
2 | allow vold sysfs_mmc_host:file w_file_perms;
3 |
--------------------------------------------------------------------------------
/sepolicy/vendor/vold_prepare_subdirs.te:
--------------------------------------------------------------------------------
1 | allow vold_prepare_subdirs self:capability sys_admin;
2 |
--------------------------------------------------------------------------------
/sepolicy/vendor/wcnss_service.te:
--------------------------------------------------------------------------------
1 | set_prop(wcnss_service, oppo_wlan_prop);
2 | set_prop(wcnss_service, oppo_debug_prop);
3 | allow wcnss_service mnt_vendor_file:file read;
4 | allow wcnss_service mnt_vendor_file:file { open getattr };
5 | allow wcnss_service vendor_shell_exec:file rx_file_perms;
6 | allow wcnss_service vendor_toolbox_exec:file rx_file_perms;
7 | allow wcnss_service kmsg_device:chr_file { read open write };
8 |
--------------------------------------------------------------------------------
/sepolicy/vendor/zygote.te:
--------------------------------------------------------------------------------
1 | allow zygote zygote:capability kill;
2 |
--------------------------------------------------------------------------------
/setup-makefiles.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # SPDX-FileCopyrightText: 2016 The CyanogenMod Project
4 | # SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | set -e
9 |
10 | DEVICE=RMX1921
11 | VENDOR=realme
12 |
13 | # Load extract_utils and do some sanity checks
14 | MY_DIR="${BASH_SOURCE%/*}"
15 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
16 |
17 | ANDROID_ROOT="${MY_DIR}/../../.."
18 |
19 | export TARGET_ENABLE_CHECKELF=false
20 |
21 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
22 | if [ ! -f "${HELPER}" ]; then
23 | echo "Unable to find helper script at ${HELPER}"
24 | exit 1
25 | fi
26 | source "${HELPER}"
27 |
28 | # Initialize the helper
29 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
30 |
31 | # Warning headers and guards
32 | write_headers
33 |
34 | write_makefiles "${MY_DIR}/proprietary-files.txt" true
35 |
36 | # Finish
37 | write_footers
38 |
--------------------------------------------------------------------------------
/system_ext.prop:
--------------------------------------------------------------------------------
1 | # DPM
2 | persist.vendor.dpm.feature=11
3 | persist.vendor.dpm.loglevel=0
4 | persist.vendor.dpm.nsrm.bkg.evt=3955
5 |
6 | # Telephony
7 | ro.telephony.sim_slots.count=2
8 | telephony.active_modems.max_count=2
9 |
--------------------------------------------------------------------------------
/update-sha1sums.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | # Copyright (C) 2016 The CyanogenMod Project
4 | # Copyright (C) 2017-2020 The LineageOS Project
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | import os
20 | import sys
21 | from hashlib import sha1
22 |
23 | device='RMX1921'
24 | vendor='realme'
25 |
26 | with open('proprietary-files.txt', 'r') as f:
27 | lines = f.read().splitlines()
28 | vendorPath = '../../../vendor/' + vendor + '/' + device + '/proprietary'
29 | needSHA1 = False
30 |
31 |
32 | def cleanup():
33 | for index, line in enumerate(lines):
34 | # Skip empty or commented lines
35 | if len(line) == 0 or line[0] == '#' or '|' not in line:
36 | continue
37 |
38 | # Drop SHA1 hash, if existing
39 | lines[index] = line.split('|')[0]
40 |
41 |
42 | def update():
43 | for index, line in enumerate(lines):
44 | # Skip empty lines
45 | if len(line) == 0:
46 | continue
47 |
48 | # Check if we need to set SHA1 hash for the next files
49 | if line[0] == '#':
50 | needSHA1 = (' - from' in line)
51 | continue
52 |
53 | if needSHA1:
54 | # Remove existing SHA1 hash
55 | line = line.split('|')[0]
56 |
57 | filePath = line.split(';')[0].split(':')[-1]
58 | if filePath[0] == '-':
59 | filePath = filePath[1:]
60 |
61 | with open(os.path.join(vendorPath, filePath), 'rb') as f:
62 | hash = sha1(f.read()).hexdigest()
63 |
64 | lines[index] = '%s|%s' % (line, hash)
65 |
66 |
67 | if len(sys.argv) == 2 and sys.argv[1] == '-c':
68 | cleanup()
69 | else:
70 | update()
71 |
72 | with open('proprietary-files.txt', 'w') as file:
73 | file.write('\n'.join(lines) + '\n')
74 |
--------------------------------------------------------------------------------
/wifi/p2p_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_no_group_iface=1
3 | persistent_reconnect=1
4 | bss_max_count=400
5 |
--------------------------------------------------------------------------------
/wifi/wpa_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_disabled=1
3 | tdls_external_control=1
4 | wowlan_triggers=magic_pkt
5 | hs20=1
6 | auto_interworking=0
7 | bss_max_count=512
8 | config_methods=virtual_display virtual_push_button keypad
9 | driver_param="use_p2p_group_interface=1 no_rrm=1"
10 |
--------------------------------------------------------------------------------