OSDN Git Service

Eleven: lastFM: Replace HttpStatus use with HttpURLConnection
authorBrandon McAnsh <brandon.mcansh@gmail.com>
Fri, 9 Oct 2015 13:20:05 +0000 (09:20 -0400)
committerBrandon McAnsh <brandon.mcansh@gmail.com>
Fri, 9 Oct 2015 13:25:50 +0000 (06:25 -0700)
* org.apache.http.* is now deprecated

https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client

Change-Id: Ibd1b044609d8057a67e2928e494c8a0dbd8f8fee
Signed-off-by: Brandon McAnsh <brandon.mcansh@gmail.com>
src/com/cyanogenmod/eleven/lastfm/Caller.java

index e17926f..a6e8b64 100644 (file)
@@ -29,7 +29,6 @@ import android.util.Log;
 
 import com.cyanogenmod.eleven.lastfm.Result.Status;
 
-import org.apache.http.HttpStatus;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.xml.sax.InputSource;
@@ -142,7 +141,7 @@ public class Caller {
             } catch (final IOException ioEx) {
                 // We will assume that the server is not ready
                 Log.e(TAG, "Failed to download data", ioEx);
-                lastResult = Result.createHttpErrorResult(HttpStatus.SC_SERVICE_UNAVAILABLE,
+                lastResult = Result.createHttpErrorResult(HttpURLConnection.HTTP_UNAVAILABLE,
                         ioEx.getLocalizedMessage());
                 return lastResult;
             }