├── configs
├── wifi
│ ├── grippower.info
│ ├── wpa_supplicant_overlay.conf
│ ├── WCNSS_cfg.dat
│ └── p2p_supplicant_overlay.conf
├── gps
│ ├── gps_debug.conf
│ └── gps.cfg
├── init
│ ├── android.hardware.bluetooth@1.0-service-qti.rc
│ ├── vendor.samsung.hardware.camera.provider@2.4-service.rc
│ └── android.hardware.drm@1.1-service.widevine.rc
├── keylayout
│ ├── sec_touchkey.kl
│ └── gpio-keys.kl
├── idc
│ ├── ft5x06_ts.idc
│ ├── sec_touchscreen.idc
│ ├── Synaptics_HID_TouchPad.idc
│ └── Synaptics_RMI4_TouchPad_Sensor.idc
├── nfc
│ ├── libnfc-sec-vendor.conf
│ └── libnfc-nci.conf
└── audio
│ └── audio_policy_configuration.xml
├── Android.bp
├── sepolicy
├── toolbox.te
├── charger.te
├── mediaextractor.te
├── nfc.te
├── radio.te
├── fsck.te
├── service_contexts
├── fsck_untrusted.te
├── hal_radio_default.te
├── uncrypt.te
├── surfaceflinger.te
├── hal_health_default.te
├── genfs_contexts
├── installd.te
├── mediadrmserver.te
├── bluetooth.te
├── hal_vibrator_default.te
├── hwservice.te
├── hwservicemanager.te
├── hal_light_default.te
├── healthd.te
├── domain.te
├── modemloader.te
├── hal_nfc_default.te
├── hal_lineage_fastcharge_default.te
├── system_app.te
├── audioserver.te
├── tee.te
├── hal_lineage_touch_default.te
├── vold.te
├── hal_camera_default.te
├── property.te
├── netd.te
├── mediacodec.te
├── hal_drm_default.te
├── hal_audio_default.te
├── hal_lineage_livedisplay_sysfs.te
├── mediaserver.te
├── hal_bluetooth_default.te
├── hwservice_contexts
├── hal_wifi_default.te
├── hal_drm_clearkey.te
├── ueventd.te
├── hal_graphics_composer_default.te
├── vendor_secril_config_svc.te
├── cameraserver.te
├── hal_power_default.te
├── hal_gnss_default.te
├── device.te
├── vendor_init.te
├── hal_sensors_default.te
├── hal_drm_widevine.te
├── kernel.te
├── hal_fingerprint_default.te
├── property_contexts
├── cpboot-daemon.te
├── init.te
├── gpsd.te
├── file.te
├── rild.te
└── system_server.te
├── seccomp
├── mediacodec-seccomp.policy
└── mediaextractor-seccomp.policy
├── config.fs
├── overlay
├── packages
│ ├── apps
│ │ ├── FlipFlap
│ │ │ └── res
│ │ │ │ └── values
│ │ │ │ ├── config.xml
│ │ │ │ └── dimens.xml
│ │ ├── CarrierConfig
│ │ │ └── res
│ │ │ │ └── xml
│ │ │ │ └── vendor.xml
│ │ ├── Settings
│ │ │ └── res
│ │ │ │ └── values
│ │ │ │ ├── dimens.xml
│ │ │ │ └── config.xml
│ │ ├── Snap
│ │ │ └── res
│ │ │ │ └── values
│ │ │ │ └── config.xml
│ │ └── Mms
│ │ │ └── res
│ │ │ └── xml
│ │ │ └── mms_config.xml
│ └── services
│ │ └── Telephony
│ │ └── res
│ │ └── values
│ │ └── config.xml
├── frameworks
│ └── base
│ │ └── packages
│ │ ├── SettingsLib
│ │ └── res
│ │ │ └── values
│ │ │ └── config.xml
│ │ └── SystemUI
│ │ └── res
│ │ └── values
│ │ └── config.xml
└── lineage-sdk
│ └── lineage
│ └── res
│ └── res
│ └── values
│ └── config.xml
├── rro_overlays
├── WifiOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ │ └── values
│ │ └── config.xml
└── TetheringOverlay
│ ├── Android.bp
│ ├── AndroidManifest.xml
│ └── res
│ └── values
│ └── config.xml
├── livedisplay
├── vendor.lineage.livedisplay@2.1-service.universal7880.rc
├── Android.bp
├── ReadingEnhancement.h
├── ReadingEnhancement.cpp
├── SunlightEnhancement.h
├── SunlightEnhancement.cpp
├── DisplayColorCalibration.h
├── DisplayModes.h
├── DisplayColorCalibration.cpp
├── DisplayModes.cpp
└── service.cpp
├── ramdisk
├── init.recovery.samsungexynos7880.rc
├── init.vendor.rilcommon.rc
├── init.gps.rc
├── wifi_qcom.rc
├── init.vendor.rilchip.rc
├── mobicore.rc
├── fstab.samsungexynos7880
├── wifi_sec.rc
├── init.baseband.rc
├── Android.mk
└── ueventd.samsungexynos7880.rc
├── amplifier
├── Android.mk
├── tfa.h
├── amplifier.c
└── tfa.c
├── shims
├── Android.mk
├── libcamera_client
│ ├── Android.mk
│ ├── CameraParameters.h
│ └── CameraParameters.cpp
├── libbauthtzcommon
│ ├── Android.mk
│ └── libbauthtzcommon.c
└── libexynoscamera
│ ├── Android.mk
│ └── GraphicBuffer.cpp
├── Android.mk
├── init
├── Android.bp
├── init_sec.h
└── init_sec.cpp
├── include
├── samsung_fastcharge.h
├── samsung_power.h
├── samsung_audio.h
└── telephony
│ ├── ril_commands_vendor.h
│ └── ril_unsol_commands_vendor.h
├── camera
├── SECCameraProperties.h
└── Android.bp
├── lineage.dependencies
├── twrp
└── twrp.fstab
├── bluetooth
└── bdroid_buildcfg.h
├── libhidl
└── Android.mk
├── releasetools.py
├── system.prop
├── extract-files.sh
├── setup-makefiles.sh
└── BoardConfigCommon.mk
/configs/wifi/grippower.info:
--------------------------------------------------------------------------------
1 | 14:12
--------------------------------------------------------------------------------
/Android.bp:
--------------------------------------------------------------------------------
1 | soong_namespace {
2 | }
3 |
--------------------------------------------------------------------------------
/sepolicy/toolbox.te:
--------------------------------------------------------------------------------
1 | allow toolbox ram_device:blk_file rw_file_perms;
2 |
--------------------------------------------------------------------------------
/sepolicy/charger.te:
--------------------------------------------------------------------------------
1 | allow charger sysfs_charger:file { open read getattr };
2 |
--------------------------------------------------------------------------------
/sepolicy/mediaextractor.te:
--------------------------------------------------------------------------------
1 | allow mediaextractor fuse:file { read getattr };
2 |
--------------------------------------------------------------------------------
/configs/wifi/wpa_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | p2p_disabled=1
2 | update_config=1
3 | pmf=1
--------------------------------------------------------------------------------
/seccomp/mediacodec-seccomp.policy:
--------------------------------------------------------------------------------
1 | # for H/W Codec
2 | uname: 1
3 | getdents64: 1
4 |
--------------------------------------------------------------------------------
/config.fs:
--------------------------------------------------------------------------------
1 | [efs/]
2 | mode: 0771
3 | user: AID_SYSTEM
4 | group: AID_RADIO
5 | caps: 0
6 |
--------------------------------------------------------------------------------
/sepolicy/nfc.te:
--------------------------------------------------------------------------------
1 | allow nfc sec_efs_file:dir search;
2 | allow nfc efs_file:dir search;
3 |
--------------------------------------------------------------------------------
/seccomp/mediaextractor-seccomp.policy:
--------------------------------------------------------------------------------
1 | nanosleep: 1
2 | _llseek: 1
3 | pread64: 1
4 | readlinkat: 1
5 |
--------------------------------------------------------------------------------
/sepolicy/radio.te:
--------------------------------------------------------------------------------
1 | binder_call(radio, gpuservice)
2 |
3 | allow radio system_app_data_file:dir getattr;
4 |
--------------------------------------------------------------------------------
/sepolicy/fsck.te:
--------------------------------------------------------------------------------
1 | # /dev/block/mmcblk0p3
2 | allow fsck emmcblk_device:blk_file { read write open ioctl getattr };
3 |
--------------------------------------------------------------------------------
/sepolicy/service_contexts:
--------------------------------------------------------------------------------
1 | # HWC
2 | Exynos.HWCService u:object_r:surfaceflinger_service:s0
3 |
--------------------------------------------------------------------------------
/sepolicy/fsck_untrusted.te:
--------------------------------------------------------------------------------
1 | allow fsck_untrusted sysfs_mmc:file r_file_perms;
2 | allow fsck_untrusted sysfs_mmc:dir search;
3 |
--------------------------------------------------------------------------------
/sepolicy/hal_radio_default.te:
--------------------------------------------------------------------------------
1 | allow hal_radio_default rild:binder call;
2 | allow hal_radio_default rild:binder transfer;
3 |
--------------------------------------------------------------------------------
/sepolicy/uncrypt.te:
--------------------------------------------------------------------------------
1 | allow uncrypt emmcblk_device:blk_file w_file_perms;
2 | allow uncrypt emmcblk_device:dir r_dir_perms;
3 |
--------------------------------------------------------------------------------
/configs/wifi/WCNSS_cfg.dat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LineageOS/android_device_samsung_universal7880-common/HEAD/configs/wifi/WCNSS_cfg.dat
--------------------------------------------------------------------------------
/sepolicy/surfaceflinger.te:
--------------------------------------------------------------------------------
1 | # HWC
2 | allow surfaceflinger secmem_device:chr_file rw_file_perms;
3 | allow surfaceflinger sysfs:file { getattr open read };
4 |
--------------------------------------------------------------------------------
/sepolicy/hal_health_default.te:
--------------------------------------------------------------------------------
1 | allow hal_health_default sysfs_charger:dir search;
2 | allow hal_health_default sysfs_charger:file { read open getattr };
3 |
4 |
--------------------------------------------------------------------------------
/sepolicy/genfs_contexts:
--------------------------------------------------------------------------------
1 | # mali debugfs
2 | genfscon debugfs /mali/ u:object_r:debugfs_mali:s0
3 |
4 | # ion debugfs
5 | genfscon debugfs /ion/ u:object_r:debugfs_ion:s0
6 |
--------------------------------------------------------------------------------
/configs/gps/gps_debug.conf:
--------------------------------------------------------------------------------
1 | NTP_SERVER=north-america.pool.ntp.org
2 | XTRA_SERVER_1=http://1.ssiloc.com:80/p2/22F3
3 | SUPL_HOST=supl.google.com
4 | SUPL_PORT=7275
5 | SUPL_MODE=1
6 |
--------------------------------------------------------------------------------
/overlay/packages/apps/FlipFlap/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3
4 |
5 |
--------------------------------------------------------------------------------
/sepolicy/installd.te:
--------------------------------------------------------------------------------
1 | # TbStorage (mobicore)
2 | allow installd mobicore_data_file:dir { rw_dir_perms rmdir };
3 | allow installd mobicore_vendor_data_file:dir { rw_dir_perms rmdir };
4 |
--------------------------------------------------------------------------------
/sepolicy/mediadrmserver.te:
--------------------------------------------------------------------------------
1 | allow mediadrmserver media_data_file:file { getattr open read create write };
2 | allow mediadrmserver media_data_file:dir { getattr write search add_name };
3 |
--------------------------------------------------------------------------------
/sepolicy/bluetooth.te:
--------------------------------------------------------------------------------
1 | # /dev/ttySAC0
2 | allow bluetooth bluetooth_device:chr_file { rw_file_perms ioctl };
3 |
4 | # /data/.cid.info
5 | allow bluetooth wifi_data_file:file r_file_perms;
6 |
--------------------------------------------------------------------------------
/rro_overlays/WifiOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | runtime_resource_overlay {
2 | name: "WifiOverlay",
3 | theme: "WifiOverlay",
4 | sdk_version: "current",
5 | product_specific: true
6 | }
7 |
--------------------------------------------------------------------------------
/sepolicy/hal_vibrator_default.te:
--------------------------------------------------------------------------------
1 | allow hal_vibrator_default sysfs_virtual:dir search;
2 | allow hal_vibrator_default sysfs_leds:dir search;
3 |
4 | allow hal_vibrator_default sysfs_virtual:file rw_file_perms;
5 |
--------------------------------------------------------------------------------
/sepolicy/hwservice.te:
--------------------------------------------------------------------------------
1 | type hal_sec_radio_hwservice, hwservice_manager_type;
2 | type hal_sec_radio_bridge_hwservice, hwservice_manager_type;
3 | type hal_sec_radio_channel_hwservice, hwservice_manager_type;
4 |
--------------------------------------------------------------------------------
/rro_overlays/TetheringOverlay/Android.bp:
--------------------------------------------------------------------------------
1 | runtime_resource_overlay {
2 | name: "TetheringConfigOverlay",
3 | theme: "TetheringConfigOverlay",
4 | sdk_version: "current",
5 | product_specific: true
6 | }
7 |
--------------------------------------------------------------------------------
/sepolicy/hwservicemanager.te:
--------------------------------------------------------------------------------
1 | # gpsd
2 | allow hwservicemanager gpsd:dir search;
3 | allow hwservicemanager gpsd:file { read open };
4 | allow hwservicemanager gpsd:process getattr;
5 | allow hwservicemanager gpsd:binder transfer;
6 |
--------------------------------------------------------------------------------
/sepolicy/hal_light_default.te:
--------------------------------------------------------------------------------
1 | allow hal_light_default sysfs_brightness:file { open read write getattr };
2 | allow hal_light_default sysfs_virtual:dir search;
3 | allow hal_light_default sysfs_virtual:file { read write open getattr };
4 |
--------------------------------------------------------------------------------
/sepolicy/healthd.te:
--------------------------------------------------------------------------------
1 | # healthd
2 | allow healthd device:dir rw_dir_perms;
3 | allow healthd rtc_device:chr_file rw_file_perms;
4 | allow healthd sysfs:file { open read getattr };
5 | allow healthd sysfs_charger:file { open read getattr };
6 |
--------------------------------------------------------------------------------
/sepolicy/domain.te:
--------------------------------------------------------------------------------
1 | dontaudit domain kernel:system module_request;
2 |
3 | # allow all domains to search in /sys/kernel/debug/mali
4 | allow domain debugfs_mali:dir search;
5 |
6 | # allow all domains to search in /sys/kernel/debug/ion
7 | allow domain debugfs_ion:dir search;
8 |
--------------------------------------------------------------------------------
/sepolicy/modemloader.te:
--------------------------------------------------------------------------------
1 | #### modemloader
2 | #
3 | type modemloader, domain;
4 | type modemloader_exec, exec_type, file_type, vendor_file_type;
5 |
6 | init_daemon_domain(modemloader)
7 |
8 | allow modemloader proc:file r_file_perms;
9 |
10 | set_prop(modemloader, modemloader_prop)
11 |
--------------------------------------------------------------------------------
/livedisplay/vendor.lineage.livedisplay@2.1-service.universal7880.rc:
--------------------------------------------------------------------------------
1 | on post-fs-data
2 | mkdir /data/vendor/display 0770 system system
3 |
4 | service vendor.livedisplay-hal-2-1-universal7880 /vendor/bin/hw/vendor.lineage.livedisplay@2.1-service.universal7880
5 | class hal
6 | user system
7 | group system
8 |
--------------------------------------------------------------------------------
/sepolicy/hal_nfc_default.te:
--------------------------------------------------------------------------------
1 | # hal_nfc_default.te
2 |
3 | allow hal_nfc_default {
4 | nfc_data_file
5 | nfc_vendor_data_file
6 | }:dir w_dir_perms;
7 |
8 | allow hal_nfc_default {
9 | nfc_data_file
10 | nfc_vendor_data_file
11 | }:file create_file_perms;
12 |
13 | set_prop(hal_nfc_default, vendor_nfc_prop)
14 |
--------------------------------------------------------------------------------
/sepolicy/hal_lineage_fastcharge_default.te:
--------------------------------------------------------------------------------
1 | # hal_lineage_fastcharge_default.te
2 |
3 | allow hal_lineage_fastcharge_default sysfs_virtual:dir search;
4 | allow hal_lineage_fastcharge_default sysfs_virtual:file rw_file_perms;
5 |
6 | get_prop(hal_lineage_fastcharge, sec_fastcharge_prop)
7 | set_prop(hal_lineage_fastcharge, sec_fastcharge_prop)
8 |
--------------------------------------------------------------------------------
/sepolicy/system_app.te:
--------------------------------------------------------------------------------
1 | allow system_app sysfs_mdnie:{ file lnk_file } rw_file_perms;
2 | allow system_app sysfs_mdnie:dir search;
3 | allow system_app wificond:binder call;
4 | allow system_app proc_pagetypeinfo:file { read open getattr };
5 | allow system_app sysfs_virtual:dir search;
6 | allow system_app sysfs_virtual:file { read open getattr };
7 |
--------------------------------------------------------------------------------
/configs/init/android.hardware.bluetooth@1.0-service-qti.rc:
--------------------------------------------------------------------------------
1 | service vendor.bluetooth-1-0-qti /vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti
2 | interface android.hardware.bluetooth@1.0::IBluetoothHci default
3 | class hal
4 | user bluetooth
5 | group bluetooth system wakelock oem_2901
6 | capabilities BLOCK_SUSPEND NET_ADMIN
7 |
--------------------------------------------------------------------------------
/sepolicy/audioserver.te:
--------------------------------------------------------------------------------
1 | # Allow rild to connect to gpsd
2 | unix_socket_connect(audioserver, property, rild)
3 |
4 | # /efs/maxim
5 | allow audioserver { efs_file sec_efs_file }:dir r_dir_perms;
6 | allow audioserver { efs_file sec_efs_file }:file r_file_perms;
7 |
8 | # TFA98xx amplifier
9 | allow audioserver amplifier_device:chr_file rw_file_perms;
10 |
--------------------------------------------------------------------------------
/sepolicy/tee.te:
--------------------------------------------------------------------------------
1 | # mobicore
2 |
3 | # Allow to create files and directories /data/app/mcRegistry
4 | file_type_auto_trans(tee, apk_data_file, mobicore_data_file);
5 |
6 | # /efs
7 | allow tee { efs_file prov_efs_file }:dir r_dir_perms;
8 | allow tee { efs_file prov_efs_file }:file r_file_perms;
9 |
10 | # sys.mobicore.enable
11 | set_prop(tee, tee_prop)
12 |
--------------------------------------------------------------------------------
/sepolicy/hal_lineage_touch_default.te:
--------------------------------------------------------------------------------
1 | allow hal_lineage_touch_default sysfs_input:dir search;
2 | allow hal_lineage_touch_default sysfs_input:file rw_file_perms;
3 |
4 | allow hal_lineage_touch_default sysfs_virtual:dir search;
5 | allow hal_lineage_touch_default sysfs_virtual:file { open read getattr };
6 | allow hal_lineage_touch_default sysfs_virtual:lnk_file read;
7 |
--------------------------------------------------------------------------------
/sepolicy/vold.te:
--------------------------------------------------------------------------------
1 | # /efs
2 | allow vold efs_file:dir r_dir_perms;
3 | # /dev/block/mmcblk0p[0-9]
4 | allow vold emmcblk_device:dir create_dir_perms;
5 | allow vold emmcblk_device:blk_file { ioctl read write create getattr setattr lock append unlink open };
6 |
7 | # sysfs_virtual
8 | allow vold sysfs_virtual:file write;
9 |
10 | allow vold sysfs_mmc:file write;
11 |
--------------------------------------------------------------------------------
/sepolicy/hal_camera_default.te:
--------------------------------------------------------------------------------
1 | # sysfs
2 | allow hal_camera_default { sysfs_virtual sysfs_camera}:dir search;
3 | allow hal_camera_default sysfs_camera:file rw_file_perms;
4 |
5 | allow hal_camera_default hal_graphics_mapper_hwservice:hwservice_manager find;
6 |
7 | allow hal_camera_default media_rw_data_file:dir search;
8 |
9 | vndbinder_use(hal_camera_default)
10 |
--------------------------------------------------------------------------------
/sepolicy/property.te:
--------------------------------------------------------------------------------
1 | # modemloader
2 | type modemloader_prop, property_type;
3 |
4 | # mobicore (tee)
5 | type tee_prop, property_type;
6 |
7 | # Fastcharge HAL
8 | type sec_fastcharge_prop, property_type;
9 |
10 | # CP-Boot Daemon
11 | type vendor_cbd_prop, property_type;
12 |
13 | # radio
14 | type vendor_radio_prop, property_type;
15 |
16 | # NFC
17 | type vendor_nfc_prop, property_type;
18 |
--------------------------------------------------------------------------------
/sepolicy/netd.te:
--------------------------------------------------------------------------------
1 | allow netd self:capability sys_module;
2 | allow netd gpsd:fd use;
3 | allow netd gpsd:udp_socket rw_socket_perms;
4 | allow netd gpsd:tcp_socket rw_socket_perms;
5 | allow netd init:tcp_socket { read write };
6 |
7 | allow netd init:tcp_socket getopt;
8 | allow netd init:tcp_socket setopt;
9 |
10 | allow netd sysfs_virtual:dir search;
11 | allow netd sysfs_virtual:file rw_file_perms;
12 |
--------------------------------------------------------------------------------
/overlay/packages/apps/FlipFlap/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 0px
5 | 60px
6 | 960px
7 | 960px
8 |
9 |
--------------------------------------------------------------------------------
/ramdisk/init.recovery.samsungexynos7880.rc:
--------------------------------------------------------------------------------
1 | on fs
2 | wait /dev/block/platform/13540000.dwmmc0
3 | symlink /dev/block/platform/13540000.dwmmc0 /dev/block/bootdevice
4 | symlink /dev/block/platform/13540000.dwmmc0/by-name/SYSTEM /dev/block/platform/13540000.dwmmc0/by-name/system
5 |
6 | on post-fs-data
7 | # avoid USB crash
8 | setprop persist.adb.nonblocking_ffs 0
9 | setprop ro.adb.nonblocking_ffs 0
10 |
--------------------------------------------------------------------------------
/sepolicy/mediacodec.te:
--------------------------------------------------------------------------------
1 | # /system/lib/omx/
2 | allow mediacodec system_file:dir r_dir_perms;
3 |
4 | # /sys/class/video4linux/video6/name
5 | allow mediacodec sysfs:file r_file_perms;
6 |
7 | allow mediacodec sysfs:dir { open read };
8 |
9 | # sysfs_virtual
10 | allow mediacodec sysfs_virtual:dir { open read search };
11 | allow mediacodec sysfs_virtual:file { open read };
12 |
13 | binder_call(mediacodec, hal_power_default)
14 |
--------------------------------------------------------------------------------
/sepolicy/hal_drm_default.te:
--------------------------------------------------------------------------------
1 | vndbinder_use(hal_drm_default)
2 |
3 | # /dev/s5p-smem
4 | allow hal_drm_default secmem_device:chr_file rw_file_perms;
5 | allow hal_drm_default tee:unix_stream_socket connectto;
6 | allow hal_drm_default efs_file:dir search;
7 | allow hal_drm_default cpk_efs_file:file r_file_perms;
8 |
9 | allow hal_drm_default media_data_file:file create_file_perms;
10 | allow hal_drm_default media_data_file:dir create_dir_perms;
11 |
--------------------------------------------------------------------------------
/configs/wifi/p2p_supplicant_overlay.conf:
--------------------------------------------------------------------------------
1 | disable_scan_offload=1
2 | p2p_listen_reg_class=81
3 | p2p_listen_channel=1
4 | p2p_oper_reg_class=124
5 | p2p_oper_channel=149
6 | manufacturer=SAMSUNG_ELECTRONICS
7 | model_name=SAMSUNG_MOBILE
8 | model_number=2014
9 | serial_number=19691101
10 | update_config=1
11 | p2p_add_cli_chan=1
12 | ip_addr_go=192.168.49.1
13 | ip_addr_mask=255.255.255.0
14 | ip_addr_start=192.168.49.200
15 | ip_addr_end=192.168.49.254
16 |
--------------------------------------------------------------------------------
/sepolicy/hal_audio_default.te:
--------------------------------------------------------------------------------
1 | allow hal_audio_default efs_file:dir search;
2 | allow hal_audio_default sec_efs_file:dir search;
3 | allow hal_audio_default sec_efs_file:file read;
4 | allow hal_audio_default sec_efs_file:file open;
5 |
6 | # Allow hal to take wakelock
7 | wakelock_use(hal_audio_default)
8 |
9 | allow hal_audio_default rild:unix_stream_socket connectto;
10 |
11 | allow hal_audio_default amplifier_device:chr_file { open read write ioctl };
12 |
--------------------------------------------------------------------------------
/configs/init/vendor.samsung.hardware.camera.provider@2.4-service.rc:
--------------------------------------------------------------------------------
1 | service sec-camera-provider-2-4 /vendor/bin/hw/vendor.samsung.hardware.camera.provider@2.4-service
2 | interface vendor.samsung.hardware.camera.provider@2.4::ISecCameraProvider legacy/0
3 | class hal
4 | user cameraserver
5 | group audio camera input drmrpc system media_rw sdcard_rw
6 | ioprio rt 4
7 | capabilities SYS_NICE
8 | writepid /dev/cpuset/camera-daemon/tasks /dev/stune/foreground/tasks
9 |
--------------------------------------------------------------------------------
/sepolicy/hal_lineage_livedisplay_sysfs.te:
--------------------------------------------------------------------------------
1 | # Allow LiveDisplay to store files under /data/vendor/display and access them
2 | allow hal_lineage_livedisplay_sysfs display_vendor_data_file:dir rw_dir_perms;
3 | allow hal_lineage_livedisplay_sysfs display_vendor_data_file:file create_file_perms;
4 | # Allow LiveDisplay to read and write to files in sysfs_graphics, sysfs_mdnie
5 | allow hal_lineage_livedisplay_sysfs sysfs_mdnie:dir search;
6 | allow hal_lineage_livedisplay_sysfs sysfs_mdnie:file rw_file_perms;
7 |
--------------------------------------------------------------------------------
/sepolicy/mediaserver.te:
--------------------------------------------------------------------------------
1 | # /efs
2 | allow mediaserver efs_file:dir r_dir_perms;
3 |
4 | # /efs/wv.keys
5 | allow mediaserver efs_file:file r_file_perms;
6 |
7 | # /dev/m2m1shot_jpeg
8 | allow mediaserver camera_device:chr_file { read write open getattr ioctl };
9 |
10 | # Snap permissions
11 | allow mediaserver sensorservice_service:service_manager { find };
12 | allow mediaserver system_server:unix_stream_socket { read write };
13 |
14 | allow mediaserver exported_camera_prop:file read;
15 |
--------------------------------------------------------------------------------
/sepolicy/hal_bluetooth_default.te:
--------------------------------------------------------------------------------
1 | allow hal_bluetooth_default bluetooth_device:chr_file { read write open ioctl };
2 |
3 | allow hal_bluetooth_default bluetooth_data_file:dir rw_dir_perms;
4 |
5 | allow hal_bluetooth_default efs_file:dir search;
6 |
7 | allow hal_bluetooth_default bluetooth_data_file:file create_file_perms;
8 |
9 | allow hal_bluetooth_default vendor_default_prop:property_service set;
10 |
11 | allow hal_bluetooth_default hal_bluetooth_hwservice:hwservice_manager { add find };
12 |
--------------------------------------------------------------------------------
/sepolicy/hwservice_contexts:
--------------------------------------------------------------------------------
1 | com.qualcomm.qti.ant::IAntHci u:object_r:hal_bluetooth_hwservice:s0
2 | vendor.samsung.hardware.camera.provider::ISecCameraProvider u:object_r:hal_camera_hwservice:s0
3 | vendor.samsung.hardware.radio::ISehRadio u:object_r:hal_telephony_hwservice:s0
4 | vendor.samsung.hardware.radio.bridge::ISehBridge u:object_r:hal_telephony_hwservice:s0
5 | vendor.samsung.hardware.radio.channel::ISehChannel u:object_r:hal_telephony_hwservice:s0
6 |
--------------------------------------------------------------------------------
/rro_overlays/TetheringOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/sepolicy/hal_wifi_default.te:
--------------------------------------------------------------------------------
1 | #### hal_wifi_default
2 | #
3 |
4 | # wifi_data_file
5 | allow hal_wifi_default wifi_data_file:file { read write open };
6 |
7 | # /efs
8 | allow hal_wifi_default efs_file:dir search;
9 |
10 | # /efs/wifi
11 | allow hal_wifi_default wifi_efs_file:dir search;
12 | allow hal_wifi_default wifi_efs_file:file { open read };
13 |
14 | # load .ko modules
15 | allow hal_wifi_default self:capability { sys_module sys_resource };
16 |
17 | # set property
18 | allow hal_wifi_default vendor_default_prop:property_service set;
19 |
--------------------------------------------------------------------------------
/sepolicy/hal_drm_clearkey.te:
--------------------------------------------------------------------------------
1 | # policy for /vendor/bin/hw/android.hardware.drm clearkey service
2 | type hal_drm_clearkey, domain;
3 | type hal_drm_clearkey_exec, exec_type, vendor_file_type, file_type;
4 |
5 | init_daemon_domain(hal_drm_clearkey)
6 |
7 | hal_server_domain(hal_drm_clearkey, hal_drm)
8 |
9 | vndbinder_use(hal_drm_clearkey);
10 |
11 | allow hal_drm_clearkey { appdomain -isolated_app }:fd use;
12 |
13 | allow hal_drm_clearkey mediadrm_data_file:dir create_dir_perms;
14 | allow hal_drm_clearkey mediadrm_data_file:file create_file_perms;
15 |
--------------------------------------------------------------------------------
/sepolicy/ueventd.te:
--------------------------------------------------------------------------------
1 | # /dev/block/mmcblk0p[0-9]
2 | allow ueventd emmcblk_device:blk_file { ioctl read write create getattr setattr lock append unlink open };
3 |
4 | # /sys/devices/virtual/misc/multipdp/uevent
5 | allow ueventd sysfs_multipdp:file rw_file_perms;
6 |
7 | allow ueventd emmcblk_device:blk_file { relabelfrom relabelto create setattr unlink };
8 |
9 | # read/chown camera firmware
10 | allow ueventd sysfs_camera:file { relabelto getattr rw_file_perms };
11 | allow ueventd sysfs_camera:filesystem associate;
12 |
13 | allow ueventd self:capability sys_nice;
14 |
--------------------------------------------------------------------------------
/configs/init/android.hardware.drm@1.1-service.widevine.rc:
--------------------------------------------------------------------------------
1 | service vendor.drm-widevine-hal-1-1 /vendor/bin/hw/android.hardware.drm@1.1-service.widevine
2 | interface android.hardware.drm@1.0::ICryptoFactory widevine
3 | interface android.hardware.drm@1.0::IDrmFactory widevine
4 | interface android.hardware.drm@1.1::ICryptoFactory widevine
5 | interface android.hardware.drm@1.1::IDrmFactory widevine
6 | class hal
7 | user media
8 | group media mediadrm drmrpc system inet readproc radio
9 | ioprio rt 4
10 | writepid /dev/cpuset/foreground/tasks
11 |
--------------------------------------------------------------------------------
/sepolicy/hal_graphics_composer_default.te:
--------------------------------------------------------------------------------
1 | allow hal_graphics_composer_default self:netlink_kobject_uevent_socket { read create getattr setopt bind };
2 |
3 | # /dev/vndbinder and /dev/s5p-mem
4 | allow hal_graphics_composer_default {
5 | vndbinder_device
6 | secmem_device
7 | }:chr_file rw_file_perms;
8 |
9 | # /sys/devices/14830000.decon_f/
10 | allow hal_graphics_composer_default sysfs_graphics:file r_file_perms;
11 | allow hal_graphics_composer_default sysfs_graphics:dir search;
12 |
13 | # /dev/video
14 | allow hal_graphics_composer_default video_device:chr_file rw_file_perms;
15 |
--------------------------------------------------------------------------------
/sepolicy/vendor_secril_config_svc.te:
--------------------------------------------------------------------------------
1 | type vendor_secril_config_svc, domain;
2 | type vendor_secril_config_svc_exec, exec_type, vendor_file_type, file_type;
3 |
4 | set_prop(vendor_secril_config_svc, exported3_radio_prop)
5 | set_prop(vendor_secril_config_svc, vendor_radio_prop)
6 | set_prop(vendor_secril_config_svc, radio_prop)
7 |
8 | # read /efs/factory.prop
9 | allow vendor_secril_config_svc {
10 | efs_file
11 | factoryprop_efs_file
12 | }:file r_file_perms;
13 |
14 | allow vendor_secril_config_svc efs_file:dir search;
15 |
16 | init_daemon_domain(vendor_secril_config_svc);
17 |
--------------------------------------------------------------------------------
/sepolicy/cameraserver.te:
--------------------------------------------------------------------------------
1 | # /dev/m2m1shot_jpeg
2 | allow cameraserver camera_device:chr_file rw_file_perms;
3 |
4 | # /sys/devices/virtual/camera/*/*_camfw
5 | allow cameraserver sysfs_camera:file rw_file_perms;
6 |
7 | # searching for syses nodes
8 | allow cameraserver sysfs_camera:dir search;
9 |
10 | # /data/camera/ISP_CV
11 | allow cameraserver camera_data_file:file r_file_perms;
12 |
13 | # /data/media(/.*)?
14 | allow cameraserver media_rw_data_file:dir r_dir_perms;
15 | allow cameraserver media_rw_data_file:file r_file_perms;
16 |
17 | # sysfs_virtual
18 | allow cameraserver sysfs_virtual:dir search;
19 |
--------------------------------------------------------------------------------
/sepolicy/hal_power_default.te:
--------------------------------------------------------------------------------
1 | # Allow reading of sysfs nodes to find input devices
2 |
3 | allow hal_power_default sysfs_devices_system_cpu:file write;
4 |
5 | allow hal_power_default sysfs_input:dir { open read search getattr };
6 | allow hal_power_default sysfs_input:file { open read write getattr };
7 |
8 | allow hal_power_default sysfs_virtual:dir { open read search };
9 | allow hal_power_default sysfs_virtual:file { open read write getattr };
10 |
11 | allow hal_power_default sysfs:dir { read open };
12 | allow hal_power_default sysfs:file { read write open };
13 |
14 | allow hal_power_default sysfs_brightness:file rw_file_perms;
15 |
--------------------------------------------------------------------------------
/sepolicy/hal_gnss_default.te:
--------------------------------------------------------------------------------
1 | # hal_gnss_default.te
2 |
3 | # cgroups tasks
4 | allow hal_gnss_default cgroup:file getattr;
5 |
6 | # /data/vendor/gps
7 | allow hal_gnss_default gps_vendor_data_file:dir rw_dir_perms;
8 | allow hal_gnss_default gps_vendor_data_file:file create_file_perms;
9 | allow hal_gnss_default gps_vendor_data_file:fifo_file create_file_perms;
10 |
11 | # /mnt/vendor
12 | allow hal_gnss_default mnt_vendor_file:dir search;
13 |
14 | # vndbinder
15 | allow hal_gnss_default vndbinder_device:chr_file rw_file_perms;
16 |
17 | # Connect to socket
18 | allow hal_gnss_default gpsd:unix_stream_socket connectto;
19 |
20 | # sensor framework
21 | allow hal_gnss_default fwk_sensor_hwservice:hwservice_manager find;
22 |
--------------------------------------------------------------------------------
/amplifier/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_SHARED_LIBRARIES := \
6 | liblog \
7 | libutils \
8 | libcutils \
9 | libtinyalsa
10 |
11 | LOCAL_C_INCLUDES := \
12 | external/tinyalsa/include \
13 | external/tinycompress/include \
14 | hardware/libhardware/include \
15 | hardware/samsung/audio \
16 | $(call include-path-for, audio-utils) \
17 | $(call include-path-for, audio-route) \
18 | $(call include-path-for, audio-effects)
19 |
20 | LOCAL_SRC_FILES := \
21 | amplifier.c \
22 | tfa.c
23 |
24 | LOCAL_MODULE := audio_amplifier.$(TARGET_BOOTLOADER_BOARD_NAME)
25 | LOCAL_MODULE_RELATIVE_PATH := hw
26 | LOCAL_MODULE_TAGS := optional
27 |
28 | include $(BUILD_SHARED_LIBRARY)
29 |
--------------------------------------------------------------------------------
/configs/keylayout/sec_touchkey.kl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2014 The CyanogenMod Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | key 158 BACK VIRTUAL
18 | key 254 APP_SWITCH VIRTUAL
19 |
20 |
--------------------------------------------------------------------------------
/shims/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2017 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | LOCAL_PATH := $(call my-dir)
18 |
19 | include $(call all-makefiles-under,$(LOCAL_PATH))
20 |
--------------------------------------------------------------------------------
/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | supl.google.com
6 | 7275
7 | 0x20000
8 | 1
9 | 1
10 | 0
11 | 1
12 | 0
13 | 0
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ramdisk/init.vendor.rilcommon.rc:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2012 The Android Open Source Project
2 | #
3 | # IMPORTANT: Do not create world writable files or directories.
4 | # This is a common source of Android security bugs.
5 | #
6 |
7 | # service can not be overwritten except SPRINT
8 | # Thus, rilcarrier is imported before common rc, like init.rilchip.rc
9 |
10 | on post-fs-data
11 | mkdir /data/vendor/secradio 0770 radio radio
12 |
13 | on property:ro.vendor.multisim.simslotcount=1
14 | stop ril-daemon1
15 |
16 | on property:vts.native_server.on=*
17 | setprop vendor.vts.native_server.on ${vts.native_server.on}
18 |
19 | service secril_config /vendor/bin/secril_config_svc
20 | user radio
21 | group radio
22 | oneshot
23 | disabled
24 |
25 | on post-fs-data
26 | exec_start secril_config
27 |
--------------------------------------------------------------------------------
/sepolicy/device.te:
--------------------------------------------------------------------------------
1 | # /dev/ttySAC3
2 | type bluetooth_device, dev_type;
3 |
4 | # /dev/block/mmcblk0p[0-9] (/dev/mbin0)
5 | type emmcblk_device, file_type;
6 |
7 | # Radio block device mounted on /efs.
8 | type radio_block_device, dev_type;
9 |
10 | # /dev/umts_boot*, /dev/ehci_power
11 | type mif_device, dev_type;
12 |
13 | # /dev/rfkill
14 | type rfkill_device, dev_type;
15 |
16 | # /dev/s5p-smem
17 | type secmem_device, dev_type;
18 |
19 | # /dev/bbd*, /dev/ttyBCM[0-9]*
20 | type bbd_device, dev_type;
21 |
22 | # /dev/vfsspi
23 | type fingerprint_device, dev_type;
24 |
25 | # /dev/batch_io
26 | type sensor_device, dev_type;
27 |
28 | # /dev/i2c-20 - TFA98xx amplifier
29 | type amplifier_device, dev_type;
30 |
31 | # /dev/knox_kap
32 | type knox_device, dev_type;
33 |
34 | # GPS
35 | type gps_device, dev_type;
36 |
--------------------------------------------------------------------------------
/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2017 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | LOCAL_PATH := $(call my-dir)
18 |
19 | ifneq ($(filter a7y17lte a5y17lte, $(TARGET_DEVICE)),)
20 |
21 | include $(call all-makefiles-under,$(LOCAL_PATH))
22 |
23 | endif
24 |
--------------------------------------------------------------------------------
/sepolicy/vendor_init.te:
--------------------------------------------------------------------------------
1 | allow vendor_init mobicore_data_file:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom };
2 | allow vendor_init mobicore_vendor_data_file:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom };
3 |
4 | # /efs
5 | allow vendor_init emmcblk_device:blk_file getattr;
6 | allow vendor_init block_device:lnk_file setattr;
7 |
8 | # Wifi
9 | allow vendor_init {
10 | dhcp_data_file
11 | wifi_data_file
12 | }:dir { getattr setattr };
13 |
14 | allow vendor_init debugfs_trace_marker:file getattr;
15 |
16 | # ZRAM
17 | allow vendor_init {
18 | proc
19 | proc_min_free_order_shift
20 | }:file write;
21 |
22 | # allow to create folders in /data/
23 | allow vendor_init system_data_file:dir { write create setattr add_name };
24 |
--------------------------------------------------------------------------------
/ramdisk/init.gps.rc:
--------------------------------------------------------------------------------
1 | on post-fs-data
2 | # Directory for GPS
3 | chmod 0660 /dev/gnss_ipc
4 | chown system system /dev/gnss_ipc
5 | mkdir /data/vendor 0771 system system
6 | chown system system /data/vendor
7 | mkdir /data/vendor/gps 0771 system system
8 | chown system system /data/vendor/gps
9 | mkdir /data/vendor/gps/sgee 0771 system system
10 | chown system system /data/vendor/gps/sgee
11 | rm /data/vendor/gps/gps_started
12 | rm /data/vendor/gps/glonass_started
13 | rm /data/vendor/gps/beidou_started
14 | rm /data/vendor/gps/smd_started
15 | rm /data/vendor/gps/sv_cno.info
16 |
17 | # GPS daemon
18 | service gpsd /vendor/bin/hw/gpsd -c /vendor/etc/gnss/gps.cfg
19 | class main
20 | user gps
21 | group system inet net_raw wakelock
22 | capabilities BLOCK_SUSPEND
23 | ioprio be 0
24 |
--------------------------------------------------------------------------------
/sepolicy/hal_sensors_default.te:
--------------------------------------------------------------------------------
1 | # /efs/FactoryApp/
2 | allow hal_sensors_default app_efs_file:dir rw_dir_perms;
3 | allow hal_sensors_default app_efs_file:file { rw_file_perms setattr };
4 |
5 | # /efs
6 | allow hal_sensors_default efs_file:dir r_dir_perms;
7 |
8 | # sensor_device
9 | allow hal_sensors_default sensor_device:chr_file rw_file_perms;
10 |
11 | # iio_device
12 | allow hal_sensors_default iio_device:chr_file { open read };
13 |
14 | # sysfs_iio
15 | allow hal_sensors_default sysfs_iio:file { open read getattr write };
16 | allow hal_sensors_default sysfs_iio:dir { open read search };
17 | allow hal_sensors_default sysfs_iio:lnk_file read;
18 |
19 | # sysfs_virtual
20 | allow hal_sensors_default sysfs_virtual:dir r_dir_perms;
21 | allow hal_sensors_default sysfs_virtual:file rw_file_perms;
22 |
23 | allow hal_sensors_default sysfs:file { open read getattr write };
24 |
--------------------------------------------------------------------------------
/init/Android.bp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (C) 2019 The LineageOS Project
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 | //
16 |
17 | cc_library_static {
18 | name: "libinit_sec",
19 | recovery_available: true,
20 | srcs: ["init_sec.cpp"],
21 | include_dirs: [
22 | "system/core/base/include",
23 | "system/core/init"
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/include/samsung_fastcharge.h:
--------------------------------------------------------------------------------
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 | #ifndef SAMSUNG_FASTCHARGE_H
18 | #define SAMSUNG_FASTCHARGE_H
19 |
20 | #define FASTCHARGE_DEFAULT_SETTING true
21 | #define FASTCHARGE_PATH "/sys/class/sec/switch/afc_disable"
22 |
23 | #endif // SAMSUNG_FASTCHARGE_H
24 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Settings/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | 5dp
16 | - 68.5%
17 |
18 |
--------------------------------------------------------------------------------
/ramdisk/wifi_qcom.rc:
--------------------------------------------------------------------------------
1 | on post-fs-data
2 | # for fwpath
3 | chown wifi wifi /sys/module/wlan/parameters/fwpath
4 | chmod 0644 /sys/module/wlan/parameters/fwpath
5 |
6 | chown wifi wifi /sys/wifi/wifiver
7 | chmod 0640 /sys/wifi/wifiver
8 | chown wifi wifi /sys/wifi/softap
9 | chmod 0640 /sys/wifi/softap
10 |
11 | # for WIFI Antenna
12 | write /data/vendor/conn/.wificable.info E
13 | chown system root /data/vendor/conn/.wificable.info
14 | chmod 0666 /data/vendor/conn/.wificable.info
15 | chown wifi root /sys/wifi/wificable
16 | chmod 0664 /sys/wifi/wificable
17 |
18 | # for WIFI TRP/TIS
19 | chown wifi wifi /data/vendor/conn/.psm.info
20 | chmod 0644 /data/vendor/conn/.psm.info
21 | chown wifi wifi /sys/wifi/pm
22 | chmod 0640 /sys/wifi/pm
23 |
24 | # for WIFI Antenna Selection
25 | chown wifi wifi /data/vendor/conn/.ant.info
26 | chmod 0644 /data/vendor/conn/.ant.info
27 |
--------------------------------------------------------------------------------
/shims/libcamera_client/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | LOCAL_PATH := $(call my-dir)
17 |
18 | include $(CLEAR_VARS)
19 | LOCAL_SRC_FILES := CameraParameters.cpp
20 |
21 | LOCAL_MODULE := libcamera_client_shim
22 | LOCAL_MODULE_TAGS := optional
23 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
24 |
25 | include $(BUILD_SHARED_LIBRARY)
26 |
--------------------------------------------------------------------------------
/ramdisk/init.vendor.rilchip.rc:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2012 The Android Open Source Project
2 | #
3 | # IMPORTANT: Do not create world writable files or directories.
4 | # This is a common source of Android security bugs.
5 | #
6 |
7 | service ril-daemon /vendor/bin/hw/rild -l ${vendor.sec.rild.libpath}
8 | class main
9 | user radio
10 | group radio cache inet misc audio sdcard_r sdcard_rw log vpn system readproc wakelock
11 | capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW SYS_ADMIN CHOWN SYS_TIME
12 | socket sap_uim_socket1 stream 660 bluetooth bluetooth
13 | onrestart restart cpboot-daemon
14 | onrestart restart DIAG-daemon
15 |
16 | service ril-daemon1 /vendor/bin/hw/rild -c 2 -l ${vendor.sec.rild.libpath2}
17 | class main
18 | user radio
19 | group radio cache inet misc audio sdcard_r sdcard_rw log vpn system readproc wakelock
20 | capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW SYS_ADMIN CHOWN SYS_TIME
21 | onrestart restart cpboot-daemon
22 | onrestart restart DIAG-daemon
23 |
--------------------------------------------------------------------------------
/sepolicy/hal_drm_widevine.te:
--------------------------------------------------------------------------------
1 | type hal_drm_widevine, domain;
2 | type hal_drm_widevine_exec, exec_type, vendor_file_type, file_type;
3 |
4 | init_daemon_domain(hal_drm_widevine)
5 |
6 | hal_server_domain(hal_drm_widevine, hal_drm)
7 |
8 | vndbinder_use(hal_drm_widevine);
9 |
10 | allow hal_drm_widevine mediacodec:fd use;
11 | allow hal_drm_widevine { appdomain -isolated_app }:fd use;
12 |
13 | allow hal_drm_widevine hal_allocator_server:fd use;
14 |
15 | allow hal_drm_widevine mediadrm_data_file:dir create_dir_perms;
16 | allow hal_drm_widevine mediadrm_data_file:file create_file_perms;
17 | allow hal_drm_widevine media_data_file:dir search;
18 | allow hal_drm_widevine vendor_data_file:dir { read write create add_name } ;
19 | allow hal_drm_widevine vendor_data_file:file { create open read write getattr } ;
20 |
21 | allow hal_drm_widevine cpk_efs_file:file { open read getattr };
22 | allow hal_drm_widevine efs_file:dir search;
23 |
24 | allow hal_drm_widevine secmem_device:chr_file { open read write ioctl };
25 |
--------------------------------------------------------------------------------
/camera/SECCameraProperties.h:
--------------------------------------------------------------------------------
1 | #ifndef SEC_CAMERA_PROPERTIES_H
2 | #define SEC_CAMERA_PROPERTIES_H
3 |
4 | /* SEC Camera Properties */
5 |
6 | /* Real-Time HDR */
7 | #define LIVE_HDR_LEVEL_RANGE 0x80000001
8 | #define LIVE_HDR_LEVEL 0x80000002
9 |
10 | /* Metering Mode */
11 | #define AVAILABLE_METERING_MODE 0x80000003
12 | #define METERING_MODE 0x80000004
13 | /* Options */
14 | #define METERING_MODE_CENTER 0
15 | #define METERING_MODE_SPORT 1
16 | #define METERING_MODE_MATRIX 2
17 | #define METERING_MODE_MANUAL 3
18 |
19 | /* Phase-Detection Auto Focus */
20 | #define AVAILABLE_PAF_MODE 0x80000005
21 | #define PAF_MODE 0x80000006
22 | /* Options */
23 | #define PAF_MODE_OFF 0
24 | #define PAF_MODE_ON 1
25 |
26 | /* Optical Image Stabilization Operation Mode */
27 | #define AVAILABLE_OIS_OPERATION_MODE 0x80020000
28 | #define OIS_OPERATION_MODE 0x80010000
29 | /* Options */
30 | #define OIS_OPERATION_MODE_PICTURE 0
31 | #define OIS_OPERATION_MODE_VIDEO 1
32 |
33 | #endif // SEC_CAMERA_PROPERTIES_H
34 |
--------------------------------------------------------------------------------
/lineage.dependencies:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "repository": "android_hardware_samsung",
4 | "target_path": "hardware/samsung"
5 | },
6 | {
7 | "repository": "android_hardware_samsung_nfc",
8 | "target_path": "hardware/samsung/nfc"
9 | },
10 | {
11 | "repository": "android_hardware_samsung_slsi_exynos",
12 | "target_path": "hardware/samsung_slsi/exynos"
13 | },
14 | {
15 | "repository": "android_hardware_samsung_slsi_exynos5",
16 | "target_path": "hardware/samsung_slsi/exynos5"
17 | },
18 | {
19 | "repository": "android_hardware_samsung_slsi_exynos7880",
20 | "target_path": "hardware/samsung_slsi/exynos7880"
21 | },
22 | {
23 | "repository": "android_hardware_samsung_slsi_openmax",
24 | "target_path": "hardware/samsung_slsi/openmax"
25 | },
26 | {
27 | "repository": "android_kernel_samsung_universal7880",
28 | "target_path": "kernel/samsung/universal7880"
29 | }
30 | ]
31 |
--------------------------------------------------------------------------------
/twrp/twrp.fstab:
--------------------------------------------------------------------------------
1 | /boot emmc /dev/block/platform/13540000.dwmmc0/by-name/BOOT
2 | /recovery emmc /dev/block/platform/13540000.dwmmc0/by-name/RECOVERY flags=backup=1
3 | /system ext4 /dev/block/platform/13540000.dwmmc0/by-name/SYSTEM
4 | /cache ext4 /dev/block/platform/13540000.dwmmc0/by-name/CACHE
5 | /data ext4 /dev/block/platform/13540000.dwmmc0/by-name/USERDATA flags=encryptable=footer;length=-16384
6 | /efs emmc /dev/block/platform/13540000.dwmmc0/by-name/EFS flags=display="EFS";backup=1
7 | /modem emmc /dev/block/platform/13540000.dwmmc0/by-name/RADIO flags=display="Baseband";backup=1
8 | /misc emmc /dev/block/platform/13540000.dwmmc0/by-name/OTA
9 |
10 | /external_sdcard vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="Micro SDcard";storage;wipeingui;removable
11 | /usb-otg vfat /dev/block/sda1 /dev/block/sda flags=display="USB-OTG";storage;wipeingui;removable
12 |
--------------------------------------------------------------------------------
/shims/libbauthtzcommon/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2017 The LineageOS Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | LOCAL_PATH := $(call my-dir)
16 | include $(CLEAR_VARS)
17 |
18 | LOCAL_SRC_FILES := \
19 | libbauthtzcommon.c
20 |
21 | LOCAL_SHARED_LIBRARIES := liblog
22 |
23 | LOCAL_MODULE := libbauthtzcommon_shim
24 | LOCAL_VENDOR_MODULE := true
25 | LOCAL_MODULE_TAGS := optional
26 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
27 |
28 | include $(BUILD_SHARED_LIBRARY)
29 |
--------------------------------------------------------------------------------
/bluetooth/bdroid_buildcfg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef _BDROID_BUILDCFG_H
18 | #define _BDROID_BUILDCFG_H
19 |
20 | #define BTM_DEF_LOCAL_NAME "Samsung Galaxy A Series 2017"
21 |
22 | #define BLUETOOTH_QTI_SW TRUE
23 | #define BLE_VND_INCLUDED TRUE
24 |
25 | #define BTM_WBS_INCLUDED TRUE /* Enable WBS */
26 | #define BTIF_HF_WBS_PREFERRED TRUE /* Use WBS */
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/shims/libexynoscamera/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | LOCAL_PATH := $(call my-dir)
17 |
18 | include $(CLEAR_VARS)
19 | LOCAL_SRC_FILES := GraphicBuffer.cpp
20 |
21 | LOCAL_C_INCLUDES := frameworks/native/include
22 |
23 | LOCAL_SHARED_LIBRARIES := libgui libui
24 |
25 | LOCAL_MODULE := libexynoscamera_shim
26 | LOCAL_MODULE_TAGS := optional
27 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
28 |
29 | include $(BUILD_SHARED_LIBRARY)
30 |
--------------------------------------------------------------------------------
/overlay/packages/services/Telephony/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
19 |
20 |
21 | true
22 |
23 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SettingsLib/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 10800000
21 |
22 |
--------------------------------------------------------------------------------
/configs/idc/ft5x06_ts.idc:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2012 The Android Open Source Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | #
16 | # Input Device Calibration File for the touch screen.
17 | #
18 |
19 | device.internal = 1
20 |
21 | touch.deviceType = touchScreen
22 | touch.orientationAware = 1
23 |
24 | touch.size.calibration = area
25 | touch.size.scale = 52
26 | touch.size.bias = 11.8
27 | touch.size.isSummed = 0
28 |
29 | touch.pressure.calibration = amplitude
30 | touch.pressure.scale = 0.015
31 |
32 | touch.orientation.calibration = vector
33 |
--------------------------------------------------------------------------------
/overlay/frameworks/base/packages/SystemUI/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
22 |
23 |
24 | true
25 |
26 |
--------------------------------------------------------------------------------
/libhidl/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2018 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | include $(CLEAR_VARS)
17 | LOCAL_SHARED_LIBRARIES := libhidltransport
18 | LOCAL_MODULE := android.hidl.base@1.0
19 | LOCAL_MODULE_TAGS := optional
20 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
21 | include $(BUILD_SHARED_LIBRARY)
22 |
23 | include $(CLEAR_VARS)
24 | LOCAL_SHARED_LIBRARIES := libhidltransport
25 | LOCAL_MODULE := android.hidl.manager@1.0
26 | LOCAL_MODULE_TAGS := optional
27 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES
28 | include $(BUILD_SHARED_LIBRARY)
29 |
--------------------------------------------------------------------------------
/shims/libbauthtzcommon/libbauthtzcommon.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #define LOG_TAG "libbauthtzcommon_shim"
18 | #define LOG_NDEBUG 0
19 |
20 | #include
21 |
22 | int BAuth_Hat_OP(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5)
23 | {
24 | ALOGW("SHIM: hijacking %s!", __func__);
25 |
26 | /*
27 | * This function is supposed to pass the hardware authentication token
28 | * (HAT) to the mobicore trustlet.
29 | */
30 |
31 | return 0;
32 | }
33 |
--------------------------------------------------------------------------------
/camera/Android.bp:
--------------------------------------------------------------------------------
1 | cc_library_shared {
2 | name: "camera.exynos5",
3 | relative_install_path: "hw",
4 |
5 | srcs: [
6 | "CameraWrapper.cpp",
7 | ],
8 |
9 | export_shared_lib_headers: [
10 | "android.hardware.graphics.bufferqueue@1.0",
11 | "android.hardware.graphics.bufferqueue@2.0",
12 | ],
13 |
14 | generated_headers: [
15 | "android.hardware.graphics.bufferqueue@1.0_genc++_headers",
16 | "android.hardware.graphics.bufferqueue@2.0_genc++_headers",
17 | ],
18 |
19 | shared_libs: [
20 | "libhardware",
21 | "liblog",
22 | "libcamera_client",
23 | "libutils",
24 | "libcutils",
25 | "android.hidl.token@1.0-utils",
26 | "android.hardware.graphics.bufferqueue@1.0",
27 | "android.hardware.graphics.bufferqueue@2.0",
28 | ],
29 |
30 | include_dirs: [
31 | "frameworks/native/libs/nativewindow/include",
32 | "frameworks/native/libs/arect/include",
33 | "frameworks/av/media/ndk/include",
34 | ],
35 |
36 | header_libs: [
37 | "libnativebase_headers",
38 | ],
39 | }
40 |
--------------------------------------------------------------------------------
/ramdisk/mobicore.rc:
--------------------------------------------------------------------------------
1 | on post-fs
2 | setprop sys.mobicoredaemon.enable stopped
3 |
4 | on nonencrypted
5 | mkdir /data/vendor/mcRegistry 0775 system system
6 | mkdir /data/misc/mcRegistry 0775 system system
7 |
8 | on property:vold.decrypt=trigger_restart_framework
9 | mkdir /data/vendor/mcRegistry 0775 system system
10 | mkdir /data/misc/mcRegistry 0775 system system
11 |
12 | on post-fs
13 | export MC_AUTH_TOKEN_PATH /efs
14 | mkdir /efs/TEE 0770 radio system
15 | chmod 0660 /dev/t-base-tui
16 | chown system system /dev/t-base-tui
17 | start mobicore
18 |
19 | on property:sys.mobicoredaemon.enable=true
20 | write /proc/iccc_ready 1
21 |
22 | # MobiCore startup
23 | service mobicore /vendor/bin/mcDriverDaemon -r /vendor/app/mcRegistry/FFFFFFFF000000000000000000000001.drbin -r /vendor/app/mcRegistry/ffffffffd0000000000000000000000a.tlbin -r /vendor/app/mcRegistry/ffffffffd00000000000000000000016.tlbin -r /vendor/app/mcRegistry/ffffffffd0000000000000000000001c.tlbin -r /vendor/app/mcRegistry/ffffffffd00000000000000000000045.drbin
24 | class core
25 | user system
26 | group system
27 | disabled
28 |
--------------------------------------------------------------------------------
/sepolicy/kernel.te:
--------------------------------------------------------------------------------
1 | allow kernel self:capability { chown mknod };
2 | dontaudit kernel kernel:capability { dac_override dac_read_search };
3 |
4 | # /dev/mbin0
5 | allow kernel emmcblk_device:blk_file r_file_perms;
6 | allow kernel device:blk_file { create setattr getattr unlink };
7 | # /bus/usb/001/001
8 | allow kernel device:dir { create write remove_name rmdir add_name };
9 | allow kernel device:chr_file { create setattr getattr unlink };
10 |
11 | # /sys/devices/system/cpu/cpu[0-9]/cpufreq/*
12 | allow kernel sysfs_devices_system_cpu:file { setattr };
13 | allow kernel sysfs:file { setattr };
14 |
15 | # /efs contents
16 | allow kernel { app_efs_file battery_efs_file efs_file sensor_efs_file }:dir r_dir_perms;
17 | allow kernel { app_efs_file battery_efs_file efs_file sensor_efs_file }:file rw_file_perms;
18 |
19 | # /efs/wifi/.mac.info
20 | allow kernel wifi_efs_file:dir r_dir_perms;
21 | allow kernel wifi_efs_file:file r_file_perms;
22 |
23 | # /data/misc/conn/.wifiver.info
24 | allow kernel wifi_data_file:file rw_file_perms;
25 |
26 | # sysfs_lcd
27 | allow kernel sysfs_lcd:file { open read };
28 |
29 | allow kernel block_device:dir search;
30 |
--------------------------------------------------------------------------------
/releasetools.py:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2017 The LineageOS Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | import re
16 |
17 | def FullOTA_Assertions(info):
18 | AddBootloaderAssertion(info, info.input_zip)
19 |
20 |
21 | def IncrementalOTA_Assertions(info):
22 | AddBootloaderAssertion(info, info.target_zip)
23 |
24 |
25 | def AddBootloaderAssertion(info, input_zip):
26 | android_info = input_zip.read("OTA/android-info.txt")
27 | m = re.search(r"require\s+version-bootloader\s*=\s*(\S+)", android_info)
28 | if m:
29 | bootloaders = m.group(1).split("|")
30 | if "*" not in bootloaders:
31 | info.script.AssertSomeBootloader(*bootloaders)
32 | info.metadata["pre-bootloader"] = m.group(1)
33 |
--------------------------------------------------------------------------------
/sepolicy/hal_fingerprint_default.te:
--------------------------------------------------------------------------------
1 | # allow hal_fingerprint_default to communicate with various devices
2 | binder_call(system_app, hal_fingerprint_default)
3 |
4 | # kernel fp device
5 | allow hal_fingerprint_default fingerprint_device:chr_file { open read write ioctl getattr };
6 |
7 | # secure memory device
8 | allow hal_fingerprint_default secmem_device:chr_file { open read write ioctl };
9 |
10 | # trust zone device
11 | allow hal_fingerprint_default tee_device:chr_file { open read write ioctl };
12 | allow hal_fingerprint_default tee:unix_stream_socket connectto;
13 |
14 | # /data/biometrics/*
15 | allow hal_fingerprint_default fingerprintd_data_file:dir { rmdir read write remove_name create open add_name search };
16 | allow hal_fingerprint_default fingerprintd_data_file:file { write create read rename open getattr unlink };
17 |
18 | # /data/vendor/biometrics/*
19 | allow hal_fingerprint_default fingerprintd_vendor_data_file:dir { rmdir read write remove_name create open add_name search };
20 | allow hal_fingerprint_default fingerprintd_vendor_data_file:file { write create read rename open getattr unlink };
21 |
22 | # sysfs_virtual
23 | allow hal_fingerprint_default sysfs_virtual:dir search;
24 | allow hal_fingerprint_default sysfs_virtual:file { open read };
25 |
--------------------------------------------------------------------------------
/rro_overlays/WifiOverlay/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/include/samsung_power.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The CyanogenMod Project
3 | * Copyright (C) 2020 The LineageOS Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | #ifndef SAMSUNG_POWER_H
19 | #define SAMSUNG_POWER_H
20 |
21 | static const std::vector cpuSysfsPaths = {
22 | "/sys/devices/system/cpu/cpu0",
23 | "/sys/devices/system/cpu/cpu4"
24 | };
25 |
26 | static const std::vector cpuInteractivePaths = {
27 | "/sys/devices/system/cpu/cpu0/cpufreq/interactive",
28 | "/sys/devices/system/cpu/cpu4/cpufreq/interactive"
29 | };
30 |
31 | /* double tap to wake node */
32 | #define TAP_TO_WAKE_NODE "/sys/class/sec/tsp/dt2w_enable"
33 |
34 | #endif // SAMSUNG_POWER_H
35 |
--------------------------------------------------------------------------------
/sepolicy/property_contexts:
--------------------------------------------------------------------------------
1 | # bluetooth
2 | persist.bluetooth_fw_ver u:object_r:bluetooth_prop:s0
3 | ro.bluetooth.tty u:object_r:bluetooth_prop:s0
4 | wc_transport. u:object_r:bluetooth_prop:s0
5 |
6 | # cbd
7 | vendor.cbd. u:object_r:vendor_cbd_prop:s0
8 | persist.vendor.cbd. u:object_r:vendor_cbd_prop:s0
9 |
10 | # Fastcharge HAL
11 | persist.vendor.sec.fastchg_enabled u:object_r:sec_fastcharge_prop:s0
12 |
13 | # NFC
14 | persist.nfc.log.index u:object_r:vendor_nfc_prop:s0
15 | vendor.nfc.fw. u:object_r:vendor_nfc_prop:s0
16 | persist.vendor.nfc.log.index u:object_r:vendor_nfc_prop:s0
17 |
18 | # modemloader
19 | hw.revision u:object_r:modemloader_prop:s0
20 | ro.cbd.dt_revision u:object_r:modemloader_prop:s0
21 | ril.cbd.dt_revision u:object_r:modemloader_prop:s0
22 | ro.modemloader.done u:object_r:modemloader_prop:s0
23 |
24 | # mobicore
25 | sys.mobicoredaemon.enable u:object_r:tee_prop:s0
26 |
27 | ### radio
28 | ro.multisim. u:object_r:vendor_radio_prop:s0
29 | ro.vendor.multisim. u:object_r:vendor_radio_prop:s0
30 | ro.vendor.radio. u:object_r:vendor_radio_prop:s0
31 | ro.multisim.simslotcount u:object_r:radio_prop:s0
32 |
--------------------------------------------------------------------------------
/configs/gps/gps.cfg:
--------------------------------------------------------------------------------
1 | ############################################
2 | StartupConfiguration_DebugFlag=0x3
3 | GlueLayer_ToolConfigSelection=1
4 | #user_ports_tcp_name=Autotest
5 | #user_ports_tcp_port=7555
6 | #debug_console=0
7 | #debug_device=0
8 | debug_enable=0
9 | #debug_dir=/data/vendor/gps
10 | gnss_data_dir=/data/vendor/gps
11 | ############################################
12 | Sif_UseFwXtraInterface=1
13 | GlueLayer_EnableGnssCfgInterface=1
14 | Agnss_TlsVariant=4
15 | Agnss_ShaVariant=0
16 |
17 | # coarse time, local time, counter method freq xfr
18 | Chip_Configuration_AidingConfiguration=0x00000016
19 |
20 | # non-shared tcxo
21 | Chip_Configuration_RefClkControl=0x0
22 |
23 | # Enable Screening in MSA_NI
24 | Chip_Configuration_FeatureCfg_ENH_MEAS_SCRN_ENABLE=1
25 |
26 | # MSA_NI Constraints (GPS + GLONASS)
27 | Agnss_SuplNiTCOverride=1
28 | UP_LocTech_PrimaryConst=0
29 | UP_LocTech_Constraints=3
30 | UP_LocTech_Requirements=3
31 |
32 | # Geofence
33 | gf_enabled=0
34 |
35 | # Scheduling capability support
36 | scheduling_enabled=0
37 |
38 | # Apply RF Loss value
39 | RfPathLossDb_Ap=5
40 | RfPathLossDb_Cp=3
41 |
42 | # Constellation support (GPS= 0x0001 GLO= 0x0002 GALILEO=0x0004 BEIDOU=0x0008 QZSS=0x0020)
43 | Chip_Configuration_GNSSConstConstraintDef=0x203B
44 | LocTech_Constraints=0x203B
--------------------------------------------------------------------------------
/overlay/packages/apps/Snap/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
21 |
22 | true
23 |
24 |
25 | false
26 |
27 |
28 | false
29 |
30 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Settings/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
20 | true
21 |
22 |
23 | true
24 |
25 |
31 | 1
32 |
33 |
--------------------------------------------------------------------------------
/livedisplay/Android.bp:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2019 The LineageOS Project
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | cc_binary {
16 | name: "vendor.lineage.livedisplay@2.1-service.universal7880",
17 | defaults: ["hidl_defaults"],
18 | relative_install_path: "hw",
19 | init_rc: ["vendor.lineage.livedisplay@2.1-service.universal7880.rc"],
20 | srcs: [
21 | "DisplayColorCalibration.cpp",
22 | "DisplayModes.cpp",
23 | "ReadingEnhancement.cpp",
24 | "SunlightEnhancement.cpp",
25 | "service.cpp",
26 | ],
27 | shared_libs: [
28 | "libbase",
29 | "libbinder",
30 | "libhidlbase",
31 | "libutils",
32 | "vendor.lineage.livedisplay@2.0",
33 | "vendor.lineage.livedisplay@2.1",
34 | ],
35 | vendor: true,
36 | }
37 |
--------------------------------------------------------------------------------
/rro_overlays/WifiOverlay/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 | false
22 |
23 |
24 | false
25 |
26 |
27 | Samsung Galaxy A 2017
28 |
29 |
30 | false
31 |
32 |
33 |
--------------------------------------------------------------------------------
/init/init_sec.h:
--------------------------------------------------------------------------------
1 | #ifndef INIT_SEC_H
2 | #define INIT_SEC_H
3 |
4 | #include
5 |
6 | enum device_variant {
7 | VARIANT_A520F = 0,
8 | VARIANT_A520W,
9 | VARIANT_A520K,
10 | VARIANT_A520L,
11 | VARIANT_A520S,
12 | VARIANT_A720F,
13 | VARIANT_A720S,
14 | VARIANT_MAX
15 | };
16 |
17 | typedef struct {
18 | std::string model;
19 | std::string codename;
20 | } variant;
21 |
22 | static const variant international_models = {
23 | .model = "SM-A520F",
24 | .codename = "a5y17lte"
25 | };
26 |
27 | static const variant canada_models = {
28 | .model = "SM-A520W",
29 | .codename = "a5y17ltecan"
30 | };
31 |
32 | static const variant korea_docomo_models = {
33 | .model = "SM-A520K",
34 | .codename = "a5y17ltektt"
35 | };
36 |
37 | static const variant korea_uplus_models = {
38 | .model = "SM-A520L",
39 | .codename = "a5y17ltelgt"
40 | };
41 |
42 | static const variant korea_telecom_models = {
43 | .model = "SM-A520S",
44 | .codename = "a5y17lteskt"
45 | };
46 |
47 | static const variant a7_international_models = {
48 | .model = "SM-A720F",
49 | .codename = "a7y17lte",
50 | };
51 |
52 | static const variant a7_korea_telecom_models = {
53 | .model = "SM-A720S",
54 | .codename = "a7y17lteskt",
55 | };
56 |
57 | static const variant *all_variants[VARIANT_MAX] = {
58 | &international_models,
59 | &canada_models,
60 | &korea_docomo_models,
61 | &korea_uplus_models,
62 | &korea_telecom_models,
63 | &a7_international_models,
64 | &a7_korea_telecom_models,
65 | };
66 |
67 | #endif // INIT_SEC_H
68 |
--------------------------------------------------------------------------------
/configs/keylayout/gpio-keys.kl:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2013, The Linux Foundation. All rights reserved.
2 | #
3 | # Redistribution and use in source and binary forms, with or without
4 | # modification, are permitted provided that the following conditions are
5 | # met:
6 | # * Redistributions of source code must retain the above copyright
7 | # notice, this list of conditions and the following disclaimer.
8 | # * Redistributions in binary form must reproduce the above
9 | # copyright notice, this list of conditions and the following
10 | # disclaimer in the documentation and/or other materials provided
11 | # with the distribution.
12 | # * Neither the name of The Linux Foundation nor the names of its
13 | # contributors may be used to endorse or promote products derived
14 | # from this software without specific prior written permission.
15 | #
16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 |
27 | key 115 VOLUME_UP WAKE_DROPPED
28 | key 114 VOLUME_DOWN WAKE_DROPPED
29 | key 172 HOME WAKE_DROPPED
30 |
--------------------------------------------------------------------------------
/shims/libexynoscamera/GraphicBuffer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 |
19 | extern "C" void _ZN7android13GraphicBufferC1EjjijjjP13native_handleb(
20 | const native_handle_t* handle,
21 | android::GraphicBuffer::HandleWrapMethod method,
22 | uint32_t width,
23 | uint32_t height,
24 | int format,
25 | uint32_t layerCount,
26 | uint64_t usage,
27 | uint32_t stride);
28 |
29 | extern "C" void _ZN7android13GraphicBufferC1EjjijjP13native_handleb(
30 | uint32_t inWidth,
31 | uint32_t inHeight,
32 | int inFormat,
33 | uint32_t inUsage,
34 | uint32_t inStride,
35 | native_handle_t* inHandle,
36 | bool keepOwnership)
37 | {
38 | android::GraphicBuffer::HandleWrapMethod inMethod =
39 | (keepOwnership ? android::GraphicBuffer::TAKE_HANDLE : android::GraphicBuffer::WRAP_HANDLE);
40 | _ZN7android13GraphicBufferC1EjjijjjP13native_handleb(inHandle, inMethod, inWidth, inHeight,
41 | inFormat, static_cast(1), static_cast(inUsage), inStride);
42 | }
43 |
--------------------------------------------------------------------------------
/sepolicy/cpboot-daemon.te:
--------------------------------------------------------------------------------
1 | # modem daemon sec label
2 | type cpboot-daemon, domain;
3 | type cpboot-daemon_exec, exec_type, file_type, vendor_file_type;
4 |
5 | net_domain(cpboot-daemon)
6 | init_daemon_domain(cpboot-daemon)
7 | wakelock_use(cpboot-daemon)
8 | set_prop(cpboot-daemon, modemloader_prop)
9 |
10 | allow cpboot-daemon self:capability { setuid setgid };
11 |
12 | allow cpboot-daemon kernel:system syslog_read;
13 | allow cpboot-daemon cgroup:dir create_dir_perms;
14 |
15 | # /dev/log/*
16 | #allow cpboot-daemon log_device:dir r_dir_perms;
17 | #allow cpboot-daemon log_device:chr_file rw_file_perms;
18 | # /dev/kmsg (write to kernel log)
19 | allow cpboot-daemon kmsg_device:chr_file rw_file_perms;
20 |
21 | # /dev/umts_boot0
22 | allow cpboot-daemon mif_device:chr_file rw_file_perms;
23 | # /dev/mbin0
24 | allow cpboot-daemon emmcblk_device:blk_file r_file_perms;
25 | # /dev/block/mmcblk0p13
26 | allow cpboot-daemon block_device:dir r_dir_perms;
27 | allow cpboot-daemon radio_block_device:blk_file r_file_perms;
28 |
29 | # /dev/mipi-lli/lli_control
30 | allow cpboot-daemon sysfs_mipi:file rw_file_perms;
31 |
32 | # /efs
33 | allow cpboot-daemon efs_file:file { open read };
34 | allow cpboot-daemon efs_file:dir r_dir_perms;
35 |
36 | allow cpboot-daemon factoryprop_efs_file:file { open read };
37 |
38 | # /efs/nv_data.bin
39 | allow cpboot-daemon bin_nv_data_efs_file:file rw_file_perms;
40 |
41 | # /sys/bus/usb/devices/1-2/idVendor
42 | allow cpboot-daemon sysfs:file r_file_perms;
43 |
44 | # /proc/cmdline
45 | allow cpboot-daemon proc_cmdline:file r_file_perms;
46 |
47 | # set properties on boot
48 | set_prop(cpboot-daemon, vendor_cbd_prop)
49 | set_prop(cpboot-daemon, system_prop)
50 |
51 | allow cpboot-daemon vendor_shell_exec:file execute_no_trans;
52 |
--------------------------------------------------------------------------------
/system.prop:
--------------------------------------------------------------------------------
1 | # Audio
2 | af.fast_track_multiplier=1
3 | audio_hal.force_voice_config=wide
4 |
5 | # Bluetooth
6 | ro.bt.bdaddr_path=/efs/bluetooth/bt_addr
7 |
8 | # Bluetooth workaround:
9 | # The new CAF code defaults to MCT HAL
10 | vendor.qcom.bluetooth.soc=rome
11 |
12 | # Charger
13 | ro.charger.enable_suspend=true
14 |
15 | # Dalvik/Art
16 | dalvik.vm.dex2oat-filter=speed
17 | dalvik.vm.heapstartsize=8m
18 | dalvik.vm.heapgrowthlimit=128m
19 | dalvik.vm.heapsize=512m
20 | dalvik.vm.heaptargetutilization=0.75
21 | dalvik.vm.heapminfree=2m
22 | dalvik.vm.heapmaxfree=8m
23 | dalvik.vm.image-dex2oat-filter=speed
24 | dalvik.vm.isa.arm64.variant=generic
25 | dalvik.vm.isa.arm64.features=default
26 | dalvik.vm.isa.arm.variant=cortex-a15
27 | dalvik.vm.isa.arm.features=default
28 |
29 | # Graphics
30 | debug.hwc.skip_dma_types=0,2
31 | ro.opengles.version=196610
32 | ro.surface_flinger.max_frame_buffer_acquired_buffers=3
33 |
34 | # Media
35 | debug.stagefright.ccodec=0
36 |
37 | # Nfc
38 | ro.nfc.port="I2C"
39 | ro.nfc.sec_hal=true
40 |
41 | # Radio
42 | persist.radio.sib16_support=1
43 | rild.libargs=-d /dev/umts_ipc0
44 | rild.libpath=/system/lib64/libsec-ril.so
45 | rild.libpath2=/system/lib64/libsec-ril-dsds.so
46 | vendor.sec.rild.libpath=/vendor/lib64/libsec-ril.so
47 | vendor.sec.rild.libpath2=/vendor/lib64/libsec-ril-dsds.so
48 | ro.telephony.default_network=9
49 | ro.ril.gprsclass=10
50 | ro.ril.hsxpa=1
51 | ro.debug_level=0x494d
52 | ro.ril.telephony.mqanelements=6
53 | ro.telephony.mms_data_profile=5
54 | telephony.lteOnGsmDevice=1
55 | telephony.lteOnCdmaDevice=0
56 | ro.telephony.get_imsi_from_sim=true
57 |
58 | # SDcardfs
59 | ro.sys.sdcardfs=false
60 |
61 | # Wifi
62 | wifi.interface=wlan0
63 |
64 | # boot device
65 | #ro.boot.bootdevice=13540000.dwmmc0
66 |
--------------------------------------------------------------------------------
/livedisplay/ReadingEnhancement.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef VENDOR_LINEAGE_LIVEDISPLAY_V2_1_READINGENHANCEMENT_H
18 | #define VENDOR_LINEAGE_LIVEDISPLAY_V2_1_READINGENHANCEMENT_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | namespace vendor {
25 | namespace lineage {
26 | namespace livedisplay {
27 | namespace V2_1 {
28 | namespace implementation {
29 |
30 | using ::android::hardware::hidl_array;
31 | using ::android::hardware::hidl_memory;
32 | using ::android::hardware::hidl_string;
33 | using ::android::hardware::hidl_vec;
34 | using ::android::hardware::Return;
35 | using ::android::hardware::Void;
36 | using ::android::sp;
37 |
38 | class ReadingEnhancement : public IReadingEnhancement {
39 | public:
40 | Return isEnabled() override;
41 | Return setEnabled(bool) override;
42 | };
43 |
44 | } // namespace implementation
45 | } // namespace V2_1
46 | } // namespace livedisplay
47 | } // namespace lineage
48 | } // namespace vendor
49 |
50 | #endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_1_READINGENHANCEMENT_H
51 |
--------------------------------------------------------------------------------
/livedisplay/ReadingEnhancement.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 |
20 | #include
21 |
22 | #include "ReadingEnhancement.h"
23 |
24 | using android::base::ReadFileToString;
25 | using android::base::Trim;
26 | using android::base::WriteStringToFile;
27 |
28 | namespace vendor {
29 | namespace lineage {
30 | namespace livedisplay {
31 | namespace V2_1 {
32 | namespace implementation {
33 |
34 | static constexpr const char* kREPath = "/sys/class/mdnie/mdnie/accessibility";
35 |
36 | Return ReadingEnhancement::isEnabled() {
37 | std::string contents;
38 |
39 | if (ReadFileToString(kREPath, &contents)) {
40 | contents = Trim(contents);
41 | }
42 |
43 | return !contents.compare("Current accessibility : DSI0 : GRAYSCALE") || !contents.compare("4");
44 | }
45 |
46 | Return ReadingEnhancement::setEnabled(bool enabled) {
47 | return WriteStringToFile(enabled ? "4" : "0", kREPath, true);
48 | }
49 |
50 | } // namespace implementation
51 | } // namespace V2_1
52 | } // namespace livedisplay
53 | } // namespace lineage
54 | } // namespace vendor
55 |
--------------------------------------------------------------------------------
/livedisplay/SunlightEnhancement.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H
18 | #define VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | namespace vendor {
25 | namespace lineage {
26 | namespace livedisplay {
27 | namespace V2_1 {
28 | namespace implementation {
29 |
30 | using ::android::hardware::hidl_array;
31 | using ::android::hardware::hidl_memory;
32 | using ::android::hardware::hidl_string;
33 | using ::android::hardware::hidl_vec;
34 | using ::android::hardware::Return;
35 | using ::android::hardware::Void;
36 | using ::android::sp;
37 |
38 | class SunlightEnhancement : public ISunlightEnhancement {
39 | public:
40 | Return isEnabled() override;
41 | Return setEnabled(bool enabled) override;
42 | };
43 |
44 | } // namespace implementation
45 | } // namespace V2_1
46 | } // namespace livedisplay
47 | } // namespace lineage
48 | } // namespace vendor
49 |
50 | #endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H
51 |
--------------------------------------------------------------------------------
/livedisplay/SunlightEnhancement.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 |
20 | #include
21 |
22 | #include "SunlightEnhancement.h"
23 |
24 | using android::base::ReadFileToString;
25 | using android::base::Trim;
26 | using android::base::WriteStringToFile;
27 |
28 | namespace vendor {
29 | namespace lineage {
30 | namespace livedisplay {
31 | namespace V2_1 {
32 | namespace implementation {
33 |
34 | static constexpr const char* kLUXPath = "/sys/class/mdnie/mdnie/lux";
35 |
36 | Return SunlightEnhancement::isEnabled() {
37 | std::string tmp;
38 | int32_t contents = 0;
39 |
40 | if (ReadFileToString(kLUXPath, &tmp)) {
41 | contents = std::stoi(Trim(tmp));
42 | }
43 |
44 | return contents > 0;
45 | }
46 |
47 | Return SunlightEnhancement::setEnabled(bool enabled) {
48 | /* see drivers/video/fbdev/exynos/decon_7880/panels/mdnie_lite_table*, get_hbm_index */
49 | return WriteStringToFile(enabled ? "40000" : "0", kLUXPath, true);
50 | }
51 |
52 | } // namespace implementation
53 | } // namespace V2_1
54 | } // namespace livedisplay
55 | } // namespace lineage
56 | } // namespace vendor
57 |
--------------------------------------------------------------------------------
/sepolicy/init.te:
--------------------------------------------------------------------------------
1 | # Mount debugfs on /sys/kernel/debug.
2 | allow init debugfs:dir mounton;
3 |
4 | # Mount EFS on /efs
5 | allow init efs_file:dir mounton;
6 |
7 | # /dev/block/mmcblk0p[0-9]
8 | allow init emmcblk_device:blk_file rw_file_perms;
9 |
10 | allow init block_device:lnk_file { setattr };
11 | allow init tmpfs:lnk_file create_file_perms;
12 |
13 | # /sys/class/power_supply/battery and /sys/class/android_usb/android0
14 | allow init proc:file { getattr setattr read write open };
15 |
16 | # /data
17 | allow init sdcardd_exec:file r_file_perms;
18 |
19 | # sysfs iio:device[0-9]
20 | allow init sysfs:lnk_file setattr;
21 |
22 | # read/chown mDNIE symlinks
23 | allow init sysfs_mdnie:lnk_file { read setattr };
24 |
25 | # read/chown camera firmware
26 | allow init sysfs_camera:file { relabelto setattr };
27 | allow init sysfs_camera:filesystem associate;
28 |
29 | # ZRAM
30 | allow init ram_device:blk_file rw_file_perms;
31 |
32 | # sysfs
33 | allow init sysfs_bluetooth_writable:file setattr;
34 | allow init sysfs_mdnie:file setattr;
35 | allow init sysfs_multipdp:file setattr;
36 | allow init sysfs_devices_system_cpu:file write;
37 | allow init sysfs_gps:file setattr;
38 | allow init sysfs_sec:file setattr ;
39 | allow init sysfs_brightness:file setattr;
40 | allow init sysfs_input:file setattr;
41 | allow init sysfs_lcd:file { setattr open };
42 | allow init sysfs_svc:file setattr;
43 | allow init sysfs_modem:file { setattr open write };
44 | allow init sysfs_wlan_fwpath:file setattr;
45 | allow init sysfs_virtual:file {read open setattr write };
46 | allow init sysfs_virtual:lnk_file read;
47 | allow init sysfs_charger:file setattr;
48 | allow init sysfs_modem:file r_file_perms;
49 | allow init sysfs:file setattr;
50 |
51 | unix_socket_connect(init, property, rild)
52 | allow init socket_device:sock_file { unlink create setattr };
53 |
54 | allow init tee_device:chr_file { read write open ioctl getattr };
55 |
--------------------------------------------------------------------------------
/ramdisk/fstab.samsungexynos7880:
--------------------------------------------------------------------------------
1 | # Android fstab file.
2 | #
3 | # The filesystem that contains the filesystem checker binary (typically /system) cannot
4 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
5 |
6 |
7 | /dev/block/platform/13540000.dwmmc0/by-name/BOOT /boot emmc defaults defaults
8 | /dev/block/platform/13540000.dwmmc0/by-name/RECOVERY /recovery emmc defaults defaults
9 | /dev/block/platform/13540000.dwmmc0/by-name/SYSTEM /system ext4 ro,errors=panic wait
10 | /dev/block/platform/13540000.dwmmc0/by-name/CACHE /cache ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check
11 | /dev/block/platform/13540000.dwmmc0/by-name/USERDATA /data ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check,encryptable=footer,length=-16384
12 | /dev/block/platform/13540000.dwmmc0/by-name/EFS /efs ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check,recoveryonly
13 |
14 | # Updater service
15 | /dev/block/platform/13540000.dwmmc0/by-name/OTA /misc emmc defaults defaults
16 |
17 | # VOLD : fstab.a7y17lte
18 | /dev/block/platform/13540000.dwmmc0/by-name/HIDDEN /preload ext4 defaults voldmanaged=preload:auto
19 | /devices/13560000.dwmmc2/mmc_host/mmc* auto vfat defaults voldmanaged=sdcard:auto,encryptable=userdata
20 | /devices/13600000.usb/13600000.dwc3/xhci-hcd.2.auto/usb* auto auto defaults voldmanaged=usb:auto
21 |
22 | # ZRAM
23 | /dev/block/zram0 none swap defaults zramsize=1610612736,max_comp_streams=8
24 |
--------------------------------------------------------------------------------
/livedisplay/DisplayColorCalibration.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef VENDOR_LINEAGE_LIVEDISPLAY_V2_1_DISPLAYCOLORCALIBRATION_H
18 | #define VENDOR_LINEAGE_LIVEDISPLAY_V2_1_DISPLAYCOLORCALIBRATION_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | namespace vendor {
25 | namespace lineage {
26 | namespace livedisplay {
27 | namespace V2_1 {
28 | namespace implementation {
29 |
30 | using ::android::hardware::hidl_array;
31 | using ::android::hardware::hidl_memory;
32 | using ::android::hardware::hidl_string;
33 | using ::android::hardware::hidl_vec;
34 | using ::android::hardware::Return;
35 | using ::android::hardware::Void;
36 | using ::android::sp;
37 |
38 | class DisplayColorCalibration : public IDisplayColorCalibration {
39 | public:
40 | Return getMaxValue() override;
41 | Return getMinValue() override;
42 | Return getCalibration(getCalibration_cb resultCb) override;
43 | Return setCalibration(const hidl_vec& rgb) override;
44 | };
45 |
46 | } // namespace implementation
47 | } // namespace V2_1
48 | } // namespace livedisplay
49 | } // namespace lineage
50 | } // namespace vendor
51 |
52 | #endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_1_DISPLAYCOLORCALIBRATION_H
53 |
--------------------------------------------------------------------------------
/ramdisk/wifi_sec.rc:
--------------------------------------------------------------------------------
1 | # Wi-Fi init file
2 | on post-fs-data
3 | mkdir /data/vendor 0771 root system
4 | mkdir /data/vendor/log 0771 root system
5 | mkdir /data/vendor/conn 0771 wifi wifi
6 | mkdir /data/vendor/wifi 0771 wifi wifi
7 | mkdir /data/vendor/wifi/wpa 0770 wifi wifi
8 | mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
9 | mkdir /data/vendor/log/wifi 0770 wifi system
10 |
11 | # for WIFI TRP/TIS
12 | chown wifi wifi /data/vendor/conn/.psm.info
13 | chmod 0640 /data/vendor/conn/.psm.info
14 |
15 | # for WIFI Antenna Selection
16 | chown wifi wifi /data/vendor/conn/.ant.info
17 | chmod 0640 /data/vendor/conn/.ant.info
18 |
19 | # for WIFI Version
20 | chown wifi wifi /data/vendor/conn/.wifiver.info
21 | chmod 0644 /data/vendor/conn/.wifiver.info
22 |
23 | # for WIFI MEMDUMP
24 | # The default value of below memdump file is set in SecProductFeature
25 | #write /data/vendor/conn/.memdump.info 2
26 | chown wifi wifi /data/vendor/conn/.memdump.info
27 | chmod 0640 /data/vendor/conn/.memdump.info
28 |
29 | # for WIFI hotspot
30 | chown wifi wifi /data/vendor/conn/.softap.info
31 | chmod 0644 /data/vendor/conn/.softap.info
32 | chown system wifi /vendor/etc/wifi/indoorchannel.info
33 | chmod 0664 /vendor/etc/wifi/indoorchannel.info
34 |
35 | # for WIFI MAC
36 | chown wifi wifi /sys/wifi/mac_addr
37 | chmod 0640 /sys/wifi/mac_addr
38 |
39 | on boot
40 | setprop wifi.interface wlan0
41 |
42 | service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
43 | -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 \
44 | -g@android:wpa_wlan0
45 | interface android.hardware.wifi.supplicant@1.0::ISupplicant default
46 | interface android.hardware.wifi.supplicant@1.1::ISupplicant default
47 | interface android.hardware.wifi.supplicant@1.2::ISupplicant default
48 | class main
49 | socket wpa_wlan0 dgram 660 wifi wifi
50 | disabled
51 | oneshot
52 |
--------------------------------------------------------------------------------
/configs/idc/sec_touchscreen.idc:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2010 The Android Open Source Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | #
16 | # Input Device Configuration File for the Atmel Maxtouch touch screen.
17 | #
18 | # These calibration values are derived from empirical measurements
19 | # and may not be appropriate for use with other touch screens.
20 | # Refer to the input device configuration documentation for more details.
21 | #
22 |
23 | # Basic Parameters
24 | touch.deviceType = touchScreen
25 | touch.orientationAware = 1
26 |
27 | # Touch Size
28 | touch.touchSize.calibration = pressure
29 |
30 | # Tool Size
31 | # Driver reports tool size as an area measurement.
32 | #
33 | # Based on empirical measurements, we estimate the size of the tool
34 | # using size = sqrt(22 * rawToolArea + 0) * 6 + 0.
35 | touch.toolSize.calibration = area
36 | touch.toolSize.areaScale = 22
37 | touch.toolSize.areaBias = 0
38 | touch.toolSize.linearScale = 6
39 | touch.toolSize.linearBias = 0
40 | touch.toolSize.isSummed = 0
41 |
42 | # Pressure
43 | # Driver reports signal strength as pressure.
44 | #
45 | # A normal index finger touch typically registers about 80 signal strength
46 | # units although we don't expect these values to be accurate.
47 | touch.pressure.calibration = amplitude
48 | touch.pressure.source = default
49 | touch.pressure.scale = 0.0125
50 | # Size
51 | touch.size.calibration = normalized
52 | # Orientation
53 | touch.orientation.calibration = vector
54 |
--------------------------------------------------------------------------------
/overlay/packages/apps/Mms/res/xml/mms_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
22 |
23 |
24 |
25 |
26 | 1045876
27 |
28 |
29 | 2592
30 |
31 |
32 | 2592
33 |
34 |
37 | true
38 |
39 |
41 | false
42 |
43 |
44 | SAMSUNG-GT-I9500-Mms
45 |
46 |
47 | http://wap.samsungmobile.com/uaprof/GT-I9500.xml
48 |
49 |
50 |
--------------------------------------------------------------------------------
/configs/idc/Synaptics_HID_TouchPad.idc:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2010 The Android Open Source Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | #
16 | # Input Device Configuration File for the Atmel Maxtouch touch screen.
17 | #
18 | # These calibration values are derived from empirical measurements
19 | # and may not be appropriate for use with other touch screens.
20 | # Refer to the input device configuration documentation for more details.
21 | #
22 |
23 | device.internal = 0
24 |
25 | # Basic Parameters
26 | touch.deviceType = pointer
27 | touch.orientationAware = 1
28 |
29 | touch.gestureMode = pointer
30 |
31 | # Touch Size
32 | touch.touchSize.calibration = pressure
33 |
34 | # Tool Size
35 | # Driver reports tool size as an area measurement.
36 | #
37 | # Based on empirical measurements, we estimate the size of the tool
38 | # using size = sqrt(22 * rawToolArea + 0) * 6 + 0.
39 | touch.toolSize.calibration = area
40 | touch.toolSize.areaScale = 22
41 | touch.toolSize.areaBias = 0
42 | touch.toolSize.linearScale = 6
43 | touch.toolSize.linearBias = 0
44 | touch.toolSize.isSummed = 0
45 |
46 | # Pressure
47 | # Driver reports signal strength as pressure.
48 | #
49 | # A normal index finger touch typically registers about 80 signal strength
50 | # units although we don't expect these values to be accurate.
51 | touch.pressure.calibration = amplitude
52 | touch.pressure.source = default
53 | touch.pressure.scale = 0.0125
54 |
55 | # Size
56 | touch.size.calibration = normalized
57 |
58 | # Orientation
59 | touch.orientation.calibration = vector
60 |
--------------------------------------------------------------------------------
/configs/idc/Synaptics_RMI4_TouchPad_Sensor.idc:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2010 The Android Open Source Project
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | #
16 | # Input Device Configuration File for the Atmel Maxtouch touch screen.
17 | #
18 | # These calibration values are derived from empirical measurements
19 | # and may not be appropriate for use with other touch screens.
20 | # Refer to the input device configuration documentation for more details.
21 | #
22 |
23 | device.internal = 0
24 |
25 | # Basic Parameters
26 | touch.deviceType = pointer
27 | touch.orientationAware = 0
28 |
29 | touch.gestureMode = pointer
30 |
31 | # Touch Size
32 | touch.touchSize.calibration = pressure
33 |
34 | # Tool Size
35 | # Driver reports tool size as an area measurement.
36 | #
37 | # Based on empirical measurements, we estimate the size of the tool
38 | # using size = sqrt(22 * rawToolArea + 0) * 6 + 0.
39 | touch.toolSize.calibration = area
40 | touch.toolSize.areaScale = 22
41 | touch.toolSize.areaBias = 0
42 | touch.toolSize.linearScale = 6
43 | touch.toolSize.linearBias = 0
44 | touch.toolSize.isSummed = 0
45 |
46 | # Pressure
47 | # Driver reports signal strength as pressure.
48 | #
49 | # A normal index finger touch typically registers about 80 signal strength
50 | # units although we don't expect these values to be accurate.
51 | touch.pressure.calibration = amplitude
52 | touch.pressure.source = default
53 | touch.pressure.scale = 0.0125
54 |
55 | # Size
56 | touch.size.calibration = normalized
57 |
58 | # Orientation
59 | touch.orientation.calibration = vector
60 |
--------------------------------------------------------------------------------
/shims/libcamera_client/CameraParameters.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | namespace android {
18 |
19 | class CameraParameters
20 | {
21 | public:
22 | static const char PIXEL_FORMAT_YUV420SP_NV21[];
23 | static const char EFFECT_CARTOONIZE[];
24 | static const char EFFECT_POINT_RED_YELLOW[];
25 | static const char EFFECT_POINT_GREEN[];
26 | static const char EFFECT_POINT_BLUE[];
27 | static const char EFFECT_VINTAGE_COLD[];
28 | static const char EFFECT_VINTAGE_WARM[];
29 | static const char EFFECT_WASHED[];
30 | static const char ISO_AUTO[];
31 | static const char ISO_NIGHT[];
32 | static const char ISO_SPORTS[];
33 | static const char ISO_6400[];
34 | static const char ISO_3200[];
35 | static const char ISO_1600[];
36 | static const char ISO_800[];
37 | static const char ISO_400[];
38 | static const char ISO_200[];
39 | static const char ISO_100[];
40 | static const char ISO_80[];
41 | static const char ISO_50[];
42 | static const char KEY_SUPPORTED_METERING_MODE[];
43 | static const char METERING_CENTER[];
44 | static const char METERING_MATRIX[];
45 | static const char METERING_SPOT[];
46 | static const char METERING_OFF[];
47 | static const char KEY_DYNAMIC_RANGE_CONTROL[];
48 | static const char KEY_SUPPORTED_PHASE_AF[];
49 | static const char KEY_PHASE_AF[];
50 | static const char KEY_SUPPORTED_RT_HDR[];
51 | static const char KEY_RT_HDR[];
52 | };
53 |
54 | }; // namespace android
55 |
--------------------------------------------------------------------------------
/sepolicy/gpsd.te:
--------------------------------------------------------------------------------
1 | type gpsd, domain;
2 | type gpsd_exec, exec_type, file_type, vendor_file_type;
3 |
4 | init_daemon_domain(gpsd);
5 |
6 | # Automatically label files created in /data/system/gps as gps_vendor_data_file
7 | file_type_auto_trans(gpsd, system_data_file, gps_vendor_data_file)
8 |
9 | # Allow rild and netd to connect to gpsd
10 | unix_socket_connect(gpsd, property, rild)
11 | unix_socket_connect(gpsd, property, netd)
12 |
13 | allow gpsd system_server:unix_stream_socket { read write setopt };
14 |
15 | allow gpsd self:capability net_raw;
16 |
17 | binder_call(gpsd, system_server)
18 | binder_call(gpsd, system_suspend_server)
19 | binder_call(gpsd, hwservicemanager)
20 |
21 | get_prop(gpsd, vendor_radio_prop)
22 | get_prop(gpsd, exported_radio_prop)
23 | get_prop(gpsd, exported_config_prop)
24 |
25 | get_prop(gpsd, hwservicemanager_prop)
26 | hwbinder_use(gpsd)
27 | allow gpsd system_suspend_hwservice:hwservice_manager { find };
28 | allow gpsd fwk_sensor_hwservice:hwservice_manager { find };
29 |
30 | # Sockets
31 | type_transition gpsd gps_vendor_data_file:sock_file gps_socket;
32 |
33 | allow gpsd dnsproxyd_socket:sock_file write;
34 | allow gpsd fwmarkd_socket:sock_file write;
35 | allow gpsd gps_socket:sock_file create_file_perms;
36 | allow gpsd self:udp_socket { create bind connect read setopt write getopt };
37 | allow gpsd self:tcp_socket { create bind connect read setopt write getopt };
38 | allow gpsd port:tcp_socket name_connect;
39 |
40 | # sysfs_gps
41 | allow gpsd system_file:dir { open read getattr };
42 | allow gpsd sysfs_gps:file { open read getattr };
43 |
44 | # /dev/ttySAC0
45 | allow gpsd bluetooth_device:chr_file { getattr setattr rw_file_perms };
46 | allow gpsd gps_device:chr_file { getattr setattr rw_file_perms };
47 | allow gpsd gps_vendor_data_file:dir { search write add_name remove_name rw_dir_perms };
48 | allow gpsd gps_vendor_data_file:fifo_file { unlink create setattr getattr rw_file_perms };
49 | allow gpsd gps_vendor_data_file:file create_file_perms;
50 |
51 | allow gpsd sysfs_wake_lock:file rw_file_perms;
52 |
53 | allow gpsd sensorservice_service:service_manager { find };
54 |
55 | # /dev/umts_boot0
56 | allow gpsd mif_device:chr_file r_file_perms;
57 |
--------------------------------------------------------------------------------
/extract-files.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (C) 2018-2020 The LineageOS Project
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | set -e
9 |
10 | DEVICE_COMMON=universal7880-common
11 | VENDOR=samsung
12 |
13 | # Load extractutils and do some sanity checks
14 | MY_DIR="${BASH_SOURCE%/*}"
15 | if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
16 |
17 | ANDROID_ROOT="${MY_DIR}/../../.."
18 |
19 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
20 | if [ ! -f "${HELPER}" ]; then
21 | echo "Unable to find helper script at ${HELPER}"
22 | exit 1
23 | fi
24 | source "${HELPER}"
25 |
26 | # Default to sanitizing the vendor folder before extraction
27 | CLEAN_VENDOR=true
28 |
29 | KANG=
30 | SECTION=
31 |
32 | while [ "${#}" -gt 0 ]; do
33 | case "${1}" in
34 | -n | --no-cleanup )
35 | CLEAN_VENDOR=false
36 | ;;
37 | -k | --kang )
38 | KANG="--kang"
39 | ;;
40 | -s | --section )
41 | SECTION="${2}"; shift
42 | CLEAN_VENDOR=false
43 | ;;
44 | * )
45 | SRC="${1}"
46 | ;;
47 | esac
48 | shift
49 | done
50 |
51 | if [ -z "${SRC}" ]; then
52 | SRC="adb"
53 | fi
54 |
55 | # Initialize the helper
56 | setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true "${CLEAN_VENDOR}"
57 |
58 | extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}"
59 |
60 | # Fix proprietary blobs
61 | BLOB_ROOT="$ANDROID_ROOT"/vendor/"$VENDOR"/"$DEVICE_COMMON"/proprietary
62 |
63 | # Replace protobuf with vndk29 compat libs for specified libs
64 | "${PATCHELF}" --replace-needed libprotobuf-cpp-lite.so libprotobuf-cpp-lite-v29.so $BLOB_ROOT/vendor/lib/libwvhidl.so
65 | "${PATCHELF}" --replace-needed libprotobuf-cpp-lite.so libprotobuf-cpp-lite-v29.so $BLOB_ROOT/vendor/lib/mediadrm/libwvdrmengine.so
66 |
67 | # Replace libvndsecril-client with libsecril-client
68 | patchelf --replace-needed libvndsecril-client.so libsecril-client.so $BLOB_ROOT/vendor/lib/libwrappergps.so
69 | patchelf --replace-needed libvndsecril-client.so libsecril-client.so $BLOB_ROOT/vendor/lib64/libwrappergps.so
70 |
71 | "${MY_DIR}/setup-makefiles.sh"
72 |
--------------------------------------------------------------------------------
/livedisplay/DisplayModes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef VENDOR_LINEAGE_LIVEDISPLAY_V2_1_DISPLAYMODES_H
18 | #define VENDOR_LINEAGE_LIVEDISPLAY_V2_1_DISPLAYMODES_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | namespace vendor {
25 | namespace lineage {
26 | namespace livedisplay {
27 | namespace V2_1 {
28 | namespace implementation {
29 |
30 | using ::android::hardware::hidl_array;
31 | using ::android::hardware::hidl_memory;
32 | using ::android::hardware::hidl_string;
33 | using ::android::hardware::hidl_vec;
34 | using ::android::hardware::Return;
35 | using ::android::hardware::Void;
36 | using ::android::sp;
37 |
38 | class DisplayModes : public IDisplayModes {
39 | public:
40 | DisplayModes();
41 |
42 | // Methods from ::vendor::lineage::livedisplay::V2_1::IDisplayModes follow.
43 | Return getDisplayModes(getDisplayModes_cb resultCb) override;
44 | Return getCurrentDisplayMode(getCurrentDisplayMode_cb resultCb) override;
45 | Return getDefaultDisplayMode(getDefaultDisplayMode_cb resultCb) override;
46 | Return setDisplayMode(int32_t modeID, bool makeDefault) override;
47 |
48 | // Methods from ::android::hidl::base::V1_0::IBase follow.
49 | private:
50 | static const std::map kModeMap;
51 | int32_t mDefaultModeId;
52 | };
53 |
54 | } // namespace implementation
55 | } // namespace V2_1
56 | } // namespace livedisplay
57 | } // namespace lineage
58 | } // namespace vendor
59 |
60 | #endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_1_DISPLAYMODES_H
61 |
--------------------------------------------------------------------------------
/livedisplay/DisplayColorCalibration.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 |
20 | #include
21 |
22 | #include "DisplayColorCalibration.h"
23 |
24 | using android::base::ReadFileToString;
25 | using android::base::Split;
26 | using android::base::Trim;
27 | using android::base::WriteStringToFile;
28 |
29 | namespace vendor {
30 | namespace lineage {
31 | namespace livedisplay {
32 | namespace V2_1 {
33 | namespace implementation {
34 |
35 | static constexpr const char* kColorPath = "/sys/class/mdnie/mdnie/sensorRGB";
36 |
37 | Return DisplayColorCalibration::getMaxValue() {
38 | return 255;
39 | }
40 |
41 | Return DisplayColorCalibration::getMinValue() {
42 | return 1;
43 | }
44 |
45 | Return DisplayColorCalibration::getCalibration(getCalibration_cb resultCb) {
46 | std::vector rgb;
47 | std::string tmp;
48 |
49 | if (ReadFileToString(kColorPath, &tmp)) {
50 | std::vector colors = Split(Trim(tmp), " ");
51 | for (const std::string& color : colors) {
52 | rgb.push_back(std::stoi(color));
53 | }
54 | }
55 |
56 | resultCb(rgb);
57 | return Void();
58 | }
59 |
60 | Return DisplayColorCalibration::setCalibration(const hidl_vec& rgb) {
61 | std::string contents;
62 | for (const int32_t& color : rgb) {
63 | contents += std::to_string(color) + " ";
64 | }
65 | return WriteStringToFile(Trim(contents), kColorPath, true);
66 | }
67 |
68 | } // namespace implementation
69 | } // namespace V2_1
70 | } // namespace livedisplay
71 | } // namespace lineage
72 | } // namespace vendor
73 |
--------------------------------------------------------------------------------
/overlay/lineage-sdk/lineage/res/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 | true
21 | 400
22 | false
23 |
24 |
36 | 83
37 |
38 |
43 | 1
44 |
45 |
46 |
47 | - restart
48 | - restart_recovery
49 | - restart_download
50 | - restart_systemui
51 |
52 |
53 |
--------------------------------------------------------------------------------
/setup-makefiles.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (C) 2017-2021 The LineageOS Project
4 | #
5 | # SPDX-License-Identifier: Apache-2.0
6 | #
7 |
8 | set -e
9 |
10 | DEVICE_COMMON=universal7880-common
11 | VENDOR=samsung
12 |
13 | # Load extractutils and do some sanity checks
14 | MY_DIR="${BASH_SOURCE%/*}"
15 | if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
16 |
17 | ANDROID_ROOT="${MY_DIR}/../../.."
18 |
19 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
20 | if [ ! -f "${HELPER}" ]; then
21 | echo "Unable to find helper script at ${HELPER}"
22 | exit 1
23 | fi
24 | source "${HELPER}"
25 |
26 | # Initialize the helper
27 | setup_vendor "${DEVICE_COMMON}" "${VENDOR}" "${ANDROID_ROOT}" true
28 |
29 | # Warning headers and guards
30 | write_headers "a5y17lte a7y17lte"
31 |
32 | write_makefiles "${MY_DIR}/proprietary-files.txt" true
33 |
34 | ###################################################################################################
35 | # CUSTOM PART START #
36 | ###################################################################################################
37 |
38 | OUTDIR=vendor/$VENDOR/$DEVICE_COMMON
39 |
40 | (cat << EOF) >> $ANDROID_ROOT/$OUTDIR/Android.mk
41 | include \$(CLEAR_VARS)
42 |
43 | EGL_LIBS := libGLES_mali.so libOpenCL.so libOpenCL.so.1 libOpenCL.so.1.1 vulkan.exynos5.so
44 |
45 | EGL_32_SYMLINKS := \$(addprefix \$(TARGET_OUT_VENDOR)/lib/,\$(EGL_LIBS))
46 | \$(EGL_32_SYMLINKS): \$(LOCAL_INSTALLED_MODULE)
47 | @echo "Symlink: EGL 32-bit lib: \$@"
48 | @mkdir -p \$(dir \$@)
49 | @rm -rf \$@
50 | \$(hide) ln -sf /vendor/lib/egl/libGLES_mali.so \$@
51 |
52 | EGL_64_SYMLINKS := \$(addprefix \$(TARGET_OUT_VENDOR)/lib64/,\$(EGL_LIBS))
53 | \$(EGL_64_SYMLINKS): \$(LOCAL_INSTALLED_MODULE)
54 | @echo "Symlink: EGL 64-bit lib : \$@"
55 | @mkdir -p \$(dir \$@)
56 | @rm -rf \$@
57 | \$(hide) ln -sf /vendor/lib64/egl/libGLES_mali.so \$@
58 |
59 | ALL_DEFAULT_INSTALLED_MODULES += \$(EGL_32_SYMLINKS) \$(EGL_64_SYMLINKS)
60 |
61 | EOF
62 |
63 | ###################################################################################################
64 | # CUSTOM PART END #
65 | ###################################################################################################
66 |
67 | # Done
68 | write_footers
69 |
--------------------------------------------------------------------------------
/sepolicy/file.te:
--------------------------------------------------------------------------------
1 | ### efs types
2 | type app_efs_file, file_type;
3 | type battery_efs_file, file_type;
4 | type baro_delta_factoryapp_efs_file, file_type;
5 | type bin_nv_data_efs_file, file_type;
6 | type sec_efs_file, file_type;
7 | # widewine, drm
8 | type cpk_efs_file, file_type;
9 | type drm_efs_file, file_type;
10 | type factorymode_factoryapp_efs_file, file_type;
11 | type imei_efs_file, file_type;
12 | type prov_efs_file, file_type;
13 | type radio_factoryapp_efs_file, file_type;
14 | type sensor_efs_file, file_type;
15 | type sensor_factoryapp_efs_file, file_type;
16 | type wifi_efs_file, file_type;
17 | type factoryprop_efs_file, file_type, data_file_type;
18 |
19 | # gps
20 | type gps_vendor_data_file, file_type, data_file_type;
21 | type gps_socket, file_type;
22 |
23 | ### sysfs types
24 | type sysfs_mdnie, fs_type, sysfs_type, mlstrustedobject;
25 | type sysfs_mipi, fs_type, sysfs_type, mlstrustedobject;
26 | type sysfs_multipdp, fs_type, sysfs_type, mlstrustedobject;
27 | type sysfs_sec, fs_type, sysfs_type, mlstrustedobject;
28 | type sysfs_camera, fs_type, sysfs_type, mlstrustedobject;
29 | type sysfs_charger, fs_type, sysfs_type, mlstrustedobject;
30 | type sysfs_gps, fs_type, sysfs_type, mlstrustedobject;
31 | type sysfs_brightness, fs_type, sysfs_type, mlstrustedobject;
32 | type sysfs_input, fs_type, sysfs_type, mlstrustedobject;
33 | type sysfs_svc, fs_type, sysfs_type, mlstrustedobject;
34 | type sysfs_lcd, fs_type, sysfs_type, mlstrustedobject;
35 | type sysfs_modem, fs_type, sysfs_type, mlstrustedobject;
36 | type sysfs_virtual, fs_type, sysfs_type, mlstrustedobject;
37 | type sysfs_iio, fs_type, sysfs_type, mlstrustedobject;
38 | type sysfs_graphics, fs_type, sysfs_type, mlstrustedobject;
39 | type sysfs_mmc, fs_type, sysfs_type, mlstrustedobject;
40 |
41 | ### data types
42 | type display_vendor_data_file, file_type, data_file_type;
43 | type fingerprintd_vendor_data_file, data_file_type, file_type;
44 | type mediadrm_data_file, file_type, data_file_type;
45 | type mobicore_vendor_data_file, data_file_type, file_type;
46 | type radio_vendor_data_file, data_file_type, file_type;
47 | type nfc_vendor_data_file, data_file_type, file_type;
48 |
49 | # file
50 | type mobicore_data_file, file_type, data_file_type, core_data_file_type;
51 |
52 | allow sysfs_type tmpfs:filesystem associate;
53 |
54 | # debugfs types
55 | type debugfs_mali, fs_type, debugfs_type;
56 | type debugfs_ion, fs_type, debugfs_type;
57 |
--------------------------------------------------------------------------------
/sepolicy/rild.te:
--------------------------------------------------------------------------------
1 | # Allow rild to change perms
2 | allow rild self:capability { chown };
3 |
4 | # Allow additiional efs access
5 | allow rild bin_nv_data_efs_file:file create_file_perms;
6 | allow rild imei_efs_file:dir r_dir_perms;
7 | allow rild imei_efs_file:file rw_file_perms;
8 | allow rild app_efs_file:dir r_dir_perms;
9 | allow rild app_efs_file:file r_file_perms;
10 |
11 | # /efs/factory.prop
12 | allow rild factoryprop_efs_file:file { open read write };
13 |
14 | # /dev
15 | allow rild audioserver:dir r_dir_perms;
16 | # /proc//cmdline
17 | allow rild audioserver:file r_file_perms;
18 |
19 | # /dev/mbin0
20 | allow rild block_device:dir r_dir_perms;
21 | allow rild emmcblk_device:blk_file r_file_perms;
22 |
23 | # /dev/umts_boot0, /dev/umts_ipc0
24 | allow rild mif_device:chr_file rw_file_perms;
25 |
26 | # /sys/devices/virtual/misc/multipdp/waketime
27 | allow rild sysfs_multipdp:file rw_file_perms;
28 |
29 | # /proc/sys/net/ipv6/conf/*/accept_ra_defrtr
30 | allow rild proc_net:file rw_file_perms;
31 |
32 | # gpsd
33 | allow rild gpsd:dir search;
34 | allow rild gpsd:file r_file_perms;
35 |
36 | # rild reads /proc/pid/cmdline of mediaserver
37 | allow rild mediaserver:dir { open read search getattr };
38 | allow rild mediaserver:file { open read getattr };
39 |
40 | # /data/misc/radio/*
41 | allow rild radio_data_file:dir rw_dir_perms;
42 | allow rild radio_data_file:file create_file_perms;
43 | # /data/data/com.android.providers.telephony/databases/telephony.db
44 | allow rild radio_data_file:lnk_file r_file_perms;
45 |
46 | # /data/vendor/secradio/*
47 | allow rild radio_vendor_data_file:dir { add_name open read remove_name write search };
48 | allow rild radio_vendor_data_file:file { create getattr ioctl lock open read unlink write };
49 |
50 | # sdcard/SDET_PLMN/input/MNCMCC.txt
51 | allow rild storage_file:dir { r_dir_perms };
52 | allow rild storage_file:lnk_file { r_file_perms };
53 | allow rild mnt_user_file:dir { r_dir_perms };
54 | allow rild mnt_user_file:lnk_file { r_file_perms };
55 |
56 | # Modem firmware download
57 | allow rild radio_block_device:blk_file r_file_perms;
58 |
59 | # prop
60 | set_prop(rild, vendor_cbd_prop)
61 | allow rild vendor_radio_prop:file { read open getattr };
62 |
63 | # /dev/knox_kap
64 | allow rild knox_device:chr_file r_file_perms;
65 |
66 | # proc
67 | allow rild proc_qtaguid_stat:file r_file_perms;
68 |
69 | # binder
70 | allow rild hal_radio_default:binder call;
71 |
72 | # audio hal
73 | allow rild hal_audio_default:dir search;
74 | allow rild hal_audio_default:file r_file_perms;
75 |
76 | allow rild mnt_vendor_file:dir search;
77 |
--------------------------------------------------------------------------------
/init/init_sec.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 |
7 | #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
8 | #include
9 |
10 | #include "property_service.h"
11 | #include "vendor_init.h"
12 |
13 | #include "init_sec.h"
14 |
15 | #define MODEL_NAME_LEN 5 // e.g. "A520F"
16 | #define BUILD_NAME_LEN 8 // e.g. "XXU2BQH4"
17 | #define CODENAME_LEN 11 // e.g. "a5y17ltecan"
18 |
19 |
20 | static void property_override(char const prop[], char const value[]) {
21 | prop_info *pi;
22 |
23 | pi = (prop_info*) __system_property_find(prop);
24 | if (pi)
25 | __system_property_update(pi, value, strlen(value));
26 | else
27 | __system_property_add(prop, strlen(prop), value, strlen(value));
28 | }
29 |
30 | void property_override_dual(char const system_prop[], char const vendor_prop[], char const value[])
31 | {
32 | property_override(system_prop, value);
33 | property_override(vendor_prop, value);
34 | }
35 |
36 | void vendor_load_properties()
37 | {
38 | const std::string bootloader = android::base::GetProperty("ro.bootloader", "");
39 | const std::string bl_model = bootloader.substr(0, MODEL_NAME_LEN);
40 | const std::string bl_build = bootloader.substr(MODEL_NAME_LEN);
41 |
42 | std::string model; // A520F
43 | std::string device; // a5y17lte
44 | std::string name; // a5y17ltexx
45 |
46 | model = "SM-" + bl_model;
47 |
48 | for (size_t i = 0; i < VARIANT_MAX; i++) {
49 | std::string model_ = all_variants[i]->model;
50 | if (model.compare(model_) == 0) {
51 | device = all_variants[i]->codename;
52 | break;
53 | }
54 | }
55 |
56 | if (device.size() == 0) {
57 | LOG(ERROR) << "Could not detect device, forcing a5y17lte";
58 | device = "a5y17lte";
59 | }
60 |
61 | name = device + "xx";
62 |
63 | LOG(INFO) << "Found bootloader: %s", bootloader.c_str();
64 | LOG(INFO) << "Setting ro.product.model: %s", model.c_str();
65 | LOG(INFO) << "Setting ro.product.device: %s", device.c_str();
66 | LOG(INFO) << "Setting ro.product.name: %s", name.c_str();
67 | LOG(INFO) << "Setting ro.build.product: %s", device.c_str();
68 |
69 | property_override_dual("ro.product.model", "ro.vendor.product.model", model.c_str());
70 | property_override_dual("ro.product.device", "ro.vendor.product.device", device.c_str());
71 | property_override_dual("ro.product.name", "ro.vendor.product.name", name.c_str());
72 | property_override("ro.build.product", device.c_str());
73 | }
74 |
--------------------------------------------------------------------------------
/sepolicy/system_server.te:
--------------------------------------------------------------------------------
1 | # /efs
2 | allow system_server efs_file:dir r_dir_perms;
3 |
4 | # /efs/gyro_cal_data
5 | allow system_server sensor_efs_file:file r_file_perms;
6 |
7 | # /data/system/gps/.gps.interface.pipe.*
8 | type_transition system_server system_data_file:fifo_file gps_vendor_data_file ".flp.interface.pipe.to_gpsd";
9 | type_transition system_server system_data_file:fifo_file gps_vendor_data_file ".gps.interface.pipe.to_gpsd";
10 | type_transition system_server system_data_file:fifo_file gps_vendor_data_file ".gps.interface.pipe.to_jni";
11 | allow system_server gps_vendor_data_file:fifo_file create_file_perms;
12 | allow system_server gps_vendor_data_file:dir rw_dir_perms;
13 |
14 | # /data/system/gps/chip.info
15 | allow system_server gps_vendor_data_file:file r_file_perms;
16 |
17 | # /efs/prox_cal
18 | allow system_server efs_file:file r_file_perms;
19 |
20 | # /efs/FactoryApp
21 | allow system_server app_efs_file:dir r_dir_perms;
22 | allow system_server app_efs_file:file r_file_perms;
23 |
24 | # WifiMachine
25 | allow system_server self:capability { sys_module };
26 | allow system_server wifi_efs_file:dir r_dir_perms;
27 | allow system_server wifi_efs_file:file r_file_perms;
28 |
29 | # mDNIE
30 | allow system_server sysfs_mdnie:lnk_file rw_file_perms;
31 | allow system_server sysfs_mdnie:file rw_file_perms;
32 |
33 | # memtrack HAL
34 | allow system_server debugfs:dir r_dir_perms;
35 | allow system_server debugfs_mali:dir r_dir_perms;
36 | allow system_server debugfs_mali:file r_file_perms;
37 |
38 | # debugfs ion
39 | allow system_server debugfs_ion:file rw_file_perms;
40 |
41 | # RIL
42 | allow system_server vendor_radio_prop:file { read open };
43 |
44 | # sensor HAL
45 | allow system_server sensor_device:chr_file rw_file_perms;
46 | allow system_server baro_delta_factoryapp_efs_file:file r_file_perms;
47 | allow system_server sensor_factoryapp_efs_file:file r_file_perms;
48 |
49 | # sysfs
50 | allow system_server sysfs_brightness:file write;
51 | allow system_server sysfs_input:file write;
52 | allow system_server sysfs_sec:file write;
53 | allow system_server sysfs_devices_system_cpu:file write;
54 | allow system_server sysfs_virtual:file write;
55 | allow system_server sysfs_iio:chr_file r_file_perms;
56 | allow system_server sysfs_iio:file write;
57 |
58 | # /data/system/gps/xtraee.bin
59 | allow system_server gps_vendor_data_file:file create_file_perms;
60 |
61 | unix_socket_connect(system_server, property, gpsd)
62 |
63 | allow system_server proc:file { read open getattr };
64 |
65 | allow system_server {
66 | userspace_reboot_exported_prop
67 | userspace_reboot_config_prop
68 | }:file { read open getattr };
69 |
--------------------------------------------------------------------------------
/shims/libcamera_client/CameraParameters.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include "CameraParameters.h"
18 |
19 | namespace android {
20 |
21 | const char CameraParameters::PIXEL_FORMAT_YUV420SP_NV21[] = "nv21";
22 | const char CameraParameters::EFFECT_CARTOONIZE[] = "cartoonize";
23 | const char CameraParameters::EFFECT_POINT_RED_YELLOW[] = "point-red-yellow";
24 | const char CameraParameters::EFFECT_POINT_GREEN[] = "point-green";
25 | const char CameraParameters::EFFECT_POINT_BLUE[] = "point-blue";
26 | const char CameraParameters::EFFECT_VINTAGE_COLD[] = "vintage-cold";
27 | const char CameraParameters::EFFECT_VINTAGE_WARM[] = "vintage-warm";
28 | const char CameraParameters::EFFECT_WASHED[] = "washed";
29 | const char CameraParameters::ISO_AUTO[] = "auto";
30 | const char CameraParameters::ISO_NIGHT[] = "night";
31 | const char CameraParameters::ISO_SPORTS[] = "sports";
32 | const char CameraParameters::ISO_6400[] = "6400";
33 | const char CameraParameters::ISO_3200[] = "3200";
34 | const char CameraParameters::ISO_1600[] = "1600";
35 | const char CameraParameters::ISO_800[] = "800";
36 | const char CameraParameters::ISO_400[] = "400";
37 | const char CameraParameters::ISO_200[] = "200";
38 | const char CameraParameters::ISO_100[] = "100";
39 | const char CameraParameters::ISO_80[] = "80";
40 | const char CameraParameters::ISO_50[] = "50";
41 | const char CameraParameters::KEY_SUPPORTED_METERING_MODE[] = "metering-values";
42 | const char CameraParameters::METERING_CENTER[] = "center";
43 | const char CameraParameters::METERING_MATRIX[] = "matrix";
44 | const char CameraParameters::METERING_SPOT[] = "spot";
45 | const char CameraParameters::METERING_OFF[] = "off";
46 | const char CameraParameters::KEY_DYNAMIC_RANGE_CONTROL[] = "dynamic-range-control";
47 | const char CameraParameters::KEY_SUPPORTED_PHASE_AF[] = "phase-af-values";
48 | const char CameraParameters::KEY_PHASE_AF[] = "phase-af";
49 | const char CameraParameters::KEY_SUPPORTED_RT_HDR[] = "rt-hdr-values";
50 | const char CameraParameters::KEY_RT_HDR[] = "rt-hdr";
51 |
52 | }; // namespace android
53 |
--------------------------------------------------------------------------------
/amplifier/tfa.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 Christopher N. Hesse
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef TFA_H
18 | #define TFA_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | #define TFA_LIBRARY_PATH "/system/lib/libtfa98xx.so"
25 |
26 |
27 | /*
28 | * Amplifier audio modes for different usecases.
29 | */
30 | typedef enum {
31 | Audio_Mode_None = -1,
32 | Audio_Mode_Music_Normal,
33 | Audio_Mode_Voice,
34 | Audio_Mode_Max
35 | } tfa_mode_t;
36 |
37 | /*
38 | * It doesn't really matter what this is, apparently we just need a continuous
39 | * chunk of memory...
40 | */
41 | typedef struct {
42 | volatile int a1;
43 | volatile unsigned char a2[500];
44 | } __attribute__((packed)) tfa_handle_t;
45 |
46 | /*
47 | * Vendor functions that we dlsym.
48 | */
49 | typedef int (*tfa_device_open_t)(tfa_handle_t*, int);
50 | typedef int (*tfa_enable_t)(tfa_handle_t*, int);
51 |
52 | /*
53 | * TFA Amplifier device abstraction.
54 | *
55 | * lib_handle: The prebuilt vendor blob, loaded into memory
56 | * tfa_handle: Misc data we need to pass to the vendor function calls
57 | * tfa_lock: A mutex guarding amplifier enable/disable operations
58 | * tfa_device_open: Vendor function for initializing the amplifier
59 | * tfa_enable: Vendor function for enabling/disabling the amplifier
60 | * mode: Audio mode for the current audio device
61 | */
62 | typedef struct {
63 | void *lib_handle;
64 | tfa_handle_t* tfa_handle;
65 | pthread_mutex_t tfa_lock;
66 | tfa_device_open_t tfa_device_open;
67 | tfa_enable_t tfa_enable;
68 | tfa_mode_t mode;
69 |
70 | // for clock init
71 | atomic_bool initializing;
72 | bool clock_enabled;
73 | bool writing;
74 | pthread_t write_thread;
75 | pthread_mutex_t mutex;
76 | pthread_cond_t cond;
77 | } tfa_device_t;
78 |
79 | /*
80 | * Public API
81 | */
82 | int tfa_power(tfa_device_t *tfa_dev, bool on);
83 | tfa_device_t * tfa_device_open();
84 | void tfa_device_close(tfa_device_t *tfa_dev);
85 |
86 | #endif // TFA_H
87 |
--------------------------------------------------------------------------------
/include/samsung_audio.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 |
19 | #ifndef SAMSUNG_AUDIO_H
20 | #define SAMSUNG_AUDIO_H
21 |
22 | #define MIXER_CARD 0
23 | #define SOUND_CARD 0
24 |
25 | /* Playback */
26 | #define SOUND_DEEP_BUFFER_DEVICE 1
27 | #define SOUND_PLAYBACK_DEVICE 0
28 | #define SOUND_PLAYBACK_SCO_DEVICE 3
29 |
30 | /* Capture */
31 | #define SOUND_CAPTURE_DEVICE 0
32 | #define SOUND_CAPTURE_SCO_DEVICE 3
33 |
34 | /* Voice calls */
35 | #define SOUND_PLAYBACK_VOICE_DEVICE 2
36 | #define SOUND_CAPTURE_VOICE_DEVICE 2
37 |
38 | /* Wideband AMR callback */
39 | #ifndef RIL_UNSOL_SNDMGR_WB_AMR_REPORT
40 | #ifdef RIL_UNSOL_WB_AMR_STATE
41 | #define RIL_UNSOL_SNDMGR_WB_AMR_REPORT RIL_UNSOL_WB_AMR_STATE
42 | #else
43 | #define RIL_UNSOL_SNDMGR_WB_AMR_REPORT 0
44 | #endif
45 | #endif
46 |
47 | /* Unusupported
48 | #define SOUND_CAPTURE_LOOPBACK_AEC_DEVICE 1
49 | #define SOUND_CAPTURE_HOTWORD_DEVICE 0
50 | */
51 |
52 | /*
53 | * If the device has stereo speakers and the speakers are arranged on
54 | * different sides of the device you can activate this feature by
55 | * setting it to 1.
56 | */
57 | #define SWAP_SPEAKER_ON_SCREEN_ROTATION 0
58 |
59 | /*
60 | * You can that this to 1 if your kernel supports irq affinity for
61 | * fast mode. See /proc/asound/irq_affinity
62 | */
63 | #define SUPPORTS_IRQ_AFFINITY 0
64 |
65 | /*
66 | * The Wolfson/Cirruslogic chips need to shutdown the DAPM route completely
67 | * to be able to load a new firmware. Some of these chips need a delay after
68 | * shutodown to full poweroff the DSPs.
69 | *
70 | * A good value to start with is 10ms:
71 | *
72 | * #define DSP_POWEROFF_DELAY 10 * 1000
73 | */
74 | /* #define DSP_POWEROFF_DELAY 0 */
75 |
76 | /*
77 | * Some device variants (often T-Mobile) have a separate voice processing IC
78 | * (Audience EarSmart xxx).
79 | * This hooks into the voice call session and enables, configures and disables
80 | * this extra firmware so RX/TX streams can be routed by the driver.
81 | */
82 | /* #define AUDIENCE_EARSMART_IC */
83 |
84 | #endif // SAMSUNG_AUDIO_H
85 |
--------------------------------------------------------------------------------
/rro_overlays/TetheringOverlay/res/values/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
24 |
25 | - usb\\d
26 | - rndis\\d
27 | - ncm\\d
28 |
29 |
30 |
33 |
34 | - "wlan\\d"
35 | - "swlan0"
36 |
37 |
38 |
41 |
42 | - bt-pan
43 |
44 |
45 |
48 |
49 | - "p2p\\d"
50 |
51 |
52 |
56 | false
57 |
58 |
--------------------------------------------------------------------------------
/include/telephony/ril_commands_vendor.h:
--------------------------------------------------------------------------------
1 | /* //device/libs/telephony/ril_commands.h
2 | **
3 | ** Copyright 2006, The Android Open Source 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 | {RIL_OEM_REQUEST_BASE, NULL},
18 | {RIL_REQUEST_DIAL_EMERGENCY_CALL, NULL}, // 10001
19 | {RIL_REQUEST_CALL_DEFLECTION, NULL}, // 10002
20 | {RIL_REQUEST_MODIFY_CALL_INITIATE, NULL}, // 10003
21 | {RIL_REQUEST_SET_IMS_CALL_LIST, NULL}, // 10004
22 | {RIL_REQUEST_SET_VOICE_DOMAIN_PREF, NULL}, // 10005
23 | {RIL_REQUEST_SAFE_MODE, NULL}, // 10006
24 | {RIL_REQUEST_SET_TRANSMIT_POWER, NULL}, // 10007
25 | {RIL_REQUEST_GET_CELL_BROADCAST_CONFIG, NULL}, // 10008
26 | {RIL_REQUEST_GET_PHONEBOOK_STORAGE_INFO, NULL}, // 10009
27 | {RIL_REQUEST_GET_PHONEBOOK_ENTRY, NULL}, // 10010
28 | {RIL_REQUEST_ACCESS_PHONEBOOK_ENTRY, NULL}, // 10011
29 | {RIL_REQUEST_USIM_PB_CAPA, NULL}, // 10012
30 | {RIL_REQUEST_LOCK_INFO, NULL}, // 10013
31 | {RIL_REQUEST_STK_SIM_INIT_EVENT, NULL}, // 10014
32 | {RIL_REQUEST_SET_PREFERRED_NETWORK_LIST, NULL}, // 10015
33 | {RIL_REQUEST_GET_PREFERRED_NETWORK_LIST, NULL}, // 10016
34 | {RIL_REQUEST_CHANGE_SIM_PERSO, NULL}, // 10017
35 | {RIL_REQUEST_ENTER_SIM_PERSO, NULL}, // 10018
36 | {RIL_REQUEST_SEND_ENCODED_USSD, NULL}, // 10019
37 | {RIL_REQUEST_CDMA_SEND_SMS_EXPECT_MORE, NULL}, // 10020
38 | {10021, NULL},
39 | {RIL_REQUEST_HOLD, NULL}, // 10022
40 | {RIL_REQUEST_SET_SIM_POWER, NULL}, // 10023
41 | {RIL_REQUEST_GET_ACB_INFO, NULL}, // 11024
42 | {RIL_REQUEST_UICC_GBA_AUTHENTICATE_BOOTSTRAP, NULL}, // 10025
43 | {RIL_REQUEST_UICC_GBA_AUTHENTICATE_NAF, NULL}, // 10026
44 | {RIL_REQUEST_GET_INCOMING_COMMUNICATION_BARRING, NULL}, // 10027
45 | {RIL_REQUEST_SET_INCOMING_COMMUNICATION_BARRING, NULL}, // 10028
46 | {RIL_REQUEST_QUERY_CNAP, NULL}, // 10029
47 | {RIL_REQUEST_SET_TRANSFER_CALL, NULL}, // 10030
48 | {RIL_REQUEST_GET_DISABLE_2G, NULL}, // 11031
49 | {RIL_REQUEST_SET_DISABLE_2G, NULL}, // 11032
50 | {RIL_REQUEST_REFRESH_NITZ_TIME, NULL}, // 11033
51 | {RIL_REQUEST_ENABLE_UNSOL_RESPONSE, NULL}, // 11034
52 | {RIL_REQUEST_CANCEL_TRANSFER_CALL, NULL}, // 11035
53 | {RIL_REQUEST_SIM_OPEN_CHANNEL_WITH_P2, NULL}, // 11036
54 | {RIL_REQUEST_ACKNOWLEDGE_RIL_CONNECTED, NULL}, // 11037
55 | {RIL_REQUEST_EMERGENCY_SEARCH, NULL}, // 11038
56 | {RIL_REQUEST_EMERGENCY_CONTROL, NULL}, // 11039
57 | {RIL_REQUEST_SIM_GET_ATR, NULL}, // 11040
58 |
--------------------------------------------------------------------------------
/ramdisk/init.baseband.rc:
--------------------------------------------------------------------------------
1 | on init
2 | symlink /dev/block/platform/13540000.dwmmc0/by-name/RADIO /dev/mbin0
3 | restorecon /dev/mbin0
4 |
5 | write /proc/sys/net/core/netdev_max_backlog 5000
6 |
7 | write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 6
8 | write /sys/class/net/rmnet1/queues/rx-0/rps_cpus 6
9 | write /sys/class/net/rmnet2/queues/rx-0/rps_cpus 6
10 | write /sys/class/net/rmnet3/queues/rx-0/rps_cpus 6
11 | write /sys/class/net/rmnet4/queues/rx-0/rps_cpus 6
12 | write /sys/class/net/rmnet5/queues/rx-0/rps_cpus 6
13 | write /sys/class/net/rmnet6/queues/rx-0/rps_cpus 6
14 | write /sys/class/net/rmnet7/queues/rx-0/rps_cpus 6
15 |
16 | on fs
17 | chown radio system /efs
18 | chmod 0771 /efs
19 | chown radio radio sys/devices/virtual/misc/multipdp/waketime
20 | chmod 0660 /sys/devices/virtual/misc/umts_dm0/dm_state
21 | chown radio system /sys/devices/virtual/misc/umts_dm0/dm_state
22 |
23 | # /efs/factory.prop for Dual / Single SIM settings
24 | chown radio radio /efs/factory.prop
25 | chmod 0600 /efs/factory.prop
26 |
27 | #For cpdebug partition
28 | wait /dev/block/platform/13540000.dwmmc0/by-name/EFS
29 | mkdir /efs/cpdebug
30 | chown radio system /efs/cpdebug
31 | chmod 0771 /efs/cpdebug
32 | symlink /dev/block/platform/13540000.dwmmc0/by-name/CP_DEBUG /efs/cpdebug/node
33 | chown radio system /efs/cpdebug/node
34 | chmod 0771 /efs/cpdebug/node
35 |
36 | on property:ril.clatd.v4-rmnet0=up
37 | write /sys/class/net/rmnet0/queues/rx-0/rps_cpus 4
38 | write /sys/class/net/v4-rmnet0/queues/rx-0/rps_cpus 2
39 |
40 | on property:ril.clatd.v4-rmnet1=up
41 | write /sys/class/net/rmnet1/queues/rx-0/rps_cpus 4
42 | write /sys/class/net/v4-rmnet1/queues/rx-0/rps_cpus 2
43 |
44 | on property:ril.clatd.v4-rmnet2=up
45 | write /sys/class/net/rmnet2/queues/rx-0/rps_cpus 4
46 | write /sys/class/net/v4-rmnet2/queues/rx-0/rps_cpus 2
47 |
48 | on property:ril.clatd.v4-rmnet3=up
49 | write /sys/class/net/rmnet3/queues/rx-0/rps_cpus 4
50 | write /sys/class/net/v4-rmnet3/queues/rx-0/rps_cpus 2
51 |
52 | on property:ril.clatd.v4-rmnet4=up
53 | write /sys/class/net/rmnet4/queues/rx-0/rps_cpus 4
54 | write /sys/class/net/v4-rmnet4/queues/rx-0/rps_cpus 2
55 |
56 | on property:ril.clatd.v4-rmnet5=up
57 | write /sys/class/net/rmnet5/queues/rx-0/rps_cpus 4
58 | write /sys/class/net/v4-rmnet5/queues/rx-0/rps_cpus 2
59 |
60 | on property:ril.clatd.v4-rmnet6=up
61 | write /sys/class/net/rmnet6/queues/rx-0/rps_cpus 4
62 | write /sys/class/net/v4-rmnet6/queues/rx-0/rps_cpus 2
63 |
64 | on property:ril.clatd.v4-rmnet7=up
65 | write /sys/class/net/rmnet7/queues/rx-0/rps_cpus 4
66 | write /sys/class/net/v4-rmnet7/queues/rx-0/rps_cpus 2
67 |
68 | service cpboot-daemon /vendor/bin/cbd -d -tss310 -bm -mm -P platform/13540000.dwmmc0/by-name/RADIO -n /efs
69 | class main
70 | user root
71 | group radio cache inet misc audio sdcard_rw log sdcard_r shell system
72 |
73 | on property:ro.multisim.simslotcount=*
74 | write /sys/module/modem_ctrl_ss310ap/parameters/ds_detect ${ro.multisim.simslotcount}
75 |
76 | on property:ro.multisim.simslotcount=1
77 | setprop persist.radio.multisim.config ss
78 |
79 | on property:ro.multisim.simslotcount=2
80 | setprop persist.radio.multisim.config dsds
81 |
--------------------------------------------------------------------------------
/ramdisk/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 | LOCAL_MODULE := fstab.samsungexynos7880
5 | LOCAL_MODULE_TAGS := optional
6 | LOCAL_MODULE_CLASS := ETC
7 | LOCAL_SRC_FILES := fstab.samsungexynos7880
8 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)
9 | include $(BUILD_PREBUILT)
10 |
11 | include $(CLEAR_VARS)
12 | LOCAL_MODULE := init.baseband.rc
13 | LOCAL_MODULE_TAGS := optional
14 | LOCAL_MODULE_CLASS := ETC
15 | LOCAL_SRC_FILES := init.baseband.rc
16 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
17 | include $(BUILD_PREBUILT)
18 |
19 | include $(CLEAR_VARS)
20 | LOCAL_MODULE := init.vendor.rilchip.rc
21 | LOCAL_MODULE_TAGS := optional
22 | LOCAL_MODULE_CLASS := ETC
23 | LOCAL_SRC_FILES := init.vendor.rilchip.rc
24 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/
25 | include $(BUILD_PREBUILT)
26 |
27 | include $(CLEAR_VARS)
28 | LOCAL_MODULE := init.vendor.rilcommon.rc
29 | LOCAL_MODULE_TAGS := optional
30 | LOCAL_MODULE_CLASS := ETC
31 | LOCAL_SRC_FILES := init.vendor.rilcommon.rc
32 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/
33 | include $(BUILD_PREBUILT)
34 |
35 | include $(CLEAR_VARS)
36 | LOCAL_MODULE := init.samsung.rc
37 | LOCAL_MODULE_TAGS := optional
38 | LOCAL_MODULE_CLASS := ETC
39 | LOCAL_SRC_FILES := init.samsung.rc
40 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
41 | include $(BUILD_PREBUILT)
42 |
43 | include $(CLEAR_VARS)
44 | LOCAL_MODULE := init.samsungexynos7880.rc
45 | LOCAL_MODULE_TAGS := optional
46 | LOCAL_MODULE_CLASS := ETC
47 | LOCAL_SRC_FILES := init.samsungexynos7880.rc
48 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
49 | include $(BUILD_PREBUILT)
50 |
51 | include $(CLEAR_VARS)
52 | LOCAL_MODULE := init.recovery.samsungexynos7880.rc
53 | LOCAL_MODULE_TAGS := optional
54 | LOCAL_MODULE_CLASS := ETC
55 | LOCAL_SRC_FILES := init.recovery.samsungexynos7880.rc
56 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)
57 | include $(BUILD_PREBUILT)
58 |
59 | include $(CLEAR_VARS)
60 | LOCAL_MODULE := init.samsungexynos7880.usb.rc
61 | LOCAL_MODULE_TAGS := optional
62 | LOCAL_MODULE_CLASS := ETC
63 | LOCAL_SRC_FILES := init.samsungexynos7880.usb.rc
64 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
65 | include $(BUILD_PREBUILT)
66 |
67 | include $(CLEAR_VARS)
68 | LOCAL_MODULE := init.gps.rc
69 | LOCAL_MODULE_TAGS := optional
70 | LOCAL_MODULE_CLASS := ETC
71 | LOCAL_SRC_FILES := init.gps.rc
72 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/
73 | include $(BUILD_PREBUILT)
74 |
75 | include $(CLEAR_VARS)
76 | LOCAL_MODULE := mobicore.rc
77 | LOCAL_MODULE_TAGS := optional
78 | LOCAL_MODULE_CLASS := ETC
79 | LOCAL_SRC_FILES := mobicore.rc
80 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/
81 | include $(BUILD_PREBUILT)
82 |
83 | include $(CLEAR_VARS)
84 | LOCAL_MODULE := wifi_sec.rc
85 | LOCAL_MODULE_TAGS := optional
86 | LOCAL_MODULE_CLASS := ETC
87 | LOCAL_SRC_FILES := wifi_sec.rc
88 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/
89 | include $(BUILD_PREBUILT)
90 |
91 | include $(CLEAR_VARS)
92 | LOCAL_MODULE := wifi_qcom.rc
93 | LOCAL_MODULE_TAGS := optional
94 | LOCAL_MODULE_CLASS := ETC
95 | LOCAL_SRC_FILES := wifi_qcom.rc
96 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/
97 | include $(BUILD_PREBUILT)
98 |
99 | include $(CLEAR_VARS)
100 | LOCAL_MODULE := ueventd.samsungexynos7880.rc
101 | LOCAL_MODULE_STEM := ueventd.rc
102 | LOCAL_MODULE_TAGS := optional
103 | LOCAL_MODULE_CLASS := ETC
104 | LOCAL_SRC_FILES := ueventd.samsungexynos7880.rc
105 | LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)
106 | include $(BUILD_PREBUILT)
107 |
--------------------------------------------------------------------------------
/livedisplay/DisplayModes.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #define LOG_TAG "DisplayModesService"
18 |
19 | #include "DisplayModes.h"
20 | #include
21 | #include
22 |
23 | namespace vendor {
24 | namespace lineage {
25 | namespace livedisplay {
26 | namespace V2_1 {
27 | namespace implementation {
28 |
29 | static constexpr const char* kModePath = "/sys/class/mdnie/mdnie/mode";
30 | static constexpr const char* kModeMaxPath = "/sys/class/mdnie/mdnie/mode_max";
31 | static constexpr const char* kDefaultPath = "/data/vendor/display/.displaymodedefault";
32 |
33 | const std::map DisplayModes::kModeMap = {
34 | // clang-format off
35 | {0, "Dynamic"},
36 | {1, "Standard"},
37 | {2, "Natural"},
38 | {3, "Cinema"},
39 | {4, "Adaptive"},
40 | {5, "Reading"},
41 | // clang-format on
42 | };
43 |
44 | DisplayModes::DisplayModes() : mDefaultModeId(0) {
45 | std::ifstream defaultFile(kDefaultPath);
46 | int value;
47 |
48 | defaultFile >> value;
49 | LOG(DEBUG) << "Default file read result " << value << " fail " << defaultFile.fail();
50 | if (defaultFile.fail()) {
51 | return;
52 | }
53 |
54 | for (const auto& entry : kModeMap) {
55 | if (value == entry.first) {
56 | mDefaultModeId = entry.first;
57 | break;
58 | }
59 | }
60 |
61 | setDisplayMode(mDefaultModeId, false);
62 | }
63 |
64 | // Methods from ::vendor::lineage::livedisplay::V2_1::IDisplayModes follow.
65 | Return DisplayModes::getDisplayModes(getDisplayModes_cb resultCb) {
66 | std::ifstream maxModeFile(kModeMaxPath);
67 | int value;
68 | std::vector modes;
69 | if (!maxModeFile.fail()) {
70 | maxModeFile >> value;
71 | } else {
72 | value = kModeMap.size();
73 | }
74 | for (const auto& entry : kModeMap) {
75 | if (entry.first < value) modes.push_back({entry.first, entry.second});
76 | }
77 | resultCb(modes);
78 | return Void();
79 | }
80 |
81 | Return DisplayModes::getCurrentDisplayMode(getCurrentDisplayMode_cb resultCb) {
82 | int32_t currentModeId = mDefaultModeId;
83 | std::ifstream modeFile(kModePath);
84 | int value;
85 | modeFile >> value;
86 | if (!modeFile.fail()) {
87 | for (const auto& entry : kModeMap) {
88 | if (value == entry.first) {
89 | currentModeId = entry.first;
90 | break;
91 | }
92 | }
93 | }
94 | resultCb({currentModeId, kModeMap.at(currentModeId)});
95 | return Void();
96 | }
97 |
98 | Return DisplayModes::getDefaultDisplayMode(getDefaultDisplayMode_cb resultCb) {
99 | resultCb({mDefaultModeId, kModeMap.at(mDefaultModeId)});
100 | return Void();
101 | }
102 |
103 | Return DisplayModes::setDisplayMode(int32_t modeID, bool makeDefault) {
104 | const auto iter = kModeMap.find(modeID);
105 | if (iter == kModeMap.end()) {
106 | return false;
107 | }
108 | std::ofstream modeFile(kModePath);
109 | modeFile << iter->first;
110 | if (modeFile.fail()) {
111 | return false;
112 | }
113 |
114 | if (makeDefault) {
115 | std::ofstream defaultFile(kDefaultPath);
116 | defaultFile << iter->first;
117 | if (defaultFile.fail()) {
118 | return false;
119 | }
120 | mDefaultModeId = iter->first;
121 | }
122 | return true;
123 | }
124 |
125 | // Methods from ::android::hidl::base::V1_0::IBase follow.
126 |
127 | } // namespace implementation
128 | } // namespace V2_1
129 | } // namespace livedisplay
130 | } // namespace lineage
131 | } // namespace vendor
132 |
--------------------------------------------------------------------------------
/livedisplay/service.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 The LineageOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #define LOG_TAG "vendor.lineage.livedisplay@2.1-service.universal7880"
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | #include "DisplayColorCalibration.h"
24 | #include "DisplayModes.h"
25 | #include "ReadingEnhancement.h"
26 | #include "SunlightEnhancement.h"
27 |
28 | using android::hardware::configureRpcThreadpool;
29 | using android::hardware::joinRpcThreadpool;
30 | using android::sp;
31 | using android::status_t;
32 | using android::OK;
33 |
34 | using vendor::lineage::livedisplay::V2_1::IDisplayColorCalibration;
35 | using vendor::lineage::livedisplay::V2_1::implementation::DisplayColorCalibration;
36 | using vendor::lineage::livedisplay::V2_1::IDisplayModes;
37 | using vendor::lineage::livedisplay::V2_1::implementation::DisplayModes;
38 | using vendor::lineage::livedisplay::V2_1::IReadingEnhancement;
39 | using vendor::lineage::livedisplay::V2_1::implementation::ReadingEnhancement;
40 | using vendor::lineage::livedisplay::V2_1::ISunlightEnhancement;
41 | using vendor::lineage::livedisplay::V2_1::implementation::SunlightEnhancement;
42 |
43 | int main() {
44 | sp displayColorCalibration;
45 | sp displayModes;
46 | sp readingEnhancement;
47 | sp sunlightEnhancement;
48 | status_t status;
49 |
50 | LOG(INFO) << "LiveDisplay HAL service is starting.";
51 |
52 | displayColorCalibration = new DisplayColorCalibration();
53 | if (displayColorCalibration == nullptr) {
54 | LOG(ERROR) << "Can not create an instance of LiveDisplay HAL DisplayColorCalibration "
55 | "Iface, exiting.";
56 | goto shutdown;
57 | }
58 |
59 | displayModes = new DisplayModes();
60 | if (displayModes == nullptr) {
61 | LOG(ERROR) << "Can not create an instance of LiveDisplay HAL DisplayModes "
62 | "Iface, exiting.";
63 | goto shutdown;
64 | }
65 |
66 | readingEnhancement = new ReadingEnhancement();
67 | if (readingEnhancement == nullptr) {
68 | LOG(ERROR)
69 | << "Can not create an instance of LiveDisplay HAL ReadingEnhancement Iface, exiting.";
70 | goto shutdown;
71 | }
72 |
73 | sunlightEnhancement = new SunlightEnhancement();
74 | if (sunlightEnhancement == nullptr) {
75 | LOG(ERROR)
76 | << "Can not create an instance of LiveDisplay HAL SunlightEnhancement Iface, exiting.";
77 | goto shutdown;
78 | }
79 |
80 | configureRpcThreadpool(1, true /*callerWillJoin*/);
81 |
82 | status = displayColorCalibration->registerAsService();
83 | if (status != OK) {
84 | LOG(ERROR)
85 | << "Could not register service for LiveDisplay HAL DisplayColorCalibration Iface ("
86 | << status << ")";
87 | goto shutdown;
88 | }
89 |
90 | status = displayModes->registerAsService();
91 | if (status != OK) {
92 | LOG(ERROR)
93 | << "Could not register service for LiveDisplay HAL DisplayColorCalibration Iface ("
94 | << status << ")";
95 | goto shutdown;
96 | }
97 |
98 | status = readingEnhancement->registerAsService();
99 | if (status != OK) {
100 | LOG(ERROR) << "Could not register service for LiveDisplay HAL ReadingEnhancement Iface ("
101 | << status << ")";
102 | goto shutdown;
103 | }
104 |
105 | status = sunlightEnhancement->registerAsService();
106 | if (status != OK) {
107 | LOG(ERROR) << "Could not register service for LiveDisplay HAL SunlightEnhancement Iface ("
108 | << status << ")";
109 | goto shutdown;
110 | }
111 |
112 | LOG(INFO) << "LiveDisplay HAL service is ready.";
113 | joinRpcThreadpool();
114 | // Should not pass this line
115 |
116 | shutdown:
117 | // In normal operation, we don't expect the thread pool to shutdown
118 | LOG(ERROR) << "LiveDisplay HAL service is shutting down.";
119 | return 1;
120 | }
121 |
--------------------------------------------------------------------------------
/include/telephony/ril_unsol_commands_vendor.h:
--------------------------------------------------------------------------------
1 | /* //device/libs/telephony/ril_unsol_commands.h
2 | **
3 | ** Copyright 2006, The Android Open Source 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 | {SAMSUNG_UNSOL_RESPONSE_BASE, NULL, WAKE_PARTIAL}, // 11000
18 | {RIL_UNSOL_RELEASE_COMPLETE_MESSAGE, NULL, WAKE_PARTIAL}, // 11001
19 | {RIL_UNSOL_STK_SEND_SMS_RESULT, NULL, WAKE_PARTIAL}, // 11002
20 | {RIL_UNSOL_STK_CALL_CONTROL_RESULT, NULL, WAKE_PARTIAL}, // 11003
21 | {11004, NULL, WAKE_PARTIAL},
22 | {RIL_UNSOL_ACB_INFO_CHANGED, NULL, WAKE_PARTIAL}, // 11005
23 | {11006, NULL, WAKE_PARTIAL},
24 | {11007, NULL, WAKE_PARTIAL},
25 | {RIL_UNSOL_DEVICE_READY_NOTI, NULL, WAKE_PARTIAL}, // 11008
26 | {RIL_UNSOL_GPS_NOTI, NULL, WAKE_PARTIAL}, // 11009
27 | {RIL_UNSOL_AM, NULL, WAKE_PARTIAL}, // 11010
28 | {RIL_UNSOL_DUN_PIN_CONTROL_SIGNAL, NULL, WAKE_PARTIAL}, // 11011
29 | {11012, NULL, WAKE_PARTIAL},
30 | {RIL_UNSOL_SAP, NULL, WAKE_PARTIAL}, // 11013
31 | {11014, NULL, WAKE_PARTIAL},
32 | {11015, NULL, WAKE_PARTIAL},
33 | {11016, NULL, WAKE_PARTIAL},
34 | {11017, NULL, WAKE_PARTIAL},
35 | {11018, NULL, WAKE_PARTIAL},
36 | {11019, NULL, WAKE_PARTIAL},
37 | {RIL_UNSOL_UART, NULL, WAKE_PARTIAL}, // 11020
38 | {RIL_UNSOL_SIM_PB_READY, NULL, WAKE_PARTIAL}, // 11021
39 | {11022, NULL, WAKE_PARTIAL},
40 | {11023, NULL, WAKE_PARTIAL},
41 | {RIL_UNSOL_VE, NULL, WAKE_PARTIAL}, // 11024
42 | {11025, NULL, WAKE_PARTIAL},
43 | {RIL_UNSOL_FACTORY_AM, NULL, WAKE_PARTIAL}, // 11026
44 | {11027, NULL, WAKE_PARTIAL},
45 | {11028, NULL, WAKE_PARTIAL},
46 | {RIL_UNSOL_SRVCC_HANDOVER, NULL, WAKE_PARTIAL}, // 11029
47 | {RIL_UNSOL_CS_FALLBACK, NULL, WAKE_PARTIAL}, // 11030
48 | {11031, NULL, WAKE_PARTIAL},
49 | {11032, NULL, WAKE_PARTIAL},
50 | {11033, NULL, WAKE_PARTIAL},
51 | {RIL_UNSOL_IMS_RETRYOVER, NULL, WAKE_PARTIAL}, // 11034
52 | {RIL_UNSOL_PB_INIT_COMPLETE, NULL, WAKE_PARTIAL}, // 11035
53 | {11036, NULL, WAKE_PARTIAL},
54 | {RIL_UNSOL_HYSTERESIS_DCN, NULL, WAKE_PARTIAL}, // 11037
55 | {RIL_UNSOL_CP_POSITION, NULL, WAKE_PARTIAL}, // 11038
56 | {11039, NULL, WAKE_PARTIAL},
57 | {11040, NULL, WAKE_PARTIAL},
58 | {11041, NULL, WAKE_PARTIAL},
59 | {11042, NULL, WAKE_PARTIAL},
60 | {RIL_UNSOL_HOME_NETWORK_NOTI, NULL, WAKE_PARTIAL}, // 11043
61 | {11044, NULL, WAKE_PARTIAL},
62 | {11045, NULL, WAKE_PARTIAL},
63 | {11046, NULL, WAKE_PARTIAL},
64 | {11047, NULL, WAKE_PARTIAL},
65 | {11048, NULL, WAKE_PARTIAL},
66 | {11049, NULL, WAKE_PARTIAL},
67 | {11050, NULL, WAKE_PARTIAL},
68 | {11051, NULL, WAKE_PARTIAL},
69 | {11052, NULL, WAKE_PARTIAL},
70 | {11053, NULL, WAKE_PARTIAL},
71 | {RIL_UNSOL_STK_CALL_STATUS, NULL, WAKE_PARTIAL}, // 11054
72 | {11055, NULL, WAKE_PARTIAL},
73 | {RIL_UNSOL_MODEM_CAP, NULL, WAKE_PARTIAL}, // 11056
74 | {RIL_UNSOL_SIM_SWAP_STATE_CHANGED, NULL, WAKE_PARTIAL}, // 11057
75 | {RIL_UNSOL_SIM_COUNT_MISMATCHED, NULL, WAKE_PARTIAL}, // 11058
76 | {11059, NULL, WAKE_PARTIAL},
77 | {RIL_UNSOL_DUN, NULL, WAKE_PARTIAL}, // 11060
78 | {RIL_UNSOL_IMS_PREFERENCE_CHANGED, NULL, WAKE_PARTIAL}, // 11061
79 | {RIL_UNSOL_SIM_APPLICATION_REFRESH, NULL, WAKE_PARTIAL}, // 11062
80 | {RIL_UNSOL_UICC_APPLICATION_STATUS, NULL, WAKE_PARTIAL}, // 11063
81 | {RIL_UNSOL_VOICE_RADIO_BEARER_HO_STATUS, NULL, WAKE_PARTIAL}, // 11064
82 | {RIL_UNSOL_CLM_NOTI, NULL, WAKE_PARTIAL}, // 11065
83 | {RIL_UNSOL_SIM_ICCID_NOTI, NULL, WAKE_PARTIAL}, // 11066
84 | {RIL_UNSOL_TIMER_STATUS_CHANGED_NOTI, NULL, WAKE_PARTIAL}, // 11067
85 | {RIL_UNSOL_PROSE_NOTI, NULL, WAKE_PARTIAL}, // 11068
86 | {RIL_UNSOL_MCPTT_NOTI, NULL, WAKE_PARTIAL}, // 11069
87 | {RIL_UNSOL_RMTUIM_NEED_APDU, NULL, WAKE_PARTIAL}, // 11070
88 | {RIL_UNSOL_RMTUIM_CONNECT, NULL, WAKE_PARTIAL}, // 11071
89 | {RIL_UNSOL_RMTUIM_DISCONNECT, NULL, WAKE_PARTIAL}, // 11072
90 | {RIL_UNSOL_RMTUIM_CARD_POWER_UP, NULL, WAKE_PARTIAL}, // 11073
91 | {RIL_UNSOL_RMTUIM_CARD_POWER_DOWN, NULL, WAKE_PARTIAL}, // 11074
92 | {RIL_UNSOL_RMTUIM_CARD_RESET, NULL, WAKE_PARTIAL}, // 11075
93 | {RIL_UNSOL_TURN_RADIO_ON, NULL, WAKE_PARTIAL}, // 11076
94 | #ifdef RIL_UNSOL_SNDMGR_WB_AMR_REPORT
95 | {RIL_UNSOL_SNDMGR_WB_AMR_REPORT, NULL, WAKE_PARTIAL}, // 20017
96 | #endif
97 | #ifdef RIL_UNSOL_SNDMGR_CLOCK_CTRL
98 | {RIL_UNSOL_SNDMGR_CLOCK_CTRL, NULL, WAKE_PARTIAL}, // 20022
99 | #endif
100 |
--------------------------------------------------------------------------------
/configs/nfc/libnfc-sec-vendor.conf:
--------------------------------------------------------------------------------
1 | ## --------------- Part-I : Configuration for Phone HW ----------------------------##
2 | ####################################################################################
3 | # I-1) Clock Source Information (AP direct 26MHz)
4 | ####################################################################################
5 | ## Clock option for 26MHz PLL (0x12)
6 | ## Clock option for 19.2MHz PLL (0x11)
7 | FW_CFG_CLK_SPEED=0x12
8 | ####################################################################################
9 |
10 |
11 | ## --------------- Part-II : Configuration for Chip / FW -------------------------##
12 | ####################################################################################
13 | # II-1) FW base address :
14 | ####################################################################################
15 | ## FW Base Address for SEN81 (0x3000)
16 | FW_BASE_ADDRESS=0x3000
17 | ####################################################################################
18 | # II-2) Timing parameter
19 | ####################################################################################
20 | # WAKEUP_DELAY for eSE Model
21 | # (Old F/W) 20ms : UICC, 80ms : eSE
22 | # (After Star Model) 20ms : UICC, 20ms : eSE
23 | #WAKEUP_DELAY=20
24 | ####################################################################################
25 | # II-3) Firmware path
26 | ####################################################################################
27 | ## F/W image for S3NRN81
28 | #FW_IMAGE="/vendor/firmware/nfc/sec_s3nrn81_firmware.bin"
29 |
30 | # for single SKU
31 | FW_DIR_PATH="/vendor/firmware/nfc/"
32 | FW_FILE_NAME="sec_s3nrn81_firmware.bin"
33 |
34 | ####################################################################################
35 | # II-4) RF Register path
36 | ####################################################################################
37 | ## RF Register for S3NRN81
38 | #RFREG_FILE="/vendor/etc/nfc/sec_s3nrn81_rfreg.bin"
39 |
40 | RF_DIR_PATH="/vendor/etc/nfc/"
41 | RF_FILE_NAME="sec_s3nrn81_rfreg.bin"
42 | ## --------------- Part-III : Configuration for MW --------------------------------##
43 | ####################################################################################
44 | # III-1) Driver path
45 | ####################################################################################
46 | ## Power driver
47 | POWER_DRIVER="/dev/sec-nfc"
48 | ## Transport driver
49 | TRANS_DRIVER="/dev/sec-nfc"
50 |
51 |
52 | ####################################################################################
53 | # III-2) Trace Level
54 | ####################################################################################
55 | ## TRACE_LEVEL (0: only err, 1: and debug, 2: trace also)
56 | ## DATA TRACE level (0: not display, 1: simply, 2: all of data trace)
57 | TRACE_LEVEL=2
58 | DATA_TRACE=2
59 |
60 | ####################################################################################
61 | # III-3) NFC Sleep Timing
62 | ####################################################################################
63 | # Set wait time to enter CLF sleep mode
64 | SLEEP_TIMEOUT=1000
65 |
66 |
67 | ####################################################################################
68 | # III-4) F/W Update Option
69 | # F/W Update Option
70 | # 0 : Download for different version
71 | # 1 : Download for upper version
72 | # 2 : Force Download
73 | ####################################################################################
74 | # 0 : Default value is "Download for different version"
75 | FW_UPDATE_MODE=0
76 | ####################################################################################
77 |
78 |
79 |
80 |
81 | ###############################################################################
82 | # Configure the default NfcA/IsoDep techology and protocol route. Can be
83 | # either a secure element (e.g. 0x02) or the host (0x00)
84 | DEFAULT_ROUTE=0x00
85 | ###############################################################################
86 | # Configure the single default SE to use. The default is to use the first
87 | # SE that is detected by the stack. This value might be used when the phone
88 | # supports multiple SE but you want to force it to use one of them
89 | DEFAULT_OFFHOST_ROUTE=0x02
90 |
91 | ###############################################################################
92 | # Choose the presence-check algorithm for type-4 tag. If not defined, the default value is 1.
93 | # PRESENCE_CHECK_ALGORITHM=0 : [default] Automatic select for below 4 method.
94 | # PRESENCE_CHECK_ALGORITHM=1 : Read Empty I block.
95 | # PRESENCE_CHECK_ALGORITHM=2 : Sleep/Wakeup Command
96 | # PRESENCE_CHECK_ALGORITHM=3 : Read binary for CH0(K version method)
97 | # PRESENCE_CHECK_ALGORITHM=4 : Read binary for CH3
98 | # PRESENCE_CHECK_ALGORITHM=5 : ACK/NACK
99 | # Default : No use (AUTO)
100 | # For China Region : Use Method 3
101 | ###############################################################################
102 | PRESENCE_CHECK_ALGORITHM=5
103 |
104 | ###############################################################################
105 | # Vendor Specific Proprietary Protocol & Discovery Configuration
106 | # Set to 0xFF if unsupported
107 | # byte[0] NCI_PROTOCOL_18092_ACTIVE
108 | # byte[1] NCI_PROTOCOL_B_PRIME
109 | # byte[2] NCI_PROTOCOL_DUAL
110 | # byte[3] NCI_PROTOCOL_15693
111 | # byte[4] NCI_PROTOCOL_KOVIO
112 | # byte[5] NCI_PROTOCOL_MIFARE
113 | # byte[6] NCI_DISCOVERY_TYPE_POLL_KOVIO
114 | # byte[7] NCI_DISCOVERY_TYPE_POLL_B_PRIME
115 | # byte[8] NCI_DISCOVERY_TYPE_LISTEN_B_PRIME
116 | NFA_PROPRIETARY_CFG={00, 81, 82, 80, 8A, 81, 70, 74, F4}
117 | ###############################################################################
118 | # Set max transceive length for IsoDep frames
119 | # Standard 0x105 (261)
120 | # Extended 0xFEFF (65279)
121 | ISO_DEP_MAX_TRANSCEIVE=0xFEFF
122 |
123 | ############### end of config ##############################
124 |
--------------------------------------------------------------------------------
/amplifier/amplifier.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 Christopher N. Hesse
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #define LOG_TAG "audio_hw_amplifier"
18 | #define LOG_NDEBUG 0
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | #include
30 | #include
31 |
32 | #include "tfa.h"
33 |
34 | typedef enum amp_state {
35 | AMP_STATE_DISABLED = 0,
36 | AMP_STATE_ENABLED,
37 | AMP_STATE_MAX = AMP_STATE_ENABLED
38 | } amp_state_t;
39 |
40 | typedef struct amp_device {
41 | amplifier_device_t amp_dev;
42 | tfa_device_t *tfa_dev;
43 | audio_mode_t current_mode;
44 | int refcount[Audio_Mode_Max];
45 | amp_state_t amp_state;
46 | } amp_device_t;
47 |
48 | static amp_device_t *amp_dev = NULL;
49 |
50 | /*
51 | * Returns the internal TFA mode appropriate for the device.
52 | *
53 | * @param snd_device The current sound device.
54 | *
55 | * @return tfa_mode_t identifying the internal amplifier mode.
56 | */
57 | static tfa_mode_t classify_snd_device(uint32_t snd_device) {
58 | tfa_mode_t mode = Audio_Mode_None;
59 |
60 | switch (snd_device) {
61 | case SND_DEVICE_OUT_SPEAKER:
62 | // our audio HAL splits this up
63 | //case SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES:
64 | mode = Audio_Mode_Music_Normal;
65 | break;
66 | case SND_DEVICE_OUT_VOICE_SPEAKER:
67 | case SND_DEVICE_OUT_VOICE_SPEAKER_WB:
68 | mode = Audio_Mode_Voice;
69 | break;
70 | default:
71 | break;
72 | }
73 |
74 | return mode;
75 | }
76 |
77 | /*
78 | * Hook into amplifier HAL
79 | */
80 | static int amp_enable_output_devices(amplifier_device_t *device,
81 | uint32_t devices, bool enable)
82 | {
83 | amp_device_t *dev = (amp_device_t *) device;
84 | tfa_mode_t tfa_mode = classify_snd_device(devices);
85 | int rc = 0;
86 |
87 | ALOGV("%s: devices=0x%x, enable=%d, tfa_mode=%d", __func__, devices, enable, tfa_mode);
88 |
89 | if (tfa_mode == Audio_Mode_None) {
90 | return 0;
91 | }
92 |
93 | if (enable) {
94 | dev->refcount[tfa_mode]++;
95 | } else if (!enable && dev->refcount[tfa_mode] > 0) {
96 | dev->refcount[tfa_mode]--;
97 | }
98 |
99 | ALOGV("%s: enable=%d, dev->refcount=%d, amp_state=%d", __func__, enable,
100 | dev->refcount[tfa_mode], dev->amp_state);
101 |
102 | if (enable && dev->amp_state == AMP_STATE_DISABLED && dev->refcount[tfa_mode] == 1) {
103 | rc = tfa_power(dev->tfa_dev, true);
104 | if (rc == 0) {
105 | dev->amp_state = AMP_STATE_ENABLED;
106 | }
107 | ALOGV("%s: tfa_power(true) with rc=%d", __func__, rc);
108 | } else if (!enable && dev->amp_state == AMP_STATE_ENABLED && dev->refcount[tfa_mode] == 0) {
109 | rc = tfa_power(dev->tfa_dev, false);
110 | if (rc == 0) {
111 | dev->amp_state = AMP_STATE_DISABLED;
112 | }
113 | ALOGV("%s: tfa_power(false) with rc=%d", __func__, rc);
114 | }
115 |
116 | // TODO: Distinguish between tfa modes
117 |
118 | return rc;
119 | }
120 |
121 | static int amp_set_mode(amplifier_device_t *device, audio_mode_t mode)
122 | {
123 | amp_device_t *dev = (amp_device_t *) device;
124 |
125 | dev->current_mode = mode;
126 |
127 | return 0;
128 | }
129 |
130 | static int amp_dev_close(hw_device_t *device)
131 | {
132 | amp_device_t *dev = (amp_device_t *) device;
133 |
134 | tfa_device_close(dev->tfa_dev);
135 |
136 | free(dev);
137 |
138 | return 0;
139 | }
140 |
141 | static int amp_module_open(const hw_module_t *module, const char *name,
142 | hw_device_t **device)
143 | {
144 | tfa_device_t *tfa_dev;
145 |
146 | if (strcmp(name, AMPLIFIER_HARDWARE_INTERFACE)) {
147 | ALOGE("%s: %s does not match amplifier hardware interface name",
148 | __func__, name);
149 | return -ENODEV;
150 | }
151 |
152 | if (amp_dev) {
153 | ALOGE("%s: Unable to open second instance of the amplifier", __func__);
154 | return -EBUSY;
155 | }
156 |
157 | tfa_dev = tfa_device_open();
158 | if (tfa_dev == NULL) {
159 | ALOGE("%s: Unable to open amplifier device", __func__);
160 | return -ENOENT;
161 | }
162 |
163 | amp_dev = calloc(1, sizeof(amp_device_t));
164 | if (!amp_dev) {
165 | ALOGE("%s: Unable to allocate memory for amplifier device", __func__);
166 | return -ENOMEM;
167 | }
168 |
169 | amp_dev->amp_dev.common.tag = HARDWARE_DEVICE_TAG;
170 | amp_dev->amp_dev.common.module = (hw_module_t *) module;
171 | amp_dev->amp_dev.common.version = HARDWARE_DEVICE_API_VERSION(1, 0);
172 | amp_dev->amp_dev.common.close = amp_dev_close;
173 |
174 | amp_dev->amp_dev.set_input_devices = NULL;
175 | amp_dev->amp_dev.set_output_devices = NULL;
176 | amp_dev->amp_dev.enable_input_devices = NULL;
177 | amp_dev->amp_dev.enable_output_devices = amp_enable_output_devices;
178 | amp_dev->amp_dev.set_mode = amp_set_mode;
179 | amp_dev->amp_dev.output_stream_start = NULL;
180 | amp_dev->amp_dev.input_stream_start = NULL;
181 | amp_dev->amp_dev.output_stream_standby = NULL;
182 | amp_dev->amp_dev.input_stream_standby = NULL;
183 | amp_dev->amp_dev.set_parameters = NULL;
184 |
185 | amp_dev->current_mode = AUDIO_MODE_NORMAL;
186 | memset(amp_dev->refcount, 0, Audio_Mode_Max);
187 | amp_dev->amp_state = AMP_STATE_DISABLED;
188 |
189 | amp_dev->tfa_dev = tfa_dev;
190 |
191 | *device = (hw_device_t *) amp_dev;
192 |
193 | return 0;
194 | }
195 |
196 | static struct hw_module_methods_t hal_module_methods = {
197 | .open = amp_module_open,
198 | };
199 |
200 | amplifier_module_t HAL_MODULE_INFO_SYM = {
201 | .common = {
202 | .tag = HARDWARE_MODULE_TAG,
203 | .module_api_version = AMPLIFIER_MODULE_API_VERSION_0_1,
204 | .hal_api_version = HARDWARE_HAL_API_VERSION,
205 | .id = AMPLIFIER_HARDWARE_MODULE_ID,
206 | .name = "Samsung TFA9896 amplifier HAL",
207 | .author = "Christopher N. Hesse",
208 | .methods = &hal_module_methods,
209 | },
210 | };
211 |
--------------------------------------------------------------------------------
/configs/audio/audio_policy_configuration.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | - Earpiece
11 | - Speaker
12 | - Built-In Mic
13 | - Built-In Back Mic
14 |
15 |
16 | Speaker
17 |
18 |
19 |
20 |
22 |
23 |
24 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
35 |
36 |
37 |
39 |
40 |
41 |
43 |
44 |
45 |
47 |
48 |
49 |
51 |
52 |
53 |
55 |
56 |
57 |
59 |
60 |
61 |
62 |
63 |
66 |
67 |
68 |
71 |
72 |
73 |
76 |
77 |
78 |
81 |
82 |
83 |
84 |
85 |
87 |
89 |
91 |
93 |
95 |
97 |
99 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/configs/nfc/libnfc-nci.conf:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # NFC Configuration for NON-HAL component S.LSI NFC Chip
3 | # Samsung Electronics, System LSI Division
4 | # Update Date : 2018/07/27
5 | # Configuration : UICC + eSE as CE mode & 106k P2P disabled
6 | # Region : SKT / KT / LGU / KOO
7 | # F/W Version dependency : NONE
8 | ########################## Start of libnfc-nci.conf ###########################
9 | ###############################################################################
10 | # Application options
11 | NFC_DEBUG_ENABLED=1
12 | ###############################################################################
13 | # performance measurement
14 | # Change this setting to control how often USERIAL log the performance (throughput)
15 | # data on read/write/poll
16 | # defailt is to log performance dara for every 100 read or write
17 | #REPORT_PERFORMANCE_MEASURE=100
18 | ###############################################################################
19 | # File used for NFA storage
20 | NFA_STORAGE="/data/nfc"
21 | ###############################################################################
22 | # When screen is turned off, specify the desired power state of the controller.
23 | # 0: power-off-sleep state; DEFAULT
24 | # 1: full-power state
25 | # 2: screen-off card-emulation (CE4/CE3/CE1 modes are used)
26 | SCREEN_OFF_POWER_STATE=1
27 | ###############################################################################
28 | # Force tag polling for the following technology(s).
29 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
30 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B |
31 | # NFA_TECHNOLOGY_MASK_F | NFA_TECHNOLOGY_MASK_ISO15693 |
32 | # NFA_TECHNOLOGY_MASK_B_PRIME | NFA_TECHNOLOGY_MASK_KOVIO |
33 | # NFA_TECHNOLOGY_MASK_ACTIVE
34 | #
35 | # Notable bits:
36 | # NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */
37 | # NFA_TECHNOLOGY_MASK_B 0x02 /* NFC Technology B */
38 | # NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */
39 | # NFA_TECHNOLOGY_MASK_ISO15693 0x08 /* Proprietary Technology */
40 | # NFA_TECHNOLOGY_MASK_KOVIO 0x20 /* Proprietary Technology */
41 | # NFA_TECHNOLOGY_MASK_ACTIVE 0x40 /* NFC Technology Active */
42 | POLLING_TECH_MASK=0xEF
43 | ###############################################################################
44 | # Force P2P to only listen for the following technology(s).
45 | # The bits are defined as tNFA_TECHNOLOGY_MASK in nfa_api.h.
46 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_F |
47 | # NFA_TECHNOLOGY_MASK_ACTIVE
48 | #
49 | # Notable bits:
50 | # NFA_TECHNOLOGY_MASK_A 0x01 /* NFC Technology A */
51 | # NFA_TECHNOLOGY_MASK_F 0x04 /* NFC Technology F */
52 | # NFA_TECHNOLOGY_MASK_ACTIVE 0x40 /* NFC Technology Active */
53 | P2P_LISTEN_TECH_MASK=0xC4
54 | PRESERVE_STORAGE=1
55 | ###############################################################################
56 | # Override the stack default for NFA_EE_MAX_EE_SUPPORTED set in nfc_target.h.
57 | # The value is set assumeing discovery of 0x00(Host), 0xC0(Ese) and 0x80(UICC).
58 | # If a platform will exclude and SE, this value can be reduced so that the stack
59 | # will not wait any longer than necessary.
60 | # Maximum EE supported number
61 | #NFA_MAX_EE_SUPPORTED=3
62 | ###############################################################################
63 | # AID_MATCHING constants
64 | # AID_MATCHING_EXACT_ONLY 0x00
65 | # AID_MATCHING_EXACT_OR_PREFIX 0x01
66 | # AID_MATCHING_PREFIX_ONLY 0x02
67 | # AID_MATCHING_EXACT_OR_SUBSET_OR_PREFIX 0x03
68 | AID_MATCHING_MODE=0x01
69 |
70 | ###############################################################################
71 | # Partial AID setting : Only used for ATT / TMO / VZW
72 | # This configuration may be changed by MNO specific requirement.
73 | # Description
74 | # 1st byte : NCI Length
75 | # 2nd byte : Number of set
76 | # 3rd~ bytes : Partial matching order
77 | # Matching value : Full matching = 0x00, Subset Matching = 0x01, Superset Matching : 0x02, Pattern Matching : 0x03
78 | # ex) 2f 39 03 02 01 02 --> order : full matching - subset matching - superset matching PARTIAL_AID={03:02:01:02}
79 | PARTIAL_AID={02:01:05}
80 |
81 | ###############################################################################
82 | # UICC listen tech mask
83 | # Force UICC to only listen to the following technology(s).
84 | # Default is NFA_TECHNOLOGY_MASK_A | NFA_TECHNOLOGY_MASK_B.
85 | # If this option is blocked by # comment, default value will be applied
86 | ###############################################################################
87 | # Description
88 | # Oring each tech mask
89 | # Type A : 0x01
90 | # Type B : 0x02
91 | # Type F : 0x04
92 | ###############################################################################
93 | # Guide
94 | # HK : UICC_LISTEN_TECH_MASK=0x07 (Enable Type F card)
95 | # Other region : UICC_LISTEN_TECH_MASK=0x03 (Default value)
96 | UICC_LISTEN_TECH_MASK=0x07
97 |
98 | ###############################################################################
99 | # Default poll duration (in ms)
100 | # The defualt is 500ms if not set (see nfc_target.h)
101 | NFA_DM_DISC_DURATION_POLL=500
102 |
103 | ###############################################################################
104 | # eSE Chip Type Setting
105 | # Configure eSE Chip Type.
106 | # NFA_HCI_USE_FORCE_SETTING = 0x00 : Auto Setting
107 | # NFA_HCI_USE_FORCE_SETTING = 0x01 : Manual Setting
108 | # NFA_HCI_ESE_CHIP_TYPE=0x00 : Oberthur eSE
109 | # NFA_HCI_ESE_CHIP_TYPE=0x01 : Gemalto eSE
110 | # NFA_HCI_DEFAULT_STATIC_PIPE_TYPE = 0x00 : Supported dynamic pipe for wired C/E.
111 | # NFA_HCI_DEFAULT_STATIC_PIPE_TYPE = 0x01 : Supported static pipe for wired C/E.
112 | # NFA_HCI_APDU_GATE = 0xF0 : Gate ID for dynamic pipe.
113 | # You must set this value if you set 'NFA_HCI_DEFAULT_STATIC_PIPE_TYPE = 0x00'.
114 | +KOO_NFA_HCI_USE_FORCE_SETTING=0x00
115 | +KOO_NFA_HCI_ESE_CHIP_TYPE=0x01
116 | +KOO_NFA_HCI_DEFAULT_STATIC_PIPE_TYPE=0x01
117 | ###############################################################################
118 |
119 | ###############################################################################
120 | # eSE Power Stable Time
121 | # Configure eSE Power Stable Time (ms)
122 | # Only for Gemalto COS
123 |
124 | ESE_POWER_STABLE_TIME=50
125 | ###############################################################################
126 |
127 | ###############################################################################
128 | # Application options
129 | APPL_TRACE_LEVEL=0xFF
130 | PROTOCOL_TRACE_LEVEL=0xFFFFFFFF
131 | ###############################################################################
132 |
133 | ###############################################################################
134 | # power control driver
135 | # Specify a kernel driver that support ioctl commands to control NFC_EN and
136 | # NFC_WAKE gpio signals.
137 | #
138 | # POWER_CONTRL_DRIVER=
139 | # i2c and spi driver may be used to control NFC_EN and NFC_WAKE signal
140 | POWER_CONTROL_DRIVER="/dev/sec-nfc"
141 |
142 | ###############################################################################
143 | # transport driver
144 | #
145 | # TRANSPORT_DRIVER=
146 | #
147 | # where can be, for example:
148 | # "/dev/ttyS" (UART)
149 | # "/dev/bcmi2cnfc" (I2C)
150 | # "hwtun" (HW Tunnel)
151 | # "/dev/bcmspinfc" (SPI)
152 | # "/dev/btusb0" (BT USB)
153 | TRANSPORT_DRIVER="/dev/sec-nfc"
154 |
155 | ###############################################################################
156 | # ProtocolClt was removed from NFA_PROPRIETARY_CFG,
157 | # and a new NFA_PROPRIETARY_CFG_CLT variable was created.
158 | # protocolClt default value = 0x90
159 | NFA_PROPRIETARY_CFG_CLT=0x90
160 |
161 | ################################################################################
162 | # ACTIVE_SE
163 | # Descrption : seId of Active SE for setting default TECH/Protocol routing
164 | # Guide
165 | # HCE only : 0x00
166 | # use eSE as CE mode (eSE only,UICC+eSE) : 0x02
167 | # Use UICC only (NFC Standalone or eSE disabled as CE mode): 0x03
168 | ACTIVE_SE=0x03
169 | +KOO_ACTIVE_SE=0x02
170 |
171 | ############### end of config ##############################
--------------------------------------------------------------------------------
/BoardConfigCommon.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (C) 2017 The LineageOS Project
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | COMMON_PATH := device/samsung/universal7880-common
18 |
19 | BUILD_BROKEN_DUP_RULES := true
20 |
21 | # Include path
22 | TARGET_SPECIFIC_HEADER_PATH := $(COMMON_PATH)/include
23 |
24 | # Firmware
25 | TARGET_NO_BOOTLOADER := true
26 | TARGET_NO_RADIOIMAGE := true
27 |
28 | # Platform
29 | TARGET_BOARD_PLATFORM := exynos5
30 | TARGET_SLSI_VARIANT := bsp
31 | TARGET_SOC := exynos7880
32 | TARGET_BOOTLOADER_BOARD_NAME := universal7880
33 | BOARD_VENDOR := samsung
34 |
35 | # CPU
36 | TARGET_ARCH := arm64
37 | TARGET_ARCH_VARIANT := armv8-a
38 | TARGET_CPU_ABI := arm64-v8a
39 | TARGET_CPU_ABI2 :=
40 | TARGET_CPU_VARIANT := cortex-a53
41 |
42 | TARGET_2ND_ARCH := arm
43 | TARGET_2ND_ARCH_VARIANT := armv8-a
44 | TARGET_2ND_CPU_ABI := armeabi-v7a
45 | TARGET_2ND_CPU_ABI2 := armeabi
46 | TARGET_2ND_CPU_VARIANT := cortex-a53
47 |
48 | # Audio
49 | AUDIOSERVER_MULTILIB := 32
50 |
51 | # Extracted with libbootimg
52 | BOARD_CUSTOM_BOOTIMG_MK := hardware/samsung/mkbootimg.mk
53 | BOARD_MKBOOTIMG_ARGS := --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100
54 | BOARD_KERNEL_BASE := 0x10000000
55 | BOARD_KERNEL_PAGESIZE := 2048
56 | BOARD_KERNEL_IMAGE_NAME := Image
57 | #BOARD_KERNEL_CMDLINE := The bootloader ignores the cmdline from the boot.img
58 | BOARD_KERNEL_SEPARATED_DT := true
59 | TARGET_CUSTOM_DTBTOOL := dtbhtoolExynos
60 |
61 | # Kernel
62 | TARGET_KERNEL_ARCH := arm64
63 | TARGET_KERNEL_HEADER_ARCH := arm64
64 | TARGET_LINUX_KERNEL_VERSION := 3.18
65 |
66 | # Kernel config
67 | TARGET_KERNEL_SOURCE := kernel/samsung/universal7880
68 |
69 | # Manifest
70 | DEVICE_MANIFEST_FILE := $(COMMON_PATH)/manifest.xml
71 | PRODUCT_ENFORCE_VINTF_MANIFEST_OVERRIDE := true
72 |
73 | # Partitions
74 | BOARD_BOOTIMAGE_PARTITION_SIZE := 33554432
75 | BOARD_RECOVERYIMAGE_PARTITION_SIZE := 39845888
76 | BOARD_SYSTEMIMAGE_PARTITION_SIZE := 4504682496
77 | BOARD_USERDATAIMAGE_PARTITION_SIZE := 25656557568
78 | BOARD_CACHEIMAGE_PARTITION_SIZE := 209715200
79 | BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
80 |
81 | # blockdev --getbsz /dev/block/mmcblk0p9
82 | BOARD_FLASH_BLOCK_SIZE := 4096
83 |
84 | # Use these flags if the board has a ext4 partition larger than 2gb
85 | BOARD_HAS_LARGE_FILESYSTEM := true
86 | TARGET_USERIMAGES_USE_EXT4 := true
87 |
88 | # Root extra folders
89 | BOARD_ROOT_EXTRA_FOLDERS += efs
90 | TARGET_FS_CONFIG_GEN := $(COMMON_PATH)/config.fs
91 |
92 | # Vendor separation
93 | TARGET_COPY_OUT_VENDOR := system/vendor
94 |
95 | # Bluetooth
96 | BOARD_HAVE_BLUETOOTH := true
97 | BOARD_HAVE_BLUETOOTH_QCOM := true
98 | BOARD_HAS_QCA_BT_ROME := true
99 | BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(COMMON_PATH)/bluetooth
100 | QCOM_BT_USE_BTNV := true
101 | QCOM_BT_USE_SMD_TTY := true
102 |
103 | # Samsung HALs
104 | TARGET_AUDIOHAL_VARIANT := samsung
105 | TARGET_POWERHAL_VARIANT := samsung
106 |
107 | # Graphics
108 | USE_OPENGL_RENDERER := true
109 |
110 | # VR Front buffer
111 | #BOARD_USES_VR_FRONT_BUFFER := true
112 |
113 | # Samsung OpenMAX Video
114 | BOARD_USE_STOREMETADATA := true
115 | BOARD_USE_METADATABUFFERTYPE := true
116 | BOARD_USE_DMA_BUF := true
117 | BOARD_USE_ANB_OUTBUF_SHARE := true
118 | BOARD_USE_IMPROVED_BUFFER := true
119 | BOARD_USE_NON_CACHED_GRAPHICBUFFER := true
120 | BOARD_USE_GSC_RGB_ENCODER := true
121 | BOARD_USE_CSC_HW := false
122 | BOARD_USE_QOS_CTRL := false
123 | BOARD_USE_S3D_SUPPORT := false
124 | BOARD_USE_TIMESTAMP_REORDER_SUPPORT := true
125 | BOARD_USE_DEINTERLACING_SUPPORT := true
126 | BOARD_USE_VP8ENC_SUPPORT := true
127 | BOARD_USE_HEVCDEC_SUPPORT := true
128 | BOARD_USE_HEVCENC_SUPPORT := true
129 | BOARD_USE_HEVC_HWIP := false
130 | BOARD_USE_VP9DEC_SUPPORT := true
131 | BOARD_USE_VP9ENC_SUPPORT := false
132 | BOARD_USE_CUSTOM_COMPONENT_SUPPORT := true
133 | BOARD_USE_VIDEO_EXT_FOR_WFD_HDCP := true
134 | BOARD_USE_SINGLE_PLANE_IN_DRM := true
135 |
136 | # HWComposer
137 | BOARD_USES_VPP := true
138 | #BOARD_USES_VPP_V2 := true // 8890 only
139 | BOARD_HDMI_INCAPABLE := true
140 |
141 | # HWCServices - requires framework support
142 | #BOARD_USES_HWC_SERVICES := true
143 |
144 | # Device Tree
145 | BOARD_USES_DT := true
146 |
147 | # WiFiDisplay
148 | #BOARD_USES_VIRTUAL_DISPLAY := true - depends on platform changes
149 | BOARD_USES_VIRTUAL_DISPLAY_DECON_EXT_WB := false
150 | BOARD_USE_VIDEO_EXT_FOR_WFD_DRM := false
151 | BOARD_USES_VDS_BGRA8888 := true
152 | BOARD_VIRTUAL_DISPLAY_DISABLE_IDMA_G0 := false
153 |
154 | # LIBHWJPEG
155 | TARGET_USES_UNIVERSAL_LIBHWJPEG := true
156 |
157 | # FIMG2D
158 | BOARD_USES_SKIA_FIMGAPI := true
159 | BOARD_USES_FIMGAPI_V5X := true
160 |
161 | # SCALER
162 | BOARD_USES_DEFAULT_CSC_HW_SCALER := true
163 | BOARD_USES_SCALER_M2M1SHOT := true
164 |
165 | # Video scaling issue workaround
166 | TARGET_OMX_LEGACY_RESCALING := true
167 |
168 | # Wifi
169 | BOARD_HAS_QCOM_WLAN := true
170 | BOARD_WLAN_DEVICE := qcwcn
171 | BOARD_HOSTAPD_DRIVER := NL80211
172 | BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
173 | BOARD_WPA_SUPPLICANT_DRIVER := NL80211
174 | BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_$(BOARD_WLAN_DEVICE)
175 | WIFI_DRIVER_FW_PATH_AP := "ap"
176 | WIFI_DRIVER_FW_PATH_STA := "sta"
177 | WIFI_DRIVER_FW_PATH_P2P := "p2p"
178 | WPA_SUPPLICANT_VERSION := VER_0_8_X
179 | WPA_SUPPLICANT_USE_HIDL := true
180 | WIFI_AVOID_IFACE_RESET_MAC_CHANGE := true
181 |
182 | # Wifi loader
183 | BOARD_HAVE_SAMSUNG_WIFI := true
184 |
185 | # Build fingerprint
186 | BUILD_FINGERPRINT := "samsung/a7y17lteskt/a7y17lteskt:9/PPR1.180610.011/A720SKSU5CUJ2:user/release-keys"
187 | PRIVATE_BUILD_DESC := "a7y17lteskt-user 9 PPR1.180610.011 A720SKSU5CUJ2 release-keys"
188 |
189 | # Charger
190 | BOARD_CHARGING_MODE_BOOTING_LPM := /sys/class/power_supply/battery/batt_lp_charging
191 | BOARD_CHARGER_SHOW_PERCENTAGE := true
192 | CHARGING_ENABLED_PATH := /sys/class/power_supply/battery/batt_lp_charging
193 |
194 | # DT2W
195 | TARGET_TAP_TO_WAKE_NODE := /sys/class/sec/tsp/dt2w_enable
196 |
197 | # RIL
198 | BOARD_MODEM_TYPE := ss333
199 | BOARD_PROVIDES_LIBRIL := true
200 | ENABLE_VENDOR_RIL_SERVICE := true
201 | TARGET_USES_VND_SECRIL := true
202 |
203 | # Security Patch Level
204 | VENDOR_SECURITY_PATCH := 2021-10-01
205 |
206 | # Release tools
207 | #TARGET_RELEASETOOLS_EXTENSIONS := $(COMMON_PATH)
208 |
209 | # Recovery
210 | #RECOVERY_VARIANT := twrp
211 | BOARD_HAS_DOWNLOAD_MODE := true
212 | TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/ramdisk/fstab.samsungexynos7880
213 |
214 | # TWRP
215 | ifeq ($(RECOVERY_VARIANT),twrp)
216 | PRODUCT_COPY_FILES += $(COMMON_PATH)/twrp/twrp.fstab:recovery/root/etc/twrp.fstab
217 | TW_THEME := portrait_hdpi
218 | TW_BRIGHTNESS_PATH := /sys/class/backlight/panel/brightness
219 | TW_MAX_BRIGHTNESS := 255
220 | TW_DEFAULT_BRIGHTNESS := 162
221 | TW_NO_REBOOT_BOOTLOADER := true
222 | TW_INCLUDE_CRYPTO := true
223 | TW_INCLUDE_NTFS_3G := true
224 | TW_HAS_DOWNLOAD_MODE := true
225 | TW_NO_EXFAT_FUSE := true
226 | TW_EXCLUDE_SUPERSU := true
227 | TARGET_RECOVERY_PIXEL_FORMAT := "ABGR_8888"
228 | RECOVERY_SDCARD_ON_DATA := true
229 | BOARD_HAS_NO_REAL_SDCARD := true
230 | TW_USE_TOOLBOX=true
231 | TW_EXCLUDE_TWRPAPP := true
232 | endif
233 |
234 | # Seccomp filters
235 | BOARD_SECCOMP_POLICY += $(COMMON_PATH)/seccomp
236 |
237 | # SELinux
238 | BOARD_VENDOR_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy
239 |
240 | # Shims
241 | TARGET_LD_SHIM_LIBS := \
242 | /vendor/lib/libbauthserver.so|libbauthtzcommon_shim.so \
243 | /vendor/lib64/libbauthserver.so|libbauthtzcommon_shim.so \
244 | /system/lib/libcamera_client.so|libcamera_client_shim.so \
245 | /system/lib64/libcamera_client.so|libcamera_client_shim.so \
246 | /system/lib/libexynoscamera.so|libexynoscamera_shim.so \
247 | /system/lib64/libexynoscamera.so|libexynoscamera_shim.so
248 |
249 | # Soong namespaces
250 | PRODUCT_SOONG_NAMESPACES += $(COMMON_PATH)
251 |
--------------------------------------------------------------------------------
/ramdisk/ueventd.samsungexynos7880.rc:
--------------------------------------------------------------------------------
1 | /dev/mali0 0666 system system
2 | /dev/ion 0666 system system
3 | /dev/ump 0666 system graphics
4 | /dev/exynos-mem 0660 system graphics
5 | /dev/video0 0660 system camera
6 | /dev/video1 0660 system camera
7 | /dev/video2 0660 system camera
8 | /dev/video3 0660 system camera
9 | /dev/video20 0660 system system
10 | # media0 is used for GSC, DECON, etc
11 | /dev/media0 0660 system camera
12 | # media1 is used for DECON Ext WB
13 | /dev/media1 0660 system graphics
14 | # Various devices use the v4l-subdev interface
15 | # We declare all such nodes simultaneously here
16 | /dev/v4l-subdev0 0660 system camera
17 | /dev/v4l-subdev1 0660 system camera
18 | /dev/v4l-subdev2 0660 system camera
19 | /dev/v4l-subdev3 0660 system camera
20 | /dev/v4l-subdev4 0660 system camera
21 | /dev/v4l-subdev5 0660 system camera
22 | /dev/v4l-subdev6 0660 system camera
23 | /dev/v4l-subdev7 0660 system camera
24 | /dev/v4l-subdev8 0660 system camera
25 | /dev/v4l-subdev9 0660 system camera
26 | /dev/v4l-subdev10 0660 system camera
27 | /dev/v4l-subdev11 0660 system camera
28 | /dev/v4l-subdev12 0660 system camera
29 | /dev/v4l-subdev13 0660 system camera
30 | /dev/v4l-subdev14 0660 system camera
31 | /dev/v4l-subdev15 0660 system camera
32 | /dev/v4l-subdev16 0660 system camera
33 | /dev/v4l-subdev17 0660 system camera
34 | /dev/v4l-subdev18 0660 system camera
35 | /dev/v4l-subdev19 0660 system camera
36 | # v4l-subdev20 is used for DECON Ext WB
37 | /dev/v4l-subdev20 0660 system graphics
38 | /dev/v4l-subdev21 0660 system graphics
39 |
40 | # gscalers
41 | /dev/video23 0660 media graphics
42 | /dev/video26 0660 media graphics
43 | /dev/video24 0660 media graphics
44 | /dev/video27 0660 media graphics
45 | /dev/video29 0660 media graphics
46 | /dev/video30 0660 media graphics
47 | # video31 is used for DECON Ext WB
48 | /dev/video31 0660 media graphics
49 |
50 | # mscalers
51 | /dev/video50 0666 media graphics
52 | /dev/video51 0666 media graphics
53 | /dev/m2m1shot_scaler0 0666 cameraserver graphics
54 | /dev/m2m1shot_scaler1 0666 cameraserver graphics
55 |
56 | /dev/video55 0666 system graphics
57 | /dev/fimg2d 0666 system graphics
58 | /dev/i2c-2 0660 system system
59 | /dev/HPD 0660 system system
60 |
61 | # mfc
62 | /dev/video6 0660 mediacodec mediadrm
63 | /dev/video7 0660 mediacodec mediadrm
64 | /dev/video8 0660 mediacodec mediadrm
65 | /dev/video9 0660 mediacodec mediadrm
66 |
67 | # camera
68 | /dev/video100 0660 cameraserver cameraserver
69 | /dev/video101 0660 cameraserver cameraserver
70 | /dev/video102 0660 cameraserver cameraserver
71 | /dev/video109 0660 cameraserver cameraserver
72 | /dev/video110 0660 cameraserver cameraserver
73 | /dev/video111 0660 cameraserver cameraserver
74 | /dev/video112 0660 cameraserver cameraserver
75 | /dev/video120 0660 cameraserver cameraserver
76 | /dev/video121 0660 cameraserver cameraserver
77 | /dev/video122 0660 cameraserver cameraserver
78 | /dev/video130 0660 cameraserver cameraserver
79 | /dev/video131 0660 cameraserver cameraserver
80 | /dev/video132 0660 cameraserver cameraserver
81 | /dev/video140 0660 cameraserver cameraserver
82 | /dev/video141 0660 cameraserver cameraserver
83 | /dev/video142 0660 cameraserver cameraserver
84 | /dev/video150 0660 cameraserver cameraserver
85 | /dev/video151 0660 cameraserver cameraserver
86 | /dev/video152 0660 cameraserver cameraserver
87 | /dev/video160 0660 cameraserver cameraserver
88 | /dev/video161 0660 cameraserver cameraserver
89 | /dev/video170 0660 cameraserver cameraserver
90 | /dev/video171 0660 cameraserver cameraserver
91 | /dev/video172 0660 cameraserver cameraserver
92 | /dev/video173 0660 cameraserver cameraserver
93 | /dev/video174 0660 cameraserver cameraserver
94 | /dev/video180 0660 cameraserver cameraserver
95 | /dev/media2 0660 media media
96 |
97 | # hevc
98 | /dev/video10 0660 mediacodec mediadrm
99 | /dev/video11 0660 mediacodec mediadrm
100 |
101 | # jpeg
102 | /dev/video12 0660 cameraserver media
103 |
104 | # audio
105 | /dev/seiren 0660 system audio
106 |
107 | # MobiCore
108 | #/dev/mobicore 0600 drmrpc drmrpc
109 | #/dev/mobicore-user 0660 drm drmrpc
110 |
111 | # Secure MEM driver
112 | #/dev/s5p-smem 0660 drm drmrpc
113 |
114 | # cbd modem block
115 | /dev/block/mmcblk0p5 0400 radio system
116 |
117 | # Modem Interface
118 | /dev/block/platform/13540000.dwmmc0/by-name/RADIO 0660 system radio
119 | /dev/block/platform/13540000.dwmmc0/by-name/CP_DEBUG 0660 radio system
120 | /dev/umts* 0660 system radio
121 | /dev/umts_csd 0660 system loop_radio
122 | /dev/smd4 0660 system radio
123 | /dev/ramdump_memshare 0660 system radio
124 | /dev/umts_ciq* 0660 system bridge_rw
125 |
126 | # Google FRP solution
127 | /dev/block/platform/13540000.dwmmc0/by-name/PERSISTENT 0660 system system
128 |
129 | # Reactivation Lock solution
130 | /dev/block/platform/13540000.dwmmc0/by-name/STEADY 0660 system system
131 |
132 | # from Samsungueventd.rc
133 |
134 | # MobiCore
135 | /dev/mobicore 0700 system system
136 | /dev/mobicore-user 0666 radio system
137 |
138 | # Secure MEM driver
139 | /dev/s5p-smem 0666 system system
140 |
141 | # Sensorhub IIO
142 | /dev/ssp_sensorhub 0660 system system
143 | /dev/iio:device* 0660 system system
144 | /sys/devices/13930000.spi/spi_master/spi2/spi2.0/iio:device* buffer/enable 0660 system system
145 | /sys/devices/13930000.spi/spi_master/spi2/spi2.0/iio:device* buffer/length 0660 system system
146 | /sys/bus/iio/devices/iio:device* 0664 system radio
147 |
148 | # interactive governor parameters
149 | /sys/devices/system/cpu/cpu* cpufreq/interactive/timer_rate 0660 system system
150 | /sys/devices/system/cpu/cpu* cpufreq/interactive/timer_slack 0660 system system
151 | /sys/devices/system/cpu/cpu* cpufreq/interactive/min_sample_time 0660 system system
152 | /sys/devices/system/cpu/cpu* cpufreq/interactive/hispeed_freq 0660 system system
153 | /sys/devices/system/cpu/cpu* cpufreq/interactive/target_loads 0660 system system
154 | /sys/devices/system/cpu/cpu* cpufreq/interactive/go_hispeed_load 0660 system system
155 | /sys/devices/system/cpu/cpu* cpufreq/interactive/above_hispeed_delay 0660 system system
156 | /sys/devices/system/cpu/cpu* cpufreq/interactive/boost 0660 system system
157 | /sys/devices/system/cpu/cpu* cpufreq/interactive/boostpulse 0200 system system
158 | /sys/devices/system/cpu/cpu* cpufreq/interactive/input_boost 0660 system system
159 | /sys/devices/system/cpu/cpu* cpufreq/interactive/boostpulse_duration 0660 system system
160 | /sys/devices/system/cpu/cpu* cpufreq/interactive/io_is_busy 0660 system system
161 |
--------------------------------------------------------------------------------
/amplifier/tfa.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 Christopher N. Hesse
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #define LOG_TAG "audio_hw_amplifier_tfa"
18 | #define LOG_NDEBUG 0
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | #include
30 |
31 | #include "tfa.h"
32 |
33 | static void * write_dummy_data(void *param) {
34 | tfa_device_t *t = (tfa_device_t *) param;
35 | uint8_t *buffer;
36 | int size;
37 | struct pcm *pcm;
38 | bool signaled = false;
39 |
40 | struct pcm_config config = {
41 | .channels = 2,
42 | .rate = 48000,
43 | .period_size = 256,
44 | .period_count = 2,
45 | .format = PCM_FORMAT_S16_LE,
46 | .start_threshold = config.period_size * config.period_count - 1,
47 | .stop_threshold = UINT_MAX,
48 | .silence_threshold = 0,
49 | .avail_min = 1,
50 | };
51 |
52 | pcm = pcm_open(0, 0, PCM_OUT | PCM_MONOTONIC, &config);
53 | if (!pcm || !pcm_is_ready(pcm)) {
54 | ALOGE("pcm_open failed: %s", pcm_get_error(pcm));
55 | if (pcm && errno != EBUSY) {
56 | goto err_close_pcm;
57 | }
58 | goto exit;
59 | }
60 |
61 | size = 1024 * 8;
62 | buffer = calloc(1, size);
63 | if (!buffer) {
64 | ALOGE("%s: failed to allocate buffer", __func__);
65 | goto err_close_pcm;
66 | }
67 |
68 | do {
69 | if (pcm_write(pcm, buffer, size)) {
70 | ALOGE("%s: pcm_write failed", __func__);
71 | }
72 | if (!signaled) {
73 | pthread_mutex_lock(&t->mutex);
74 | t->writing = true;
75 | pthread_cond_signal(&t->cond);
76 | pthread_mutex_unlock(&t->mutex);
77 | signaled = true;
78 | }
79 | } while (t->initializing);
80 |
81 | t->writing = false;
82 |
83 | err_free:
84 | free(buffer);
85 | err_close_pcm:
86 | pcm_close(pcm);
87 | exit:
88 | if (!signaled) {
89 | pthread_mutex_lock(&t->mutex);
90 | t->writing = true;
91 | pthread_cond_signal(&t->cond);
92 | pthread_mutex_unlock(&t->mutex);
93 | }
94 |
95 | return NULL;
96 | }
97 |
98 | static int tfa_clock_on(tfa_device_t *tfa_dev)
99 | {
100 | if (tfa_dev->clock_enabled) {
101 | ALOGW("%s: clocks already on", __func__);
102 | return -EBUSY;
103 | }
104 |
105 | tfa_dev->initializing = true;
106 | pthread_create(&tfa_dev->write_thread, NULL, write_dummy_data, tfa_dev);
107 | pthread_mutex_lock(&tfa_dev->mutex);
108 | while (!tfa_dev->writing) {
109 | pthread_cond_wait(&tfa_dev->cond, &tfa_dev->mutex);
110 | }
111 | pthread_mutex_unlock(&tfa_dev->mutex);
112 | tfa_dev->clock_enabled = true;
113 |
114 | ALOGI("%s: clocks enabled", __func__);
115 |
116 | return 0;
117 | }
118 |
119 | static int tfa_clock_off(tfa_device_t *tfa_dev)
120 | {
121 | if (!tfa_dev->clock_enabled) {
122 | ALOGW("%s: clocks already off", __func__);
123 | return 0;
124 | }
125 |
126 | tfa_dev->initializing = false;
127 | pthread_join(tfa_dev->write_thread, NULL);
128 | tfa_dev->clock_enabled = false;
129 |
130 | ALOGI("%s: clocks disabled", __func__);
131 |
132 | return 0;
133 | }
134 |
135 | /*
136 | * Loads the vendor amplifier library and grabs the needed functions.
137 | *
138 | * @param tfa_dev Device handle.
139 | *
140 | * @return 0 on success, <0 on error.
141 | */
142 | static int load_tfa_lib(tfa_device_t *tfa_dev) {
143 | if (access(TFA_LIBRARY_PATH, R_OK) < 0) {
144 | ALOGE("%s: amplifier library %s not found", __func__, TFA_LIBRARY_PATH);
145 | return -errno;
146 | }
147 |
148 | tfa_dev->lib_handle = dlopen(TFA_LIBRARY_PATH, RTLD_NOW);
149 | if (tfa_dev->lib_handle == NULL) {
150 | ALOGE("%s: dlopen failed for %s (%s)", __func__, TFA_LIBRARY_PATH, dlerror());
151 | return -1;
152 | } else {
153 | ALOGV("%s: dlopen successful for %s", __func__, TFA_LIBRARY_PATH);
154 | }
155 |
156 | tfa_dev->tfa_device_open = (tfa_device_open_t)dlsym(tfa_dev->lib_handle, "tfa_device_open");
157 | if (tfa_dev->tfa_device_open == NULL) {
158 | ALOGE("%s: dlsym error %s for tfa_device_open", __func__, dlerror());
159 | tfa_dev->tfa_device_open = 0;
160 | return -1;
161 | }
162 |
163 | tfa_dev->tfa_enable = (tfa_enable_t)dlsym(tfa_dev->lib_handle, "tfa_enable");
164 | if (tfa_dev->tfa_enable == NULL) {
165 | ALOGE("%s: dlsym error %s for tfa_enable", __func__, dlerror());
166 | tfa_dev->tfa_enable = 0;
167 | return -1;
168 | }
169 |
170 | return 0;
171 | }
172 |
173 | /*
174 | * Hooks into the vendor library and enables/disables the amplifier IC.
175 | *
176 | * @param tfa_dev Device handle.
177 | * @param on true or false for enabling/disabling of the IC.
178 | *
179 | * @return 0 on success, != 0 on error.
180 | */
181 | int tfa_power(tfa_device_t *tfa_dev, bool on) {
182 | int rc = 0;
183 |
184 | ALOGV("%s: %s amplifier device", __func__, on ? "Enabling" : "Disabling");
185 | pthread_mutex_lock(&tfa_dev->tfa_lock);
186 | if (on) {
187 | if (tfa_dev->tfa_handle->a1 != 0) {
188 | tfa_dev->tfa_handle->a1 = 0;
189 | }
190 | }
191 |
192 | // this implementation requires explicit clock control
193 | if (on) {
194 | tfa_clock_on(tfa_dev);
195 | }
196 |
197 | rc = tfa_dev->tfa_enable(tfa_dev->tfa_handle, on ? 1 : 0);
198 | if (rc) {
199 | ALOGE("%s: Failed to %s amplifier device", __func__, on ? "enable" : "disable");
200 | }
201 |
202 | if (tfa_dev->clock_enabled) {
203 | tfa_clock_off(tfa_dev);
204 | }
205 | pthread_mutex_unlock(&tfa_dev->tfa_lock);
206 |
207 | return rc;
208 | }
209 |
210 | /*
211 | * Initializes the amplifier device and local class data.
212 | *
213 | * @return tfa_device_t on success, NULL on error.
214 | */
215 | tfa_device_t * tfa_device_open() {
216 | tfa_device_t *tfa_dev;
217 | int rc;
218 |
219 | ALOGV("Opening amplifier device");
220 |
221 | tfa_dev = (tfa_device_t *) malloc(sizeof(tfa_device_t));
222 | if (tfa_dev == NULL) {
223 | ALOGE("%s: Not enough memory to load the lib handle", __func__);
224 | return NULL;
225 | }
226 |
227 | // allocate memory for tfa handle
228 | tfa_dev->tfa_handle = malloc(sizeof(tfa_handle_t));
229 | if (tfa_dev->tfa_handle == NULL) {
230 | ALOGE("%s: Not enough memory to load the tfa handle", __func__);
231 | return NULL;
232 | }
233 |
234 | rc = load_tfa_lib(tfa_dev);
235 | if (rc < 0) {
236 | ALOGE("%s: Failed to load amplifier library", __func__);
237 | return NULL;
238 | }
239 |
240 | rc = tfa_dev->tfa_device_open(tfa_dev->tfa_handle, 0);
241 | if (rc < 0) {
242 | ALOGE("%s: Failed to open amplifier device", __func__);
243 | return NULL;
244 | }
245 |
246 | pthread_mutex_init(&tfa_dev->tfa_lock, (const pthread_mutexattr_t *) NULL);
247 |
248 | rc = tfa_power(tfa_dev, false);
249 | if (rc < 0) {
250 | ALOGE("%s: Failed to do initial amplifier powerdown", __func__);
251 | return NULL;
252 | }
253 |
254 | // do a full powerup - powerdown cycle and initialize clocks
255 | tfa_dev->writing = false;
256 | tfa_dev->clock_enabled = false;
257 | pthread_mutex_init(&tfa_dev->mutex, NULL);
258 | pthread_cond_init(&tfa_dev->cond, NULL);
259 |
260 | rc = tfa_power(tfa_dev, true);
261 | if (rc < 0) {
262 | ALOGE("%s: Failed to do initial amplifier powerup", __func__);
263 | return NULL;
264 | } else {
265 | rc = tfa_power(tfa_dev, false);
266 | if (rc < 0) {
267 | ALOGE("%s: Failed to do initial amplifier powerdown (2)", __func__);
268 | return NULL;
269 | }
270 | }
271 |
272 | return tfa_dev;
273 | }
274 |
275 | /*
276 | * De-Initializes the amplifier device.
277 | */
278 | void tfa_device_close(tfa_device_t *tfa_dev) {
279 | ALOGV("%s: Closing amplifier device", __func__);
280 | tfa_power(tfa_dev, false);
281 |
282 | pthread_mutex_destroy(&tfa_dev->tfa_lock);
283 |
284 | if (tfa_dev->tfa_handle) {
285 | free(tfa_dev->tfa_handle);
286 | }
287 |
288 | if (tfa_dev->lib_handle) {
289 | dlclose(tfa_dev->lib_handle);
290 | }
291 |
292 | if (tfa_dev) {
293 | free(tfa_dev);
294 | }
295 | }
296 |
--------------------------------------------------------------------------------