Merge "Skip verifying the partition with no changed blocks."

am: 44a22a3

* commit '44a22a34f72936f7006ce50510c2d54d19b5d798':
  Skip verifying the partition with no changed blocks.

Change-Id: Id3ef138022f19be23a26cd42868b2395c313acb8
This commit is contained in:
Tao Bao 2016-04-15 04:07:16 +00:00 committed by android-build-merger
commit 4aea5186ef
1 changed files with 9 additions and 0 deletions

View File

@ -1472,8 +1472,12 @@ class BlockDifference(object):
def WriteVerifyScript(self, script, touched_blocks_only=False):
partition = self.partition
# full OTA
if not self.src:
script.Print("Image %s will be patched unconditionally." % (partition,))
# incremental OTA
else:
if touched_blocks_only and self.version >= 3:
ranges = self.touched_src_ranges
@ -1481,6 +1485,11 @@ class BlockDifference(object):
else:
ranges = self.src.care_map.subtract(self.src.clobbered_blocks)
expected_sha1 = self.src.TotalSha1()
# No blocks to be checked, skipping.
if not ranges:
return
ranges_str = ranges.to_string_raw()
if self.version >= 4:
script.AppendExtra(('if (range_sha1("%s", "%s") == "%s" || '