[Android Software Development] morfikov:
I've finally built my first TWRP from the OMNI (minimal) source, but there's some issues that have to be resolved, so I have some questions concerning fixing the problems.

First of all I have a TP-LINK Neffos Y5 smartphone (Snapdragon 210, SoC MSM8909), so it's a Qualcomm hardware. I've seen that people put BOARD_USES_QCOM_HARDWARE := true in the BoardConfig.mk when they deal with Qualcomm devices. I don't really know what that option does, but when I put it in the file I get the following:

make: *** No rule to make target '/media/Kabi/Android/omni/out/target/product/tp802a/obj/STATIC_LIBRARIES/libbatteryservice_intermediates/export_includes', needed by '/media/Kabi/Android/omni/out/target/product/tp802a/obj/EXECUTABLES/healthd_intermediates/import_includes'. Stop.

And of course I'm unable to continue. Usually when similar errors occur, some repos were missing. I don't really know what to think about this situation. Does anyone know what repo should be added when the BOARD_USES_QCOM_HARDWARE option is used?

The next thing is the HW encryption. This smartphone runs Android 6.0 and when I check its encryption settings, it says hardware-backed. So basically when I want to decrypt the /data/ partition in the recovery mode, TWRP is unable to do it and always returns "bad password". Here's the log:

I:Can't probe device /dev/block/mmcblk0p29
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p29', current file system: 'ext4'
get_crypt_ftr_info crypto key location: 'footer'
I:Using automatic handling for /data/media emulated storage device.
I:Setting up '/data' as data/media emulated storage.
I:Created '/sdcard' folder.
I:Backup folder set to '/data/media/TWRP/BACKUPS/Neffos_Y5'
I:Settings storage is '/data/media'
Updating partition details...
...done
Unable to mount storage
I:Unmounting main partitions...
....
I:Set page: 'decrypt'
I:Set page: 'trydecrypt'
I:operation_start: 'Decrypt'
crypt_ftr->fs_size = 25421759
Using scrypt with keymaster for cryptfs KDF
Invalid hex string
Failed to convert passwd from hex, using passwd instead
keymaster module name is Keymaster QCOM HAL
keymaster version is 3
Found keymaster0 module, using keymaster0 API.
could not open keymaster device in keystore (Operation not permitted)
Failed to init keymaster
Signing failed
kdf failed
failure decrypting master key
Failed to decrypt master key

How to fix that? I know that probably some hardware related things are missing, but I don't really know where to start looking for them. In the BoardConfig.mk I've set the following options:

TARGET_HW_DISK_ENCRYPTION := true
TW_INCLUDE_CRYPTO := true
TARGET_KEYMASTER_WAIT_FOR_QSEE := true

And in the fstab.recovery file I have this (I have more entries of course, but these are related, at least I think so):

/firmware vfat /dev/block/bootdevice/by-name/modem flags=display="Firmware";backup=1;mounttodecrypt;
/efs1 emmc /dev/block/bootdevice/by-name/modemst1 flags=display="Modemst1";backup=1;mounttodecrypt
/efs2 emmc /dev/block/bootdevice/by-name/modemst2 flags=display="Modemst2";backup=1;mounttodecrypt
/system ext4 /dev/block/bootdevice/by-name/system flags=display="System";backup=1;wipeingui;mounttodecrypt
/data ext4 /dev/block/bootdevice/by-name/userdata flags=display="Data";backup=1;wipeingui;wipeduringfactoryreset;encryptable=footer;length=-16384

Another thing. The TWRP log mentioned something about the TW_TARGET_USES_QCOM_BSP option:

Overlay graphics may work (mdssfb_80000), but not enabled. Use TW_TARGET_USES_QCOM_BSP := true to enable.

So I've put this option in the BoardConfig.mk , but I got this error:

bootable/recovery/minui/graphics_overlay.cpp:35:10: fatal error: 'linux/msm_mdp.h' file not found
#include <linux/msm_mdp.h>

How to fix that?

I also have the wrong time. I'm able to select the appropriate timezone (UTC+1 CET), but it always shows me the wrong time. So when the real time is 7pm, it says it's 1am, and minutes also differs. I've copied the following file to eliminate some time related errors in the log:

PRODUCT_COPY_FILES += \
bionic/libc/zoneinfo/tzdata:recovery/root/system/usr/share/zoneinfo/tzdata

But this isn't fixing the wrong time. Any ideas?

And the last thing is the battery status. When I boot my device using the TWRP recovery, the percentage show the right number, but often it's a little bit different, and sometimes it disappears completely. Is that normal?