From 0dd5a83d0ec4c9d7b51843dd6eebd5ce92a1ad92 Mon Sep 17 00:00:00 2001 From: Zhomart Mukhamejanov Date: Mon, 23 Apr 2018 11:38:54 -0700 Subject: updater_sample: add streaming support - UpdateConfigs: add helper methods for streaming - add PrepareStreamingService intent service Test: manually and junit4 Bug: 77148143 Change-Id: I61711eb9abe051987e725fbd94f8cd029ff21dd3 --- .../android/systemupdatersample/UpdateConfig.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java') diff --git a/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java b/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java index 23510e426..1851724ed 100644 --- a/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java +++ b/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java @@ -69,11 +69,11 @@ public class UpdateConfig implements Parcelable { if (c.mAbInstallType == AB_INSTALL_TYPE_STREAMING) { JSONObject meta = o.getJSONObject("ab_streaming_metadata"); JSONArray propertyFilesJson = meta.getJSONArray("property_files"); - InnerFile[] propertyFiles = - new InnerFile[propertyFilesJson.length()]; + PackageFile[] propertyFiles = + new PackageFile[propertyFilesJson.length()]; for (int i = 0; i < propertyFilesJson.length(); i++) { JSONObject p = propertyFilesJson.getJSONObject(i); - propertyFiles[i] = new InnerFile( + propertyFiles[i] = new PackageFile( p.getString("filename"), p.getLong("offset"), p.getLong("size")); @@ -176,17 +176,17 @@ public class UpdateConfig implements Parcelable { private static final long serialVersionUID = 31042L; /** defines beginning of update data in archive */ - private InnerFile[] mPropertyFiles; + private PackageFile[] mPropertyFiles; public StreamingMetadata() { - mPropertyFiles = new InnerFile[0]; + mPropertyFiles = new PackageFile[0]; } - public StreamingMetadata(InnerFile[] propertyFiles) { + public StreamingMetadata(PackageFile[] propertyFiles) { this.mPropertyFiles = propertyFiles; } - public InnerFile[] getPropertyFiles() { + public PackageFile[] getPropertyFiles() { return mPropertyFiles; } } @@ -194,7 +194,7 @@ public class UpdateConfig implements Parcelable { /** * Description of a file in an OTA package zip file. */ - public static class InnerFile implements Serializable { + public static class PackageFile implements Serializable { private static final long serialVersionUID = 31043L; @@ -207,7 +207,7 @@ public class UpdateConfig implements Parcelable { /** size of the update data in archive */ private long mSize; - public InnerFile(String filename, long offset, long size) { + public PackageFile(String filename, long offset, long size) { this.mFilename = filename; this.mOffset = offset; this.mSize = size; -- cgit v1.2.3