Minor refactoring of dynamic patching code. (#7325)

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.
This commit is contained in:
Stanislav Baranov
2018-12-28 13:23:38 -08:00
committed by GitHub
parent 868dc047b4
commit 6f763fbad7
3 changed files with 257 additions and 259 deletions
@@ -264,7 +264,7 @@ public class FlutterMain {
Log.e(TAG, "Unable to read application info", e);
}
if (metaData != null && metaData.getBoolean("DynamicUpdates")) {
if (metaData != null && metaData.getBoolean("DynamicPatching")) {
sResourceUpdater = new ResourceUpdater(context);
sResourceUpdater.startUpdateDownloadOnce();
sResourceUpdater.waitForDownloadCompletion();
File diff suppressed because it is too large Load Diff
@@ -107,7 +107,7 @@ public final class ResourceUpdater {
}
public String getUpdateInstallationPath() {
return context.getFilesDir().toString() + "/update.zip";
return context.getFilesDir().toString() + "/patch.zip";
}
public String buildUpdateDownloadURL() {
@@ -120,16 +120,16 @@ public final class ResourceUpdater {
throw new RuntimeException(e);
}
if (metaData == null || metaData.getString("UpdateServerURL") == null) {
if (metaData == null || metaData.getString("PatchServerURL") == null) {
return null;
}
URI uri;
try {
uri = new URI(metaData.getString("UpdateServerURL") + "/" + getAPKVersion() + ".zip");
uri = new URI(metaData.getString("PatchServerURL") + "/" + getAPKVersion() + ".zip");
} catch (URISyntaxException e) {
Log.w(TAG, "Invalid AndroidManifest.xml UpdateServerURL: " + e.getMessage());
Log.w(TAG, "Invalid AndroidManifest.xml PatchServerURL: " + e.getMessage());
return null;
}