Optional manifest icons

pull/199/head
M66B 4 years ago
parent 0fbc9fe735
commit 7357d926b8

@ -559,10 +559,11 @@ public class ContactInfo {
try { try {
String json = Helper.readStream(m.getInputStream()); String json = Helper.readStream(m.getInputStream());
JSONObject jroot = new JSONObject(json); JSONObject jroot = new JSONObject(json);
if (jroot.has("icons")) {
JSONArray jicons = jroot.getJSONArray("icons"); JSONArray jicons = jroot.getJSONArray("icons");
for (int i = 0; i < jicons.length(); i++) { for (int i = 0; i < jicons.length(); i++) {
JSONObject jicon = jicons.getJSONObject(i); JSONObject jicon = jicons.getJSONObject(i);
String src = jicon.getString("src"); String src = jicon.optString("src");
String sizes = jicon.optString("sizes", ""); String sizes = jicon.optString("sizes", "");
String type = jicon.optString("type", ""); String type = jicon.optString("type", "");
if (!TextUtils.isEmpty(src)) { if (!TextUtils.isEmpty(src)) {
@ -573,6 +574,7 @@ public class ContactInfo {
imgs.add(img); imgs.add(img);
} }
} }
}
} finally { } finally {
m.disconnect(); m.disconnect();
} }

Loading…
Cancel
Save