fix flashing issue after restore policy issue

 * since commit: https://github.com/TeamWin/android_bootable_recovery/commit/a2bd7b7758a4585814f642d55301043276d8a002
   after factory reset /data/recovery doesn't recreates in A-only devices.

 * so fixes issue flashing newer roms need access to /data/recovery

Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
Change-Id: I02cb67f7161571b1aa02784049231d42872a3587
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit bcbe94e2b5ef83fe65a5c9767287802365b5ee4e)
diff --git a/data.cpp b/data.cpp
index 6ba278f..abba149 100755
--- a/data.cpp
+++ b/data.cpp
@@ -1106,6 +1106,14 @@
 			LOGINFO("Unable to mount '%s' to write version number.\n", Path.c_str());
 			return;
 		}
+
+		if (!TWFunc::Path_Exists(recoveryCacheDir)) {
+			LOGINFO("Recreating %s folder.\n", recoveryCacheDir.c_str());
+			if (!TWFunc::Create_Dir_Recursive(recoveryCacheDir.c_str(), S_IRWXU | S_IRWXG | S_IWGRP | S_IXGRP, 0, 0)) {
+				LOGERR("DataManager::Output_Version -- Unable to make %s: %s\n", recoveryCacheDir.c_str(), strerror(errno));
+				return;
+			}
+		}
 	}
 	if (!TWFunc::Path_Exists(recoveryCacheDir)) {
 		LOGINFO("Recreating %s folder.\n", recoveryCacheDir.c_str());