Summary: This is to allow us to test dialogs from the UI debugger
Reviewed By: lblasa
Differential Revision: D39468653
fbshipit-source-id: 59c759a794c42b85bc288d60e1b2c6a71e32bb3d
Summary: Added an initial litho Tree observer and descriptors, its quiet naive and will be improved in a future diff
Reviewed By: lblasa
Differential Revision: D39466931
fbshipit-source-id: 66a462882af2e585b9719ee2f61595449f99c5e5
Summary: Added simple activity to test how flipper reacts to changes in native UI
Reviewed By: passy
Differential Revision: D38704012
fbshipit-source-id: 8a593577322922c6f6f0f96dd5cb0761c3035389
Summary:
Scaffolded desktop UI for UI debugger
I changed getroot from an rpc call to an event sent on connect. The root should never change as its the application object.
Reviewed By: lblasa
Differential Revision: D38866008
fbshipit-source-id: ca0f1908bedb643238f11ed796922e3359619167
Summary:
This includes a bunch of different things which I wanted to do separately, but it's all a massive Jenga Tower and you cannot remove a single piece.
- Litho upgrade
- Gradle plugin upgrade
- Remove storage permission as it apparently doesn't do anything above Android 10
- Upgraded build target to Android 12 because the new support lib/Kotlin stdlib required this which then caused the issue below to pop up
- Added "export=true" everywhere as this is now a blocking issue if you don't have it
- Upgraded to the LeakCanary2 plugin as version one no longer builds with an Android 12 target for the export reason
- Make CI run on JRE 11 because that's required by the new Gradle plugin
- Update internal CI to no longer define the SDK twice and use Java 11
Pull Request resolved: https://github.com/facebook/flipper/pull/3095
Test Plan: Built Android Sample and Tutorial app, connected to Flipper.
Reviewed By: lblasa
Differential Revision: D32644410
Pulled By: passy
fbshipit-source-id: 8978f158d9c642b3bbd9dbbd7321eb20098a7a53
Summary:
Just a few tweaks to bring AndroidX up-to-date. Required
some fixes to the Kotlin Tutorial as it was throwing
errors about JRE incompatibilities.
Reviewed By: fabiomassimo
Differential Revision: D29761484
fbshipit-source-id: 10cb76115fe7542a60b6e5d14be9c0434e85171c
Summary:
The current ownership and release model prevents cleanly releasing new versions of the plugin while the code is split between two repos.
This diff moves the flipper-litho plugin to the Litho repository. You'll find new releases as `litho-editor-flipper` that'll be reexported via gradle's `api` to the old artifact.
Reviewed By: colriot
Differential Revision: D23962234
fbshipit-source-id: 7884423342904219ae9b41632c6df90cda870798
Summary: - add another activity where there are two component overlapping each other
Reviewed By: mweststrate
Differential Revision: D21040425
fbshipit-source-id: 5514b59140bbf6b726e6777191e1808be5ac5b6f
Summary:
This is in line with the most recent stable Android Studio Release.
Pull Request resolved: https://github.com/facebook/flipper/pull/958
Test Plan:
Used it myself.
Open Source CI required a higher NDK, so let's first check what CI says to that internally now.
Reviewed By: jknoxville
Differential Revision: D20794634
Pulled By: passy
fbshipit-source-id: c32f934634b036ad3c1cad9fc49541e585d64329
Summary:
Add logic on client side
# How it works (from the code)
1. Server side sends request url and method to response data and headers to client side
1.1. This will happen every time server update **any** mock response (add, edit, and remove)
2. Client stores those in map
3. For every network request,
3.1. Check if there is a matching url and method
3.2. If so, create a new response with the data and headers and drop the request
3.3. If not, proceed and send the request and wait for a response
`addNetworkInterceptor` is changed to `addInterceptor` to allow short-circuit and proceed without fetching anything. More info can be found at https://square.github.io/okhttp/interceptors/
Note:
- This is an original PR.
- The content below is from original PR
Add network response mocking for Network plugin. See discussion [here](https://github.com/facebook/flipper/issues/475)
## Changelog
- Add Network response mocking, currently support Android clients only
- Change the Android example app to use `addInterceptor()` instead of `addNetworkInterceptor()`
Pull Request resolved: https://github.com/facebook/flipper/pull/488
Test Plan:
{F231673798}

- Connect an Android device
- Tap on Network plugin
- Click on the Mock button
- Click on Add Route button, and specify the URL
- Edit the mock data in the text area
- Optionally, click the Headers tab to edit the headers data
- Click close button to close the dialog
- Send some network data in your application. You should be able to see the mock data appears in the Network table in those rows highlighted in yellow
Reviewed By: passy
Differential Revision: D16580291
Pulled By: cekkaewnumchai
fbshipit-source-id: fc391f5e7efebc6f51a72b00d16263e009e1fdb0
Summary: Lets you test the crash reporter more easily
Reviewed By: passy
Differential Revision: D18830402
fbshipit-source-id: fca57a05f121ca4219aaaf4e2b8bfeca9b46a4a9
Summary:
Well, now I feel dumb. That should have definitely been caught earlier.
I'll set up a CI job to verify this.
Fixes https://github.com/facebook/flipper/issues/648
Reviewed By: jknoxville
Differential Revision: D18657185
fbshipit-source-id: 5fea08103f5a4292159b519d62d84800c0444e41
Summary: I don't know why we left this for so long, it doesn't make a good first impression.
Reviewed By: mweststrate
Differential Revision: D18348908
fbshipit-source-id: b8b0e5fe8f6ab81281d6ea1a1299ebdaaf0b9c43
Summary:

There is no spacing between the texts on the demo app and I found them difficult to click. So I decided to add some margins to make them more thumb-friendly :)
## Changelog
Make demo app more thumb-friendly
Pull Request resolved: https://github.com/facebook/flipper/pull/621
Test Plan: N/A
Reviewed By: jknoxville
Differential Revision: D18245979
Pulled By: priteshrnandgaonkar
fbshipit-source-id: 9c99a477c4100323144518f56369a42085589f77
Summary:
This was removed because it's implicitly required by the library now.
However, Buck doesn't pick this up by default and requires further
configuration. It's easiest just to declare this twice now.
Reviewed By: jknoxville
Differential Revision: D18202459
fbshipit-source-id: 48c6a91c2fca0d932950a81c092b78b90a24c27b
Summary:
If we move the permissions into the library itself, the manifest
merger will take care of adding them to consuming applications,
making setup instructions easier.
## Changelog
Move required permission declarations into flipper-core
Pull Request resolved: https://github.com/facebook/flipper/pull/593
Test Plan:
Using aapt we can dump the permissions of a sample app.
`$ANDROID_HOME/build-tools/29.0.2/aapt d permissions sample-debug.apk `
```
package: com.facebook.flipper.sample
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.ACCESS_WIFI_STATE'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-permission: name='android.permission.FOREGROUND_SERVICE
```
Reviewed By: priteshrnandgaonkar
Differential Revision: D18006323
Pulled By: passy
fbshipit-source-id: c4cf28ee698faa3e2b631462f2953976135b299c
Summary:
Breaking Litho/Sections off. Doesn't really make sense to have
two deps for this especially since they're pretty tightly coupled.
This makes our core already quite slim.
Reviewed By: jknoxville
Differential Revision: D17420118
fbshipit-source-id: 9a03911f4af6410745b9aefd0e6a75bdf106660f
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/548
First project to pull out of the "fat distribution" we currently have.
Still needs setup for Maven and registration in Bintray.
Reviewed By: jknoxville
Differential Revision: D17395660
fbshipit-source-id: 6244495a2e25d705dd930ef87c7e5e1f038eb921
Summary:
Here I have an early version of the Navigation Plugin (Android) for Open Source.
A lot of apps will be using there own Navigation framework for handling deep links. In order to keep things as simple as possible, recording navigation events is done through a single function that can be called from anywhere in the app. This will allow users to place this function in there own navigation frameworks and use there own logic with it.
Seperately, I have shown how this can be used with our Android sample app. I use the built in Android intent-filters to provide a demo of how this can potentially be used, and to form the basis of the docs that I will write.
Reviewed By: passy, danielbuechele
Differential Revision: D16828049
fbshipit-source-id: 22765f63ca0c471689d2ec5865fdfc155b92697f
Summary:
`/*` is the standard throughout open source code. For example, Firefox uses single /*: https://hg.mozilla.org/mozilla-central/file/21d22b2f541258d3d1cf96c7ba5ad73e96e616b5/gfx/ipc/CompositorWidgetVsyncObserver.cpp#l3
In addition, Rust considers `/**` to be a doc comment (similar to Javadoc) and having such a comment at the beginning of the file causes `rustc` to barf.
Note that some JavaScript tooling requires `/**`. This is OK since JavaScript files were not covered by the linter in the first place, but it would be good to have that tooling fixed too.
Reviewed By: zertosh
Differential Revision: D15640366
fbshipit-source-id: b4ed4599071516364d6109720750d6a43304c089
Summary:
Adds a plugin for listing the databases, tables and contents of those tables in an android app.
Right now, works with sqlite, but it should be generic enough to work with other db types.
## Changelog
Add initial version of android databases plugin
Creating a PR, I may need to do some cleaning up, but this is to kick off that process.
Pull Request resolved: https://github.com/facebook/flipper/pull/441
Reviewed By: danielbuechele
Differential Revision: D15288831
Pulled By: jknoxville
fbshipit-source-id: 6379ad60d640ea6b0a9473acc03dd6ea81a3a8d4
Summary: I hope that this takes care of all the android violations.
Reviewed By: danielbuechele
Differential Revision: D15199150
fbshipit-source-id: 0f5b4edc1bc9d38de0885f88bb2c3e43acfa09cd
Summary: Add the affiliates bit that the linter is checking for.
Reviewed By: jknoxville
Differential Revision: D15164826
fbshipit-source-id: 500ffe89ec0c2fd3acfbc374408d16a337cecfa4
Summary:
This makes use of the new no-op package and also structures the app
into release and debug flavours that can be built with and without
Flipper part of the APK.
This was a pretty tedious adventure. I may have missed some corner cases
and also restructured a bunch of seemingly unrelated stuff that was
necessary to respect buck module boundaries.
Reviewed By: jknoxville
Differential Revision: D15148004
fbshipit-source-id: bf81f45105f5f16d17daccb3e8050ee00d69fc35
Summary:
We should not ship this as part of our distribution.
Just meant we had to bifurcate our unit tests which
is a bit awkward, but it works now.
Reviewed By: jknoxville
Differential Revision: D15146980
fbshipit-source-id: 496b000630bbfcaa663cddacb00550e1499a1279
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