releasetools: Remove the unconditional fallback to bsdiff.

This CL uses the 'incomplete' tag to skip applying imgdiff to files with
incomplete block list. It's not the ideal fix to address the holes in
ext4 images, but would unhide other imgdiff issues covered by the
unconditional fallback.

Bug: 68016761
Test: Generate an incremental OTA package from images with incomplete
      block list. Check the imgdiff stats report.
Test: `python -m unittest test_blockimgdiff`
Change-Id: Ice77686414e70f5e42de35c1757fb31cf02e4fd4
This commit is contained in:
Tao Bao
2018-02-06 15:16:41 -08:00
parent 4a066a2cd2
commit 4ccea8549e
2 changed files with 20 additions and 41 deletions

View File

@@ -236,11 +236,19 @@ class BlockImageDiffTest(unittest.TestCase):
block_image_diff.CanUseImgdiff(
"/vendor/app/app3.apk", RangeSet("10-15"), src_ranges))
# At least one of the ranges is incomplete.
src_ranges = RangeSet("0-5")
src_ranges.extra['incomplete'] = True
self.assertFalse(
block_image_diff.CanUseImgdiff(
"/vendor/app/app4.apk", RangeSet("10-15"), src_ranges))
# The stats are correctly logged.
self.assertDictEqual(
{
ImgdiffStats.SKIPPED_NONMONOTONIC : {'/system/app/app2.apk'},
ImgdiffStats.SKIPPED_TRIMMED : {'/vendor/app/app3.apk'},
ImgdiffStats.SKIPPED_INCOMPLETE: {'/vendor/app/app4.apk'},
},
block_image_diff.imgdiff_stats.stats)