Merge "Error correction: Use block_image_recover in block OTAs" am: fe4e86c7fd am: a25cced65f

am: bc946c6521

* commit 'bc946c65213a131d672f0f897989d71177d32ea4':
  Error correction: Use block_image_recover in block OTAs
This commit is contained in:
Sami Tolvanen 2015-10-29 19:20:42 +00:00 committed by android-build-merger
commit 6c0477429b
1 changed files with 14 additions and 1 deletions

View File

@ -1286,7 +1286,20 @@ class BlockDifference(object):
else:
ranges = self.src.care_map.subtract(self.src.clobbered_blocks)
ranges_str = ranges.to_string_raw()
if self.version >= 3:
if self.version >= 4:
script.AppendExtra(('if (range_sha1("%s", "%s") == "%s" || '
'block_image_verify("%s", '
'package_extract_file("%s.transfer.list"), '
'"%s.new.dat", "%s.patch.dat") || '
'(block_image_recover("%s", "%s") && '
'block_image_verify("%s", '
'package_extract_file("%s.transfer.list"), '
'"%s.new.dat", "%s.patch.dat"))) then') % (
self.device, ranges_str, self.src.TotalSha1(),
self.device, partition, partition, partition,
self.device, ranges_str,
self.device, partition, partition, partition))
elif self.version == 3:
script.AppendExtra(('if (range_sha1("%s", "%s") == "%s" || '
'block_image_verify("%s", '
'package_extract_file("%s.transfer.list"), '