Merge "reduced the checkforapp function call to reduce unwanted log info" into android-9.0
diff --git a/Android.mk b/Android.mk
index 57c3003..08080ae 100755
--- a/Android.mk
+++ b/Android.mk
@@ -510,15 +510,18 @@
ifeq ($(TWRP_INCLUDE_LOGCAT), true)
TWRP_REQUIRED_MODULES += logcat
ifeq ($(TARGET_USES_LOGD), true)
- TWRP_REQUIRED_MODULES += logd libsysutils libnl event-log-tags init.recovery.logd.rc
- ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
- LOCAL_POST_INSTALL_CMD += \
- $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system_root/system/etc; \
- cp $(TARGET_OUT_ETC)/event-log-tags $(TARGET_RECOVERY_ROOT_OUT)/system_root/system/etc/;
- else
- LOCAL_POST_INSTALL_CMD += \
- $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/etc; \
- cp $(TARGET_OUT_ETC)/event-log-tags $(TARGET_RECOVERY_ROOT_OUT)/system/etc/;
+ TWRP_REQUIRED_MODULES += logd libsysutils libnl init.recovery.logd.rc
+ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 28; echo $$?),0)
+ TWRP_REQUIRED_MODULES += event-log-tags
+ ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
+ LOCAL_POST_INSTALL_CMD += \
+ $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system_root/system/etc; \
+ cp $(TARGET_OUT_ETC)/event-log-tags $(TARGET_RECOVERY_ROOT_OUT)/system_root/system/etc/;
+ else
+ LOCAL_POST_INSTALL_CMD += \
+ $(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/etc; \
+ cp $(TARGET_OUT_ETC)/event-log-tags $(TARGET_RECOVERY_ROOT_OUT)/system/etc/;
+ endif
endif
endif
endif
diff --git a/etc/Android.mk b/etc/Android.mk
index ca549ea..f7bb3d8 100644
--- a/etc/Android.mk
+++ b/etc/Android.mk
@@ -82,19 +82,33 @@
ifeq ($(TWRP_INCLUDE_LOGCAT), true)
ifeq ($(TARGET_USES_LOGD), true)
+ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 28; echo $$?),0)
+ include $(CLEAR_VARS)
+ LOCAL_MODULE := init.recovery.logd.rc
+ LOCAL_MODULE_TAGS := eng
+ LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
- include $(CLEAR_VARS)
- LOCAL_MODULE := init.recovery.logd.rc
- LOCAL_MODULE_TAGS := eng
- LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
+ # Cannot send to TARGET_RECOVERY_ROOT_OUT since build system wipes init*.rc
+ # during ramdisk creation and only allows init.recovery.*.rc files to be copied
+ # from TARGET_ROOT_OUT thereafter
+ LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
- # Cannot send to TARGET_RECOVERY_ROOT_OUT since build system wipes init*.rc
- # during ramdisk creation and only allows init.recovery.*.rc files to be copied
- # from TARGET_ROOT_OUT thereafter
- LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
+ LOCAL_SRC_FILES := init.recovery.logd27.rc
+ include $(BUILD_PREBUILT)
+ else
+ include $(CLEAR_VARS)
+ LOCAL_MODULE := init.recovery.logd.rc
+ LOCAL_MODULE_TAGS := eng
+ LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
- LOCAL_SRC_FILES := $(LOCAL_MODULE)
- include $(BUILD_PREBUILT)
+ # Cannot send to TARGET_RECOVERY_ROOT_OUT since build system wipes init*.rc
+ # during ramdisk creation and only allows init.recovery.*.rc files to be copied
+ # from TARGET_ROOT_OUT thereafter
+ LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
+
+ LOCAL_SRC_FILES := init.recovery.logd28.rc
+ include $(BUILD_PREBUILT)
+ endif
endif
endif
diff --git a/etc/init.recovery.logd.rc b/etc/init.recovery.logd27.rc
similarity index 60%
rename from etc/init.recovery.logd.rc
rename to etc/init.recovery.logd27.rc
index 423039c..0454a7a 100644
--- a/etc/init.recovery.logd.rc
+++ b/etc/init.recovery.logd27.rc
@@ -3,6 +3,7 @@
on load_persist_props_action
start logd
+ start logd-reinit
service logd /sbin/logd
class core
@@ -11,3 +12,11 @@
socket logdw dgram 0222 logd logd
group root system
seclabel u:r:logd:s0
+
+service logd-reinit /sbin/logd --reinit
+ oneshot
+ disabled
+ user logd
+ group logd
+ writepid /dev/cpuset/system-background/tasks
+ seclabel u:r:logd:s0
diff --git a/etc/init.recovery.logd28.rc b/etc/init.recovery.logd28.rc
new file mode 100644
index 0000000..673df77
--- /dev/null
+++ b/etc/init.recovery.logd28.rc
@@ -0,0 +1,31 @@
+on init
+ start logd
+
+on fs
+ write /dev/event-log-tags "# content owned by logd
+"
+ chown logd logd /dev/event-log-tags
+ chmod 0644 /dev/event-log-tags
+
+on load_persist_props_action
+ start logd
+ start logd-reinit
+
+service logd /sbin/logd
+ socket logd stream 0666 logd logd
+ socket logdr seqpacket 0666 logd logd
+ socket logdw dgram+passcred 0222 logd logd
+ file /proc/kmsg r
+ file /dev/kmsg w
+ user logd
+ group logd system package_info readproc
+ writepid /dev/cpuset/system-background/tasks
+ seclabel u:r:logd:s0
+
+service logd-reinit /sbin/logd --reinit
+ oneshot
+ disabled
+ user logd
+ group logd
+ writepid /dev/cpuset/system-background/tasks
+ seclabel u:r:logd:s0
diff --git a/partition.cpp b/partition.cpp
index a34d854..17614ff 100755
--- a/partition.cpp
+++ b/partition.cpp
@@ -693,7 +693,9 @@
Primary_Block_Device.c_str(), Mount_Point.c_str());
}
} else {
- if (!Decrypt_FBE_DE()) {
+ int is_device_fbe;
+ DataManager::GetValue(TW_IS_FBE, is_device_fbe);
+ if (!Decrypt_FBE_DE() && is_device_fbe == 1) {
char wrappedvalue[PROPERTY_VALUE_MAX];
property_get("fbe.data.wrappedkey", wrappedvalue, "");
std::string wrappedkeyvalue(wrappedvalue);
@@ -723,7 +725,7 @@
bool TWPartition::Decrypt_FBE_DE() {
if (TWFunc::Path_Exists("/data/unencrypted/key/version")) {
DataManager::SetValue(TW_IS_FBE, 1);
- property_set("ro.crypto.state", "encrypted");
+ property_set("ro.crypto.state", "encrypted");
property_set("ro.crypto.type", "file");
LOGINFO("File Based Encryption is present\n");
#ifdef TW_INCLUDE_FBE