Remove Extra spaces occured while using multiline string variable
* On multiline string variable it adds spaces
Change-Id: I0f9140f3840b0238009af2271ac67b25754f76c9
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
diff --git a/Android.mk b/Android.mk
index ca204d3..89eb7c6 100755
--- a/Android.mk
+++ b/Android.mk
@@ -151,7 +151,7 @@
LOCAL_SHARED_LIBRARIES += libcrypto
endif
-ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?),0)
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 23; echo $$?),0)
LOCAL_SHARED_LIBRARIES += libbase
endif
diff --git a/twrp.cpp b/twrp.cpp
index f81bdf9..7689c25 100755
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -43,6 +43,11 @@
#include "twrp-functions.hpp"
#include "data.hpp"
#include "partitions.hpp"
+#ifdef __ANDROID_API_N__
+#include <android-base/strings.h>
+#else
+#include <base/strings.h>
+#endif
#include "openrecoveryscript.hpp"
#include "variables.h"
#include "twrpAdbBuFifo.hpp"
@@ -161,6 +166,8 @@
} else {
other_prop = current_prop;
}
+ other_prop = android::base::Trim(other_prop);
+ current_prop = android::base::Trim(current_prop);
string sys_val = TWFunc::System_Property_Get(other_prop, SarPartitionManager, "/s");
if (!sys_val.empty()) {
LOGINFO("Overriding %s with value: \"%s\" from system property %s\n", current_prop.c_str(), sys_val.c_str(), other_prop.c_str());