This change adds explicit validation of dynamic patches in all places
where they're used, instead of only validating it in some places which
wasn't as reliable because some of the code paths were missed.
This change also moves utility functions that deal with validating
patches from ResourceExtractor to ResourceUpdater, to make them
available as API for other places in code that need this validation.
This fixes potential race condition when patch gets downloaded on top
of zip file that's currently in active use by resource extractor and/or
asset manager. This change is necessary since download can happen in
the background while normal application operations are in progress.
This is a no-op change, except for fixing a bug where download task
reference wasn't cleared after download was completed.
This change also removes call to output stream flush(), which is not
necessary according to Java spec.
The rest of the change deals with requiring the code to work directly
with ResourceUpdater object instead of having FlutterMain be a facade
that forwards some of ResourceUpdater's methods. This simplifies the
other (more essential) upcoming changes that will be landing in the
followings few PRs.
This change introduces manifest properties that control when dynamic patches are downloaded and installed in the application lifecycle.
Application developer can choose whether between install on restart, install on resume, or immediate forced install of dynamic patches.
Minor refactoring of dynamic patching code.
- Changes naming of manifest properties to be consistent with documentation.
- Moves methods from inner class to outer class to make them more reusable.
Unique patch numbers are mainly useful for canary and A-B testing, but otherwise complicate things and can now be omitted.
Also, always append .zip to patch download URL. This obviates the need to configure redirects on the server when not using patch numbers.