Merge "Skip verifying the partition with no changed blocks." into nyc-dev

am: 05ce0a9

* commit '05ce0a94a5a6eec3113b62a39f97401e6a3fb3a0':
  Skip verifying the partition with no changed blocks.

Change-Id: I8a3a9f8fe7bcf25fd719940d883a22a7adcfdef9
This commit is contained in:
Tao Bao
2016-04-15 03:29:42 +00:00
committed by android-build-merger

View File

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