remove unnecessary Android version checks (#23277)

Summary:
React Native's minSdkVersion is 16, or we support Android versions 16 (Jelly Bean) and above. But in the code we have many checks if Android is Jelly Bean or newer, which are unnecessary. This PR removes unnecessary Android version checks, also uses Android version names instead of numbers.

[Android] [Changes] - remove unnecessary Android version checks
Pull Request resolved: https://github.com/facebook/react-native/pull/23277

Differential Revision: D13955909

Pulled By: cpojer

fbshipit-source-id: 6b1caa5ef4fe42273d3c69a6617fff140a697b5c
This commit is contained in:
Dulmandakh authored and Facebook Github Bot committed 2019-02-05 03:08:16 -08:00
1 parent 9a7fff9eb1
commit 4d95e85f64
18 files changed
+41 -104

No files matched your search

@@ -114,11 +114,7 @@ public class ReactNativeTestRule implements TestRule {
@Override
public void onGlobalLayout() {
if (isLayoutUpdated.get()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} else {
mView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
mView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
mLatch.countDown();
}
}