Rename remaining exported Sonar Android references
Summary: Excludes internal plugins, but should cover everything else. Reviewed By: priteshrnandgaonkar Differential Revision: D10009134 fbshipit-source-id: f601014e984bccf78fadbe59ee50dffdb4f6cb12
This commit is contained in:
committed by
Facebook Github Bot
parent
bf7eeada67
commit
777e9323de
@@ -13,7 +13,7 @@ import com.facebook.flipper.core.FlipperPlugin;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sonar plugin that keeps events in a buffer until a connection is available.
|
* Flipper plugin that keeps events in a buffer until a connection is available.
|
||||||
*
|
*
|
||||||
* <p>In order to send data to the {@link FlipperConnection}, use {@link #send(String, FlipperObject)}
|
* <p>In order to send data to the {@link FlipperConnection}, use {@link #send(String, FlipperObject)}
|
||||||
* instead of {@link FlipperConnection#send(String, FlipperObject)}.
|
* instead of {@link FlipperConnection#send(String, FlipperObject)}.
|
||||||
@@ -22,7 +22,7 @@ public abstract class BufferingFlipperPlugin implements FlipperPlugin {
|
|||||||
|
|
||||||
private static final int BUFFER_SIZE = 500;
|
private static final int BUFFER_SIZE = 500;
|
||||||
|
|
||||||
private @Nullable RingBuffer<CachedSonarEvent> mEventQueue;
|
private @Nullable RingBuffer<CachedFlipperEvent> mEventQueue;
|
||||||
private @Nullable FlipperConnection mConnection;
|
private @Nullable FlipperConnection mConnection;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -52,24 +52,24 @@ public abstract class BufferingFlipperPlugin implements FlipperPlugin {
|
|||||||
if (mConnection != null) {
|
if (mConnection != null) {
|
||||||
mConnection.send(method, sonarObject);
|
mConnection.send(method, sonarObject);
|
||||||
} else {
|
} else {
|
||||||
mEventQueue.enqueue(new CachedSonarEvent(method, sonarObject));
|
mEventQueue.enqueue(new CachedFlipperEvent(method, sonarObject));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void sendBufferedEvents() {
|
private synchronized void sendBufferedEvents() {
|
||||||
if (mEventQueue != null && mConnection != null) {
|
if (mEventQueue != null && mConnection != null) {
|
||||||
for (CachedSonarEvent cachedSonarEvent : mEventQueue.asList()) {
|
for (CachedFlipperEvent cachedFlipperEvent : mEventQueue.asList()) {
|
||||||
mConnection.send(cachedSonarEvent.method, cachedSonarEvent.sonarObject);
|
mConnection.send(cachedFlipperEvent.method, cachedFlipperEvent.sonarObject);
|
||||||
}
|
}
|
||||||
mEventQueue.clear();
|
mEventQueue.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class CachedSonarEvent {
|
private static class CachedFlipperEvent {
|
||||||
final String method;
|
final String method;
|
||||||
final FlipperObject sonarObject;
|
final FlipperObject sonarObject;
|
||||||
|
|
||||||
private CachedSonarEvent(String method, FlipperObject sonarObject) {
|
private CachedFlipperEvent(String method, FlipperObject sonarObject) {
|
||||||
this.method = method;
|
this.method = method;
|
||||||
this.sonarObject = sonarObject;
|
this.sonarObject = sonarObject;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import com.facebook.flipper.plugins.common.MainThreadFlipperReceiver;
|
|||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience class for adding console execution to a Sonar Plugin. Calling {@link
|
* Convenience class for adding console execution to a Flipper Plugin. Calling {@link
|
||||||
* ConsoleCommandReceiver#listenForCommands(FlipperConnection, ScriptingEnvironment, ContextProvider)}
|
* ConsoleCommandReceiver#listenForCommands(FlipperConnection, ScriptingEnvironment, ContextProvider)}
|
||||||
* will add the necessary listeners for responding to command execution calls.
|
* will add the necessary listeners for responding to command execution calls.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class BoundsDrawable extends Drawable {
|
|||||||
|
|
||||||
drawBoundsDimensions(canvas, mContentBounds);
|
drawBoundsDimensions(canvas, mContentBounds);
|
||||||
|
|
||||||
// Disabled for now since Sonar doesn't support options too well at this point in time.
|
// Disabled for now since Flipper doesn't support options too well at this point in time.
|
||||||
// Once options are supported, we should re-enable the calls below
|
// Once options are supported, we should re-enable the calls below
|
||||||
// drawCardinalDimensionsBetween(canvas, mContentBounds, mPaddingBounds);
|
// drawCardinalDimensionsBetween(canvas, mContentBounds, mPaddingBounds);
|
||||||
// drawCardinalDimensionsBetween(canvas, mPaddingBounds, mMarginBounds);
|
// drawCardinalDimensionsBetween(canvas, mPaddingBounds, mMarginBounds);
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class InspectorFlipperPlugin implements FlipperPlugin {
|
|||||||
private @Nullable List<ExtensionCommand> mExtensionCommands;
|
private @Nullable List<ExtensionCommand> mExtensionCommands;
|
||||||
private boolean mShowLithoAccessibilitySettings;
|
private boolean mShowLithoAccessibilitySettings;
|
||||||
|
|
||||||
/** An interface for extensions to the Inspector Sonar plugin */
|
/** An interface for extensions to the Inspector Flipper plugin */
|
||||||
public interface ExtensionCommand {
|
public interface ExtensionCommand {
|
||||||
/** The command to respond to */
|
/** The command to respond to */
|
||||||
String command();
|
String command();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class InspectorValue<T> implements FlipperValue {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Descrive the type of data this value contains. This will influence how values are parsed and
|
* Descrive the type of data this value contains. This will influence how values are parsed and
|
||||||
* displayed by the Sonar desktop app. For example colors will be parse as integers and displayed
|
* displayed by the Flipper desktop app. For example colors will be parse as integers and displayed
|
||||||
* using hex values and be editable using a color picker.
|
* using hex values and be editable using a color picker.
|
||||||
*
|
*
|
||||||
* <p>Do not extends this list of types without adding support for the type in the desktop
|
* <p>Do not extends this list of types without adding support for the type in the desktop
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import javax.annotation.Nullable;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A NodeDescriptor is an object which known how to expose an Object of type T to the ew Inspector.
|
* A NodeDescriptor is an object which known how to expose an Object of type T to the ew Inspector.
|
||||||
* This class is the extension point for the Sonar inspector plugin and is how custom classes and
|
* This class is the extension point for the Flipper inspector plugin and is how custom classes and
|
||||||
* data can be exposed to the inspector.
|
* data can be exposed to the inspector.
|
||||||
*/
|
*/
|
||||||
public abstract class NodeDescriptor<T> {
|
public abstract class NodeDescriptor<T> {
|
||||||
@@ -44,8 +44,8 @@ public abstract class NodeDescriptor<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalidate a node. This tells Sonar that this node is no longer valid and its properties and/or
|
* Invalidate a node. This tells Flipper that this node is no longer valid and its properties and/or
|
||||||
* children have changed. This will trigger Sonar to re-query this node getting any new data.
|
* children have changed. This will trigger Flipper to re-query this node getting any new data.
|
||||||
*/
|
*/
|
||||||
protected final void invalidate(final T node) {
|
protected final void invalidate(final T node) {
|
||||||
if (mConnection != null) {
|
if (mConnection != null) {
|
||||||
@@ -64,8 +64,8 @@ public abstract class NodeDescriptor<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalidate a node in the ax tree. This tells Sonar that this node is no longer valid and its properties and/or
|
* Invalidate a node in the ax tree. This tells Flipper that this node is no longer valid and its properties and/or
|
||||||
* children have changed. This will trigger Sonar to re-query this node getting any new data.
|
* children have changed. This will trigger Flipper to re-query this node getting any new data.
|
||||||
*/
|
*/
|
||||||
protected final void invalidateAX(final T node) {
|
protected final void invalidateAX(final T node) {
|
||||||
if (mConnection != null) {
|
if (mConnection != null) {
|
||||||
@@ -187,13 +187,13 @@ public abstract class NodeDescriptor<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return A string indicating how this element should be decorated. Check with the Sonar desktop
|
* @return A string indicating how this element should be decorated. Check with the Flipper desktop
|
||||||
* app to see what values are supported.
|
* app to see what values are supported.
|
||||||
*/
|
*/
|
||||||
public abstract String getDecoration(T node) throws Exception;
|
public abstract String getDecoration(T node) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return A string indicating how this element should be decorated in the AX tree. Check with the Sonar desktop
|
* @return A string indicating how this element should be decorated in the AX tree. Check with the Flipper desktop
|
||||||
* app to see what values are supported.
|
* app to see what values are supported.
|
||||||
*/
|
*/
|
||||||
public String getAXDecoration(T node) throws Exception {
|
public String getAXDecoration(T node) throws Exception {
|
||||||
|
|||||||
@@ -512,7 +512,7 @@ public final class AccessibilityUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a {@link FlipperObject} of useful properties of AccessibilityNodeInfo, to be shown in the
|
* Creates a {@link FlipperObject} of useful properties of AccessibilityNodeInfo, to be shown in the
|
||||||
* Sonar Layout Inspector accessibility extension. All properties are immutable since they are all derived from
|
* Flipper Layout Inspector accessibility extension. All properties are immutable since they are all derived from
|
||||||
* various {@link View} properties. This is a more complete list than
|
* various {@link View} properties. This is a more complete list than
|
||||||
* getAccessibilityNodeInfoProperties returns.
|
* getAccessibilityNodeInfoProperties returns.
|
||||||
*
|
*
|
||||||
@@ -609,7 +609,7 @@ public final class AccessibilityUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Modifies a {@link FlipperObject.Builder} to add Talkback-specific Accessibiltiy properties to be
|
* Modifies a {@link FlipperObject.Builder} to add Talkback-specific Accessibiltiy properties to be
|
||||||
* shown in the Sonar Layout Inspector.
|
* shown in the Flipper Layout Inspector.
|
||||||
*
|
*
|
||||||
* @param props The {@link FlipperObject.Builder} to add the properties to.
|
* @param props The {@link FlipperObject.Builder} to add the properties to.
|
||||||
* @param view The {@link View} to derive the properties from.
|
* @param view The {@link View} to derive the properties from.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import com.squareup.leakcanary.AnalysisResult;
|
|||||||
import com.squareup.leakcanary.HeapDump;
|
import com.squareup.leakcanary.HeapDump;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When a leak is detected, sends results to connected Sonar desktop app. In order to use this
|
* When a leak is detected, sends results to connected Flipper desktop app. In order to use this
|
||||||
* service in place of the default, a custom RefWatcher will need to be created See
|
* service in place of the default, a custom RefWatcher will need to be created See
|
||||||
* https://github.com/square/leakcanary/wiki/Customizing-LeakCanary#uploading-to-a-server
|
* https://github.com/square/leakcanary/wiki/Customizing-LeakCanary#uploading-to-a-server
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ public class DebugComponentDescriptor extends NodeDescriptor<DebugComponent> {
|
|||||||
&& PropWithDescription.class.isAssignableFrom(f.get(component).getClass())) {
|
&& PropWithDescription.class.isAssignableFrom(f.get(component).getClass())) {
|
||||||
final Object description =
|
final Object description =
|
||||||
((PropWithDescription) f.get(component))
|
((PropWithDescription) f.get(component))
|
||||||
.getSonarLayoutInspectorPropDescription();
|
.getFlipperLayoutInspectorPropDescription();
|
||||||
// Treat the description as immutable for now, because it's a "translation" of the
|
// Treat the description as immutable for now, because it's a "translation" of the
|
||||||
// actual prop,
|
// actual prop,
|
||||||
// mutating them is not going to change the original prop.
|
// mutating them is not going to change the original prop.
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ package com.facebook.flipper.plugins.litho;
|
|||||||
|
|
||||||
public interface PropWithDescription {
|
public interface PropWithDescription {
|
||||||
|
|
||||||
Object getSonarLayoutInspectorPropDescription();
|
Object getFlipperLayoutInspectorPropDescription();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class FlipperOkhttpInterceptor implements Interceptor {
|
|||||||
try {
|
try {
|
||||||
info.body = body.bytes();
|
info.body = body.bytes();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e("Sonar", e.toString());
|
Log.e("Flipper", e.toString());
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class SharedPreferencesFlipperPlugin implements FlipperPlugin {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a {@link android.content.SharedPreferences} plugin for Sonar
|
* Creates a {@link android.content.SharedPreferences} plugin for Flipper
|
||||||
*
|
*
|
||||||
* @param context The context to retrieve the file from. Will use the package name as the file
|
* @param context The context to retrieve the file from. Will use the package name as the file
|
||||||
* name with {@link Context#MODE_PRIVATE}.
|
* name with {@link Context#MODE_PRIVATE}.
|
||||||
@@ -53,7 +53,7 @@ public class SharedPreferencesFlipperPlugin implements FlipperPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a {@link android.content.SharedPreferences} plugin for Sonar
|
* Creates a {@link android.content.SharedPreferences} plugin for Flipper
|
||||||
*
|
*
|
||||||
* @param context The context to retrieve the file from. Will use the name as the file name with
|
* @param context The context to retrieve the file from. Will use the name as the file name with
|
||||||
* {@link Context#MODE_PRIVATE}.
|
* {@link Context#MODE_PRIVATE}.
|
||||||
@@ -64,7 +64,7 @@ public class SharedPreferencesFlipperPlugin implements FlipperPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a {@link android.content.SharedPreferences} plugin for Sonar
|
* Creates a {@link android.content.SharedPreferences} plugin for Flipper
|
||||||
*
|
*
|
||||||
* @param context The context to retrieve the file from.
|
* @param context The context to retrieve the file from.
|
||||||
* @param name The preference file name.
|
* @param name The preference file name.
|
||||||
|
|||||||
Reference in New Issue
Block a user