diff options
author | Zhomart Mukhamejanov <zhomart@google.com> | 2018-05-10 23:45:03 +0200 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-05-10 23:45:03 +0200 |
commit | 7217e7045de6d86fdeb0230f354a9fb7ff6884df (patch) | |
tree | 51fe2e69094925fe64814351bc654d59fb124e91 /updater_sample/src/com/example/android/systemupdatersample | |
parent | Merge "updater_sample: add http header demo" (diff) | |
parent | updater_sample: fix UpdateConfig (diff) | |
download | android_bootable_recovery-7217e7045de6d86fdeb0230f354a9fb7ff6884df.tar android_bootable_recovery-7217e7045de6d86fdeb0230f354a9fb7ff6884df.tar.gz android_bootable_recovery-7217e7045de6d86fdeb0230f354a9fb7ff6884df.tar.bz2 android_bootable_recovery-7217e7045de6d86fdeb0230f354a9fb7ff6884df.tar.lz android_bootable_recovery-7217e7045de6d86fdeb0230f354a9fb7ff6884df.tar.xz android_bootable_recovery-7217e7045de6d86fdeb0230f354a9fb7ff6884df.tar.zst android_bootable_recovery-7217e7045de6d86fdeb0230f354a9fb7ff6884df.zip |
Diffstat (limited to 'updater_sample/src/com/example/android/systemupdatersample')
-rw-r--r-- | updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java b/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java index b08bfd0f6..9bdd8b9e8 100644 --- a/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java +++ b/updater_sample/src/com/example/android/systemupdatersample/UpdateConfig.java @@ -79,9 +79,13 @@ public class UpdateConfig implements Parcelable { p.getLong("offset"), p.getLong("size")); } + String authorization = null; + if (meta.has("authorization")) { + authorization = meta.getString("authorization"); + } c.mAbStreamingMetadata = new StreamingMetadata( propertyFiles, - meta.getString("authorization_token")); + authorization); } c.mRawJson = json; return c; @@ -196,7 +200,7 @@ public class UpdateConfig implements Parcelable { } public Optional<String> getAuthorization() { - return Optional.of(mAuthorization); + return mAuthorization == null ? Optional.empty() : Optional.of(mAuthorization); } } |