Permalink
Browse files

Change inlined `okhttp3.Headers` references to a Java import

Summary:
In BundleDownloader.java, there were references to `okhttp3.Headers` instead of importing the class at the top of the file. This PR is a simple change to use an import instead.

Compile the Android app

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.)

[ANDROID][MINOR][BundleDownloader] - Use Java import instead of fully qualified class name
Closes #17507

Differential Revision: D6691593

Pulled By: hramos

fbshipit-source-id: 81b366db608b7be8a903d2f25b36ca5642d9eec3
  • Loading branch information...
ide authored and facebook-github-bot committed Jan 10, 2018
1 parent b9b7fab commit 7f5818960596a2a18b7d427fd23d46396c05bee5
Showing with 4 additions and 3 deletions.
  1. +4 −3 ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.java
@@ -28,6 +28,7 @@
import javax.annotation.Nullable;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
@@ -171,7 +172,7 @@ public void execute(Map<String, String> headers, Buffer body, boolean finished)
if (headers.containsKey("X-Http-Status")) {
status = Integer.parseInt(headers.get("X-Http-Status"));
}
processBundleResult(url, status, okhttp3.Headers.of(headers), body, outputFile, bundleInfo, callback);
processBundleResult(url, status, Headers.of(headers), body, outputFile, bundleInfo, callback);
} else {
if (!headers.containsKey("Content-Type") || !headers.get("Content-Type").equals("application/json")) {
return;
@@ -221,7 +222,7 @@ public void cancelDownloadBundleFromURL() {
private void processBundleResult(
String url,
int statusCode,
okhttp3.Headers headers,
Headers headers,
BufferedSource body,
File outputFile,
BundleInfo bundleInfo,
@@ -380,7 +381,7 @@ private static boolean isDeltaUrl(String bundleUrl) {
return bundleUrl.indexOf(".delta?") != -1;
}
private static void populateBundleInfo(String url, okhttp3.Headers headers, BundleInfo bundleInfo) {
private static void populateBundleInfo(String url, Headers headers, BundleInfo bundleInfo) {
bundleInfo.mUrl = url;
String filesChangedCountStr = headers.get("X-Metro-Files-Changed-Count");

0 comments on commit 7f58189

Please sign in to comment.