Add runInBackground Interface method
Summary: Add support for plugins to opt in to background for android. This diff does the following - Adds a method `runInBackground` in java interface of `FlipperPlugin` - Make the network plugin opt in to run in background Reviewed By: danielbuechele Differential Revision: D10360033 fbshipit-source-id: b31c7550d00b760b7033c150232e3925b6272d24
This commit is contained in:
committed by
Facebook Github Bot
parent
e58961e184
commit
14e38c087f
@@ -198,6 +198,11 @@ class JFlipperPlugin : public jni::JavaClass<JFlipperPlugin> {
|
||||
static const auto method = javaClassStatic()->getMethod<void()>("onDisconnect");
|
||||
method(self());
|
||||
}
|
||||
|
||||
bool runInBackground() {
|
||||
static const auto method = javaClassStatic()->getMethod<jboolean()>("runInBackground");
|
||||
return method(self()) == JNI_TRUE;
|
||||
}
|
||||
};
|
||||
|
||||
class JFlipperStateUpdateListener : public jni::JavaClass<JFlipperStateUpdateListener> {
|
||||
@@ -247,6 +252,10 @@ class JFlipperPluginWrapper : public FlipperPlugin {
|
||||
jplugin->didDisconnect();
|
||||
}
|
||||
|
||||
virtual bool runInBackground() override {
|
||||
return jplugin->runInBackground();
|
||||
}
|
||||
|
||||
JFlipperPluginWrapper(jni::global_ref<JFlipperPlugin> plugin): jplugin(plugin) {}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user