Skip to content

Commit dd4298a

Browse files
safaiyehfacebook-github-bot
authored andcommitted
Remove left over code from deprecating Android < 21 (#30243)
Summary: Came to learn RN is deprecating Android 19, 20: a17ff44 Did a quick check of left over code from the deprecation. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Deprecated] - Cleanup usages of deprecated Android API Pull Request resolved: #30243 Reviewed By: fkgozali Differential Revision: D24548084 Pulled By: JoshuaGross fbshipit-source-id: 3054ca1455bcff2bd5c9791633942dc0cca7cb2c
1 parent 6c21f15 commit dd4298a

File tree

4 files changed

+3
-26
lines changed

4 files changed

+3
-26
lines changed

ReactAndroid/src/main/java/com/facebook/react/bridge/queue/ReactQueueConfigurationSpec.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
*/
2020
public class ReactQueueConfigurationSpec {
2121

22-
private static final long LEGACY_STACK_SIZE_BYTES = 2000000;
23-
2422
private final MessageQueueThreadSpec mNativeModulesQueueThreadSpec;
2523
private final MessageQueueThreadSpec mJSQueueThreadSpec;
2624

@@ -44,11 +42,7 @@ public static Builder builder() {
4442
}
4543

4644
public static ReactQueueConfigurationSpec createDefault() {
47-
MessageQueueThreadSpec spec =
48-
Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP
49-
? MessageQueueThreadSpec.newBackgroundThreadSpec(
50-
"native_modules", LEGACY_STACK_SIZE_BYTES)
51-
: MessageQueueThreadSpec.newBackgroundThreadSpec("native_modules");
45+
MessageQueueThreadSpec spec = MessageQueueThreadSpec.newBackgroundThreadSpec("native_modules");
5246
return builder()
5347
.setJSQueueThreadSpec(MessageQueueThreadSpec.newBackgroundThreadSpec("js"))
5448
.setNativeModulesQueueThreadSpec(spec)

ReactAndroid/src/main/java/com/facebook/react/modules/datepicker/DismissableDatePickerDialog.java

-13
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
import java.lang.reflect.Field;
1818
import java.lang.reflect.Method;
1919

20-
/**
21-
* Certain versions of Android (Jellybean-KitKat) have a bug where when dismissed, the {@link
22-
* DatePickerDialog} still calls the OnDateSetListener. This class works around that issue.
23-
*
24-
* <p>See: <a href="https://code.google.com/p/android/issues/detail?id=34833">Issue 34833</a>
25-
*/
2620
public class DismissableDatePickerDialog extends DatePickerDialog {
2721

2822
public DismissableDatePickerDialog(
@@ -46,13 +40,6 @@ public DismissableDatePickerDialog(
4640
fixSpinner(context, year, monthOfYear, dayOfMonth);
4741
}
4842

49-
@Override
50-
protected void onStop() {
51-
// do *not* call super.onStop() on KitKat on lower, as that would erroneously call the
52-
// OnDateSetListener when the dialog is dismissed, or call it twice when "OK" is pressed.
53-
super.onStop();
54-
}
55-
5643
private void fixSpinner(Context context, int year, int month, int dayOfMonth) {
5744
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N) {
5845
try {

ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected void doInBackgroundGuarded(Void... params) {
126126
}
127127

128128
/**
129-
* Instantiating CookieManager in KitKat+ will load the Chromium task taking a 100ish ms so we do
129+
* Instantiating CookieManager will load the Chromium task taking a 100ish ms so we do
130130
* it lazily to make sure it's done on a background thread as needed.
131131
*/
132132
private @Nullable CookieManager getCookieManager() {

ReactAndroid/src/main/java/com/facebook/react/views/view/ReactDrawableHelper.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ private static Drawable getDefaultThemeDrawable(Context context) {
7373
}
7474

7575
private static RippleDrawable getRippleDrawable(
76-
Context context, ReadableMap drawableDescriptionDict) {
77-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
78-
throw new JSApplicationIllegalArgumentException(
79-
"Ripple drawable is not available on android API <21");
80-
}
76+
Context context, ReadableMap drawableDescriptionDict) {
8177
int color = getColor(context, drawableDescriptionDict);
8278
Drawable mask = getMask(drawableDescriptionDict);
8379
ColorStateList colorStateList =

0 commit comments

Comments
 (0)