make tar backups opt in.

Change-Id: Ib01131f3a65ce4114e73abe2c7ba42263d281844
diff --git a/nandroid.c b/nandroid.c
index 8cee3be..5a32a76 100644
--- a/nandroid.c
+++ b/nandroid.c
@@ -139,6 +139,17 @@
         return NULL;
     }
 
+    if (strcmp(backup_path, "/data") == 0 && is_data_media()) {
+        return tar_compress_wrapper;
+    }
+
+    char str[255];
+    char* partition;
+    property_get("ro.cwm.prefer_tar", str, "false");
+    if (strcmp("true", str) != 0) {
+        return mkyaffs2image_wrapper;
+    }
+
     if (strcmp("yaffs2", mv->filesystem) == 0) {
         return mkyaffs2image_wrapper;
     }
@@ -345,6 +356,17 @@
         return NULL;
     }
 
+    if (strcmp(backup_path, "/data") == 0 && is_data_media()) {
+        return tar_extract_wrapper;
+    }
+
+    char str[255];
+    char* partition;
+    property_get("ro.cwm.prefer_tar", str, "false");
+    if (strcmp("true", str) != 0) {
+        return unyaffs_wrapper;
+    }
+
     if (strcmp("yaffs2", mv->filesystem) == 0) {
         return unyaffs_wrapper;
     }