am 7788547f: am 586b38cc: Merge "Calculate max_stashed_blocks correctly for block OTA v3"

* commit '7788547ff34d93b5196933eedb9f006fb1fe9f4d':
  Calculate max_stashed_blocks correctly for block OTA v3
This commit is contained in:
Sami Tolvanen
2015-04-17 19:09:02 +00:00
committed by Android Git Automerger

View File

@@ -387,6 +387,12 @@ class BlockImageDiff(object):
xf.style, xf.style,
xf.tgt_ranges.to_string_raw(), src_str)) xf.tgt_ranges.to_string_raw(), src_str))
elif self.version >= 3: elif self.version >= 3:
# take into account automatic stashing of overlapping blocks
if xf.src_ranges.overlaps(xf.tgt_ranges):
temp_stash_usage = stashed_blocks + xf.src_ranges.size();
if temp_stash_usage > max_stashed_blocks:
max_stashed_blocks = temp_stash_usage
out.append("%s %s %s %s\n" % ( out.append("%s %s %s %s\n" % (
xf.style, xf.style,
self.HashBlocks(self.tgt, xf.tgt_ranges), self.HashBlocks(self.tgt, xf.tgt_ranges),
@@ -405,6 +411,12 @@ class BlockImageDiff(object):
xf.style, xf.patch_start, xf.patch_len, xf.style, xf.patch_start, xf.patch_len,
xf.tgt_ranges.to_string_raw(), src_str)) xf.tgt_ranges.to_string_raw(), src_str))
elif self.version >= 3: elif self.version >= 3:
# take into account automatic stashing of overlapping blocks
if xf.src_ranges.overlaps(xf.tgt_ranges):
temp_stash_usage = stashed_blocks + xf.src_ranges.size();
if temp_stash_usage > max_stashed_blocks:
max_stashed_blocks = temp_stash_usage
out.append("%s %d %d %s %s %s %s\n" % ( out.append("%s %d %d %s %s %s %s\n" % (
xf.style, xf.style,
xf.patch_start, xf.patch_len, xf.patch_start, xf.patch_len,