├── Android.bp ├── sepolicy ├── public │ ├── attributes │ └── uncrypt.te ├── vendor │ ├── radio.te │ ├── zygote.te │ ├── recovery.te │ ├── gpuservice.te │ ├── cdsprpcd.te │ ├── isolated_app.te │ ├── kcal_dev.te │ ├── qti_init_shell.te │ ├── vendor_wcnss_service.te │ ├── device.te │ ├── mediaswcodec.te │ ├── vendor_hal_perf_default.te │ ├── attributes │ ├── hal_ir_default.te │ ├── property.te │ ├── sensors.te │ ├── adsprpcd.te │ ├── vold.te │ ├── untrusted_app.te │ ├── hal_health_default.te │ ├── mediacodec.te │ ├── hal_light_default.te │ ├── vendor_qtelephony.te │ ├── hal_perf_default.te │ ├── hal_power_stats_default.te │ ├── toolbox.te │ ├── hal_bluetooth_default.te │ ├── hal_neuralnetworks_default.te │ ├── service.te │ ├── hal_nfc_default.te │ ├── hwservice.te │ ├── ueventd.te │ ├── kernel.te │ ├── qcom │ │ └── vendor_init.te │ ├── gmscore_app.te │ ├── hal_misys.te │ ├── priv_app.te │ ├── service_contexts │ ├── hal_dms.te │ ├── tee.te │ ├── vendor_qti_init_shell.te │ ├── thermal-engine.te │ ├── app.te │ ├── init.te │ ├── hal_sensors_default.te │ ├── hal_misys_default.te │ ├── hal_dms_default.te │ ├── system_server.te │ ├── vendor_init.te │ ├── hwservice_contexts │ ├── hal_audio_default.te │ ├── file.te │ ├── hal_camera_default.te │ ├── system_app.te │ ├── hal_power_default.te │ ├── platform_app.te │ ├── property_contexts │ ├── hal_fingerprint_default.te │ ├── batterysecret.te │ └── dontaudit.te └── private │ ├── bluetooth.te │ ├── priv_app.te │ ├── platform_app.te │ ├── system_server.te │ ├── system_suspend.te │ ├── system_app.te │ ├── vendor_wfd_app.te │ ├── mediaserver.te │ ├── vendor_qtelephony.te │ ├── init.te │ ├── recovery.te │ ├── dontaudit.te │ ├── service_contexts │ ├── xiaomiparts_app.te │ └── property_contexts ├── properties ├── odm.prop └── product.prop ├── XiaomiDoze ├── proguard.flags ├── Android.bp ├── res │ └── drawable │ │ ├── ic_pocket_gesture.xml │ │ ├── ic_wake_gesture.xml │ │ ├── ic_pickup_up_gesture.xml │ │ └── ic_hand_wave_gesture.xml ├── src │ └── com │ │ └── xiaomi │ │ └── doze │ │ ├── DozeSettingsActivity.java │ │ └── BootCompletedReceiver.java └── AndroidManifest.xml ├── rootdir ├── bin │ ├── init.xiaomiparts.sh │ ├── init.recovery.qcom.sh │ └── init.qti.chg_policy.sh └── etc │ ├── init.recovery.qcom.rc │ └── init.xiaomiparts.rc ├── README.md ├── XiaomiParts ├── res │ ├── drawable │ │ ├── preview.jpg │ │ ├── action_reset.xml │ │ ├── ic_thermal_camera.xml │ │ ├── ic_doze.xml │ │ ├── ic_dirac_preset.xml │ │ ├── ic_thermal_default.xml │ │ ├── ic_scenes.xml │ │ ├── ic_dirac_headphone.xml │ │ ├── ic_hifi.xml │ │ ├── ic_usb_fastcharge.xml │ │ ├── ic_thermal_dialer.xml │ │ ├── ic_qs_log.xml │ │ ├── ic_pickup.xml │ │ ├── action_presets.xml │ │ ├── ic_mi.xml │ │ ├── ic_xiaomidoze.xml │ │ ├── ic_vibrate.xml │ │ ├── ic_thermal_benchmark.xml │ │ ├── ic_hand.xml │ │ ├── switchbar_background.xml │ │ ├── ic_kcal.xml │ │ ├── ic_clear_speaker.xml │ │ ├── ic_fps_info.xml │ │ ├── ic_pocket.xml │ │ ├── ic_custom_seekbar_minus.xml │ │ ├── ic_dirac.xml │ │ ├── ic_custom_seekbar_plus.xml │ │ ├── ic_thermal_browser.xml │ │ ├── ic_custom_seekbar_reset.xml │ │ ├── ic_thermal_gaming.xml │ │ └── ic_thermal_streaming.xml │ ├── raw │ │ └── clear_speaker_sound.mp3 │ ├── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── themes.xml │ │ └── styles.xml │ ├── menu │ │ └── menu_reset.xml │ ├── xml │ │ ├── clear_speaker_settings.xml │ │ ├── ambient_gesture_panel.xml │ │ └── dirac_settings.xml │ ├── layout │ │ ├── activity_kcal.xml │ │ ├── thermal_layout.xml │ │ ├── doze.xml │ │ ├── thermal.xml │ │ └── switch_bar.xml │ └── values-night │ │ └── styles.xml ├── proguard.flags ├── src │ └── com │ │ └── xiaomi │ │ └── parts │ │ ├── XiaomipartsTile.java │ │ ├── dirac │ │ ├── DiracTileService.java │ │ └── DiracActivity.java │ │ ├── preferences │ │ ├── SecureSettingCustomSeekBarPreference.java │ │ ├── SecureSettingsStore.java │ │ └── SecureSettingListPreference.java │ │ ├── DeviceSettingsActivity.java │ │ ├── speaker │ │ └── ClearSpeakerActivity.java │ │ ├── ambient │ │ └── AmbientGesturePreferenceActivity.java │ │ ├── SuTask.java │ │ ├── thermal │ │ └── ThermalActivity.java │ │ ├── kcal │ │ ├── Utils.java │ │ └── PresetDialog.java │ │ ├── Startup.java │ │ ├── FPSTileService.java │ │ └── utils │ │ └── AmbientUtils.java └── Android.mk ├── configs ├── wifi │ ├── p2p_supplicant_overlay.conf │ └── wpa_supplicant_overlay.conf ├── dolby │ ├── hiddenapi-com.dolby.daxservice.xml │ ├── config-com.dolby.daxappui.xml │ ├── config-com.dolby.daxservice.xml │ ├── privapp-com.dolby.daxappui.xml │ ├── privapp-com.dolby.daxservice.xml │ └── media_codecs_dolby_audio.xml ├── permissions │ ├── com.google.android.apps.dialer.call_recording_audio.features.xml │ ├── Android.bp │ └── privapp-permissions-hotword.xml ├── usr │ ├── keylayout │ │ ├── uinput-fpc.kl │ │ ├── uinput-goodix.kl │ │ ├── sm8150-tavil-snd-card_Button_Jack.kl │ │ └── gpio-keys.kl │ └── idc │ │ ├── uinput-fpc.idc │ │ └── uinput-goodix.idc ├── audio │ ├── bluetooth_hearing_aid_audio_policy_configuration.xml │ └── audio_configs_stock.xml ├── perf │ ├── msm_irqbalance.conf │ ├── targetconfig.xml │ └── perfconfigstore.xml ├── config.fs ├── excluded-input-devices.xml └── media │ └── system_properties.xml ├── libshims ├── fakelogprint │ └── fakelogprint.cpp └── Android.bp ├── overlay ├── ApertureOverlay │ ├── res │ │ └── values │ │ │ ├── bools.xml │ │ │ └── arrays.xml │ ├── Android.bp │ └── AndroidManifest.xml ├── ApertureDevOverlay │ ├── res │ │ └── values │ │ │ ├── bools.xml │ │ │ └── arrays.xml │ ├── Android.bp │ └── AndroidManifest.xml ├── WifiOverlay │ ├── Android.bp │ └── AndroidManifest.xml ├── NotchBarKillerOverlay │ ├── res │ │ └── values │ │ │ ├── strings.xml │ │ │ └── config.xml │ ├── Android.bp │ └── AndroidManifest.xml ├── TetheringConfigOverlay │ ├── AndroidManifest.xml │ └── Android.bp ├── DialerOverlay │ ├── Android.bp │ ├── res │ │ └── values │ │ │ └── config.xml │ └── AndroidManifest.xml ├── SettingsOverlay │ ├── Android.bp │ ├── res │ │ └── values │ │ │ ├── bools.xml │ │ │ └── arrays.xml │ └── AndroidManifest.xml ├── SystemUIOverlay │ ├── Android.bp │ ├── res │ │ ├── values-sw372dp │ │ │ └── dimens.xml │ │ └── values-land │ │ │ └── dimens.xml │ └── AndroidManifest.xml ├── TelephonyOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── config.xml ├── CarrierConfigOverlay │ ├── Android.bp │ └── AndroidManifest.xml ├── FrameworksResOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ │ └── values │ │ └── dimens.xml └── SettingsProviderOverlay │ ├── Android.bp │ ├── AndroidManifest.xml │ └── res │ └── values │ └── defaults.xml ├── init ├── include │ └── init_common.h ├── init.cpp └── Android.bp ├── arrow.dependencies ├── setup-makefiles.sh ├── releasetools.py ├── reorder-libs.py ├── update-sha1sums.py └── extract-files.sh /Android.bp: -------------------------------------------------------------------------------- 1 | soong_namespace { 2 | } 3 | -------------------------------------------------------------------------------- /sepolicy/public/attributes: -------------------------------------------------------------------------------- 1 | hal_attribute(misys) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/radio.te: -------------------------------------------------------------------------------- 1 | get_prop(radio, vendor_audio_prop) 2 | -------------------------------------------------------------------------------- /properties/odm.prop: -------------------------------------------------------------------------------- 1 | # Qcom 2 | ro.vendor.qti.va_odm.support=1 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/zygote.te: -------------------------------------------------------------------------------- 1 | allow zygote self:capability kill; 2 | -------------------------------------------------------------------------------- /sepolicy/private/bluetooth.te: -------------------------------------------------------------------------------- 1 | get_prop(bluetooth, incremental_prop); 2 | -------------------------------------------------------------------------------- /sepolicy/private/priv_app.te: -------------------------------------------------------------------------------- 1 | hal_client_domain(priv_app, hal_misys) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/recovery.te: -------------------------------------------------------------------------------- 1 | allow recovery pstorefs:dir r_dir_perms; 2 | -------------------------------------------------------------------------------- /XiaomiDoze/proguard.flags: -------------------------------------------------------------------------------- 1 | -keep class com.xiaomi.doze.* { 2 | *; 3 | } 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/gpuservice.te: -------------------------------------------------------------------------------- 1 | get_prop(gpuservice, graphics_config_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/private/platform_app.te: -------------------------------------------------------------------------------- 1 | hal_client_domain(platform_app, hal_misys) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/cdsprpcd.te: -------------------------------------------------------------------------------- 1 | r_dir_file(vendor_cdsprpcd, public_adsprpcd_file) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/isolated_app.te: -------------------------------------------------------------------------------- 1 | allow isolated_app app_data_file:file setattr; 2 | -------------------------------------------------------------------------------- /sepolicy/private/system_server.te: -------------------------------------------------------------------------------- 1 | get_prop(system_server, vendor_wfd_sys_debug_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/private/system_suspend.te: -------------------------------------------------------------------------------- 1 | allow system_suspend sysfs_wakeup:file { read }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/kcal_dev.te: -------------------------------------------------------------------------------- 1 | # KCAL 2 | allow kcal_dev sysfs:filesystem associate; 3 | -------------------------------------------------------------------------------- /sepolicy/private/system_app.te: -------------------------------------------------------------------------------- 1 | # Thermal 2 | allow system_app sysfs_thermal:file write; 3 | -------------------------------------------------------------------------------- /sepolicy/private/vendor_wfd_app.te: -------------------------------------------------------------------------------- 1 | get_prop(vendor_wfd_app, vendor_wfd_sys_debug_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/qti_init_shell.te: -------------------------------------------------------------------------------- 1 | get_prop(vendor_qti_init_shell, radio_control_prop) 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_wcnss_service.te: -------------------------------------------------------------------------------- 1 | get_prop(vendor_wcnss_service, vendor_bluetooth_prop) 2 | -------------------------------------------------------------------------------- /rootdir/bin/init.xiaomiparts.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | # Dummy executable, will be used later 4 | -------------------------------------------------------------------------------- /sepolicy/public/uncrypt.te: -------------------------------------------------------------------------------- 1 | # OTA with encrypted f2fs 2 | allow uncrypt self:capability sys_admin; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/device.te: -------------------------------------------------------------------------------- 1 | type fingerprint_device, dev_type; 2 | 3 | type lirc_device, dev_type; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/mediaswcodec.te: -------------------------------------------------------------------------------- 1 | allow mediaswcodec gpu_device:chr_file { ioctl open read write }; 2 | -------------------------------------------------------------------------------- /sepolicy/private/mediaserver.te: -------------------------------------------------------------------------------- 1 | dontaudit mediaserver package_native_service:service_manager { find }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_hal_perf_default.te: -------------------------------------------------------------------------------- 1 | allow vendor_hal_perf_default sysfs_msm_subsys:dir search; 2 | -------------------------------------------------------------------------------- /sepolicy/private/vendor_qtelephony.te: -------------------------------------------------------------------------------- 1 | allow vendor_qtelephony vendor_hal_telephony_service:service_manager find; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/attributes: -------------------------------------------------------------------------------- 1 | # Dolby 2 | attribute hal_dms; 3 | attribute hal_dms_client; 4 | attribute hal_dms_server; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_ir_default.te: -------------------------------------------------------------------------------- 1 | allow hal_ir_default lirc_device:{ 2 | chr_file 3 | file 4 | } rw_file_perms; 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/property.te: -------------------------------------------------------------------------------- 1 | vendor_internal_prop(vendor_power_prop) 2 | 3 | vendor_restricted_prop(vendor_fingerprint_prop); 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/sensors.te: -------------------------------------------------------------------------------- 1 | # Allow sensors to access backlight sysfs state 2 | r_dir_file(vendor_sensors, vendor_sysfs_graphics) 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2020 - The LineageOS Project 2 | 3 | Common device tree for Xiaomi SM6250 based devices 4 | ============== 5 | -------------------------------------------------------------------------------- /sepolicy/private/init.te: -------------------------------------------------------------------------------- 1 | allow init property_type:file { append create getattr map open read relabelto rename setattr unlink write }; 2 | -------------------------------------------------------------------------------- /sepolicy/vendor/adsprpcd.te: -------------------------------------------------------------------------------- 1 | r_dir_file(vendor_adsprpcd, public_adsprpcd_file) 2 | r_dir_file(vendor_adsprpcd, vendor_sysfs_graphics) 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/vold.te: -------------------------------------------------------------------------------- 1 | # Allow vold to set read_ahead_kb on /data partition 2 | allow vold vendor_sysfs_scsi_host:file w_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/untrusted_app.te: -------------------------------------------------------------------------------- 1 | get_prop(untrusted_app, vendor_persist_camera_prop) 2 | allow untrusted_app zygote:unix_stream_socket { getopt }; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_health_default.te: -------------------------------------------------------------------------------- 1 | allow hal_health_default sysfs_wakeup:dir r_dir_perms; 2 | allow hal_health_default sysfs_wakeup:file r_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/mediacodec.te: -------------------------------------------------------------------------------- 1 | allow mediacodec hal_dms_hwservice:hwservice_manager find; 2 | allow mediacodec hal_dms_default:binder { call transfer }; 3 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArrowOS-Devices/android_device_xiaomi_sm6250-common/HEAD/XiaomiParts/res/drawable/preview.jpg -------------------------------------------------------------------------------- /configs/wifi/p2p_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_no_group_iface=1 3 | persistent_reconnect=1 4 | bss_max_count=400 5 | p2p_go_intent=14 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_light_default.te: -------------------------------------------------------------------------------- 1 | allow hal_light_default { 2 | sysfs_leds 3 | }:file rw_file_perms; 4 | 5 | r_dir_file(hal_light_default, sysfs_leds) 6 | -------------------------------------------------------------------------------- /XiaomiParts/res/raw/clear_speaker_sound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArrowOS-Devices/android_device_xiaomi_sm6250-common/HEAD/XiaomiParts/res/raw/clear_speaker_sound.mp3 -------------------------------------------------------------------------------- /libshims/fakelogprint/fakelogprint.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int __android_log_print(int prio, const char* tag, const char* fmt, ...) { 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /sepolicy/private/recovery.te: -------------------------------------------------------------------------------- 1 | userdebug_or_eng(` 2 | # Set recovery to permissive 3 | recovery_only(` 4 | permissive init; 5 | permissive recovery; 6 | ') 7 | ') 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_qtelephony.te: -------------------------------------------------------------------------------- 1 | set_prop(vendor_qtelephony, radio_prop) 2 | 3 | allow vendor_qtelephony vendor_hal_datafactory_hwservice:hwservice_manager find; 4 | -------------------------------------------------------------------------------- /overlay/ApertureOverlay/res/values/bools.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_perf_default.te: -------------------------------------------------------------------------------- 1 | allow vendor_hal_perf_default hal_audio_default:dir r_dir_perms; 2 | allow vendor_hal_perf_default hal_audio_default:file r_file_perms; 3 | -------------------------------------------------------------------------------- /overlay/ApertureDevOverlay/res/values/bools.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_stats_default.te: -------------------------------------------------------------------------------- 1 | allow hal_power_stats_default vendor_sysfs_iio:dir r_dir_perms; 2 | allow hal_power_stats_default vendor_sysfs_iio:file r_file_perms; 3 | -------------------------------------------------------------------------------- /sepolicy/vendor/toolbox.te: -------------------------------------------------------------------------------- 1 | allow toolbox per_boot_file:dir create_dir_perms; 2 | allow toolbox per_boot_file:file create_file_perms; 3 | 4 | allow toolbox self:capability kill; 5 | -------------------------------------------------------------------------------- /configs/dolby/hiddenapi-com.dolby.daxservice.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_bluetooth_default.te: -------------------------------------------------------------------------------- 1 | # Allow hal_bluetooth_default to read files in vendor_wifi_vendor_data_file 2 | r_dir_file(hal_bluetooth_default, vendor_wifi_vendor_data_file) 3 | -------------------------------------------------------------------------------- /overlay/WifiOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | runtime_resource_overlay { 2 | name: "WifiOverlay", 3 | theme: "WifiOverlay", 4 | sdk_version: "current", 5 | product_specific: true 6 | } 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_neuralnetworks_default.te: -------------------------------------------------------------------------------- 1 | r_dir_file(vendor_hal_neuralnetworks_default, public_adsprpcd_file) 2 | 3 | get_prop(vendor_hal_neuralnetworks_default, vendor_adsprpc_prop) 4 | -------------------------------------------------------------------------------- /sepolicy/private/dontaudit.te: -------------------------------------------------------------------------------- 1 | # please don't kill yourself unless it's allowed 2 | dontaudit linkerconfig self:capability kill; 3 | 4 | # b/152468658 5 | dontaudit vdc self:capability kill; 6 | -------------------------------------------------------------------------------- /overlay/NotchBarKillerOverlay/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Notch Bar Killer 3 | 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/service.te: -------------------------------------------------------------------------------- 1 | type DisplayFeatureControl, service_manager_type; 2 | type perfshielder, service_manager_type; 3 | type miui_multi_display, service_manager_type; 4 | type ProcessManager, service_manager_type; 5 | -------------------------------------------------------------------------------- /init/include/init_common.h: -------------------------------------------------------------------------------- 1 | #ifndef __INIT_COMMON__H__ 2 | #define __INIT_COMMON__H__ 3 | 4 | void load_common_properties(); 5 | void property_override(char const prop[], char const value[], bool add = true); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_nfc_default.te: -------------------------------------------------------------------------------- 1 | # Data file accesses. 2 | allow hal_nfc_default vendor_nfc_vendor_data_file:dir { create_dir_perms search }; 3 | allow hal_nfc_default vendor_nfc_vendor_data_file:file create_file_perms; 4 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice.te: -------------------------------------------------------------------------------- 1 | type hal_misys_hwservice, hwservice_manager_type; 2 | 3 | type hal_camerapostproc_xiaomi_hwservice, hwservice_manager_type; 4 | 5 | # Dolby 6 | type hal_dms_hwservice, hwservice_manager_type; 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/ueventd.te: -------------------------------------------------------------------------------- 1 | allow ueventd self:capability sys_nice; 2 | 3 | # KCAL 4 | allow ueventd kcal_dev:dir r_dir_perms; 5 | allow ueventd kcal_dev:file rw_file_perms; 6 | allow ueventd kcal_dev:lnk_file r_file_perms; 7 | -------------------------------------------------------------------------------- /configs/dolby/config-com.dolby.daxappui.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /configs/dolby/config-com.dolby.daxservice.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/kernel.te: -------------------------------------------------------------------------------- 1 | # KCAL 2 | allow kernel kcal_dev:dir relabelto; 3 | allow kernel kcal_dev:file relabelto; 4 | allow kernel kcal_dev:lnk_file relabelto; 5 | 6 | # For zram writeback 7 | allow kernel per_boot_file:file r_file_perms; 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/qcom/vendor_init.te: -------------------------------------------------------------------------------- 1 | # Allow init.qcom.usb.sh to create files in uvc.0 2 | allow vendor_qti_init_shell configfs:dir create_dir_perms; 3 | allow vendor_qti_init_shell configfs:{ 4 | file 5 | lnk_file 6 | } create_file_perms; 7 | -------------------------------------------------------------------------------- /overlay/ApertureOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2022 Paranoid Android 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "ApertureOverlay", 8 | system_ext_specific: true, 9 | } 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/gmscore_app.te: -------------------------------------------------------------------------------- 1 | binder_call(gmscore_app, hal_memtrack_default); 2 | binder_call(gmscore_app, hal_memtrack_hwservice); 3 | 4 | allow gmscore_app bt_firmware_file:filesystem getattr; 5 | allow gmscore_app firmware_file:filesystem getattr; 6 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_misys.te: -------------------------------------------------------------------------------- 1 | # HwBinder IPC from client to server 2 | binder_call(hal_misys_client, hal_misys_server) 3 | 4 | add_hwservice(hal_misys_server, hal_misys_hwservice) 5 | allow hal_misys_client hal_misys_hwservice:hwservice_manager find; 6 | -------------------------------------------------------------------------------- /overlay/ApertureDevOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2022 Paranoid Android 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | runtime_resource_overlay { 7 | name: "ApertureDevOverlay", 8 | system_ext_specific: true, 9 | } 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/priv_app.te: -------------------------------------------------------------------------------- 1 | allow priv_app DisplayFeatureControl:service_manager find; 2 | allow priv_app miui_multi_display:service_manager find; 3 | allow priv_app perfshielder:service_manager find; 4 | allow priv_app ProcessManager:service_manager find; 5 | -------------------------------------------------------------------------------- /rootdir/bin/init.recovery.qcom.sh: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | # Make recovery permissive 4 | setenforce 0 5 | 6 | while [ ! -d /dev/block/mapper ]; do 7 | sleep 1 8 | done 9 | 10 | ln -s /dev/block/mapper/* /dev/block/bootdevice/by-name/ 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /sepolicy/vendor/service_contexts: -------------------------------------------------------------------------------- 1 | DisplayFeatureControl u:object_r:DisplayFeatureControl:s0 2 | perfshielder u:object_r:perfshielder:s0 3 | miui_multi_display u:object_r:miui_multi_display:s0 4 | ProcessManager u:object_r:ProcessManager:s0 5 | -------------------------------------------------------------------------------- /configs/permissions/com.google.android.apps.dialer.call_recording_audio.features.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /configs/wifi/wpa_supplicant_overlay.conf: -------------------------------------------------------------------------------- 1 | disable_scan_offload=1 2 | p2p_disabled=1 3 | tdls_external_control=1 4 | wowlan_triggers=magic_pkt 5 | bss_max_count=512 6 | interworking=1 7 | config_methods=virtual_display virtual_push_button keypad 8 | driver_param="use_p2p_group_interface=1 no_rrm=1" 9 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_dms.te: -------------------------------------------------------------------------------- 1 | # HwBinder IPC from client to server, and callbacks 2 | binder_call(hal_dms_client, hal_dms_server) 3 | binder_call(hal_dms_server, hal_dms_client) 4 | 5 | add_hwservice(hal_dms_server, hal_dms_hwservice) 6 | allow hal_dms_client hal_dms_hwservice:hwservice_manager find; 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/tee.te: -------------------------------------------------------------------------------- 1 | typeattribute tee data_between_core_and_vendor_violators; 2 | 3 | allow tee fingerprint_data_file:dir create_dir_perms; 4 | allow tee { 5 | fingerprint_data_file 6 | mnt_vendor_file 7 | }:file create_file_perms; 8 | 9 | allow tee mnt_vendor_file:dir rw_dir_perms; 10 | -------------------------------------------------------------------------------- /libshims/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | cc_library_shared { 8 | name: "fakelogprint", 9 | vendor: true, 10 | shared_libs: ["liblog"], 11 | srcs: ["fakelogprint/fakelogprint.cpp"], 12 | } 13 | -------------------------------------------------------------------------------- /configs/permissions/Android.bp: -------------------------------------------------------------------------------- 1 | prebuilt_etc { 2 | name: "com.google.android.apps.dialer.call_recording_audio.features.xml", 3 | sub_dir: "permissions", 4 | src: "com.google.android.apps.dialer.call_recording_audio.features.xml", 5 | filename_from_src: true, 6 | product_specific: true, 7 | } 8 | -------------------------------------------------------------------------------- /overlay/ApertureOverlay/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2 5 | 6 6 | 20 7 | 100 8 | 9 | 10 | -------------------------------------------------------------------------------- /overlay/ApertureDevOverlay/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2 5 | 6 6 | 20 7 | 100 8 | 9 | 10 | -------------------------------------------------------------------------------- /configs/dolby/privapp-com.dolby.daxappui.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_qti_init_shell.te: -------------------------------------------------------------------------------- 1 | allow vendor_qti_init_shell configfs:dir rw_dir_perms; 2 | allow vendor_qti_init_shell configfs:file create_file_perms; 3 | allow vendor_qti_init_shell ctl_stop_prop:property_service set; 4 | allow vendor_qti_init_shell sysfs_wakeup:file setattr; 5 | 6 | set_prop(vendor_qti_init_shell, vendor_power_prop) 7 | -------------------------------------------------------------------------------- /sepolicy/vendor/thermal-engine.te: -------------------------------------------------------------------------------- 1 | allow vendor_thermal-engine { 2 | vendor_sysfs_devfreq 3 | sysfs_msm_subsys 4 | }:dir r_dir_perms; 5 | 6 | allow vendor_thermal-engine vendor_sysfs_devfreq:file rw_file_perms; 7 | 8 | # Rule for vendor_thermal-engine to access init process 9 | unix_socket_connect(vendor_thermal-engine, property, init); 10 | -------------------------------------------------------------------------------- /XiaomiParts/proguard.flags: -------------------------------------------------------------------------------- 1 | -keep class com.xiaomi.parts.* { 2 | *; 3 | } 4 | 5 | -keep class com.xiaomi.parts.ambient.* { 6 | *; 7 | } 8 | 9 | -keep class com.xiaomi.parts.dirac.* { 10 | *; 11 | } 12 | 13 | -keep class com.xiaomi.parts.kcal.* { 14 | *; 15 | } 16 | 17 | -keep class com.xiaomi.parts.speaker.* { 18 | *; 19 | } 20 | 21 | -keep class com.xiaomi.parts.thermal.* { 22 | *; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /sepolicy/vendor/app.te: -------------------------------------------------------------------------------- 1 | allow { appdomain -isolated_app } adsprpcd_file:dir r_dir_perms; 2 | allow { appdomain -isolated_app } public_adsprpcd_file:file r_file_perms; 3 | allow { appdomain -isolated_app } vendor_xdsp_device:chr_file r_file_perms; 4 | 5 | get_prop({ appdomain -isolated_app }, vendor_fingerprint_prop) 6 | get_prop({ appdomain -isolated_app }, vendor_tee_listener_prop) 7 | get_prop(appdomain, vendor_persist_camera_prop) 8 | -------------------------------------------------------------------------------- /configs/usr/keylayout/uinput-fpc.kl: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | #key 96 DPAD_CENTER 12 | #key 102 HOME 13 | #key 105 DPAD_LEFT 14 | #key 106 DPAD_RIGHT 15 | -------------------------------------------------------------------------------- /configs/usr/keylayout/uinput-goodix.kl: -------------------------------------------------------------------------------- 1 | # 2 | # Goodix fingerprint sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | #key 96 DPAD_CENTER 11 | #key 102 HOME 12 | #key 105 DPAD_LEFT 13 | #key 106 DPAD_RIGHT 14 | -------------------------------------------------------------------------------- /sepolicy/vendor/init.te: -------------------------------------------------------------------------------- 1 | allow init vendor_configs_file:file mounton; 2 | 3 | allow init same_process_hal_file:file execute; 4 | 5 | allow init adsprpcd_file:file mounton; 6 | 7 | allow init sysfs_fcharge:file { write open }; 8 | 9 | allow init per_boot_file:file ioctl; 10 | allowxperm init per_boot_file:file ioctl { F2FS_IOC_SET_PIN_FILE }; 11 | 12 | # Allow init to set read_ahead_kb on /data partition 13 | allow init vendor_sysfs_scsi_host:file w_file_perms; 14 | -------------------------------------------------------------------------------- /configs/usr/idc/uinput-fpc.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-fpc 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | -------------------------------------------------------------------------------- /configs/usr/idc/uinput-goodix.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-gf 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | -------------------------------------------------------------------------------- /overlay/ApertureOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/action_reset.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /XiaomiParts/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /overlay/ApertureDevOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_sensors_default.te: -------------------------------------------------------------------------------- 1 | unix_socket_connect(hal_sensors_default, audio, hal_audio_default) 2 | 3 | allow hal_sensors_default audio_socket:sock_file rw_file_perms; 4 | allow hal_sensors_default socket_device:sock_file rw_file_perms; 5 | allow hal_sensors_default iio_device:chr_file rw_file_perms; 6 | allow hal_sensors_default vendor_sysfs_iio:dir r_dir_perms; 7 | allow hal_sensors_default vendor_sysfs_iio:file rw_file_perms; 8 | 9 | get_prop(hal_sensors_default, vendor_adsprpc_prop) 10 | -------------------------------------------------------------------------------- /overlay/TetheringConfigOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /XiaomiParts/res/menu/menu_reset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_thermal_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /XiaomiDoze/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2020-2021 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | android_app { 8 | name: "XiaomiDoze", 9 | 10 | srcs: ["src/**/*.java"], 11 | resource_dirs: ["res"], 12 | certificate: "platform", 13 | platform_apis: true, 14 | privileged: true, 15 | 16 | static_libs: [ 17 | "org.lineageos.settings.resources", 18 | ], 19 | 20 | optimize: { 21 | proguard_flags_files: ["proguard.flags"], 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_misys_default.te: -------------------------------------------------------------------------------- 1 | type hal_misys_default, domain; 2 | hal_server_domain(hal_misys_default, hal_misys) 3 | 4 | type hal_misys_default_exec, exec_type, vendor_file_type, file_type; 5 | 6 | init_daemon_domain(hal_misys_default) 7 | 8 | allow hal_misys_default camera_persist_file:file rw_file_perms; 9 | allow hal_misys_default camera_persist_file:dir rw_dir_perms; 10 | r_dir_file(hal_misys_default, firmware_file) 11 | r_dir_file(hal_misys_default, mnt_vendor_file) 12 | 13 | get_prop(hal_misys_default, vendor_camera_prop) 14 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_doze.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_dms_default.te: -------------------------------------------------------------------------------- 1 | type hal_dms_default, domain; 2 | hal_server_domain(hal_dms_default, hal_dms) 3 | 4 | type hal_dms_default_exec, exec_type, vendor_file_type, file_type; 5 | init_daemon_domain(hal_dms_default) 6 | 7 | allow hal_dms_default vendor_data_file:file { rw_file_perms create unlink }; 8 | allow hal_dms_default vendor_data_file:dir { rw_file_perms add_name remove_name }; 9 | allow hal_dms_default mediacodec:binder call; 10 | binder_call(hal_dms_default, hal_audio_default) 11 | binder_call(hal_dms_default, platform_app) 12 | -------------------------------------------------------------------------------- /rootdir/etc/init.recovery.qcom.rc: -------------------------------------------------------------------------------- 1 | on init 2 | write /sys/class/backlight/panel0-backlight/brightness 200 3 | 4 | setprop sys.usb.configfs 1 5 | 6 | start init-recovery-qcom-sh 7 | 8 | on fs 9 | wait /dev/block/platform/soc/${ro.boot.bootdevice} 10 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice 11 | start init-recovery-qcom-sh 12 | 13 | service init-recovery-qcom-sh /init.recovery.qcom.sh 14 | disabled 15 | user root 16 | group root 17 | seclabel u:r:recovery:s0 18 | oneshot 19 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_server.te: -------------------------------------------------------------------------------- 1 | # Allow system_server to read fast charging status 2 | allow system_server vendor_sysfs_battery_supply:file { getattr open read }; 3 | 4 | # Allow system server battery suply rw access 5 | allow system_server vendor_sysfs_battery_supply:file rw_file_perms; 6 | 7 | get_prop(system_server, vendor_persist_camera_prop) 8 | 9 | # Allow system_server to getpgid app_zygote 10 | allow system_server app_zygote:process getpgid; 11 | 12 | # KCAL 13 | allow system_server kcal_dev:file rw_file_perms; 14 | allow system_server kcal_dev:dir r_dir_perms; 15 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_dirac_preset.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_thermal_default.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/vendor_init.te: -------------------------------------------------------------------------------- 1 | set_prop(vendor_init, vendor_power_prop) 2 | set_prop(vendor_init, vendor_alarm_boot_prop) 3 | set_prop(vendor_init, vendor_video_prop) 4 | get_prop(vendor_init, persist_debug_prop) 5 | set_prop(vendor_init, vendor_ssr_prop) 6 | 7 | allow vendor_init { 8 | proc_dirty 9 | proc 10 | }:file w_file_perms; 11 | 12 | allow vendor_init block_device:lnk_file setattr; 13 | allow vendor_init vendor_camera_prop:property_service set; 14 | 15 | allow vendor_init input_device:chr_file { create setattr unlink rw_file_perms }; 16 | 17 | allow vendor_qti_init_shell configfs:dir create_dir_perms; 18 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_scenes.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /sepolicy/private/service_contexts: -------------------------------------------------------------------------------- 1 | # IMS 2 | vendor.qti.hardware.radio.ims.IImsRadio/imsradio0 u:object_r:vendor_hal_telephony_service:s0 3 | vendor.qti.hardware.radio.ims.IImsRadio/imsradio1 u:object_r:vendor_hal_telephony_service:s0 4 | vendor.qti.hardware.radio.qtiradio.IQtiRadioStable/slot1 u:object_r:vendor_hal_telephony_service:s0 5 | vendor.qti.hardware.radio.qtiradio.IQtiRadioStable/slot2 u:object_r:vendor_hal_telephony_service:s0 6 | vendor.qti.hardware.radio.am.IQcRilAudio/slot1 u:object_r:vendor_hal_telephony_service:s0 7 | vendor.qti.hardware.radio.am.IQcRilAudio/slot2 u:object_r:vendor_hal_telephony_service:s0 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/hwservice_contexts: -------------------------------------------------------------------------------- 1 | vendor.xiaomi.hardware.misys::IMiSys u:object_r:hal_misys_hwservice:s0 2 | vendor.xiaomi.hardware.campostproc::IMiPostProcService u:object_r:hal_camerapostproc_xiaomi_hwservice:s0 3 | 4 | vendor.goodix.hardware.biometrics.fingerprint::IGoodixFingerprintDaemon u:object_r:hal_fingerprint_hwservice:s0 5 | vendor.goodix.hardware.biometrics.fingerprint::IGoodixFingerprintDaemonExt u:object_r:hal_fingerprint_hwservice:s0 6 | 7 | # Dolby 8 | vendor.dolby.hardware.dms::IDms u:object_r:hal_dms_hwservice:s0 9 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_audio_default.te: -------------------------------------------------------------------------------- 1 | # For interfacing with PowerHAL 2 | hal_client_domain(hal_audio_default, hal_power) 3 | 4 | # Allow hal_audio_default to read vendor_persist_audio_file 5 | r_dir_file(hal_audio_default, vendor_persist_audio_file) 6 | 7 | r_dir_file(hal_audio_default, sysfs) 8 | 9 | binder_call(hal_audio_default, system_suspend_server) 10 | 11 | set_prop(hal_audio_default, vendor_audio_prop) 12 | 13 | allow hal_audio_default audio_socket:sock_file rw_file_perms; 14 | allow hal_audio_default system_suspend_hwservice:hwservice_manager find; 15 | 16 | # Dolby 17 | allow hal_audio_default hal_dms_hwservice:hwservice_manager find; 18 | binder_call(hal_audio_default, hal_dms_default) 19 | -------------------------------------------------------------------------------- /XiaomiParts/res/xml/clear_speaker_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /XiaomiParts/res/layout/activity_kcal.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /sepolicy/private/xiaomiparts_app.te: -------------------------------------------------------------------------------- 1 | type xiaomiparts_app, domain; 2 | 3 | app_domain(xiaomiparts_app) 4 | 5 | # Access standard system services 6 | allow xiaomiparts_app app_api_service:service_manager find; 7 | 8 | # Allow reading and writing shared prefs 9 | allow xiaomiparts_app system_app_data_file:dir create_dir_perms; 10 | allow xiaomiparts_app system_app_data_file:{ file lnk_file } create_file_perms; 11 | 12 | # Allow binder communication with gpuservice 13 | binder_call(xiaomiparts_app, gpuservice) 14 | 15 | # Allow XiaomiParts to read and write to cgroup 16 | allow xiaomiparts_app cgroup:file rw_file_perms; 17 | 18 | # Allow XiaomiParts to write to sysfs_thermal 19 | allow xiaomiparts_app sysfs_thermal:file w_file_perms; 20 | -------------------------------------------------------------------------------- /XiaomiDoze/res/drawable/ic_pocket_gesture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sepolicy/vendor/file.te: -------------------------------------------------------------------------------- 1 | type sysfs_kgsl, sysfs_type, fs_type; 2 | 3 | type audio_socket, file_type; 4 | 5 | type camera_persist_file, file_type, vendor_persist_type; 6 | 7 | type fingerprint_data_file, data_file_type, core_data_file_type, file_type; 8 | 9 | type per_boot_file, file_type, data_file_type, core_data_file_type; 10 | 11 | type persist_subsys_file, vendor_persist_type, file_type; 12 | 13 | type public_adsprpcd_file, file_type; 14 | 15 | type sysfs_msm_boot, fs_type, sysfs_type; 16 | 17 | type sysfs_msm_subsys, sysfs_type, fs_type; 18 | 19 | type vendor_sysfs_iio, fs_type, sysfs_type; 20 | 21 | type sysfs_fps, sysfs_type, fs_type; 22 | 23 | type kcal_dev, sysfs_type, fs_type; 24 | 25 | type sysfs_fcharge, sysfs_type, fs_type; 26 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_dirac_headphone.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_hifi.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_usb_fastcharge.xml: -------------------------------------------------------------------------------- 1 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /sepolicy/private/property_contexts: -------------------------------------------------------------------------------- 1 | # Camera 2 | ro.camera.req.fmq. u:object_r:exported_default_prop:s0 3 | ro.camera.res.fmq. u:object_r:exported_default_prop:s0 4 | 5 | # Global 6 | ro.boot.hwc u:object_r:exported_default_prop:s0 7 | ro.build.flavor u:object_r:build_prop:s0 8 | ro.product.marketname u:object_r:build_prop:s0 9 | ro.product.mod_device u:object_r:build_prop:s0 10 | 11 | # MIUI 12 | ro.cust.test u:object_r:exported_system_prop:s0 13 | ro.miui. u:object_r:exported_system_prop:s0 14 | ro.fota.oem u:object_r:exported_system_prop:s0 15 | 16 | # Recovery 17 | ro.build.expect. u:object_r:exported_default_prop:s0 18 | 19 | # WiFi Display 20 | persist.vendor.setWFDInfo. u:object_r:vendor_wfd_sys_debug_prop:s0 21 | -------------------------------------------------------------------------------- /configs/permissions/privapp-permissions-hotword.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_thermal_dialer.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /properties/product.prop: -------------------------------------------------------------------------------- 1 | # Camera 2 | ro.hardware.camera=xiaomi 3 | ro.com.google.lens.oem_camera_package=com.android.camera 4 | 5 | # Charger 6 | ro.charger.enable_suspend=true 7 | 8 | # Graphics 9 | debug.sf.hw=1 10 | debug.gralloc.enable_fb_ubwc=1 11 | 12 | # LMKD 13 | ro.config.low_ram=false 14 | 15 | # Phantom process monitoring 16 | sys.fflag.override.settings_enable_monitor_phantom_procs=false 17 | 18 | # Incremental FS 19 | ro.incremental.enable=1 20 | 21 | # Telephony 22 | persist.vendor.ims.disableADBLogs=1 23 | persist.vendor.ims.disableDebugLogs=1 24 | persist.vendor.ims.disableIMSLogs=1 25 | persist.vendor.ims.disableQXDMLogs=1 26 | 27 | # Transcoding related property. 28 | debug.media.transcoding.codec_max_operating_rate_720P=240 29 | debug.media.transcoding.codec_max_operating_rate_1080P=120 30 | -------------------------------------------------------------------------------- /init/init.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 "init_common.h" 18 | #include "vendor_init.h" 19 | 20 | void vendor_load_properties() { 21 | load_common_properties(); 22 | } 23 | -------------------------------------------------------------------------------- /overlay/NotchBarKillerOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2020 Paranoid Android 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | runtime_resource_overlay { 16 | name: "NotchBarKillerOverlay", 17 | sdk_version: "current", 18 | product_specific: true, 19 | } 20 | -------------------------------------------------------------------------------- /overlay/DialerOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 ArrowOS 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: "DialerOverlay", 19 | sdk_version: "current", 20 | resource_dirs: ["res"], 21 | vendor: true, 22 | } 23 | -------------------------------------------------------------------------------- /overlay/SettingsOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 ArrowOS 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: "SettingsOverlay", 19 | sdk_version: "current", 20 | resource_dirs: ["res"], 21 | vendor: true, 22 | } 23 | -------------------------------------------------------------------------------- /overlay/SystemUIOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 ArrowOS 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: "SystemUIOverlay", 19 | sdk_version: "current", 20 | resource_dirs: ["res"], 21 | vendor: true, 22 | } 23 | -------------------------------------------------------------------------------- /arrow.dependencies: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "remote": "gitlab", 4 | "repository": "arrowos-project/android_prebuilts_clang_host_linux-x86_clang-r437112b", 5 | "target_path": "prebuilts/clang/host/linux-x86/clang-r437112b", 6 | "branch": "master" 7 | }, 8 | { 9 | "remote": "github", 10 | "repository": "ArrowOS-Devices/android_packages_apps_GCamGOPrebuilt", 11 | "target_path": "packages/apps/GCamGOPrebuilt", 12 | "branch": "arrow-13.0" 13 | }, 14 | { 15 | "remote": "github", 16 | "repository": "ArrowOS-Devices/android_hardware_xiaomi", 17 | "target_path": "hardware/xiaomi", 18 | "branch": "arrow-13.0" 19 | }, 20 | { 21 | "remote": "github", 22 | "repository": "SonalSingh18/vendor_xiaomi_miuicamera", 23 | "target_path": "vendor/xiaomi/miuicamera", 24 | "branch": "master" 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /overlay/TelephonyOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 ArrowOS 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: "TelephonyOverlay", 19 | sdk_version: "current", 20 | resource_dirs: ["res"], 21 | vendor: true, 22 | } 23 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_qs_log.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /overlay/CarrierConfigOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 ArrowOS 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: "CarrierConfigOverlay", 19 | sdk_version: "current", 20 | resource_dirs: ["res"], 21 | vendor: true, 22 | } 23 | -------------------------------------------------------------------------------- /overlay/FrameworksResOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 ArrowOS 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: "FrameworksResOverlay", 19 | sdk_version: "current", 20 | resource_dirs: ["res"], 21 | vendor: true, 22 | } 23 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_camera_default.te: -------------------------------------------------------------------------------- 1 | # For interfacing with PowerHAL 2 | hal_client_domain(hal_camera_default, hal_power) 3 | 4 | # Allow hal_camera_default to read to vendor_sysfs_kgsl 5 | r_dir_file(hal_camera_default, vendor_sysfs_kgsl) 6 | 7 | # Allow hal_camera_default to read to mnt/vendor/persist/camera 8 | r_dir_file(hal_camera_default, camera_persist_file) 9 | r_dir_file(hal_camera_default, mnt_vendor_file) 10 | r_dir_file(hal_camera_default, vendor_persist_sensors_file) 11 | 12 | allow hal_camera_default proc_stat:file read; 13 | 14 | set_prop(hal_camera_default, vendor_camera_prop) 15 | 16 | allow hal_camera_default socket_device:sock_file write; 17 | allow hal_camera_default proc_stat:file { open }; 18 | 19 | allow hal_camera_default public_adsprpcd_file:file r_file_perms; 20 | allow hal_camera_default vendor_xdsp_device:chr_file r_file_perms; 21 | -------------------------------------------------------------------------------- /overlay/SettingsProviderOverlay/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2021 ArrowOS 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: "SettingsProviderOverlay", 19 | sdk_version: "current", 20 | resource_dirs: ["res"], 21 | vendor: true, 22 | } 23 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_pickup.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/action_presets.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /XiaomiParts/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | #66000000 17 | 18 | 19 | -------------------------------------------------------------------------------- /overlay/SystemUIOverlay/res/values-sw372dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 16dp 20 | 21 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_mi.xml: -------------------------------------------------------------------------------- 1 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /overlay/SettingsOverlay/res/values/bools.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | false 17 | 18 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_xiaomidoze.xml: -------------------------------------------------------------------------------- 1 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /overlay/DialerOverlay/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | true 17 | 4 18 | 19 | -------------------------------------------------------------------------------- /sepolicy/vendor/system_app.te: -------------------------------------------------------------------------------- 1 | allow system_app vendor_sysfs_battery_supply:dir { search }; 2 | allow system_app vendor_sysfs_battery_supply:file { read }; 3 | allow system_app vendor_sysfs_battery_supply:file { open }; 4 | allow system_app vendor_sysfs_battery_supply:file { getattr }; 5 | allow system_app sysfs_kgsl:dir { read getattr search open }; 6 | 7 | r_dir_file(system_app, vendor_sysfs_battery_supply) 8 | r_dir_file(system_app, vendor_sysfs_graphics) 9 | 10 | allow system_app sysfs_zram:dir search; 11 | allow system_app sysfs_zram:file r_file_perms; 12 | 13 | allow system_app sysfs_fps:file rw_file_perms; 14 | 15 | allow system_app sysfs_thermal:file rw_file_perms; 16 | 17 | allow system_app kcal_dev:file rw_file_perms; 18 | allow system_app kcal_dev:dir search; 19 | 20 | allow system_app sysfs_fcharge:file { open read getattr write }; 21 | 22 | get_prop(system_app, vendor_persist_camera_prop) 23 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_vibrate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /configs/audio/bluetooth_hearing_aid_audio_policy_configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /overlay/TetheringConfigOverlay/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 | certificate: "platform", 21 | sdk_version: "current", 22 | product_specific: true 23 | } 24 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_thermal_benchmark.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /overlay/SystemUIOverlay/res/values-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | 17 | 0dp 18 | 19 | 20 | -------------------------------------------------------------------------------- /XiaomiParts/src/com/xiaomi/parts/XiaomipartsTile.java: -------------------------------------------------------------------------------- 1 | package com.xiaomi.parts; 2 | 3 | import android.content.ActivityNotFoundException; 4 | import android.content.Intent; 5 | import android.service.quicksettings.TileService; 6 | 7 | import com.xiaomi.parts.DeviceSettings; 8 | import com.xiaomi.parts.DeviceSettingsActivity; 9 | 10 | public class XiaomipartsTile extends TileService { 11 | 12 | @Override 13 | public void onClick() { 14 | try { 15 | Intent intent = new Intent(this, DeviceSettingsActivity.class); 16 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 17 | startActivityAndCollapse(intent); 18 | } catch (ActivityNotFoundException ignored) { 19 | // At this point, the app is most likely hidden and set to only open from Settings 20 | Intent intent = new Intent(this, DeviceSettings.class); 21 | startActivityAndCollapse(intent); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_hand.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/switchbar_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_kcal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_power_default.te: -------------------------------------------------------------------------------- 1 | # Allow hal_power_default to write to dt2w nodes 2 | allow hal_power_default input_device:dir r_dir_perms; 3 | allow hal_power_default input_device:chr_file rw_file_perms; 4 | 5 | r_dir_file(hal_power_default, input_device) 6 | 7 | allow hal_power_default { 8 | vendor_sysfs_devfreq 9 | sysfs_msm_subsys 10 | }:dir search; 11 | 12 | allow hal_power_default { 13 | cgroup 14 | proc 15 | vendor_sysfs_devfreq 16 | sysfs_devices_system_cpu 17 | vendor_sysfs_graphics 18 | vendor_sysfs_kgsl 19 | sysfs_msm_subsys 20 | vendor_sysfs_scsi_host 21 | }:{ 22 | file 23 | lnk_file 24 | } rw_file_perms; 25 | 26 | allow hal_power_default vendor_latency_device:chr_file rw_file_perms; 27 | 28 | # Rule for hal_power_default to access graphics composer process 29 | unix_socket_connect(hal_power_default, vendor_pps, hal_graphics_composer_default); 30 | 31 | # To get/set powerhal state property 32 | set_prop(hal_power_default, vendor_power_prop) 33 | -------------------------------------------------------------------------------- /XiaomiParts/res/layout/thermal_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 19 | -------------------------------------------------------------------------------- /sepolicy/vendor/platform_app.te: -------------------------------------------------------------------------------- 1 | # Dolby 2 | allow platform_app hal_dms_hwservice:hwservice_manager find; 3 | binder_call(platform_app, hal_dms_default) 4 | 5 | # Face Unlock 6 | get_prop(platform_app, vendor_camera_prop) 7 | 8 | # FPS Info 9 | allow platform_app sysfs_fps:file { getattr open read }; 10 | 11 | # System Info 12 | allow platform_app vendor_sysfs_battery_supply:dir search; 13 | allow platform_app vendor_sysfs_battery_supply:file { getattr open read }; 14 | allow platform_app vendor_sysfs_kgsl:dir search; 15 | allow platform_app vendor_sysfs_kgsl:file { getattr open read }; 16 | 17 | get_prop(platform_app, vendor_audio_prop); 18 | 19 | allow platform_app { 20 | DisplayFeatureControl 21 | miui_multi_display 22 | perfshielder 23 | ProcessManager 24 | }:service_manager find; 25 | 26 | allow platform_app { 27 | hal_camerapostproc_xiaomi_hwservice 28 | hal_misys_hwservice 29 | }:hwservice_manager find; 30 | 31 | allow platform_app app_data_file:file execute; 32 | -------------------------------------------------------------------------------- /XiaomiParts/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 11 | 12 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /overlay/DialerOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /overlay/SettingsOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /overlay/SystemUIOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /overlay/TelephonyOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /overlay/FrameworksResOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /XiaomiParts/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_MODULE_TAGS := optional 5 | LOCAL_STATIC_ANDROID_LIBRARIES := \ 6 | SettingsLib 7 | 8 | LOCAL_SRC_FILES := $(call all-java-files-under, src) 9 | LOCAL_PACKAGE_NAME := XiaomiParts 10 | LOCAL_CERTIFICATE := platform 11 | LOCAL_PRIVILEGED_MODULE := true 12 | LOCAL_PRIVATE_PLATFORM_APIS := true 13 | LOCAL_SYSTEM_EXT_MODULE := true 14 | LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res 15 | LOCAL_USE_AAPT2 := true 16 | 17 | package_resource_overlays := $(strip \ 18 | $(wildcard $(foreach dir, $(PRODUCT_PACKAGE_OVERLAYS), \ 19 | $(addprefix $(dir)/, packages/apps/XiaomiParts/res))) \ 20 | $(wildcard $(foreach dir, $(DEVICE_PACKAGE_OVERLAYS), \ 21 | $(addprefix $(dir)/, packages/apps/XiaomiParts/res)))) 22 | 23 | LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR) 24 | 25 | LOCAL_PROGUARD_ENABLED := disabled 26 | LOCAL_DEX_PREOPT := false 27 | 28 | include $(BUILD_PACKAGE) 29 | 30 | include $(call all-makefiles-under,$(LOCAL_PATH)) 31 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_clear_speaker.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /configs/dolby/privapp-com.dolby.daxservice.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /overlay/CarrierConfigOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /sepolicy/vendor/property_contexts: -------------------------------------------------------------------------------- 1 | # Bluetooth 2 | persist.vendor.bt. u:object_r:vendor_bluetooth_prop:s0 3 | 4 | # Camera 5 | persist.vendor.camera.mi.module. u:object_r:vendor_camera_prop:s0 6 | vendor.camera. u:object_r:vendor_camera_prop:s0 7 | persist.camera. u:object_r:vendor_camera_prop:s0 8 | 9 | # Fingerprint 10 | persist.vendor.sys.fp. u:object_r:vendor_fingerprint_prop:s0 11 | ro.hardware.fp u:object_r:vendor_fingerprint_prop:s0 12 | vendor.fps_hal. u:object_r:vendor_fingerprint_prop:s0 13 | vendor.sys.fp u:object_r:vendor_fingerprint_prop:s0 14 | 15 | # Power 16 | vendor.powerhal.state u:object_r:vendor_power_prop:s0 17 | vendor.powerhal.audio u:object_r:vendor_power_prop:s0 18 | vendor.powerhal.lpm u:object_r:vendor_power_prop:s0 19 | vendor.powerhal.init u:object_r:vendor_power_prop:s0 20 | vendor.powerhal.rendering u:object_r:vendor_power_prop:s0 21 | -------------------------------------------------------------------------------- /overlay/SettingsProviderOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /XiaomiParts/res/layout/doze.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_fps_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /XiaomiParts/res/layout/thermal.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /XiaomiDoze/res/drawable/ic_wake_gesture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_pocket.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /XiaomiDoze/res/drawable/ic_pickup_up_gesture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_custom_seekbar_minus.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /sepolicy/vendor/hal_fingerprint_default.te: -------------------------------------------------------------------------------- 1 | typeattribute hal_fingerprint_default data_between_core_and_vendor_violators; 2 | 3 | allow hal_fingerprint_default fingerprint_data_file:dir rw_dir_perms; 4 | allow hal_fingerprint_default fingerprint_data_file:file create_file_perms; 5 | allow hal_fingerprint_default vendor_hal_perf_hwservice:hwservice_manager find; 6 | 7 | allow hal_fingerprint_default { 8 | fingerprint_device 9 | input_device 10 | tee_device 11 | uhid_device 12 | }: chr_file rw_file_perms; 13 | 14 | allow hal_fingerprint_default self:netlink_socket create_socket_perms_no_ioctl; 15 | 16 | allow hal_fingerprint_default { 17 | input_device 18 | vendor_sysfs_graphics 19 | sysfs_msm_subsys 20 | }: dir r_dir_perms; 21 | 22 | allow hal_fingerprint_default { 23 | vendor_sysfs_fingerprint 24 | vendor_sysfs_fps_attr 25 | vendor_sysfs_graphics 26 | sysfs_msm_subsys 27 | }: file rw_file_perms; 28 | 29 | r_dir_file(hal_fingerprint_default, firmware_file) 30 | 31 | set_prop(hal_fingerprint_default, vendor_fingerprint_prop) 32 | 33 | allow hal_fingerprint_default vendor_sysfs_spss:dir { search }; 34 | allow hal_fingerprint_default vendor_sysfs_spss:file { open read }; 35 | -------------------------------------------------------------------------------- /XiaomiDoze/res/drawable/ic_hand_wave_gesture.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_dirac.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 23 | 28 | 29 | -------------------------------------------------------------------------------- /XiaomiParts/src/com/xiaomi/parts/dirac/DiracTileService.java: -------------------------------------------------------------------------------- 1 | package com.xiaomi.parts.dirac; 2 | 3 | import android.content.Context; 4 | import android.service.quicksettings.Tile; 5 | import android.service.quicksettings.TileService; 6 | 7 | import com.xiaomi.parts.R; 8 | 9 | public class DiracTileService extends TileService { 10 | 11 | private DiracUtils mDiracUtils; 12 | 13 | @Override 14 | public void onStartListening() { 15 | 16 | Tile tile = getQsTile(); 17 | if (mDiracUtils.isDiracEnabled()) { 18 | tile.setState(Tile.STATE_ACTIVE); 19 | } else { 20 | tile.setState(Tile.STATE_INACTIVE); 21 | } 22 | 23 | tile.updateTile(); 24 | super.onStartListening(); 25 | } 26 | 27 | @Override 28 | public void onClick() { 29 | Tile tile = getQsTile(); 30 | if (mDiracUtils.isDiracEnabled()) { 31 | mDiracUtils.setEnabled(false); 32 | tile.setState(Tile.STATE_INACTIVE); 33 | } else { 34 | mDiracUtils.setEnabled(true); 35 | tile.setState(Tile.STATE_ACTIVE); 36 | } 37 | tile.updateTile(); 38 | super.onClick(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /overlay/SettingsOverlay/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 25 | 26 | 0 27 | -1 28 | -1 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /XiaomiParts/res/drawable/ic_custom_seekbar_plus.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /overlay/NotchBarKillerOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 21 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /overlay/WifiOverlay/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 22 | 23 | 28 | 29 | -------------------------------------------------------------------------------- /rootdir/etc/init.xiaomiparts.rc: -------------------------------------------------------------------------------- 1 | on boot 2 | 3 | # FPS Info permissions 4 | chown system graphics /sys/class/drm/sde-crtc-0/measured_fps 5 | chmod 0666 /sys/class/drm/sde-crtc-0/measured_fps 6 | 7 | # KCAL permissions 8 | chown system system /sys/devices/platform/kcal_ctrl.0/kcal 9 | chown system system /sys/devices/platform/kcal_ctrl.0/kcal_enable 10 | chown system system /sys/devices/platform/kcal_ctrl.0/kcal_cont 11 | chown system system /sys/devices/platform/kcal_ctrl.0/kcal_sat 12 | chown system system /sys/devices/platform/kcal_ctrl.0/kcal_hue 13 | chown system system /sys/devices/platform/kcal_ctrl.0/kcal_min 14 | chown system system /sys/devices/platform/kcal_ctrl.0/kcal_val 15 | chmod 0660 /sys/devices/platform/kcal_ctrl.0/kcal 16 | chmod 0660 /sys/devices/platform/kcal_ctrl.0/kcal_enable 17 | chmod 0660 /sys/devices/platform/kcal_ctrl.0/kcal_cont 18 | chmod 0660 /sys/devices/platform/kcal_ctrl.0/kcal_sat 19 | chmod 0660 /sys/devices/platform/kcal_ctrl.0/kcal_hue 20 | chmod 0660 /sys/devices/platform/kcal_ctrl.0/kcal_min 21 | chmod 0660 /sys/devices/platform/kcal_ctrl.0/kcal_val 22 | 23 | # USB Fastcharge permissions 24 | chown system system /sys/kernel/fast_charge/force_fast_charge 25 | chmod 0660 /sys/kernel/fast_charge/force_fast_charge 26 | -------------------------------------------------------------------------------- /XiaomiParts/src/com/xiaomi/parts/preferences/SecureSettingCustomSeekBarPreference.java: -------------------------------------------------------------------------------- 1 | package com.xiaomi.parts.preferences; 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 | -------------------------------------------------------------------------------- /init/Android.bp: -------------------------------------------------------------------------------- 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 | cc_library_static { 18 | name: "libinit_xiaomi_sm6250_common", 19 | recovery_available: true, 20 | srcs: [ 21 | "init_common.cpp" 22 | ], 23 | include_dirs: [ 24 | "system/libbase/include", 25 | "system/core/init" 26 | ], 27 | export_include_dirs: [ 28 | "include" 29 | ], 30 | shared_libs: [ 31 | "libbase", 32 | ] 33 | } 34 | 35 | cc_library_static { 36 | name: "libinit_xiaomi_sm6250", 37 | recovery_available: true, 38 | srcs: [ 39 | "init.cpp" 40 | ], 41 | whole_static_libs: [ 42 | "libinit_xiaomi_sm6250_common" 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /XiaomiDoze/src/com/xiaomi/doze/DozeSettingsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2022 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.xiaomi.doze; 18 | 19 | import android.os.Bundle; 20 | 21 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; 22 | import com.android.settingslib.widget.R; 23 | 24 | public class DozeSettingsActivity extends CollapsingToolbarBaseActivity { 25 | 26 | private static final String TAG_DOZE = "doze"; 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | 32 | getFragmentManager().beginTransaction().replace(R.id.content_frame, 33 | new DozeSettingsFragment(), TAG_DOZE).commit(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /XiaomiParts/src/com/xiaomi/parts/dirac/DiracActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.xiaomi.parts.dirac; 18 | 19 | import android.os.Bundle; 20 | 21 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; 22 | import com.android.settingslib.widget.R; 23 | 24 | public class DiracActivity extends CollapsingToolbarBaseActivity { 25 | 26 | private static final String TAG_DIRAC = "dirac"; 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | 32 | getFragmentManager().beginTransaction().replace(R.id.content_frame, 33 | new DiracSettingsFragment(), TAG_DIRAC).commit(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /setup-makefiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # SPDX-License-Identifier: Apache-2.0 7 | # 8 | 9 | set -e 10 | 11 | # Load extract_utils and do some sanity checks 12 | MY_DIR="${BASH_SOURCE%/*}" 13 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 14 | 15 | ANDROID_ROOT="${MY_DIR}/../../.." 16 | 17 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 18 | if [ ! -f "${HELPER}" ]; then 19 | echo "Unable to find helper script at ${HELPER}" 20 | exit 1 21 | fi 22 | source "${HELPER}" 23 | 24 | # Initialize the helper for common 25 | setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true 26 | 27 | # Warning headers and guards 28 | write_headers "curtana excalibur gram joyeuse miatoll" 29 | 30 | # The standard common blobs 31 | write_makefiles "${MY_DIR}/proprietary-files.txt" true 32 | 33 | # Finish 34 | write_footers 35 | 36 | if [ -s "${MY_DIR}/../${DEVICE}/proprietary-files.txt" ]; then 37 | # Reinitialize the helper for device 38 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false 39 | 40 | # Warning headers and guards 41 | write_headers 42 | 43 | # The standard device blobs 44 | write_makefiles "${MY_DIR}/../${DEVICE}/proprietary-files.txt" true 45 | 46 | # Finish 47 | write_footers 48 | fi 49 | -------------------------------------------------------------------------------- /XiaomiParts/src/com/xiaomi/parts/DeviceSettingsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 The Xiaomi-SM6250 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 com.xiaomi.parts; 18 | 19 | import android.os.Bundle; 20 | 21 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; 22 | import com.android.settingslib.widget.R; 23 | 24 | public class DeviceSettingsActivity extends CollapsingToolbarBaseActivity { 25 | 26 | private static final String TAG_DEVICESETTINGS = "devicesettings"; 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | 32 | getFragmentManager().beginTransaction().replace(R.id.content_frame, 33 | new DeviceSettings(), TAG_DEVICESETTINGS).commit(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /XiaomiParts/src/com/xiaomi/parts/speaker/ClearSpeakerActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 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 com.xiaomi.parts.speaker; 18 | 19 | import android.os.Bundle; 20 | 21 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; 22 | import com.android.settingslib.widget.R; 23 | 24 | public class ClearSpeakerActivity extends CollapsingToolbarBaseActivity { 25 | 26 | private static final String TAG_CLEARSPEAKER = "clearspeaker"; 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | 32 | getFragmentManager().beginTransaction().replace(R.id.content_frame, 33 | new ClearSpeakerFragment(), TAG_CLEARSPEAKER).commit(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /XiaomiParts/src/com/xiaomi/parts/ambient/AmbientGesturePreferenceActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.xiaomi.parts.ambient; 18 | 19 | import android.os.Bundle; 20 | 21 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; 22 | import com.android.settingslib.widget.R; 23 | 24 | public class AmbientGesturePreferenceActivity extends CollapsingToolbarBaseActivity { 25 | 26 | private static final String TAG_AMBIENTGESTURES = "ambientgestures"; 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | getFragmentManager().beginTransaction().replace(R.id.content_frame, 32 | new AmbientGesturePreferenceFragment(), TAG_AMBIENTGESTURES).commit(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /XiaomiDoze/src/com/xiaomi/doze/BootCompletedReceiver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 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 com.xiaomi.doze; 19 | 20 | import android.content.BroadcastReceiver; 21 | import android.content.Context; 22 | import android.content.Intent; 23 | import android.util.Log; 24 | 25 | public class BootCompletedReceiver extends BroadcastReceiver { 26 | 27 | private static final boolean DEBUG = false; 28 | private static final String TAG = "XiaomiDoze"; 29 | 30 | @Override 31 | public void onReceive(final Context context, Intent intent) { 32 | if (Utils.isDozeEnabled(context) && Utils.sensorsEnabled(context)) { 33 | if (DEBUG) Log.d(TAG, "Starting service"); 34 | Utils.startService(context); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /sepolicy/vendor/batterysecret.te: -------------------------------------------------------------------------------- 1 | type batterysecret, domain; 2 | type batterysecret_exec, exec_type, vendor_file_type, file_type; 3 | 4 | init_daemon_domain(batterysecret) 5 | 6 | r_dir_file(batterysecret, cgroup) 7 | r_dir_file(batterysecret, mnt_vendor_file) 8 | r_dir_file(batterysecret, vendor_sysfs_battery_supply) 9 | r_dir_file(batterysecret, sysfs_batteryinfo) 10 | r_dir_file(batterysecret, sysfs_type) 11 | r_dir_file(batterysecret, vendor_sysfs_usb_supply) 12 | r_dir_file(batterysecret, vendor_sysfs_usbpd_device) 13 | 14 | allow batterysecret { 15 | mnt_vendor_file 16 | persist_subsys_file 17 | rootfs 18 | }:dir rw_dir_perms; 19 | 20 | allow batterysecret { 21 | vendor_sysfs_battery_supply 22 | sysfs_usb 23 | vendor_sysfs_usb_supply 24 | vendor_sysfs_usbpd_device 25 | }:file rw_file_perms; 26 | 27 | allow batterysecret persist_subsys_file:file create_file_perms; 28 | 29 | allow batterysecret kmsg_device:chr_file rw_file_perms; 30 | 31 | allow batterysecret self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; 32 | 33 | allow batterysecret self:global_capability_class_set { 34 | sys_tty_config 35 | sys_boot 36 | }; 37 | 38 | allow batterysecret self:capability { 39 | chown 40 | fsetid 41 | }; 42 | 43 | allow batterysecret { 44 | system_suspend_hwservice 45 | hidl_manager_hwservice 46 | }:hwservice_manager find; 47 | 48 | binder_call(batterysecret, system_suspend_server) 49 | 50 | wakelock_use(batterysecret) 51 | -------------------------------------------------------------------------------- /overlay/NotchBarKillerOverlay/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 22 | true 23 | 24 | M 0,0 L 0, 0 C 0,0 0,0 0,0 25 | @*android:string/config_mainBuiltInDisplayCutout 26 | 27 | 28 | 4 29 | 5 30 | 31 | 32 | -------------------------------------------------------------------------------- /XiaomiParts/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /releasetools.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 The LineageOS Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # http://www.apache.org/licenses/LICENSE-2.0 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | import common 14 | 15 | def FullOTA_InstallEnd(info): 16 | OTA_InstallEnd(info, info.input_zip) 17 | return 18 | 19 | def IncrementalOTA_InstallEnd(info): 20 | OTA_InstallEnd(info, info.target_zip) 21 | return 22 | 23 | def AddImage(info, input_zip, basename, dest): 24 | path = "IMAGES/" + basename 25 | if path not in input_zip.namelist(): 26 | return 27 | 28 | data = input_zip.read(path) 29 | common.ZipWriteStr(info.output_zip, basename, data) 30 | info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) 31 | info.script.AppendExtra('package_extract_file("%s", "%s");' % (basename, dest)) 32 | 33 | def OTA_InstallEnd(info, input_zip): 34 | AddImage(info, input_zip, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo") 35 | AddImage(info, input_zip, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta") 36 | AddImage(info, input_zip, "vbmeta_system.img", "/dev/block/bootdevice/by-name/vbmeta_system") 37 | return 38 | -------------------------------------------------------------------------------- /configs/audio/audio_configs_stock.xml: -------------------------------------------------------------------------------- 1 | 2 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /configs/usr/keylayout/sm8150-tavil-snd-card_Button_Jack.kl: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 226 HEADSETHOOK 29 | key 257 VOLUME_UP 30 | key 258 VOLUME_DOWN 31 | 32 | -------------------------------------------------------------------------------- /configs/usr/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 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | key 115 VOLUME_UP 29 | key 114 VOLUME_DOWN 30 | key 102 HOME 31 | key 528 FOCUS 32 | key 766 CAMERA 33 | -------------------------------------------------------------------------------- /overlay/FrameworksResOverlay/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 25 | 93px 26 | 27 | 29 | 93px 30 | 31 | 33 | 100px 34 | 35 | 37 | 100px 38 | 39 | 40 | -------------------------------------------------------------------------------- /configs/perf/msm_irqbalance.conf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | # 29 | 30 | PRIO=1,1,0,0,0,0,0,0 31 | #arch_timer, arm-pmu, arch_mem_timer, msm_drm, kgsl-3d0 32 | IGNORED_IRQ=19,21,38,115,332 33 | -------------------------------------------------------------------------------- /XiaomiParts/src/com/xiaomi/parts/SuTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020 The Xiaomi-SM6250 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 com.xiaomi.parts; 18 | 19 | import android.content.Context; 20 | import android.os.AsyncTask; 21 | import android.widget.Toast; 22 | 23 | import com.xiaomi.parts.R; 24 | 25 | public abstract class SuTask extends AsyncTask { 26 | private Context mContext; 27 | 28 | public SuTask(Context context) { 29 | super(); 30 | mContext = context; 31 | } 32 | 33 | abstract protected void sudoInBackground(Params... params) 34 | throws SuShell.SuDeniedException; 35 | 36 | @Override 37 | protected Boolean doInBackground(Params... params) { 38 | try { 39 | sudoInBackground(params); 40 | return true; 41 | } catch (SuShell.SuDeniedException e) { 42 | return false; 43 | } 44 | } 45 | 46 | @Override 47 | protected void onPostExecute(Boolean result) { 48 | super.onPostExecute(result); 49 | if (!result) { 50 | Toast.makeText(mContext, R.string.cannot_get_su, 51 | Toast.LENGTH_LONG).show(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /configs/config.fs: -------------------------------------------------------------------------------- 1 | [AID_VENDOR_QTI_DIAG] 2 | value:2901 3 | 4 | [AID_VENDOR_QDSS] 5 | value:2902 6 | 7 | [AID_VENDOR_RFS] 8 | value:2903 9 | 10 | [AID_VENDOR_RFS_SHARED] 11 | value:2904 12 | 13 | [AID_VENDOR_ADPL_ODL] 14 | value:2905 15 | 16 | [AID_VENDOR_QRTR] 17 | value:2906 18 | 19 | [AID_VENDOR_THERMAL] 20 | value:2907 21 | 22 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti] 23 | mode: 0755 24 | user: AID_BLUETOOTH 25 | group: AID_BLUETOOTH 26 | caps: BLOCK_SUSPEND NET_ADMIN 27 | 28 | [vendor/bin/pm-service] 29 | mode: 0755 30 | user: AID_SYSTEM 31 | group: AID_SYSTEM 32 | caps: NET_BIND_SERVICE SYS_BOOT 33 | 34 | [vendor/bin/pd-mapper] 35 | mode: 0755 36 | user: AID_SYSTEM 37 | group: AID_SYSTEM 38 | caps: NET_BIND_SERVICE 39 | 40 | [vendor/bin/imsdatadaemon] 41 | mode: 0755 42 | user: AID_RADIO 43 | group: AID_RADIO 44 | caps: NET_BIND_SERVICE 45 | 46 | [vendor/bin/ims_rtp_daemon] 47 | mode: 0755 48 | user: AID_RADIO 49 | group: AID_RADIO 50 | caps: NET_BIND_SERVICE 51 | 52 | [vendor/bin/imsrcsd] 53 | mode: 0755 54 | user: AID_RADIO 55 | group: AID_RADIO 56 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 57 | 58 | [vendor/bin/cnd] 59 | mode: 0755 60 | user: AID_SYSTEM 61 | group: AID_SYSTEM 62 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN 63 | 64 | [vendor/bin/slim_daemon] 65 | mode: 0755 66 | user: AID_GPS 67 | group: AID_GPS 68 | caps: NET_BIND_SERVICE 69 | 70 | [vendor/bin/loc_launcher] 71 | mode: 0755 72 | user: AID_GPS 73 | group: AID_GPS 74 | caps: SETUID SETGID 75 | 76 | [vendor/bin/xtwifi-client] 77 | mode: 0755 78 | user: AID_GPS 79 | group: AID_GPS 80 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 81 | 82 | [vendor/bin/sensors.qti] 83 | mode: 0755 84 | user: AID_SYSTEM 85 | group: AID_SYSTEM 86 | caps: NET_BIND_SERVICE 87 | 88 | [vendor/firmware_mnt/image/*] 89 | mode: 0771 90 | user: AID_SYSTEM 91 | group: AID_SYSTEM 92 | caps: 0 93 | -------------------------------------------------------------------------------- /XiaomiParts/src/com/xiaomi/parts/thermal/ThermalActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 The LineageOS Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.xiaomi.parts.thermal; 18 | 19 | import android.os.Bundle; 20 | import android.view.MenuItem; 21 | 22 | import com.xiaomi.parts.utils.FileUtils; 23 | 24 | import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; 25 | import com.android.settingslib.widget.R; 26 | 27 | public class ThermalActivity extends CollapsingToolbarBaseActivity { 28 | 29 | private static final String TAG_THERMAL = "thermal"; 30 | private static final String THERMAL_SCONFIG = "/sys/class/thermal/thermal_message/sconfig"; 31 | 32 | @Override 33 | protected void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | 36 | if (FileUtils.fileExists(THERMAL_SCONFIG)) { 37 | getFragmentManager().beginTransaction().replace(R.id.content_frame, 38 | new ThermalSettingsFragment(), TAG_THERMAL).commit(); 39 | } 40 | } 41 | 42 | @Override 43 | public boolean onOptionsItemSelected(MenuItem item) { 44 | if (item.getItemId() == android.R.id.home) { 45 | onBackPressed(); 46 | return true; 47 | } 48 | return false; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /overlay/SettingsProviderOverlay/res/values/defaults.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | false 23 | 24 | 25 | 50 26 | 27 | 28 | 120000 29 | 30 | 31 | false 32 | 33 | 34 | false 35 | 36 | 37 | 0 38 | 39 | 40 | true 41 | 42 | 43 | true 44 | 45 | 46 | true 47 | 48 | 49 | -------------------------------------------------------------------------------- /XiaomiParts/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 11 | 12 | 21 | 22 | 26 | 27 | 30 | 31 | 34 | 35 | 37 | 38 |