mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-07 02:08:34 +08:00
Android: add support for headless js tasks
Summary: Provide a base `HeadlessJsTaskService` class that can be extended to run JS in headless mode in response to some event. Added `HeadlessJsTaskEventListener` for modules that are interested in background lifecycle events, and `HeadlessJsTaskContext` that basically extends `ReactContext` without touching it. The react instance is shared with the rest of the app (e.g. activities) through the `ReactNativeHost`. Reviewed By: astreet Differential Revision: D3225753 fbshipit-source-id: 2c5e7679636f31e0e7842d8a67aeb95baf47c563
This commit is contained in:
committed by
Facebook Github Bot
parent
542ab8643e
commit
3080b8d26c
23
ReactAndroid/src/main/java/com/facebook/react/jstasks/BUCK
Normal file
23
ReactAndroid/src/main/java/com/facebook/react/jstasks/BUCK
Normal file
@@ -0,0 +1,23 @@
|
||||
include_defs('//ReactAndroid/DEFS')
|
||||
|
||||
DEPS = [
|
||||
react_native_target('java/com/facebook/react/bridge:bridge'),
|
||||
react_native_target('java/com/facebook/react/common:common'),
|
||||
react_native_target('java/com/facebook/react/uimanager:uimanager'),
|
||||
react_native_dep('libraries/fbcore/src/main/java/com/facebook/common/logging:logging'),
|
||||
react_native_dep('third-party/java/infer-annotations:infer-annotations'),
|
||||
react_native_dep('third-party/java/jsr-305:jsr-305'),
|
||||
]
|
||||
|
||||
android_library(
|
||||
name = 'jstasks',
|
||||
srcs = glob(['*.java']),
|
||||
deps = DEPS,
|
||||
visibility = [
|
||||
'PUBLIC',
|
||||
],
|
||||
)
|
||||
|
||||
project_config(
|
||||
src_target = ':jstasks',
|
||||
)
|
||||
Reference in New Issue
Block a user