Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdace63d authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Select the right pages to scrap

The code before overwrote some data the outside code expected to not be
modified which resulted in the scrapped pages to be offset.

Test: - cts-tradefed run cts-dev -m Print
      - Tried to repro case in the bug
Bug: 62296301

Change-Id: If3f250dbca43125bbbe9faadc5183a6dbaa69481
parent 4eb76b2d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -426,7 +426,7 @@ public final class PageRangeUtils {
            // be based off the start of the written ones instead of zero.
            // be based off the start of the written ones instead of zero.
            // The written pages are always non-null and not empty.
            // The written pages are always non-null and not empty.
            final int offset = -pagesWrittenToFile[0].getStart();
            final int offset = -pagesWrittenToFile[0].getStart();
            PageRangeUtils.offset(pagesInDocRequested, offset);
            PageRangeUtils.offset(pagesInDocRequested.clone(), offset);
            return pagesInDocRequested;
            return pagesInDocRequested;
        } else if (Arrays.equals(pagesInDocRequested, ALL_PAGES_RANGE)
        } else if (Arrays.equals(pagesInDocRequested, ALL_PAGES_RANGE)
                && isAllPages(pagesWrittenToFile, pageCount)) {
                && isAllPages(pagesWrittenToFile, pageCount)) {