This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow SonarFlowReporter to use an existing Flipper Network Plugin if …
…any was presented, or fall to DI Summary: After adding Graphservice to AMA Android, I tried to integrate Flipper network plugin to capture GS requests and send them to Flipper. However, I noticed that AMA uses Catalyst shell package which will [init Flipper initially](https://www.internalfb.com/code/fbsource/[56757675f594]/fbandroid/java/com/facebook/catalyst/shell/FbReactApplicationBaseSonarUtil.java?lines=25-39) so any attempt to use DI to create a new network plugin to catch GS traffic won't work since Flipper singleton will relay on the first network plugin that was created before DI. This changes will resolve the problem, before letting DI create a new network plugin object, it will look for an existing one so it reuse it, if non were declared then it will create a new instance. Reviewed By: WilliamY97 Differential Revision: D57799647 fbshipit-source-id: 6d059bcc63060f832d2c0bceeeff5f216db6a7a2
- Loading branch information