File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
core/src/main/java/io/snabble/sdk Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 11# Changelog
22All notable changes to this project will be documented in this file.
33
4+ ## [ 0.14.10]
5+
6+ ### Changed
7+ - Added accessor to additional metadata
8+
49## [ 0.14.9]
510
611### Changes
Original file line number Diff line number Diff line change @@ -146,10 +146,24 @@ public String getVersionName() {
146146 * notify the user that it will not function anymore.
147147 */
148148 public boolean isOutdatedSDK () {
149+ JsonObject jsonObject = getAdditionalMetadata ();
150+ if (jsonObject != null ) {
151+ return JsonUtils .getBooleanOpt (jsonObject , "kill" , false );
152+ }
153+
154+ return false ;
155+ }
156+
157+ /** Returns additional metadata that may be provided for apps unrelated to the SDK **/
158+ public JsonObject getAdditionalMetadata () {
149159 JsonObject jsonObject = metadataDownloader .getJsonObject ();
150160
151- return jsonObject .has ("metadata" ) &&
152- JsonUtils .getBooleanOpt (jsonObject .get ("metadata" ).getAsJsonObject (), "kill" , false );
161+ JsonElement jsonElement = jsonObject .get ("metadata" );
162+ if (jsonElement != null ) {
163+ return jsonElement .getAsJsonObject ();
164+ }
165+
166+ return null ;
153167 }
154168
155169 private synchronized void readMetadata () {
You can’t perform that action at this time.
0 commit comments