Java Code Examples for com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener

The following are top voted examples for showing how to use com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: RNLearn_Project1   File: CatalystInstanceImpl.java   View source code 6 votes vote down vote up
private void incrementPendingJSCalls() {
  int oldPendingCalls = mPendingJSCalls.getAndIncrement();
  boolean wasIdle = oldPendingCalls == 0;
  Systrace.traceCounter(
      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
      mJsPendingCallsTitleForTrace,
      oldPendingCalls + 1);
  if (wasIdle && !mBridgeIdleListeners.isEmpty()) {
    mNativeModulesQueueThread.runOnQueue(new Runnable() {
      @Override
      public void run() {
        for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
          listener.onTransitionToBridgeBusy();
        }
      }
    });
  }
}
 
Example 2
Project: RNLearn_Project1   File: CatalystInstanceImpl.java   View source code 6 votes vote down vote up
private void decrementPendingJSCalls() {
  int newPendingCalls = mPendingJSCalls.decrementAndGet();
  // TODO(9604406): handle case of web workers injecting messages to main thread
  //Assertions.assertCondition(newPendingCalls >= 0);
  boolean isNowIdle = newPendingCalls == 0;
  Systrace.traceCounter(
      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
      mJsPendingCallsTitleForTrace,
      newPendingCalls);

  if (isNowIdle && !mBridgeIdleListeners.isEmpty()) {
    mNativeModulesQueueThread.runOnQueue(new Runnable() {
      @Override
      public void run() {
        for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
          listener.onTransitionToBridgeIdle();
        }
      }
    });
  }
}
 
Example 3
Project: RNLearn_Project1   File: CatalystInstanceImpl.java   View source code 6 votes vote down vote up
private void incrementPendingJSCalls() {
  int oldPendingCalls = mPendingJSCalls.getAndIncrement();
  boolean wasIdle = oldPendingCalls == 0;
  Systrace.traceCounter(
      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
      mJsPendingCallsTitleForTrace,
      oldPendingCalls + 1);
  if (wasIdle && !mBridgeIdleListeners.isEmpty()) {
    mNativeModulesQueueThread.runOnQueue(new Runnable() {
      @Override
      public void run() {
        for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
          listener.onTransitionToBridgeBusy();
        }
      }
    });
  }
}
 
Example 4
Project: RNLearn_Project1   File: CatalystInstanceImpl.java   View source code 6 votes vote down vote up
private void decrementPendingJSCalls() {
  int newPendingCalls = mPendingJSCalls.decrementAndGet();
  // TODO(9604406): handle case of web workers injecting messages to main thread
  //Assertions.assertCondition(newPendingCalls >= 0);
  boolean isNowIdle = newPendingCalls == 0;
  Systrace.traceCounter(
      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
      mJsPendingCallsTitleForTrace,
      newPendingCalls);

  if (isNowIdle && !mBridgeIdleListeners.isEmpty()) {
    mNativeModulesQueueThread.runOnQueue(new Runnable() {
      @Override
      public void run() {
        for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
          listener.onTransitionToBridgeIdle();
        }
      }
    });
  }
}
 
Example 5
Project: Ironman   File: CatalystInstanceImpl.java   View source code 6 votes vote down vote up
/**
 * Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration
 * (besides the UI thread) to finish running. Must be called from the UI thread so that we can
 * fully shut down other threads.
 */
@Override
public void destroy() {
  UiThreadUtil.assertOnUiThread();

  if (mDestroyed) {
    return;
  }

  // TODO: tell all APIs to shut down
  mDestroyed = true;
  mHybridData.resetNative();
  mJavaRegistry.notifyCatalystInstanceDestroy();
  boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0);
  if (!wasIdle && !mBridgeIdleListeners.isEmpty()) {
    for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
      listener.onTransitionToBridgeIdle();
    }
  }

  // This is a noop if the listener was not yet registered.
  Systrace.unregisterListener(mTraceListener);
}
 
Example 6
Project: Ironman   File: CatalystInstanceImpl.java   View source code 6 votes vote down vote up
private void decrementPendingJSCalls() {
  int newPendingCalls = mPendingJSCalls.decrementAndGet();
  // TODO(9604406): handle case of web workers injecting messages to main thread
  //Assertions.assertCondition(newPendingCalls >= 0);
  boolean isNowIdle = newPendingCalls == 0;
  Systrace.traceCounter(
      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
      mJsPendingCallsTitleForTrace,
      newPendingCalls);

  if (isNowIdle && !mBridgeIdleListeners.isEmpty()) {
    for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
      listener.onTransitionToBridgeIdle();
    }
  }
}
 
Example 7
Project: RNLearn_Project1   File: CatalystInstanceImpl.java   View source code 5 votes vote down vote up
/**
 * Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration
 * (besides the UI thread) to finish running. Must be called from the UI thread so that we can
 * fully shut down other threads.
 */
@Override
public void destroy() {
  UiThreadUtil.assertOnUiThread();

  if (mDestroyed) {
    return;
  }

  // TODO: tell all APIs to shut down
  mDestroyed = true;
  mNativeModulesQueueThread.runOnQueue(new Runnable() {
    @Override
    public void run() {
      mJavaRegistry.notifyJSInstanceDestroy();
      boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0);
      if (!wasIdle && !mBridgeIdleListeners.isEmpty()) {
        for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
          listener.onTransitionToBridgeIdle();
        }
      }
      mHybridData.resetNative();
    }
  });

  // This is a noop if the listener was not yet registered.
  Systrace.unregisterListener(mTraceListener);
}
 
Example 8
Project: RNLearn_Project1   File: CatalystInstanceImpl.java   View source code 5 votes vote down vote up
/**
 * Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration
 * (besides the UI thread) to finish running. Must be called from the UI thread so that we can
 * fully shut down other threads.
 */
@Override
public void destroy() {
  UiThreadUtil.assertOnUiThread();

  if (mDestroyed) {
    return;
  }

  // TODO: tell all APIs to shut down
  mDestroyed = true;
  mNativeModulesQueueThread.runOnQueue(new Runnable() {
    @Override
    public void run() {
      mJavaRegistry.notifyJSInstanceDestroy();
      boolean wasIdle = (mPendingJSCalls.getAndSet(0) == 0);
      if (!wasIdle && !mBridgeIdleListeners.isEmpty()) {
        for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
          listener.onTransitionToBridgeIdle();
        }
      }
      mHybridData.resetNative();
    }
  });

  // This is a noop if the listener was not yet registered.
  Systrace.unregisterListener(mTraceListener);
}
 
Example 9
Project: ReactNativeSignatureExample   File: ReactInstanceManagerImpl.java   View source code 5 votes vote down vote up
ReactInstanceManagerImpl(
    Context applicationContext,
    @Nullable String jsBundleFile,
    @Nullable String jsMainModuleName,
    List<ReactPackage> packages,
    boolean useDeveloperSupport,
    @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
    LifecycleState initialLifecycleState,
    UIImplementationProvider uiImplementationProvider,
    NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
    @Nullable JSCConfig jscConfig) {
  initializeSoLoaderIfNecessary(applicationContext);

  // TODO(9577825): remove this
  ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
  setDisplayMetrics(applicationContext);

  mApplicationContext = applicationContext;
  mJSBundleFile = jsBundleFile;
  mJSMainModuleName = jsMainModuleName;
  mPackages = packages;
  mUseDeveloperSupport = useDeveloperSupport;
  mDevSupportManager = DevSupportManagerFactory.create(
      applicationContext,
      mDevInterface,
      mJSMainModuleName,
      useDeveloperSupport);
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  mLifecycleState = initialLifecycleState;
  mUIImplementationProvider = uiImplementationProvider;
  mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
  mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
  mJSCConfig = jscConfig;
}
 
Example 10
Project: react-native-ibeacon-android   File: ReactInstanceManagerImpl.java   View source code 5 votes vote down vote up
ReactInstanceManagerImpl(
    Context applicationContext,
    @Nullable String jsBundleFile,
    @Nullable String jsMainModuleName,
    List<ReactPackage> packages,
    boolean useDeveloperSupport,
    @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
    LifecycleState initialLifecycleState,
    UIImplementationProvider uiImplementationProvider,
    NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
    @Nullable JSCConfig jscConfig) {
  initializeSoLoaderIfNecessary(applicationContext);

  // TODO(9577825): remove this
  ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
  setDisplayMetrics(applicationContext);

  mApplicationContext = applicationContext;
  mJSBundleFile = jsBundleFile;
  mJSMainModuleName = jsMainModuleName;
  mPackages = packages;
  mUseDeveloperSupport = useDeveloperSupport;
  mDevSupportManager = DevSupportManagerFactory.create(
      applicationContext,
      mDevInterface,
      mJSMainModuleName,
      useDeveloperSupport);
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  mLifecycleState = initialLifecycleState;
  mUIImplementationProvider = uiImplementationProvider;
  mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
  mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
  mJSCConfig = jscConfig;
}
 
Example 11
Project: react-native-box-loaders   File: ReactInstanceManagerImpl.java   View source code 5 votes vote down vote up
ReactInstanceManagerImpl(
    Context applicationContext,
    @Nullable Activity currentActivity,
    @Nullable DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler,
    @Nullable String jsBundleFile,
    @Nullable String jsMainModuleName,
    List<ReactPackage> packages,
    boolean useDeveloperSupport,
    @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
    LifecycleState initialLifecycleState,
    UIImplementationProvider uiImplementationProvider,
    NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
    @Nullable JSCConfig jscConfig) {
  initializeSoLoaderIfNecessary(applicationContext);

  // TODO(9577825): remove this
  ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
  setDisplayMetrics(applicationContext);

  mApplicationContext = applicationContext;
  mCurrentActivity = currentActivity;
  mDefaultBackButtonImpl = defaultHardwareBackBtnHandler;
  mJSBundleFile = jsBundleFile;
  mJSMainModuleName = jsMainModuleName;
  mPackages = packages;
  mUseDeveloperSupport = useDeveloperSupport;
  mDevSupportManager = DevSupportManagerFactory.create(
      applicationContext,
      mDevInterface,
      mJSMainModuleName,
      useDeveloperSupport);
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  mLifecycleState = initialLifecycleState;
  mUIImplementationProvider = uiImplementationProvider;
  mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
  mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
  mJSCConfig = jscConfig;
}
 
Example 12
Project: Ironman   File: CatalystInstanceImpl.java   View source code 5 votes vote down vote up
private void incrementPendingJSCalls() {
  int oldPendingCalls = mPendingJSCalls.getAndIncrement();
  boolean wasIdle = oldPendingCalls == 0;
  Systrace.traceCounter(
      Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
      mJsPendingCallsTitleForTrace,
      oldPendingCalls + 1);
  if (wasIdle && !mBridgeIdleListeners.isEmpty()) {
    for (NotThreadSafeBridgeIdleDebugListener listener : mBridgeIdleListeners) {
      listener.onTransitionToBridgeBusy();
    }
  }
}
 
Example 13
Project: RNLearn_Project1   File: ReactInstanceManager.java   View source code 4 votes vote down vote up
ReactInstanceManager(
  Context applicationContext,
  @Nullable Activity currentActivity,
  @Nullable DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler,
  @Nullable JSBundleLoader bundleLoader,
  @Nullable String jsMainModuleName,
  List<ReactPackage> packages,
  boolean useDeveloperSupport,
  @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
  LifecycleState initialLifecycleState,
  UIImplementationProvider uiImplementationProvider,
  NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
  JSCConfig jscConfig,
  @Nullable RedBoxHandler redBoxHandler,
  boolean lazyNativeModulesEnabled,
  boolean lazyViewManagersEnabled,
  boolean useStartupThread) {

  initializeSoLoaderIfNecessary(applicationContext);

  // TODO(9577825): remove this
  ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
  DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(applicationContext);

  mApplicationContext = applicationContext;
  mCurrentActivity = currentActivity;
  mDefaultBackButtonImpl = defaultHardwareBackBtnHandler;
  mBundleLoader = bundleLoader;
  mJSMainModuleName = jsMainModuleName;
  mPackages = packages;
  mUseDeveloperSupport = useDeveloperSupport;
  mDevSupportManager = DevSupportManagerFactory.create(
      applicationContext,
      mDevInterface,
      mJSMainModuleName,
      useDeveloperSupport,
      redBoxHandler);
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  mLifecycleState = initialLifecycleState;
  mUIImplementationProvider = uiImplementationProvider;
  mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
  mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
  mJSCConfig = jscConfig;
  mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
  mLazyViewManagersEnabled = lazyViewManagersEnabled;
  mUseStartupThread = useStartupThread;
}
 
Example 14
Project: RNLearn_Project1   File: ReactInstanceManagerBuilder.java   View source code 4 votes vote down vote up
public ReactInstanceManagerBuilder setBridgeIdleDebugListener(
  NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener) {
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  return this;
}
 
Example 15
Project: RNLearn_Project1   File: CatalystInstanceImpl.java   View source code 4 votes vote down vote up
/**
 * Removes a NotThreadSafeBridgeIdleDebugListener previously added with
 * {@link #addBridgeIdleDebugListener}
 */
@Override
public void removeBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener) {
  mBridgeIdleListeners.remove(listener);
}
 
Example 16
Project: RNLearn_Project1   File: ReactInstanceManager.java   View source code 4 votes vote down vote up
ReactInstanceManager(
  Context applicationContext,
  @Nullable Activity currentActivity,
  @Nullable DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler,
  @Nullable JSBundleLoader bundleLoader,
  @Nullable String jsMainModuleName,
  List<ReactPackage> packages,
  boolean useDeveloperSupport,
  @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
  LifecycleState initialLifecycleState,
  UIImplementationProvider uiImplementationProvider,
  NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
  JSCConfig jscConfig,
  @Nullable RedBoxHandler redBoxHandler,
  boolean lazyNativeModulesEnabled,
  boolean lazyViewManagersEnabled,
  boolean useStartupThread) {

  initializeSoLoaderIfNecessary(applicationContext);

  // TODO(9577825): remove this
  ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
  DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(applicationContext);

  mApplicationContext = applicationContext;
  mCurrentActivity = currentActivity;
  mDefaultBackButtonImpl = defaultHardwareBackBtnHandler;
  mBundleLoader = bundleLoader;
  mJSMainModuleName = jsMainModuleName;
  mPackages = packages;
  mUseDeveloperSupport = useDeveloperSupport;
  mDevSupportManager = DevSupportManagerFactory.create(
      applicationContext,
      mDevInterface,
      mJSMainModuleName,
      useDeveloperSupport,
      redBoxHandler);
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  mLifecycleState = initialLifecycleState;
  mUIImplementationProvider = uiImplementationProvider;
  mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
  mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
  mJSCConfig = jscConfig;
  mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
  mLazyViewManagersEnabled = lazyViewManagersEnabled;
  mUseStartupThread = useStartupThread;
}
 
Example 17
Project: RNLearn_Project1   File: ReactInstanceManagerBuilder.java   View source code 4 votes vote down vote up
public ReactInstanceManagerBuilder setBridgeIdleDebugListener(
  NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener) {
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  return this;
}
 
Example 18
Project: RNLearn_Project1   File: CatalystInstanceImpl.java   View source code 4 votes vote down vote up
/**
 * Removes a NotThreadSafeBridgeIdleDebugListener previously added with
 * {@link #addBridgeIdleDebugListener}
 */
@Override
public void removeBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener) {
  mBridgeIdleListeners.remove(listener);
}
 
Example 19
Project: ReactNativeSignatureExample   File: ReactInstanceManager.java   View source code 4 votes vote down vote up
public Builder setBridgeIdleDebugListener(
    NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener) {
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  return this;
}
 
Example 20
Project: react-native-ibeacon-android   File: ReactInstanceManager.java   View source code 4 votes vote down vote up
public Builder setBridgeIdleDebugListener(
    NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener) {
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  return this;
}
 
Example 21
Project: react-native-box-loaders   File: ReactInstanceManager.java   View source code 4 votes vote down vote up
public Builder setBridgeIdleDebugListener(
    NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener) {
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  return this;
}
 
Example 22
Project: Ironman   File: ReactInstanceManager.java   View source code 4 votes vote down vote up
public Builder setBridgeIdleDebugListener(
    NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener) {
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  return this;
}
 
Example 23
Project: Ironman   File: XReactInstanceManagerImpl.java   View source code 4 votes vote down vote up
XReactInstanceManagerImpl(
  Context applicationContext,
  @Nullable Activity currentActivity,
  @Nullable DefaultHardwareBackBtnHandler defaultHardwareBackBtnHandler,
  @Nullable JSBundleLoader bundleLoader,
  @Nullable String jsMainModuleName,
  List<ReactPackage> packages,
  boolean useDeveloperSupport,
  @Nullable NotThreadSafeBridgeIdleDebugListener bridgeIdleDebugListener,
  LifecycleState initialLifecycleState,
  UIImplementationProvider uiImplementationProvider,
  NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler,
  JSCConfig jscConfig,
  @Nullable RedBoxHandler redBoxHandler,
  boolean lazyNativeModulesEnabled,
  boolean lazyViewManagersEnabled) {

  initializeSoLoaderIfNecessary(applicationContext);

  // TODO(9577825): remove this
  ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
  DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(applicationContext);

  mApplicationContext = applicationContext;
  mCurrentActivity = currentActivity;
  mDefaultBackButtonImpl = defaultHardwareBackBtnHandler;
  mBundleLoader = bundleLoader;
  mJSMainModuleName = jsMainModuleName;
  mPackages = packages;
  mUseDeveloperSupport = useDeveloperSupport;
  mDevSupportManager = DevSupportManagerFactory.create(
      applicationContext,
      mDevInterface,
      mJSMainModuleName,
      useDeveloperSupport,
      redBoxHandler);
  mBridgeIdleDebugListener = bridgeIdleDebugListener;
  mLifecycleState = initialLifecycleState;
  mUIImplementationProvider = uiImplementationProvider;
  mMemoryPressureRouter = new MemoryPressureRouter(applicationContext);
  mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
  mJSCConfig = jscConfig;
  mLazyNativeModulesEnabled = lazyNativeModulesEnabled;
  mLazyViewManagersEnabled = lazyViewManagersEnabled;
}
 
Example 24
Project: Ironman   File: CatalystInstanceImpl.java   View source code 4 votes vote down vote up
/**
 * Removes a NotThreadSafeBridgeIdleDebugListener previously added with
 * {@link #addBridgeIdleDebugListener}
 */
@Override
public void removeBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener) {
  mBridgeIdleListeners.remove(listener);
}
 
Example 25
Project: RNLearn_Project1   File: CatalystInstanceImpl.java   View source code 2 votes vote down vote up
/**
 * Adds a idle listener for this Catalyst instance. The listener will receive notifications
 * whenever the bridge transitions from idle to busy and vice-versa, where the busy state is
 * defined as there being some non-zero number of calls to JS that haven't resolved via a
 * onBatchComplete call. The listener should be purely passive and not affect application logic.
 */
@Override
public void addBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener) {
  mBridgeIdleListeners.add(listener);
}
 
Example 26
Project: RNLearn_Project1   File: CatalystInstanceImpl.java   View source code 2 votes vote down vote up
/**
 * Adds a idle listener for this Catalyst instance. The listener will receive notifications
 * whenever the bridge transitions from idle to busy and vice-versa, where the busy state is
 * defined as there being some non-zero number of calls to JS that haven't resolved via a
 * onBatchComplete call. The listener should be purely passive and not affect application logic.
 */
@Override
public void addBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener) {
  mBridgeIdleListeners.add(listener);
}
 
Example 27
Project: Ironman   File: CatalystInstanceImpl.java   View source code 2 votes vote down vote up
/**
 * Adds a idle listener for this Catalyst instance. The listener will receive notifications
 * whenever the bridge transitions from idle to busy and vice-versa, where the busy state is
 * defined as there being some non-zero number of calls to JS that haven't resolved via a
 * onBatchComplete call. The listener should be purely passive and not affect application logic.
 */
@Override
public void addBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener) {
  mBridgeIdleListeners.add(listener);
}