Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public static int indexOf(String lineIdentifier) {
private static final String STATUS_GOOD = "good service";
private static final String STATUS_MINOR_DELAYS = "minor delays";
private static final String STATUS_SEVERE_DELAYS = "severe delays";
private static final String STATUS_PLANNED_CLOSURE = "planned closure";
private static final String STATUS_PART_CLOSURE = "part closure";
private static final String STATUS_PART_SUSPENDED = "part suspended";
private static final String STATUS_SUSPENDED = "suspended";
Expand All @@ -135,9 +136,11 @@ private static Map<String, String> createMessageToCodeMap() {
result.put(STATUS_GOOD, "OK");
result.put(STATUS_MINOR_DELAYS, "MD");
result.put(STATUS_SEVERE_DELAYS, "SD");
result.put(STATUS_PLANNED_CLOSURE, "PLC");
result.put(STATUS_PART_CLOSURE, "PC");
result.put(STATUS_PART_SUSPENDED, "PS");
result.put(STATUS_SUSPENDED, "S");
result.put(STATUS_OTHER, "?");
return Collections.unmodifiableMap(result);
}

Expand Down Expand Up @@ -265,6 +268,7 @@ protected String determineOverallStatus(JSONObject responseObj) throws JSONExcep
counterMap.put(STATUS_GOOD, 0);
counterMap.put(STATUS_MINOR_DELAYS, 0);
counterMap.put(STATUS_SEVERE_DELAYS, 0);
counterMap.put(STATUS_PLANNED_CLOSURE, 0);
counterMap.put(STATUS_PART_CLOSURE, 0);
counterMap.put(STATUS_PART_SUSPENDED, 0);
counterMap.put(STATUS_SUSPENDED, 0);
Expand Down Expand Up @@ -323,6 +327,7 @@ protected String doInBackground(Void... params) {
connection = (HttpURLConnection) url.openConnection();
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
String response = convertStreamToString(connection.getInputStream());
Log.d(TAG, response);
try {
// Expected response format is something like:
// {
Expand Down