Rename LeakCanarySonarPlugin to LeakCanaryFlipperPlugin

Summary: As before.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9990841

fbshipit-source-id: 4517d6949c3eb408b86b2b520d369134b006cf4f
This commit is contained in:
Pascal Hartig
2018-09-22 09:19:12 -07:00
committed by Facebook Github Bot
parent 235916666b
commit bd27a624cd
4 changed files with 7 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.core.FlipperClient; import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.inspector.DescriptorMapping; import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.leakcanary.LeakCanarySonarPlugin; import com.facebook.flipper.plugins.leakcanary.LeakCanaryFlipperPlugin;
import com.facebook.flipper.plugins.litho.LithoSonarDescriptors; import com.facebook.flipper.plugins.litho.LithoSonarDescriptors;
import com.facebook.flipper.plugins.network.NetworkSonarPlugin; import com.facebook.flipper.plugins.network.NetworkSonarPlugin;
import com.facebook.flipper.plugins.network.SonarOkhttpInterceptor; import com.facebook.flipper.plugins.network.SonarOkhttpInterceptor;
@@ -47,7 +47,7 @@ public class FlipperSampleApplication extends Application {
client.addPlugin(new InspectorFlipperPlugin(this, descriptorMapping)); client.addPlugin(new InspectorFlipperPlugin(this, descriptorMapping));
client.addPlugin(networkPlugin); client.addPlugin(networkPlugin);
client.addPlugin(new SharedPreferencesSonarPlugin(this, "sample")); client.addPlugin(new SharedPreferencesSonarPlugin(this, "sample"));
client.addPlugin(new LeakCanarySonarPlugin()); client.addPlugin(new LeakCanaryFlipperPlugin());
client.start(); client.start();
getSharedPreferences("sample", Context.MODE_PRIVATE).edit().putString("Hello", "world").apply(); getSharedPreferences("sample", Context.MODE_PRIVATE).edit().putString("Hello", "world").apply();

View File

@@ -20,9 +20,9 @@ import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
public class LeakCanarySonarPlugin implements FlipperPlugin { public class LeakCanaryFlipperPlugin implements FlipperPlugin {
private static final String TAG = "LeakCanarySonarPlugin"; private static final String TAG = "LeakCanaryFlipperPlugin";
private static final String REPORT_LEAK_EVENT = "reportLeak"; private static final String REPORT_LEAK_EVENT = "reportLeak";
private static final String CLEAR_EVENT = "clear"; private static final String CLEAR_EVENT = "clear";

View File

@@ -27,7 +27,7 @@ public class RecordLeakService extends AbstractAnalysisResultService {
final FlipperClient client = AndroidFlipperClient.getInstance(this); final FlipperClient client = AndroidFlipperClient.getInstance(this);
if (client != null) { if (client != null) {
final LeakCanarySonarPlugin plugin = client.getPlugin("LeakCanary"); final LeakCanaryFlipperPlugin plugin = client.getPlugin("LeakCanary");
if (plugin != null) { if (plugin != null) {
plugin.reportLeak(leakInfo); plugin.reportLeak(leakInfo);
} }

View File

@@ -13,9 +13,9 @@ Note: this plugin is only available for Android.
First, add the plugin to your Flipper client instance: First, add the plugin to your Flipper client instance:
```java ```java
import com.facebook.sonar.plugins.leakcanary.LeakCanarySonarPlugin; import com.facebook.sonar.plugins.leakcanary.LeakCanaryFlipperPlugin;
client.addPlugin(new LeakCanarySonarPlugin()); client.addPlugin(new LeakCanaryFlipperPlugin());
``` ```
Next, build a custom RefWatcher using RecordLeakService: (see [LeakCanary docs](https://github.com/square/leakcanary/wiki/Customizing-LeakCanary#uploading-to-a-server) for more information on RefWatcher) Next, build a custom RefWatcher using RecordLeakService: (see [LeakCanary docs](https://github.com/square/leakcanary/wiki/Customizing-LeakCanary#uploading-to-a-server) for more information on RefWatcher)