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 https://github.com/facebook/react-native/pull/17507

Differential Revision: D6691593

Pulled By: hramos

fbshipit-source-id: 81b366db608b7be8a903d2f25b36ca5642d9eec3
This commit is contained in:
James Ide 2018-01-09 23:32:04 -08:00 committed by Facebook Github Bot
parent b9b7fabf98
commit 7f58189605
1 changed files with 4 additions and 3 deletions

View File

@ -28,6 +28,7 @@ import java.util.regex.Pattern;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import okhttp3.Call; import okhttp3.Call;
import okhttp3.Callback; import okhttp3.Callback;
import okhttp3.Headers;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
@ -171,7 +172,7 @@ public class BundleDownloader {
if (headers.containsKey("X-Http-Status")) { if (headers.containsKey("X-Http-Status")) {
status = Integer.parseInt(headers.get("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 { } else {
if (!headers.containsKey("Content-Type") || !headers.get("Content-Type").equals("application/json")) { if (!headers.containsKey("Content-Type") || !headers.get("Content-Type").equals("application/json")) {
return; return;
@ -221,7 +222,7 @@ public class BundleDownloader {
private void processBundleResult( private void processBundleResult(
String url, String url,
int statusCode, int statusCode,
okhttp3.Headers headers, Headers headers,
BufferedSource body, BufferedSource body,
File outputFile, File outputFile,
BundleInfo bundleInfo, BundleInfo bundleInfo,
@ -380,7 +381,7 @@ public class BundleDownloader {
return bundleUrl.indexOf(".delta?") != -1; 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; bundleInfo.mUrl = url;
String filesChangedCountStr = headers.get("X-Metro-Files-Changed-Count"); String filesChangedCountStr = headers.get("X-Metro-Files-Changed-Count");