From bb8a2151387148e66bdd0b0ceb5d70d9db84ba69 Mon Sep 17 00:00:00 2001 From: Zhomart Mukhamejanov Date: Thu, 10 May 2018 12:19:16 -0700 Subject: updater_sample: fix UpdateConfig - fix UpdateConfig - fix smaple.json - fix FileDownloaderTest Test: manually Change-Id: I09d272f77c89a02f54a24cf753fdfda4ce243927 Signed-off-by: Zhomart Mukhamejanov --- .../src/com/example/android/systemupdatersample/UpdateConfig.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'updater_sample/src/com') 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 getAuthorization() { - return Optional.of(mAuthorization); + return mAuthorization == null ? Optional.empty() : Optional.of(mAuthorization); } } -- cgit v1.2.3