Tweaks to update message parsing, catch activity not found errors in case the messages were badly formed

pull/14/head
Sam Bosley 13 years ago
parent 986d6e04e6
commit 30ed47ef5b

@ -212,9 +212,9 @@ public class UpdateMessageService {
private ClickableSpan getClickableSpanForUpdate(JSONObject update, String type) {
if ("pref".equals(type)) {
try {
if (!update.has("prefs"))
if (!update.has("action_list"))
return null;
JSONArray prefSpec = update.getJSONArray("prefs");
JSONArray prefSpec = update.getJSONArray("action_list");
if (prefSpec.length() == 0)
return null;
final String prefArray = prefSpec.toString();
@ -231,9 +231,9 @@ public class UpdateMessageService {
}
} else if ("screen".equals(type)) {
try {
if (!update.has("screens"))
if (!update.has("action_list"))
return null;
JSONArray screens = update.getJSONArray("screens");
JSONArray screens = update.getJSONArray("action_list");
if (screens.length() == 0)
return null;
final ArrayList<String> screenList = new ArrayList<String>();

@ -3,6 +3,7 @@ package com.todoroo.astrid.service;
import java.util.ArrayList;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.os.Bundle;
@ -49,6 +50,9 @@ public class UpdateScreenFlow extends Activity {
} catch (ClassNotFoundException e) {
e.printStackTrace();
finish();
} catch (ActivityNotFoundException e) {
e.printStackTrace();
finish();
}
}

Loading…
Cancel
Save