Skip to content

Commit

Permalink
Fixing the hybrid qpl integration with the flipper plugin
Browse files Browse the repository at this point in the history
Summary:
In the previous diff hybrid qpl data is started being missing due to JFlipperPlugin not having the isDuplicationAllowed field. Because FlipperPlugin is implemented as the Java Interface it wasn't possible to add it there - instead we added this field to the QPL Flipper Plugin.

This is causing an issue when the C++ flipper plugin will be added first to the client. Because isDuplicationAllowed flag as the default will be False. For this reason, Java Flipper plugin is not being attached when calling the native addPlugin() API. Changing this call to check for the identifier and if it's "UIPerft"(Flipper plugin) then changing it to True.

Differential Revision: D64058286

fbshipit-source-id: b74810ba9c4e91956545ae4fd3260fc4159ff7c1
  • Loading branch information
Shamil Yessenkulov authored and facebook-github-bot committed Oct 9, 2024
1 parent ec35ca0 commit 1d91d76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions android/src/main/cpp/sonar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,9 @@ class JFlipperClient : public jni::HybridClass<JFlipperClient> {
try {
auto wrapper =
std::make_shared<JFlipperPluginWrapper>(make_global(plugin));
if (wrapper->identifier() == "UIPerf") {
wrapper->isDuplicationAllowed.store(true);
}
FlipperClient::instance()->addPlugin(wrapper);
} catch (const std::exception& e) {
handleException(e);
Expand Down
2 changes: 1 addition & 1 deletion xplat/Flipper/FlipperPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FlipperPlugin {
return false;
}

bool isDuplicationAllowed = false;
std::atomic<bool> isDuplicationAllowed{false};
};

} // namespace flipper
Expand Down

0 comments on commit 1d91d76

Please sign in to comment.