Add TWRP flags to enable logd and/or logcat in recovery

Developers and device maintainers may find it useful to have access
to logcat in recovery. This patch set adds the following build flags:

TARGET_USES_LOGD - This is an Android build flag that enables logd
support. Devices that don't have built in kernel logging to dev/log/*
will need this flag for logcat. We'll also use this to include the
necessary support files for logd in TWRP.

TWRP_INCLUDE_LOGCAT - This enables logcat support in recovery.

I pulled the init entries from my HTC One M8 GPE boot.img,
so I'm not certain whether these will work for all devices
or if they're all necessary.

Feedback is welcome.

PS2: Use "TARGET_USES_LOGD" instead as this flag already exists, and
previous flag was named incorrectly (logd isn't kernel logging)

PS3: Start logd service on load_persist_props action, needed for 6.0+

PS4: More info on "TARGET_USES_LOGD" flag as related to liblog
compilation can be found at the below links:

https://android.googlesource.com/platform/system/core/+/android-6.0.1_r10/liblog/Android.mk#27
https://android.googlesource.com/platform/system/core/+/android-6.0.1_r10/liblog/Android.mk#50

Whether or not this flag is needed for logcat in TWRP is dependent
on whether liblog was compiled with this flag.

PS5: Update commit message to better describe "TARGET_USES_LOGD" flag

PS6: Another commit message update

Change-Id: Iaac6c6c822dc93fbe4b6eadcf24eef6995dd6b50
diff --git a/Android.mk b/Android.mk
index 0a5692c..0660a46 100644
--- a/Android.mk
+++ b/Android.mk
@@ -425,6 +425,12 @@
 ifneq ($(TW_EXCLUDE_DEFAULT_USB_INIT), true)
     LOCAL_ADDITIONAL_DEPENDENCIES += init.recovery.usb.rc
 endif
+ifeq ($(TARGET_USES_LOGD), true)
+    LOCAL_ADDITIONAL_DEPENDENCIES += logd libsysutils libnl init.recovery.logd.rc
+endif
+ifeq ($(TWRP_INCLUDE_LOGCAT), true)
+    LOCAL_ADDITIONAL_DEPENDENCIES += logcat
+endif
 # Allow devices to specify device-specific recovery dependencies
 ifneq ($(TARGET_RECOVERY_DEVICE_MODULES),)
     LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_RECOVERY_DEVICE_MODULES)