Skip to content

Commit

Permalink
fix: saveVersionInfo implem
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Jun 23, 2022
1 parent 9c59c02 commit be2dce0
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -455,18 +455,20 @@ private void removeVersionInfo(final String version) {
}

private void saveVersionInfo(final String version, final VersionInfo info) {
if(version != null && (info == null || !info.isBuiltin() && !info.isUnknown())) {
if(version == null || (info != null && (info.isBuiltin() || info.isUnknown()))) {
Log.d(TAG, "Not saving info for version: [" + version + "] " + info);
return;
}

if(info == null) {
Log.d(TAG, "Removing info for version [" + version + "]");
this.editor.remove(version + INFO_SUFFIX);
} else {
final VersionInfo update = info.setVersion(version);
Log.d(TAG, "Storing info for version [" + version + "] " + update.toString());
if(info == null) {
this.editor.remove(version + INFO_SUFFIX);
} else {
this.editor.putString(version + INFO_SUFFIX, update.toString());
}
this.editor.commit();
} else {
Log.d(TAG, "Not saving info for version: [" + version + "] " + info);
this.editor.putString(version + INFO_SUFFIX, update.toString());
}
this.editor.commit();
}

public void setVersionName(final String version, final String name) {
Expand Down

0 comments on commit be2dce0

Please sign in to comment.