releasetools: compare size between compressed and patch while build otapackage

Currently, whether contains patch or verbatim, compute with file size
and patch size.
But ota file must be compressed with zip, so it should be better with
compressed size than uncompressed.

Test: aosp_shamu-user build without proprietary blobs between MOB30P and NRD90S
$ du -k ota_shamu_old.zip ota_shamu_new.zip
217252	ota_shamu_old.zip
216520	ota_shamu_new.zip

Change-Id: If68cb1fbe2f7815067451915a0dcfe93ea5ba8d6
Signed-off-by: YOUNG HO CHA <ganadist@gmail.com>
diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py
index f32d9d8..403a3a4 100755
--- a/tools/releasetools/ota_from_target_files.py
+++ b/tools/releasetools/ota_from_target_files.py
@@ -748,7 +748,7 @@
       basefilename = info.filename[len(prefix):]
       fn = partition + "/" + basefilename
       data = z.read(info.filename)
-      out[fn] = common.File(fn, data)
+      out[fn] = common.File(fn, data, info.compress_size)
   return out
 
 
@@ -1379,7 +1379,7 @@
     for diff in diffs:
       tf, sf, d = diff.GetPatch()
       path = "/".join(tf.name.split("/")[:-1])
-      if d is None or len(d) > tf.size * OPTIONS.patch_threshold or \
+      if d is None or len(d) > tf.compress_size * OPTIONS.patch_threshold or \
           path not in known_paths:
         # patch is almost as big as the file; don't bother patching
         # or a patch + rename cannot take place due to the target