diff options
author | Zhomart Mukhamejanov <zhomart@google.com> | 2018-05-10 19:59:06 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-05-10 19:59:06 +0200 |
commit | 319e1912381f8cd4c1257b7c8c869639bcdbe4a4 (patch) | |
tree | 824ab20e31f493f64f52a97dc44c8954af961753 /updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java | |
parent | Merge "screen_ui: Fix an issue when displaying wrapped text." (diff) | |
parent | Merge "updater_sample: add http header demo" (diff) | |
download | android_bootable_recovery-319e1912381f8cd4c1257b7c8c869639bcdbe4a4.tar android_bootable_recovery-319e1912381f8cd4c1257b7c8c869639bcdbe4a4.tar.gz android_bootable_recovery-319e1912381f8cd4c1257b7c8c869639bcdbe4a4.tar.bz2 android_bootable_recovery-319e1912381f8cd4c1257b7c8c869639bcdbe4a4.tar.lz android_bootable_recovery-319e1912381f8cd4c1257b7c8c869639bcdbe4a4.tar.xz android_bootable_recovery-319e1912381f8cd4c1257b7c8c869639bcdbe4a4.tar.zst android_bootable_recovery-319e1912381f8cd4c1257b7c8c869639bcdbe4a4.zip |
Diffstat (limited to 'updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java')
-rw-r--r-- | updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java b/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java index 1851724ed..b08bfd0f6 100644 --- a/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java +++ b/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java @@ -25,6 +25,7 @@ import org.json.JSONObject; import java.io.File; import java.io.Serializable; +import java.util.Optional; /** * An update description. It will be parsed from JSON, which is intended to @@ -78,7 +79,9 @@ public class UpdateConfig implements Parcelable { p.getLong("offset"), p.getLong("size")); } - c.mAbStreamingMetadata = new StreamingMetadata(propertyFiles); + c.mAbStreamingMetadata = new StreamingMetadata( + propertyFiles, + meta.getString("authorization_token")); } c.mRawJson = json; return c; @@ -178,17 +181,23 @@ public class UpdateConfig implements Parcelable { /** defines beginning of update data in archive */ private PackageFile[] mPropertyFiles; - public StreamingMetadata() { - mPropertyFiles = new PackageFile[0]; - } + /** SystemUpdaterSample receives the authorization token from the OTA server, in addition + * to the package URL. It passes on the info to update_engine, so that the latter can + * fetch the data from the package server directly with the token. */ + private String mAuthorization; - public StreamingMetadata(PackageFile[] propertyFiles) { + public StreamingMetadata(PackageFile[] propertyFiles, String authorization) { this.mPropertyFiles = propertyFiles; + this.mAuthorization = authorization; } public PackageFile[] getPropertyFiles() { return mPropertyFiles; } + + public Optional<String> getAuthorization() { + return Optional.of(mAuthorization); + } } /** @@ -224,7 +233,6 @@ public class UpdateConfig implements Parcelable { public long getSize() { return mSize; } - } } |