mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Cleanup ForwardingCookieHandler class
Summary: This diff cleansup the class ForwardingCookieHandler, refactoring constants and adding annotations to avoid lint errors changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D22771914 fbshipit-source-id: 4fdff2df5ea103f93519c2f4504288202114b1fc
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f829722b54
commit
b7d8641a28
+1
-1
@@ -45,7 +45,7 @@ public class ReactQueueConfigurationSpec {
|
||||
|
||||
public static ReactQueueConfigurationSpec createDefault() {
|
||||
MessageQueueThreadSpec spec =
|
||||
Build.VERSION.SDK_INT < 21
|
||||
Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP
|
||||
? MessageQueueThreadSpec.newBackgroundThreadSpec(
|
||||
"native_modules", LEGACY_STACK_SIZE_BYTES)
|
||||
: MessageQueueThreadSpec.newBackgroundThreadSpec("native_modules");
|
||||
|
||||
+6
-4
@@ -40,8 +40,9 @@ public class ForwardingCookieHandler extends CookieHandler {
|
||||
private static final String VERSION_ONE_HEADER = "Set-cookie2";
|
||||
private static final String COOKIE_HEADER = "Cookie";
|
||||
|
||||
// As CookieManager was synchronous before API 21 this class emulates the async behavior on <21.
|
||||
private static final boolean USES_LEGACY_STORE = Build.VERSION.SDK_INT < 21;
|
||||
// As CookieManager was synchronous before API 21 this class emulates the async behavior on < 21.
|
||||
private static final boolean USES_LEGACY_STORE =
|
||||
Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP;
|
||||
|
||||
private final CookieSaver mCookieSaver;
|
||||
private final ReactContext mContext;
|
||||
@@ -100,6 +101,7 @@ public class ForwardingCookieHandler extends CookieHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private void clearCookiesAsync(final Callback callback) {
|
||||
CookieManager cookieManager = getCookieManager();
|
||||
if (cookieManager != null) {
|
||||
@@ -148,7 +150,7 @@ public class ForwardingCookieHandler extends CookieHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(21)
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private void addCookieAsync(String url, String cookie) {
|
||||
CookieManager cookieManager = getCookieManager();
|
||||
if (cookieManager != null) {
|
||||
@@ -266,7 +268,7 @@ public class ForwardingCookieHandler extends CookieHandler {
|
||||
});
|
||||
}
|
||||
|
||||
@TargetApi(21)
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private void flush() {
|
||||
CookieManager cookieManager = getCookieManager();
|
||||
if (cookieManager != null) {
|
||||
|
||||
+2
-2
@@ -116,8 +116,8 @@ public class OkHttpClientProvider {
|
||||
specs.add(ConnectionSpec.CLEARTEXT);
|
||||
|
||||
client.connectionSpecs(specs);
|
||||
} catch (Exception exc) {
|
||||
FLog.e("OkHttpClientProvider", "Error while enabling TLS 1.2", exc);
|
||||
} catch (Exception ex) {
|
||||
FLog.e("OkHttpClientProvider", "Error while enabling TLS 1.2", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user