Граф коммитов

2829 Коммитов

Автор SHA1 Сообщение Дата
Emily Janzer b8cb8d50a5 Update copyright for yoga files
Summary: Appeasing lint

Reviewed By: hramos

Differential Revision: D9819535

fbshipit-source-id: 0080f17a62291291a0ea90942af4b38588e9057f
2018-10-05 18:48:50 -07:00
Marc Horowitz bb9b9a8b9d When converting arguments JS->Java, handle integers correctly
Summary:
If a folly::dynamic contains a double when a Java method is
declared to take an int, getInt() will be called, and a C++ exception
will be thrown.  This change uses similar logic to
NativeReadableMap.getInt() to convert a folly::dynamic double to a
jint.  This will still throw an exception if the JS value cannot be
represented as a jint without loss.

Reviewed By: fromcelticpark

Differential Revision: D10209492

fbshipit-source-id: fd96416200c6b283ce5c8f8fa4c227ceb8f43054
2018-10-05 16:21:33 -07:00
Emily Janzer c5186aeb46 Simplify OSS enums
Summary: Simplifying our OSS enums (remove private variables and methods) so that redex can more easily optimize them for us.

Reviewed By: achen1, Feng23

Differential Revision: D9812796

fbshipit-source-id: 11a8272db41ff04399d1cdf366e28ddf1b07b7be
2018-10-03 18:47:39 -07:00
Andrew Chen (Eng) fa6035bda6 Fix accessibility role/label
Summary: D10138128 had some shamefully wrong boolean logic to determine whether we should customize the accessibility delegate. Previously, we did it if BOTH the accessibility label AND role were present. We should actually do it if EITHER are present.

Reviewed By: mdvacca

Differential Revision: D10182135

fbshipit-source-id: 209a8ab43f5869762843fe878cfd59a7b9b5ab1a
2018-10-03 18:40:12 -07:00
Ram N 7f6254be43 Cache the instance of `ChoreographerCompat`
Summary:
Since `ChoreographerCompat.getInstance()` is a singleton, we cache its instance.

This will be important in a subsequent diff where we ensure that `ChoreographerCompat.getInstance()` is only called on the UI thread

Reviewed By: achen1

Differential Revision: D9169298

fbshipit-source-id: 2067a50770dd41f5b1a12b62b6a9f8fea83d91e8
2018-10-03 13:40:36 -07:00
Ram N a5f3571770 Refactor the usages of ChoreographerCompat
Summary:
Reducing the places where we directly access `ChoreographerCompat.getInstance()`.

Since this is a singleton anyway, there was no need to pass this as an argument. In subsequent diffs, we will also ensure that `ChoreographerCompat.getInstance()` runs on the UI thread, so that the `Choreographer` it gets is based on the `Looper` of the main thread.

Reviewed By: achen1

Differential Revision: D10136624

fbshipit-source-id: ad18f7b61eb8b05094aff310f2eb90eb225427dc
2018-10-03 13:40:35 -07:00
Ram N 8b487d4d5a Create Handler lazily in DevServerHelper
Summary: Creating this Handler in the constructor implies that the constructor needs to run on the UI Thread. Since DevSupportManager is also initialized with ReactInstanceManager,

Reviewed By: mdvacca

Differential Revision: D10094981

fbshipit-source-id: b724b05ddbd6af68da1111a1a004491835f7a35a
2018-10-03 09:19:14 -07:00
David Vacca 001b04f983 Cleanup FabricBinding class
Summary: This diff removes unused method on the FabricBinding class, these methods were being used as part of the Fabric Android implementation, but they are not necessary anymore.

Reviewed By: shergin

Differential Revision: D10128636

fbshipit-source-id: 5afef4c2e9f4955af008200c5bdd2b6acc7ef333
2018-10-02 15:09:05 -07:00
David Vacca 9e7d918365 Introduce EventBeatManager and enable events
Summary: This diff introduces the concept of EventBeatManager, this is a class that acts as a proxy between the list of EventBeats registered in C++ and the Android side.

Reviewed By: shergin

Differential Revision: D10127857

fbshipit-source-id: a1956ca42d4c470fbc11cc9f30336a182fe7910c
2018-10-02 15:09:04 -07:00
Andrew Chen (Eng) 5be0dff433 Avoid view manager class loads (take 2)
Summary:
Second attempt at landing D9930713. Notes about the previous issue is mentioned as an inline comment below.

===========

We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit.

Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name)

Reviewed By: axe-fb

Differential Revision: D10118711

fbshipit-source-id: 78de8f34db364a64f5ce6af70e3d8691353b0d4d
2018-10-02 14:03:24 -07:00
Andrew Chen (Eng) d3f2f96f93 Fix default accessibility delegate
Summary:
The current accessibility implementation tries to generalize every view's accessibility node info by setting an accessibility delegate on every view -- regardless of whether or not any accessibility properties are set. This delegate however doesn't correctly set the appropriate accessibility node fields for every view. For example, ScrollViews needs AccessibilityNode.setScrollable(true) set, but the generic delegate does not account for this. For now let's avoid unnecessarily
setting an accessibility delegate on views that don't have any accessibility props set, which will likely fix the majority of these issues.

Reviewed By: mdvacca

Differential Revision: D10138128

fbshipit-source-id: b999b41e7256e3dce94cd70e9b944979d52f74fd
2018-10-01 18:47:29 -07:00
Andrew Chen (Eng) 4ac500a337 Don't access ReadableNativeArray on UI thread
Summary: ReadableNativeArray initializes the ReactBridge which loads a bunch of c++ classes. Let's avoid doing this on the UI thread.

Reviewed By: mdvacca

Differential Revision: D10108380

fbshipit-source-id: ab4520535288ce450a865952e996b716d571df7f
2018-10-01 16:49:10 -07:00
Alexander Khaylo 4768bea0cf Fix CameraRoll.getPhotos() crash on Android if device has a problematic video asset (#21438)
Summary:
Changed catching IOException to Exception
Fixes #20112
Pull Request resolved: https://github.com/facebook/react-native/pull/21438

Differential Revision: D10132453

Pulled By: hramos

fbshipit-source-id: c68fa8c45d43e4f2d116b8084ffd731ad6bf5aec
2018-10-01 14:32:27 -07:00
Ram N ee74135a46 Add tracing to when SO libraries are loaded
Summary:
Currently, loading SO libraries is pretty expensive. While they are triggered due to accessing `ReadableNativeArray`. However, with preloader experiments, this block seems to move around and is loaded when the first dependent class loads it.

Also, as a part of D10108380, this will be moved again.

Adding a trace to keep track of where it moves.

Reviewed By: achen1

Differential Revision: D9890280

fbshipit-source-id: 4b331ef1d7e824935bf3708442537349d2d631d0
2018-10-01 14:08:29 -07:00
Héctor Ramos e28d8f6eeb Fix copyright headers
Summary:
Update several files to use the proper copyright header:

```
//  Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
```

In the case of Xcode project files, I used the shortform version, `Copyright (c) Facebook, Inc. and its affiliates.`

Reviewed By: axe-fb

Differential Revision: D10114529

fbshipit-source-id: a1f2d5a46d04797c1cf281ea9ab80d3a2caa6fb4
2018-09-28 17:33:12 -07:00
chenwenyu ea53727e16 Android: fix cookies lost on Android 5.0 and above (#19770)
Summary:
This fixes cookie missing bug on Android 5.0 and above.
On Android 5.0 and above, after the app successfully obtains the cookie, you kills the App within 30 seconds and restarts the App. It accesses the interface that needs to carry the cookie and finds that the cookie does not exist.

Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior.

Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior.

[ANDROID] [BUGFIX] [Cookie] - Fix cookies lost on Android 5.0 and above
Pull Request resolved: https://github.com/facebook/react-native/pull/19770

Differential Revision: D10114102

Pulled By: hramos

fbshipit-source-id: 5b4766f02f70541fd46ac5db36f1179fe386ac7a
2018-09-28 16:02:35 -07:00
Artur Chrusciel af181fb192 Check if child view != null before dropping (#20465)
Summary:
Fixes our top crash when framework try drop a view from parent, but it's a null (already removed etc.).

Fixes #20288
Pull Request resolved: https://github.com/facebook/react-native/pull/20465

Differential Revision: D10113976

Pulled By: hramos

fbshipit-source-id: 34f5654f3bdbc63eb7f7d0b5c94885576fc3cdcd
2018-09-28 15:47:25 -07:00
Andrew Chen (Eng) e082a61324 Revert D9930713: Avoid view manager class loads
Differential Revision:
D9930713

Original commit changeset: 4aa013f8398d

fbshipit-source-id: 1fed02b41fa9d91f54d1a19f710bdb666701a4a0
2018-09-28 15:20:35 -07:00
Timothy Kukulski 97f0e43710 allow zero offset when shadow radius is nonzero
Summary:
update creation logic for text shadow: allow shadows with zero offset when the radius is nonzero

(?should we also add a check to drop the node as a no-op when color.alpha == 0 ?)

Reviewed By: yungsters

Differential Revision: D10017778

fbshipit-source-id: 0168ac6db5ad22a5d7eb32dcd184aede361d6651
2018-09-28 13:02:20 -07:00
Krzysztof Magiera 02ad56f541 Expose a getter for overflow setting in ReactViewGroup (#21398)
Summary:
This change adds getter for overflow attribute in ReactViewGroup class. Overflow setting can affect how view children are drawn but also how hit testing behaves when receiving touch. Exposing this setting makes it possible for gesture-handler library to implement proper hit testing that takes into account overflow property of a view.
Pull Request resolved: https://github.com/facebook/react-native/pull/21398

Differential Revision: D10105398

Pulled By: shergin

fbshipit-source-id: 15ae2b31be3bf80e7e1d28b87ce4474af0f486f5
2018-09-28 09:36:54 -07:00
Andrew Chen (Eng) 95174d4ea8 Avoid view manager class loads
Summary:
We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit.

Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name)

Reviewed By: TheSavior

Differential Revision: D9930713

fbshipit-source-id: 4aa013f8398d4f51b7eef07937d2977ba1950726
2018-09-27 16:03:24 -07:00
Andrew Chen (Eng) 230b7b0e72 Introduce ReactNativeConfiguration to manage experimentation
Summary: Similar to ComponentsConfiguration used by Litho. Allows us to abtest without having to pipe everything through ReactInstanceManager

Reviewed By: axe-fb

Differential Revision: D9930707

fbshipit-source-id: 43edf7d8fa2bab7b7888df57ea1bec2b4726f51b
2018-09-27 16:03:23 -07:00
Andrew Chen (Eng) aac7c4d5d2 Refactor UIManager view manager accesses
Summary: Replaced each view manager access with a getViewManager() function call. This will later be used to lazily load view manager classes by allowing java to avoid sending the entire list of view managers to JS.

Reviewed By: QueryConnectionException

Differential Revision: D9695788

fbshipit-source-id: 949858aa2f0b0b00b68e260461ba8f1d085cf07f
2018-09-27 16:03:22 -07:00
Sergei Dryganets 748cf82c97 Rounded corner rendering fixed on Android N. (#21340)
Summary:
On Android N (API 24) rounded corners rendering has issues in case scale factor is set for the view.
Pull Request resolved: https://github.com/facebook/react-native/pull/21340

Differential Revision: D10084318

Pulled By: hramos

fbshipit-source-id: 53ae5a32b96cc7ee7eba084330682239d8beb85d
2018-09-27 08:17:21 -07:00
Ram N 62829a7a69 Initialize getConstantsForViewManagers eagerly
Summary: During the JS run, the view managers used on a React Native screen eventually call the native methods for `UIManagerModule.getConstantsForViewMangers(viewManagerName)`. This blocks the JS thread. This diff tries to cache the values of those calls and return them when JS needs it, ensuring that JS is not blocked as much.

Reviewed By: achen1

Differential Revision: D9985817

fbshipit-source-id: 36feabc8a386956f8a6474f6e7978285d31f24dd
2018-09-26 18:17:13 -07:00
David Aurelio 6bcc1dfcc8 Set up Yoga experiment
Reviewed By: priteshrnandgaonkar

Differential Revision: D9943869

fbshipit-source-id: 6b6550f453ab4e0ab8305401b299f2d0ed415f72
2018-09-25 15:48:03 -07:00
David Aurelio 27a3bdb886 Adapt methods for fast calls
Summary:
Changes all possible native JNI methods to critical methods.

For now, this only changes Android up and including v7. In order to be prepared for the `CriticalNative` annotation in Android v8, the following restrictions apply:

- Qualifying methods must be static (this is also enforced for Dalvik / Android v4)
- Method implementations can only consume primitive JNI types (`boolean`, jchar`, etc.)

Reviewed By: priteshrnandgaonkar

Differential Revision: D9943868

fbshipit-source-id: 728817eb37822b717fd3daf94cd9f02b42c17db6
2018-09-25 15:48:03 -07:00
David Aurelio ee6c1ecef0 Make native method binding configurable
Summary:
Moves binding of native methods into a separate native method that can be parameterized.

This will be used to experiment with JNI-related technology.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9943870

fbshipit-source-id: 661f15537d5bbf7a3eef7717e3d99fed2de23904
2018-09-25 15:48:03 -07:00
Matias Colotto 201f2f189f ReactScrollView should account for `overflow: scroll`
Summary:
Support for `overflow: visible` was recently added to Android ScrollView.
However, it didn't account for `overflow: scroll` and changed the behavior, causing content to render
when before it would be clipped.

Reviewed By: achen1

Differential Revision: D10036807

fbshipit-source-id: e44a79b18eecbc7d64621f7cf5d800a00a121b13
2018-09-25 15:04:01 -07:00
Andrew Chen (Eng) 59aada873e Remove overflow hidden killswitch
Summary: There hasn't been any reports of overflow issues since the last issue was fixed in v183 (July 30th). Let's remove this flag

Reviewed By: yungsters

Differential Revision: D10020006

fbshipit-source-id: 593c7d2c2bef5f0bd60d5de1941cd58f7fd6ccc7
2018-09-25 11:52:19 -07:00
David Vacca b41ce43c07 Move folder and packages from 'fabricxx' to 'fabric'
Summary: This diff renames fabricxx into fabric

Reviewed By: achen1

Differential Revision: D10013410

fbshipit-source-id: 75d73ace6957d706d39bb87118140bb642bed747
2018-09-25 02:30:04 -07:00
David Vacca a5f1d79adf Move fabric dependecies out of OSS instrumentation tests (#21306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/21306

This diff moves fabric dependencies out of OSS instrumentation tests (js/react-native-github/ReactAndroid/src/androidTest/java/com/facebook/react/testing/BUCK), this will un-break build of OSS project in CI.

Reviewed By: rsnara

Differential Revision: D10020517

fbshipit-source-id: e2cf23afeeecf4cfb41345742f59c16af6b108d0
2018-09-25 02:30:04 -07:00
gengjiawen 0a2825f8b3 add x86_64 arm64-v8a support. Fixes #2814 (#18754)
Summary:
add arm64 support, related issue : https://github.com/facebook/react-native/issues/2814.
If we are okay with binary aar android-jsc, then the pr can be directly merged. Otherwise merge facebook/android-jsc#30 first and do a new release.

RNTester all variant works. You can also test the apk from here: https://github.com/gengjiawen/react-native/releases/tag/v0.56beta.

https://github.com/facebook/android-jsc/pull/30.

 [ANDROID] [ENHANCEMENT] [ABI] - add x86_64 arm64-v8a support.

Differential Revision: D9491481

Pulled By: hramos

fbshipit-source-id: d6ec6992768eb0c0866a0317273e09fae5b8935e
2018-09-24 11:32:56 -07:00
David Vacca ef863c0679 Remove unused parameters in ReactInstanceManager methods
Summary: Just a small diff to remove some unused parameters in some methods of the ReactInstnaceManager class

Reviewed By: achen1

Differential Revision: D10011168

fbshipit-source-id: 2247ecd01bfc63c27837c6abad4bff1b4e590ac0
2018-09-24 11:17:59 -07:00
Oleg Lokhvitsky e0170a9445 Android ScrollView fix for pagingEnabled
Summary:
The snapToOffsets changes improved the flinging algorithm for snapToInterval/snapToOffsets but actually broke it for pagingEnabled because it's meant to only scroll one page at a time.

First, I just brough back the old algorithm, but noticed that it has a bunch of issues (e.g. #20155). So, I tried to improve the algorithm to make sure it uses the proper target offset prediction using the same physics model that Android uses for it's normal scrolling but still be limited to one page scrolls.

This resolves #21116.

Reviewed By: shergin

Differential Revision: D9945017

fbshipit-source-id: be7d4dfd1140f4c4d32bad93a03812dc80286069
2018-09-24 10:22:23 -07:00
Oleg Lokhvitsky 4af4da9089 Android ScrollView support for `overflow: visible`
Summary:
ScrollView always clipping children on Android even when `overflow: visible` was specified.
This change just omits the clipping during draw if `overflow: visible` is passed in.
The default is not changed (from hidden to visible) in case there is a performance impact.
Android now matches iOS in behavior. This helps with issue #21116 and resolves #14416.

Reviewed By: shergin

Differential Revision: D9952096

fbshipit-source-id: 367afe33ee7ff0fdc5aa1074d239883aa289888a
2018-09-24 10:22:23 -07:00
Kevin Leung 65e4e674fc Android subpixel text (#19043)
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Fixes inconsistency in custom font rendering in android. See explanation below.

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

I tested the following on my physical device (Sony Z5C) and on Android emulator on Mac.
The test app contains various fonts in the AvenirNext family, which are added to the app as `.ttf` format.

Note that the character "thickness" is inconsistent. Some characters looks thicker than other. See the screenshots below as an example:
- Looks thicker: right half of the `g` and `&` as in "Region & Language" (list-view screen)
- Looks thicker: `w` as in `Change Password` (list-view screen)
- Looks vertically compressed: `a` and `e` as in "Message" in the bottom bar (list-view screen)
- Looks thicker: `A`, `N`, `V`, `v` (paragraph screen)
- Looks thinner: `i` (paragraph screen), it leaves extra space on its right hand side

![screenshot_20180427-151129](https://user-images.githubusercontent.com/1103788/39350754-ae9fafe2-4a31-11e8-8835-97280783bb95.png)
![screenshot_20180427-151419](https://user-images.githubusercontent.com/1103788/39350755-aecc9bba-4a31-11e8-8128-2d230f003dfa.png)

Every characters has consistent "weight" and looks nice:

![screenshot_20180427-150835](https://user-images.githubusercontent.com/1103788/39350753-ae698728-4a31-11e8-8a55-4e161c559b95.png)
![screenshot_20180427-151639](https://user-images.githubusercontent.com/1103788/39350756-aef95d44-4a31-11e8-820b-1a7dee77fabe.png)

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

None

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [ENHANCEMENT] [CustomStyleSpan] - Enable subpixel text rendering

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/19043

Differential Revision: D10008155

Pulled By: hramos

fbshipit-source-id: 7fe9bb0f9be80380947ff80eac522e3cfd6b22cf
2018-09-24 02:03:31 -07:00
Krzysztof Ciombor 4d71b1525d Fix event handlers for DPad arrows on Android TV (#21143)
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Fixes #20924
DPad arrow events were missing from `KEY_EVENTS_ACTIONS` which meant that they were not broadcasted by `TVEventHandler`.
Pull Request resolved: https://github.com/facebook/react-native/pull/21143

Differential Revision: D10007851

Pulled By: mdvacca

fbshipit-source-id: 9a03cad249a4a1917975d1de10b6112e69d32a72
2018-09-24 00:47:07 -07:00
Ram N c31f79fe47 Remove class loads for CoreModulesPackage
Summary: CoreModulePackages was following the old way of adding Native Modules to the Array list. This diff changes it to use names instead of class.

Reviewed By: achen1

Differential Revision: D9996803

fbshipit-source-id: a6c3daf2193a2559db0908f9e26e339e03e4f8c7
2018-09-21 21:17:57 -07:00
Janic Duplessis a6f47d46ca Decode gzip body if not handled by okhttp (#21187)
Summary:
When looking at enabling gzip content encoding on Android I stumbled on this old issue where the body content is not decoded. It happens because okhttp only handles gzip decoding if the user does NOT provide an accept-encoding header. This is pretty confusing because on iOS we need to pass the header manually if we want to receive a gzipped response. I think it makes sense to handle the decoding no matter what.

See the comment in code for more details.

Fixed #5297
Pull Request resolved: https://github.com/facebook/react-native/pull/21187

Differential Revision: D9978889

Pulled By: hramos

fbshipit-source-id: b86791fb7d3157f325a0904225d2f63d166080d5
2018-09-20 15:07:02 -07:00
Héctor Ramos 5068dfcad3 Use Android SDK 27 in React Native
Summary:
Upgrade React Native to Android SDK 27 again, following the reversal in D9886607 (68c7999c25).

The SDK 27 is actually available internally in an alternate location that is suitable for use cases like React Native's. For future reference, SDK 28 is also available for use in this location.

Reviewed By: axe-fb

Differential Revision: D9929066

fbshipit-source-id: 9413f891d5587293a30544351340e9407a2dce55
2018-09-20 07:56:23 -07:00
Ram N 8bd570b7ba Initialize Native Modules in a separate thread
Reviewed By: achen1

Differential Revision: D9693326

fbshipit-source-id: 1ccefa4a7a320a6720bbd31f60a96f49ec5f8974
2018-09-19 23:17:34 -07:00
Ram N 0cd3994f1a Channge interface to getNativeModule to use strings instead of classes
Summary: Now that NativeModules are stored based on String keys instead of classnames, the old innterface to getNativeModules(Class moduleInterface) is deprecated. This interface is also incorrect since a native module with the same name may be overridden, causing issues. Getting native modules by name is also similar to what JavaScript does

Reviewed By: achen1

Differential Revision: D9697827

fbshipit-source-id: ff832bd2ea5e1c7cfe7d8c0c3a66f0d755b2c354
2018-09-19 19:53:00 -07:00
David Aurelio 5f31a1082b Support `!`-style fast calls for Android
Summary:
Adds support for `!`-style fast calls in Android versions < 8.

For now, this comes with the following restrictions:

- has to be enabled with a macro
- only supports native functions that return and accept primitive Java types (`jint`, `jdouble`, etc.), and `void`
- this is supposed to map to `CriticalNative` as described in https://source.android.com/devices/tech/dalvik/improvements#faster-native-methods.

Inline documentation in art: http://androidxref.com/6.0.1_r10/xref/art/runtime/jni_internal.cc#2110

Possible follow ups:
- don’t prefix when the Android runtime is too new (to avoid the warning, and future error, see http://androidxref.com/8.1.0_r33/xref/art/runtime/jni_internal.cc#2355)
- shim `CriticalNative` (see https://android.googlesource.com/platform/libcore/+/master/dalvik/src/main/java/dalvik/annotation/optimization/CriticalNative.java)
- test whether we can use `CriticalNative` at all (docs claim classes must be on bootclasspath)
- suppport `FastNative`, i.e. instance methods that can also receive and return `jobject`

Reviewed By: cjhopman

Differential Revision: D9630538

fbshipit-source-id: 0ae86c909b192429d60f8eddb15528cc38610379
2018-09-19 17:32:46 -07:00
David Vacca 6b0512c819 Enable Fabric test using Fabric C++ implementation
Summary:
This diff:
- Disables all tests but one of FabricViewTest
- Disables all tests but one of FabricBenchmarkTest
- Changes ReactAppTestActivity to run with Hermes

The reason there is only one test running in each test class, is because the tear down process of Fabric is still flaky and it produces crashes when restarting RN. We are working on this right now and we will enable the rest of the tests after that's fixed.

Reviewed By: achen1

Differential Revision: D9890700

fbshipit-source-id: a8716481eff15b77bd12b38aaaefd4e282c71f3b
2018-09-19 08:03:21 -07:00
David Vacca 7e7040b7bd Remove Fabric android implementation
Summary: This diff removes the Fabric Android implementation in favor of Fabric C++, as part of another diff I'm going to move the fabricxx package into fabric package

Reviewed By: shergin

Differential Revision: D9841240

fbshipit-source-id: c7922b7bfb9885f33b1f52237ec7cf00c1df96fb
2018-09-19 08:03:20 -07:00
Héctor Ramos 68c7999c25 Downgrade to compileSdkVersion 26
Summary:
Go back to using compileSdkVersion 26 and targetSdkVersion 26, temporarily. We can re-add this once Android SDK 27 becomes available in Facebook's internal repository.

The Android SDK Build Tools 27.0.3 **are** available, so we can continue using those.

Reviewed By: axe-fb

Differential Revision: D9886607

fbshipit-source-id: 6c1c9c1e1309c3a0483cc4c0bd8dcb4a5f29fc7e
2018-09-18 08:02:50 -07:00
David Vacca 9ad193c35b Implement Local Data in Android Fabric C++
Summary: This diff introduces the concept of Local Data in Android Fabric C++ and as an example we uses it to implement Text View.

Reviewed By: shergin

Differential Revision: D9583970

fbshipit-source-id: ab7478b16ef4327ff574ca1467870ab9cb684ea0
2018-09-17 18:49:06 -07:00
David Vacca 5c0da011cb Add support to measure shadow nodes in the FabricUIManager
Summary: In this diff I added support to be able to measure C++ shadowNode in Android. As an example I implemented the measurement of TextViews

Reviewed By: shergin

Differential Revision: D9583972

fbshipit-source-id: 1344782d4c586c94a4576b18a4acfa4775e46952
2018-09-17 18:49:05 -07:00
gengjiawen 4f49404e15 bump android target version to 27 (#20843)
Summary:
bump target version to 27
pass all current ci.
none
[GENERAL] [ANDROID] [FEATURE] - bump android target version to 27
Pull Request resolved: https://github.com/facebook/react-native/pull/20843

Differential Revision: D9845999

Pulled By: hramos

fbshipit-source-id: 3c532a2d5a2b7d201bacab54cf3d60e1efffb653
2018-09-15 05:47:09 -07:00