Summary: Last big batch of adding license headers in Java code where they were missing.
Reviewed By: jknoxville
Differential Revision: D15164860
fbshipit-source-id: 4c0a61eec7b5659fdc674ebed85f2ade60dd0aa0
Summary:
This diff makes headless flipper accept `metrics` argument. Once this is passed. The headless flipper will terminate to export the metrics of the plugins, the type of the export looks like the following.
```
export type MetricType = {[metricName: string]: number};
type MetricPluginType = {[pluginID: string]: MetricType};
export type ExportMetricType = {[clientID: string]: MetricPluginType};
```
This diff, uses the store to export the metrics. I will modify the logic to accept the data which gets exported through `exportData`
Reviewed By: passy
Differential Revision: D14933499
fbshipit-source-id: dade5b7bc59ea4beb6d16c5ef471737e8597358a
Summary:
Currently running the sample app on a pre-21 device produces a runtime error. This is because it includes OkHttp which requires 21+.
So this change just stops the sample app from being installable on pre-21 devices.
```
FATAL EXCEPTION: main
Process: com.facebook.flipper.sample, PID: 19629
java.lang.ExceptionInInitializerError
at okhttp3.OkHttpClient.newSslSocketFactory(OkHttpClient.java:263)
at okhttp3.OkHttpClient.<init>(OkHttpClient.java:229)
at okhttp3.OkHttpClient$Builder.build(OkHttpClient.java:1015)
at com.facebook.flipper.sample.FlipperSampleApplication.onCreate(FlipperSampleApplication.java:54)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: Expected Android API level 21+ but was 19
at okhttp3.internal.platform.AndroidPlatform.buildIfSupported(AndroidPlatform.java:238)
at okhttp3.internal.platform.Platform.findPlatform(Platform.java:202)
at okhttp3.internal.platform.Platform.<clinit>(Platform.java:79)
... 16 more
```
Reviewed By: passy
Differential Revision: D14953859
fbshipit-source-id: 8289c19e837f1d3739e120dc5a0f53111b800ca0
Summary:
This is quite hacky, but allows us to test that a plugin connects, sends some actions and
then shuts down the app which we can use in a headless test.
Reviewed By: jknoxville
Differential Revision: D14482381
fbshipit-source-id: deafa8fa7e6d5a5ca1bb006e9d150b62295105af
Summary:
This can be used in integration tests/headless to create
some data to match against.
Ideally, headless also will need some mechanism to be
told to exit, but that's a separate issue.
Reviewed By: jknoxville
Differential Revision: D14387494
fbshipit-source-id: 88d7c27e342fb0b26251e6edf12e7b922d5144c0
Summary: Only load the image when clicking on the "button"
Reviewed By: oprisnik
Differential Revision: D14165707
fbshipit-source-id: d07fb76562f8b91fc945713d779319b976e17016
Summary:
Not quite sure about the default as static, but then if it's for
debugging only, does it matter?
Reviewed By: oprisnik
Differential Revision: D14165668
fbshipit-source-id: edd53420a4fc8570de87f02b3e5e65cfe649f810
Summary:
This looks bad. There are two things I want to follow up on in future
diffs before landing this:
- Make loading the image conditional by adding another button.
- Add a default constructor to the plugin that avoids this crazy bit of boilerplate.
Reviewed By: oprisnik
Differential Revision: D14165569
fbshipit-source-id: 25c5fbaee32e72c6469979cda694cc9f13a92166
Summary:
This deprecates the `getPlugin(String)` method and introduces
a `getPluginByClass(Class<T>)` instead which avoids having
to `instanceof`-check and then cast the result, which provides
a nicer experience for Java users.
Reviewed By: jknoxville
Differential Revision: D13277568
fbshipit-source-id: fb7b5b8c0180470ef0ad322559b5b7424520848b
Summary:
This PR adds the barebone of a crash reporting plugin in android. Since there is no easy way to stack the PR's in git, creating a new PR, but this depends on the [iOS PR](https://github.com/facebook/flipper/pull/322)
Pull Request resolved: https://github.com/facebook/flipper/pull/328
Reviewed By: jknoxville, passy
Differential Revision: D13137447
Pulled By: priteshrnandgaonkar
fbshipit-source-id: 3b86cebbb1ea01601405dd7ba58e1caa2b506065
Summary:
We have getAndroidContext() instead.
This will probably take a few iterations to land, but getting it out there so that I can try :)
Reviewed By: muraziz
Differential Revision: D12921523
fbshipit-source-id: 038ecf8c411fdbde6831051b219a43716007ac49
Summary:
Just a quick startup test that can save you the time of manually
opening the app.
I don't have any plans of hooking this up in Circle, but it's
still kinda useful to have.
Reviewed By: jknoxville
Differential Revision: D12901590
fbshipit-source-id: a16a1814574d9f27770dcf98c6b238517c589930
Summary:
Start adding Nullable and finals in some places to
make our sample app (and hopefully rest of the codebase) follow
some of the standards we have in place elsewhere.
Reviewed By: jknoxville
Differential Revision: D10463816
fbshipit-source-id: 7df6758919331ba8a334c94214b9e02bbab8cd2d
Summary:
The start of an example plugin.
My intention is for this to be a place that we keep up to date with the current best practice for doing things.
For example, with the introduction on persistedStateReducer, there are two ways to receive incoming messages, but only one of them works in the background. This should act as a guideline.
For this reason, don't hold back on reviewing it. I want it to be 👌
Reviewed By: priteshrnandgaonkar
Differential Revision: D10448592
fbshipit-source-id: d5fa978c14e47a7fa3c9a29d0929d5a6109267af
Summary:
As titled.
The controller you requested could not be found.
Reviewed By: priteshrnandgaonkar
Differential Revision: D9990862
fbshipit-source-id: 459420adf400fd4504035fc36b14c5595f431f6a
Summary:
Per title.
The controller you requested could not be found.
Reviewed By: priteshrnandgaonkar
Differential Revision: D9966768
fbshipit-source-id: 224ff9d02d6a01a6f7ee28788ddd9167d15aafee
Summary:
Rename everything `Sonar*.java` in `core/`.
Biggest chunk of the rename happened with
```fish
for name in (cat names.txt)
ambr --no-interactive --regex '\b'"$name"'\b' (echo $name | sed 's/Sonar/Flipper/') fbandroid/java/com/facebook
end
```
names.txt:
```
SonarArray
SonarClient
SonarConnection
SonarDynamic
SonarObject
SonarPlugin
SonarReceiver
SonarResponder
SonarStateUpdateListener
SonarValue
```
The controller you requested could not be found.
Reviewed By: priteshrnandgaonkar
Differential Revision: D9940900
fbshipit-source-id: 4a1342fac02513025d80dcb0af62c26ea38b5086
Summary:
This soft-breaks Android Studio support because folder names no longer map to package names, but this will be mitigated by future diffs.
Steps taken for rename:
```
cd xplat/sonar/android/;
ambr 'com.facebook.sonar' 'com.facebook.flipper'
```
Reviewed By: danielbuechele
Differential Revision: D9850009
fbshipit-source-id: d26d8ab783e7050e4e2fbdd0c35eae3f97879464
Summary:
Two fixes included in this one. The debug flag is obvious, the annotations
less so. I'll try and find the right place to document this, but the reason
we need this here is because we reflect on `Prop.class`, so these need to be
available at runtime.
Reviewed By: jknoxville
Differential Revision: D9766713
fbshipit-source-id: 269b5a60c0df644f4fda0ea289ef9dc392ee352b
Summary:
The plugin was part of the wrong package based on its directory. This
confuses Gradle and I'm frankly a bit surprised this ever built before.
Pull Request resolved: https://github.com/facebook/flipper/pull/247
Reviewed By: danielbuechele
Differential Revision: D9420595
Pulled By: passy
fbshipit-source-id: fd8e47ff242c4535b36e379df93b672eb8bb840d
Summary:
This allows breaking changes in Litho to be landed.
I'm also adding some helpers to determine if Flipper itself
is currently in a release or snapshot release train.
N.B. We don't publish snapshot releases for Flipper
right now, but will in the future where this will come in
handy.
Reviewed By: jknoxville
Differential Revision: D9359035
fbshipit-source-id: d21b607eca5d57caf4cc34234f6ba3cb0d8f307d
Summary: Adds a link on MainActivitiy that opens the diagnostic screen
Reviewed By: danielbuechele
Differential Revision: D9267065
fbshipit-source-id: 1b44134de0e57f8021b19d76644dac6389c88b65
Summary:
Open the screen by running adb shell
am start -n com.facebook.samples.litho/com.facebook.sonar.android.diagnostics.SonarDiagnosticActivity
Reviewed By: danielbuechele
Differential Revision: D9150556
fbshipit-source-id: 534583cfa5e90af6fd0d2a50572e3763b8888da2
Summary:
Open the screen by running adb shell
am start -n com.facebook.wakizashi/com.facebook.sonar.android.diagnostics.SonarDiagnosticActivity
Reviewed By: passy
Differential Revision: D8954095
fbshipit-source-id: b4a638bc0ba2f69a69c121c7c1c00fbe47476ee3
Summary:
This moves the native setup to a separate gradle file and unpacks everything outside the build folder. That way we don't throw everything away on every incremental build.
This is an intermediate step to get to a more declarative setup like Fresco has it and get rid of the individual hacks we have for every download.
Pull Request resolved: https://github.com/facebook/Sonar/pull/154
Reviewed By: jknoxville
Differential Revision: D8833812
Pulled By: passy
fbshipit-source-id: 2424c9d6e22e6092c04af344e06939b4a6aba041