Commit 45e2565a authored by Marcin Wiacek's avatar Marcin Wiacek Committed by Commit Bot

Improving code readability by using HttpURLConnection.HTTP_OK

Change-Id: I5fecd9eae4a18621051f144df4669d8827a044ec
Reviewed-on: https://chromium-review.googlesource.com/1150526Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Marcin Wiącek <marcin@mwiacek.com>
Cr-Commit-Position: refs/heads/master@{#578467}
parent 72655077
......@@ -944,7 +944,7 @@ public class OMADownloadHandler extends BroadcastReceiver
dos.close();
}
int responseCode = urlConnection.getResponseCode();
if (responseCode == 200 || responseCode == -1) {
if (responseCode == HttpURLConnection.HTTP_OK || responseCode == -1) {
return true;
}
return false;
......
......@@ -516,7 +516,7 @@ public class OmahaBase {
private static void checkServerResponseCode(HttpURLConnection urlConnection)
throws RequestFailureException {
try {
if (urlConnection.getResponseCode() != 200) {
if (urlConnection.getResponseCode() != HttpURLConnection.HTTP_OK) {
throw new RequestFailureException("Received " + urlConnection.getResponseCode()
+ " code instead of 200 (OK) from the server. Aborting.");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment