Speed up the payload.bin read in process.
A 700MiB OTA package now takes only 100ms to read in, compared with
7000ms previously. That's 70x faster.
When parsing the update_metadata in payload.bin, the entire file has to
be read in previously, because zip.js does not support partial read-in.
In fact, only a small portion of the payload.bin is update_metadata.
Reading the entire payload.bin not only slows down the process but also
occupy excessive memory.
The new class OTAPayloadBlobWriter (inherited from zip.Writer) will read
in the metadata (header, manifest, signature) and throw an StopIteration
exception when finished.
Test: open a large OTA package
Change-Id: Iebf8045325dae9a118d9d8ea5674872aa7c280c4
1 file changed