Commit Graph

2567 Commits

Author SHA1 Message Date
Héctor Ramos da7873563b Migrate Android sources to MIT license header
Reviewed By: fkgozali

Differential Revision: D8065619

fbshipit-source-id: 719c303b40c96950bab8e5dde9a75f449b2956c6
2018-05-31 15:37:30 -07:00
Himabindu Gadupudi fecfa2a553 Revert D8194925: Fix ART surface sleep issue
Differential Revision:
D8194925

Original commit changeset: 5448d49d9590

fbshipit-source-id: c01e11d44424e1f6fb79866bb845ed60764c5f13
2018-05-31 12:02:54 -07:00
David Vacca 6e359c4589 Initialize Event Emitter as part of UIManagerModule
Reviewed By: achen1

Differential Revision: D8216184

fbshipit-source-id: 3b188804e2dad2b112f566da49a939eb4338713d
2018-05-30 22:06:40 -07:00
David Vacca 0f10e03dd8 Binding for js events
Reviewed By: fkgozali

Differential Revision: D8181616

fbshipit-source-id: 5937c83f22ac09e3041fcb0f8d4e9e3026b2b397
2018-05-30 22:06:40 -07:00
David Vacca 23fbd312aa Include instanceHandle in cloning mechanism
Reviewed By: shergin, achen1

Differential Revision: D8072075

fbshipit-source-id: 2fcfdfa5116850ce0bac6c2c86d87e5bf00fd7f0
2018-05-30 22:06:40 -07:00
David Vacca 40c7248345 store / retrieve instanceHandle from View
Reviewed By: shergin, achen1

Differential Revision: D8074014

fbshipit-source-id: aee0d41e0e9da44e8748f47da04dcd76dbe96d8d
2018-05-30 22:06:40 -07:00
David Vacca 54acf3a431 Deprecate UIManagerModule#getEventDispatcher and refactor usages
Reviewed By: shergin

Differential Revision: D7832079

fbshipit-source-id: 263a2f8ff96ab6e14b91395644710b4d5f36dc50
2018-05-30 22:06:40 -07:00
David Vacca a04ad8d8fb First implementation of scheduleWork method
Reviewed By: shergin

Differential Revision: D7799412

fbshipit-source-id: b78a0bc0e80868f6877a31f862d7e6104fd4a049
2018-05-30 22:06:40 -07:00
David Vacca 58ea20b5e8 Refactor setup of Event Dispatcher
Reviewed By: achen1

Differential Revision: D7746311

fbshipit-source-id: cfee1c2ced6d85477628085f3260496e80ae48c2
2018-05-30 22:06:40 -07:00
David Vacca e61341ba32 Introducing Scheduling of JS calls from native
Reviewed By: achen1

Differential Revision: D7729226

fbshipit-source-id: 9869e0a6a2b0c58b7538836ed2c13a4b28dd8887
2018-05-30 22:06:40 -07:00
Andrew Chen (Eng) 4a9b2a7302 Fix ReactInstanceManager unmountApplication
Reviewed By: mdvacca

Differential Revision: D7945746

fbshipit-source-id: 0c2eed9a623e442fa4a4ff29ffa01f025466c9b6
2018-05-30 15:36:47 -07:00
Andrew Chen (Eng) c6b4f9f2ce Fix TextInput's initial layout measurements
Reviewed By: mdvacca

Differential Revision: D7732819

fbshipit-source-id: 0ca4e5643d2cfefe304d7f189474a671c4bcb31e
2018-05-30 14:59:20 -07:00
Himabindu Gadupudi 5fc42f308a Fix ART surface sleep issue
Summary: Fixes https://github.com/facebook/react-native/issues/17565.

Reviewed By: achen1

Differential Revision: D8194925

fbshipit-source-id: 5448d49d959078eaded697f791e1b382471fabdb
2018-05-30 14:30:37 -07:00
Kenneth Geisshirt 57e7556b8d Fixing link to Android build guide.
Summary:
While browsing the repository, I noticed that the link to how to build for Android has changed. It's a very simple fix.

Verifying that the URL is correct.

None.

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

[DOCS] [BUGFIX] [ReactAndroid/README.md] - Incorrect URL
Closes https://github.com/facebook/react-native/pull/19450

Differential Revision: D8178077

Pulled By: hramos

fbshipit-source-id: 388c35b5322416333681d66ef1b8ca42e9e83151
2018-05-27 15:17:55 -07:00
Andres Suarez d42697bcf3 Run buildifier over BUCK and TARGETS files
Reviewed By: scottrice

Differential Revision: D8163151

fbshipit-source-id: 700a77c09c6ab1bef8fd24a2a3133a4b50e3b3a3
2018-05-25 11:15:59 -07:00
Erik Poort 04028bf216 This ensures no illegal cookies are send to okhttp
Summary:
When a website in a ReactNative WebView sets a cookie with an illegal
character, this cookie will automatically be added to any request to the
same domain.

This happens through:
BridgeInterceptor.java (l.84)
ReactCookieJarContainer.java (l.44)
JavaNetCookieJar.java (l.59)
ForwardingCookieHandler.java (l.57)
ForwardingCookieHandler.java (l.168)
CookieManager.java (l.39)

The BridgeInterceptor.java then tries to set a Cookie header, which
validates both keys and values, and then crashes.
okhttp3.6.0 Headers.java (l.320)

This fix will strip illegal characters from any cookie that is being
passed to the okhttp request.

To demonstrate how to crash the app, you can find an example app here:
https://github.com/erikpoort/react-native-test-illegal-cookie

Or you can load the following url into a webview: https://invalidcookietest.us.dev.monkapps.com/
Press the 'Set cookie' button.
Then try to fetch the same url.

[ANDROID] [BREAKING] [ReactCookieJarContainer.java] - I'm filtering cookies containing illegal characters from any request.
Closes https://github.com/facebook/react-native/pull/18203

Differential Revision: D8164302

Pulled By: hramos

fbshipit-source-id: 6e58461df594eb2c7aad4c7ad70b76d12ac09b84
2018-05-25 11:15:59 -07:00
Josh Hargreaves 41975f75d9 Disable onKeyPress logic when handler not defined
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.
-->

There are some bugs surrounding the use of unicode characters that are causing issues with `onKeyPress` on Android: see https://github.com/facebook/react-native/issues/18405#issuecomment-373624413.
We disable the creation and use of `ReactEditTextInputConnectionWrapper` unless the onKeyPress prop is specified, so that this code is 'opt-in' & not a general regression for every use of the TextInput.
N.B. it seems to introduce a lot of unnecessary code complexity to allow for enabling/disabling the onKeyPress events after a InputConnection has been created in `onCreateInputConnection` when the keyboard focusses (a new input connection is created whenever a TextInput gains focus) so I opted not to for simplicity's sake.

Build & debug RNTest app, verify ReactEditTextInputConnectionWrapper code not executed if onKeyPress function not specified.

<!--
  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!
-->

[ANDROID] [BUGFIX] [TextInput] - Disable TextInput onKeyPress event from being fired unless callback specified.
Closes https://github.com/facebook/react-native/pull/18443

Differential Revision: D8149625

Pulled By: hramos

fbshipit-source-id: cdf28141d71cdedd67a6ef350e3a3b955f97e340
2018-05-25 11:15:59 -07:00
Héctor Ramos 3e0ebc7663 Revert bump to API 26 and fix Android tests failures
Summary:
This reverts a3931e9531

The open source `test_android` job is not configured to use Android 26 quite yet. I've spent a couple of days trying to get our Android tests back in working order, with no luck.

I'm reverting the change that bumped React Native to use build tools 26 + Android SDK 26. I encourage contributors interested in making this change happen to work on getting our Android tests working with API 26.

This will allow us to focus on getting `test_android` back to green, and _then_ we can work on bumping to API 26 while keeping tests green.

Reviewed By: fkgozali

Differential Revision: D8066226

fbshipit-source-id: 9bfd58a7f081c0971b78b331073e70545c21ca6d
2018-05-23 13:06:12 -07:00
Sebastian Markbage 5028d48382 Wire up event handler bindings
Reviewed By: mdvacca

Differential Revision: D8048409

fbshipit-source-id: 5706130607302b4be2287cc303def7c2fb398bc8
2018-05-22 00:12:35 -07:00
David Vacca 3bcfdc4b9f Add more fabric logging information
Reviewed By: fkgozali

Differential Revision: D8084526

fbshipit-source-id: f59c5e60b4814229835a9eaa64bbb45242d04211
2018-05-21 18:16:47 -07:00
Dmitry Zakharov 7c5845a5a2 Remove Native Extensions
Reviewed By: michalgr

Differential Revision: D8057885

fbshipit-source-id: 6af7f7729201d26a704adaadb15813979cd035f8
2018-05-21 12:21:56 -07:00
Dmitry Zakharov 782971f60e Move Native Extensions from JSContext layer to ContextFactory
Reviewed By: michalgr

Differential Revision: D8057886

fbshipit-source-id: 45a63d909169c9a40414de9cd54bdb411f9f595d
2018-05-21 12:21:55 -07:00
Oleg Lokhvitsky 33ffa79a51 Prevent RefreshControl from getting stuck when a parent is scrolled horizontally
Reviewed By: achen1

Differential Revision: D8044763

fbshipit-source-id: 8f3351de13eb17d2937f3b9e76500889398f9c59
2018-05-21 11:12:47 -07:00
Taras Tsugrii 1a7682b2a1 Re-format BUCK to use recommended style.
Reviewed By: yfeldblum

Differential Revision: D8073585

fbshipit-source-id: 12322aebc09b89d5af9cc257b16c1bc0fbb066c1
2018-05-20 23:24:51 -07:00
Sebastian Markbage 6cc597e6e4 Alternative Instance Handle Approach without JSWeakRef
Reviewed By: fkgozali

Differential Revision: D8003736

fbshipit-source-id: 597378555cc3f9c0ae95e8927460a3c813ebfb45
2018-05-18 20:22:45 -07:00
David Vacca 4e1453eb01 Add RTL support for Fabric android rendering
Reviewed By: fkgozali

Differential Revision: D8035223

fbshipit-source-id: 22d702e487fd2c20cd03e5004d904ddfcfbdb55a
2018-05-17 10:22:40 -07:00
David Vacca b1d646a7cd Add extra logging information for ReactShadowNode
Reviewed By: achen1

Differential Revision: D8020040

fbshipit-source-id: c0606eeeb14e89e52f2a0b5537418d88387e4e0a
2018-05-16 18:21:49 -07:00
Héctor Ramos 86b3865bfe Omit Fabric Yoga dependency in OSS
Reviewed By: achen1

Differential Revision: D8036707

fbshipit-source-id: 33c02ae28cecd7d470d0cd968589c65485857f6c
2018-05-16 17:54:59 -07:00
Sebastian Markbage 6c58035ae6 Reuse and clean up JSC class ref bindings
Reviewed By: fkgozali

Differential Revision: D7893634

fbshipit-source-id: de11cb93f9f7e7c935af2da4616671043438363b
2018-05-15 14:46:34 -07:00
Dulmandakh a3931e9531 android compileSdkVersion 26, use buildToolsVersion 26.0.3
Summary:
Starting August 2018, Google Play will require targetSdkVersion 26 for new applications, and November 2018 for application updates.

This PR will use Android build tools 26.0.3 and compilerSdk 26, then support library version 26.0.2 to make targeting 26 easier in the future.

I think this PR will help to people compile and test their applications, thus make transition easier (smoother). Also we'll have opportunity and time to migrate code to target 26.

https://github.com/facebook/react-native/issues/18095

React Native on android must work as usual

Closes https://github.com/facebook/react-native/pull/19257

Differential Revision: D8010354

Pulled By: mdvacca

fbshipit-source-id: 63ba03585e918b38c2a2adb5d2f2e85d7ce46fae
2018-05-15 09:28:41 -07:00
gengjiawen 07df36557c remove fresco proguard rules
Summary:
Fresco now maintain proguard rules by itself (https://github.com/facebook/fresco/pull/2075), so it won't be necessary for react native copy its rules.
Run RNTTester Android app in release mode, app build successful and won't crash in ImageModule.

none

 [ANDROID] [BUGFIX] [PROGUARD] - remove fresco proguard rules
Closes https://github.com/facebook/react-native/pull/19040

Differential Revision: D7992146

Pulled By: hramos

fbshipit-source-id: 9ee3dd4c6756472395ec9e36a967b469f0760999
2018-05-14 11:18:05 -07:00
David Vacca a83cddf037 Refactor isFabric() -> getUIManagerType()
Reviewed By: achen1

Differential Revision: D7897855

fbshipit-source-id: 6b52d989187124c81ab8ee4a732703b46b05dc65
2018-05-14 09:46:25 -07:00
David Vacca 3ac914478d Add support for View Manager commands in Fabric
Reviewed By: achen1

Differential Revision: D7879104

fbshipit-source-id: fd89acb3941bb03364d18ddedf68a081aef934a0
2018-05-14 09:46:23 -07:00
David Vacca dbc9364b21 Fabric FB4A integration
Reviewed By: fkgozali

Differential Revision: D7953706

fbshipit-source-id: 406f8340eb3706dc07dcd32dcfaa5bdc06981aa1
2018-05-11 19:16:14 -07:00
Eli White 36fcbaa56d Prettier the rest of ReactNative
Reviewed By: yungsters

Differential Revision: D7974340

fbshipit-source-id: 5fe457a8a9be4bd360fc3af9acb5c1136b2be0d7
2018-05-11 13:52:30 -07:00
Andrew Chen (Eng) a5a4facac3 Fix ReactShadowNodeTest
Reviewed By: mdvacca

Differential Revision: D7944803

fbshipit-source-id: 6d3b10004d478ad75942af96603c899f44a2e711
2018-05-11 13:00:50 -07:00
Andrew Chen (Eng) 194bd88052 Fix RootViewTest
Reviewed By: fkgozali

Differential Revision: D7944946

fbshipit-source-id: a8dbceba060b22ac4bc4728fb342372c437a0733
2018-05-11 11:17:31 -07:00
Marc Horowitz a810e6875f move nativeLoggingHook into AndroidJSCFactory
Reviewed By: fromcelticpark

Differential Revision: D7803905

fbshipit-source-id: 797f5250a4a129a8dff3fb447c01837d68bea452
2018-05-09 22:12:03 -07:00
Marc Horowitz a363a7b501 Refactor ReactMarker out of Platform
Reviewed By: fromcelticpark

Differential Revision: D7803908

fbshipit-source-id: 957e80519c209732b163ece2bccb7c8c36ff8107
2018-05-09 22:12:03 -07:00
Marc Horowitz 042449f24a simplify handleMemoryPressure conditionalization, delete some dead code
Reviewed By: javache

Differential Revision: D7803912

fbshipit-source-id: 0bab4be07fc006a208caa75f94b5716c99b5d265
2018-05-09 22:12:03 -07:00
Marc Horowitz d1d09c208a Remove unused JS Sampling Profiler code
Reviewed By: cwdick

Differential Revision: D7803915

fbshipit-source-id: 3edb42d449ff7b272f7d25ac8f16a646839f8c20
2018-05-09 22:12:02 -07:00
Marc Horowitz ef258b0106 Remove unnecessary #includes to reduce dependencies
Reviewed By: davidaurelio

Differential Revision: D7803909

fbshipit-source-id: 2ccafdbfcb786c4c5f703714fb0c92cda1026cef
2018-05-09 22:12:02 -07:00
Andrew Jack 16b955bd1f Fix Android modal crash: android.view.WindowManager$BadTokenException
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 a crash with the Android Dialog. This occurs when the Activity is finishing or has been removed and React Native requests the modal to be shown.

Stacktrace here:
```
Caused by android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@f125ea3 is not valid; is your activity running?
       at android.view.ViewRootImpl.setView(ViewRootImpl.java:683)
       at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:319)
       at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:85)
       at android.app.Dialog.show(Dialog.java:326)
       at com.facebook.react.views.modal.ReactModalHostView.showOrUpdate(ReactModalHostView.java:256)
       at com.facebook.react.views.modal.ReactModalHostManager.onAfterUpdateTransaction(ReactModalHostManager.java:107)
       at com.facebook.react.views.modal.ReactModalHostManager.onAfterUpdateTransaction(ReactModalHostManager.java:28)
       at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:35)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:233)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:153)
       at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:816)
       at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:929)
       at com.facebook.react.uimanager.UIViewOperationQueue.access$2100(UIViewOperationQueue.java:47)
       at com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded(UIViewOperationQueue.java:887)
       at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:21)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at android.os.Looper.loop(Looper.java:207)
       at android.app.ActivityThread.main(ActivityThread.java:5728)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
```

Related issues: #18570 & #18634

mdvacca added to this file in e5c2a66897
Doesn't look like the issue was introduced in the above change, but it masks the issue. The wrapping if block should not allow a null activity to display a dialog.

<!--
  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!
-->

Run sample app on Android and display dialog when app is about to close.

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

[ANDROID] [BUGFIX] [Modal] - Fix Android BadTokenException crash

<!--
  **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
-->
Closes https://github.com/facebook/react-native/pull/18996

Differential Revision: D7938147

Pulled By: hramos

fbshipit-source-id: f4ffd1746304d6184d727339072a7e926ffdaf39
2018-05-09 13:29:39 -07:00
Andrew Chen (Eng) 1be2541ce2 Add assertion to ensure copied shadow nodes are of the same type as the original
Reviewed By: mdvacca

Differential Revision: D7664638

fbshipit-source-id: e1b7acbafd8a8fd9d6301d8afbb3e5959dc15b7a
2018-05-07 14:55:33 -07:00
Andrew Chen (Eng) 30d06b4286 Better error messages for ReadableNativeMap ClassCastExceptions
Reviewed By: mdvacca

Differential Revision: D7800266

fbshipit-source-id: 3fa224d3adc54a7bc59a6a37b9ad6928ac33ceb6
2018-05-07 12:26:05 -07:00
David Vacca 23f8f7aecb Breaking Change: Restrict WebView to only manage navigation of whitelisted URLs: http(s) by default
Reviewed By: achen1

Differential Revision: D7834050

fbshipit-source-id: 80f7fd3cd20979590b75804819e154afc14a3c64
2018-05-04 23:18:14 -07:00
David Vacca 1e68ca7dc8 Cleanup android warnings related to static interface declarations
Reviewed By: fkgozali

Differential Revision: D7853681

fbshipit-source-id: d342e9dc9a1efa921d1421d545798e0b706745b4
2018-05-04 18:00:02 -07:00
David Vacca b7562818e6 Add molly dependency in Fabric/jsc/jni project
Reviewed By: fkgozali

Differential Revision: D7816676

fbshipit-source-id: 8f227482eb1129f51d758bc13e619af30d6c2b1f
2018-05-04 18:00:02 -07:00
Andrew Chen (Eng) 5a6147c4f8 Fix DevLoadingViewController
Reviewed By: mdvacca

Differential Revision: D7860219

fbshipit-source-id: 3770a2064808bf4ae4c61f15c6d68c3b93fe9f38
2018-05-03 13:03:53 -07:00
David Aurelio 786c1ecc2a Markers: add info about type of delta client
Summary: Adds information which type of delta client is used (if at all) to the `BundleInfo` object.

Reviewed By: fromcelticpark

Differential Revision: D7845139

fbshipit-source-id: e4bf6cda62c71a78aaff97aa69daec263e6d3cdf
2018-05-03 08:47:47 -07:00