Skip to content

Commit

Permalink
Remove left over code from deprecating Android < 21 (#30243)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
safaiyeh authored and facebook-github-bot committed Oct 27, 2020
1 parent 6c21f15 commit dd4298a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
*/
public class ReactQueueConfigurationSpec {

private static final long LEGACY_STACK_SIZE_BYTES = 2000000;

private final MessageQueueThreadSpec mNativeModulesQueueThreadSpec;
private final MessageQueueThreadSpec mJSQueueThreadSpec;

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

public static ReactQueueConfigurationSpec createDefault() {
MessageQueueThreadSpec spec =
Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP
? MessageQueueThreadSpec.newBackgroundThreadSpec(
"native_modules", LEGACY_STACK_SIZE_BYTES)
: MessageQueueThreadSpec.newBackgroundThreadSpec("native_modules");
MessageQueueThreadSpec spec = MessageQueueThreadSpec.newBackgroundThreadSpec("native_modules");
return builder()
.setJSQueueThreadSpec(MessageQueueThreadSpec.newBackgroundThreadSpec("js"))
.setNativeModulesQueueThreadSpec(spec)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;

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

public DismissableDatePickerDialog(
Expand All @@ -46,13 +40,6 @@ public DismissableDatePickerDialog(
fixSpinner(context, year, monthOfYear, dayOfMonth);
}

@Override
protected void onStop() {
// do *not* call super.onStop() on KitKat on lower, as that would erroneously call the
// OnDateSetListener when the dialog is dismissed, or call it twice when "OK" is pressed.
super.onStop();
}

private void fixSpinner(Context context, int year, int month, int dayOfMonth) {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.N) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected void doInBackgroundGuarded(Void... params) {
}

/**
* Instantiating CookieManager in KitKat+ will load the Chromium task taking a 100ish ms so we do
* Instantiating CookieManager will load the Chromium task taking a 100ish ms so we do
* it lazily to make sure it's done on a background thread as needed.
*/
private @Nullable CookieManager getCookieManager() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ private static Drawable getDefaultThemeDrawable(Context context) {
}

private static RippleDrawable getRippleDrawable(
Context context, ReadableMap drawableDescriptionDict) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
throw new JSApplicationIllegalArgumentException(
"Ripple drawable is not available on android API <21");
}
Context context, ReadableMap drawableDescriptionDict) {
int color = getColor(context, drawableDescriptionDict);
Drawable mask = getMask(drawableDescriptionDict);
ColorStateList colorStateList =
Expand Down

0 comments on commit dd4298a

Please sign in to comment.