Commit Graph

84 Commits

Author SHA1 Message Date
John Knox
d73551a440 Add artificial crash button to sample app
Summary: Lets you test the crash reporter more easily

Reviewed By: passy

Differential Revision: D18830402

fbshipit-source-id: fca57a05f121ca4219aaaf4e2b8bfeca9b46a4a9
2019-12-05 06:45:33 -08:00
Pascal Hartig
2854b57c74 Fix release build
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
2019-11-22 07:02:49 -08:00
John Knox
f0de600492 Fix wording of network request buttons
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
2019-11-06 08:04:12 -08:00
Zhang Qichuan
7e8dc28b2f Added margins to the texts on the demo app (#621)
Summary:
![screencap-2019-10-31T060952 432Z](https://user-images.githubusercontent.com/410850/67923337-842c7000-fbe8-11e9-86f4-92b183d11d9c.png)

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
2019-10-31 09:44:47 -07:00
Pascal Hartig
ef4defe56f Fix android sample buck build
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
2019-10-29 10:23:05 -07:00
Michael Evans
cc19cc75ee Move declaration of required permissions into core lib (#593)
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
2019-10-18 06:43:35 -07:00
Andres Suarez
0675dd924d Tidy up Flipper license headers [1/2]
Reviewed By: passy

Differential Revision: D17863711

fbshipit-source-id: 259dc77826fb803ff1b88c88529d7f679d3b74d8
2019-10-11 13:46:45 -07:00
Chaiwat Ekkaewnumchai
053cfc09f3 Make LeakCanary a Separate Plugin
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/559

Reviewed By: passy

Differential Revision: D17546936

fbshipit-source-id: dce128a771b73e8b18dfc2b78ee99502c3f1ce86
2019-09-25 03:05:56 -07:00
Pascal Hartig
2baadf9867 Make litho/sections a separate plugin
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
2019-09-19 03:02:51 -07:00
Pascal Hartig
c4a9b603e2 Make network a separate plugin
Summary: Per title.

Reviewed By: jknoxville

Differential Revision: D17419678

fbshipit-source-id: aee00f077b7ed955c60884853dc1128d27366ee8
2019-09-19 03:02:51 -07:00
Pascal Hartig
7ac82bec4e Make fresco a stand-alone gradle project (#548)
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
2019-09-19 03:02:51 -07:00
Ron Edelstein
0f503f40ac Apply java formatting
Reviewed By: zertosh

Differential Revision: D17006136

fbshipit-source-id: 356442170cee830f4794bff456a6d2162f45d6b3
2019-08-24 20:33:38 -07:00
Benjamin Elo
8f6740bb01 Open source version of Navigation Plugin
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
2019-08-16 07:15:56 -07:00
Rain ⁣
aa649ff48f standardize C-like MIT copyright headers throughout fbsource
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
2019-06-06 19:40:28 -07:00
John Knox
a630b50a8f Add databases plugin v0 (android) (#441)
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
2019-05-28 10:17:56 -07:00
Pascal Hartig
f584eb05dd Another round of header updates
Summary: I hope that this takes care of all the android violations.

Reviewed By: danielbuechele

Differential Revision: D15199150

fbshipit-source-id: 0f5b4edc1bc9d38de0885f88bb2c3e43acfa09cd
2019-05-03 09:59:33 -07:00
Pascal Hartig
bbee7a3357 Update iOS license headers (and more)
Summary: Add the affiliates bit that the linter is checking for.

Reviewed By: jknoxville

Differential Revision: D15164826

fbshipit-source-id: 500ffe89ec0c2fd3acfbc374408d16a337cecfa4
2019-05-02 03:28:07 -07:00
Pascal Hartig
2e65ab7133 Reorganise sample into debug/release flavours
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
2019-05-01 08:38:22 -07:00
Pascal Hartig
b7fff23700 Move example plugin out of core
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
2019-05-01 08:38:22 -07:00
Pascal Hartig
608b9182ce Add version headers
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
2019-05-01 08:14:55 -07:00
Pascal Hartig
c5e77220fc Remove dangling TODO comment
Summary: No longer relevant.

Reviewed By: jknoxville

Differential Revision: D15146917

fbshipit-source-id: 830a8193b128a8177610269b6e7f37fb8f1ee74e
2019-04-30 13:13:00 -07:00
Pascal Hartig
8ba4feba66 Add gradle license headers
Summary: Some more will follow.

Reviewed By: jknoxville

Differential Revision: D15146750

fbshipit-source-id: b78331b1fb00f357812e598165d6def62e2a89c8
2019-04-30 05:34:59 -07:00
Pritesh Nandgaonkar
afd729deb6 Added metrics argument to headless inorder to export metrics
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
2019-04-25 07:41:34 -07:00
John Knox
6f8d6ddd85 Sample app requires API 21+
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
2019-04-17 06:55:48 -07:00
Pascal Hartig
9389a8e919 Bump some more dependencies (#414)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/414

Some more minor upgrades.

Reviewed By: jknoxville

Differential Revision: D14933687

fbshipit-source-id: 35bfcbb2ab3e552e430d8a2e3e30fb3568fab6c9
2019-04-15 09:57:59 -07:00
Pascal Hartig
59881f1888 Bump okhttp
Summary:
Requires some compile options as it uses newer Java features.
Post here: https://github.com/square/okhttp/issues/4597#issuecomment-461204144

Reviewed By: jknoxville

Differential Revision: D14933502

fbshipit-source-id: 265c43f2d9ae61fa9f6f42516fc6eb899af7f072
2019-04-15 06:55:21 -07:00
Pritesh Nandgaonkar
25f82986ea Avoid triggering notification in headless
Summary:
There was a bug where headless version used to crash when crash reporter plugin used to get messages. So the problem was that it tried to trigger the notification in headless version, which obviously won't work.

Solves this [bug](https://our.intern.facebook.com/intern/sandcastle/log/?instance_id=88210824&step_id=773963185&step_index=5&name=Get+headless+and+run+it)
Bug:

{F155634920}

Reviewed By: jknoxville, danielbuechele

Differential Revision: D14874122

fbshipit-source-id: 2614b16665a354be7a75844a372dbea7a59d7e55
2019-04-11 04:08:59 -07:00
Pascal Hartig
7c185ea771 Add activity for connectivity test
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
2019-03-18 07:34:44 -07:00
Pascal Hartig
69dd6e4fc1 Add non-interactive mode to sample app
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
2019-03-14 11:16:40 -07:00
Pascal Hartig
fbe9e3a086 Prepare for Fresco stable release (#385)
Summary:
This unblocks our open source releases.

Pull Request resolved: https://github.com/facebook/flipper/pull/385

Reviewed By: danielbuechele

Differential Revision: D14299867

Pulled By: passy

fbshipit-source-id: d9ce29d0d0713cd54f6d8bed03e7a919f443f44b
2019-03-04 09:03:10 -08:00
Pascal Hartig
156a0c17c6 Load Fresco image on button press only
Summary: Only load the image when clicking on the "button"

Reviewed By: oprisnik

Differential Revision: D14165707

fbshipit-source-id: d07fb76562f8b91fc945713d779319b976e17016
2019-02-22 02:51:33 -08:00
Pascal Hartig
cbfb280783 Set up FrescoFlipperPlugin default constructor
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
2019-02-22 02:51:33 -08:00
Pascal Hartig
d371a211a8 Set up Fresco in sample app
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
2019-02-22 02:51:33 -08:00
Aziz Murtazaev
0279fc919f Move android module's support lib references to AndroidX
Summary: SupportLib v28 -> AndroidX v1

Reviewed By: passy

Differential Revision: D14150032

fbshipit-source-id: f9c0d15a4f281fea78500e78275eb260e484e674
2019-02-21 09:26:07 -08:00
Pascal Hartig
7eb1546f25 Move version specifier
Summary: Android Studio keeps loudly complaining about this.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13376394

fbshipit-source-id: 6163977bb013dff214aa684662e4879a19a7a786
2018-12-07 06:50:47 -08:00
Pascal Hartig
214f112c14 Add getPluginByClass interface
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
2018-12-05 08:03:41 -08:00
Pritesh Nandgaonkar
9cfa1b3074 Send notifications on litho's error boundary
Summary: Sends notifications to crash reportr plugin whenever the error boundary happens

Reviewed By: danielbuechele

Differential Revision: D13307473

fbshipit-source-id: dc0c6d2ebac32881fdb1aa5f63def824a115cf9e
2018-12-04 05:51:59 -08:00
Pritesh Nandgaonkar
37c973d0c9 Crash reporting plugin android (#328)
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
2018-11-26 03:43:26 -08:00
Pritesh Nandgaonkar
e02420ac78 Make android project compile with new gradle and build tools
Summary:
If this is not done. I get
```
Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1).
Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar
```
I follwed the suggestion given on [stack overflow](https://stackoverflow.com/questions/52944598/could-not-find-aapt2-proto-jar)

Reviewed By: jknoxville

Differential Revision: D12839581

fbshipit-source-id: aa02620c7e4c52899b2c2c4805fd8a6f168d946a
2018-11-15 06:37:55 -08:00
Ian Childs
7b569a1692 Remove getBaseContext
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
2018-11-07 04:20:13 -08:00
Pascal Hartig
a7fd546f0e Add basic integration test
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
2018-11-02 07:09:51 -07:00
Ian Childs
f3833a6e5a More prep for ComponentContext not extending Context
Summary: Per title

Reviewed By: astreet

Differential Revision: D12839032

fbshipit-source-id: c69805fd68a6530d1e56edad3bb5edf4089ee98a
2018-10-31 07:29:32 -07:00
Pascal Hartig
cb186d2af3 Fix sample app style issues
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
2018-10-20 05:11:14 -07:00
John Knox
6cc7f60cde Add sample js and android plugin
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
2018-10-19 09:44:05 -07:00
Hilal Alsibai
34c55262ce Reformat sample android app with google-java-format
Summary: Prettier code

Reviewed By: sjkirby

Differential Revision: D10181909

fbshipit-source-id: 05e4c2417dc04e65a95b69beb3694f240c9d954a
2018-10-06 11:41:35 -07:00
Hilal Alsibai
c7e0a26876 Update sample android app to use multiple shared preference files
Summary: Demonstrates the ability to have multiple shared preference files appear in Flipper

Reviewed By: sjkirby

Differential Revision: D10181910

fbshipit-source-id: 02acc02c722315da74dfb69542ca3ab1f26fa2e5
2018-10-06 11:41:35 -07:00
Pascal Hartig
90cf003035 Rename shared preferences plugin
Summary: Sonar -> Flipper

Reviewed By: priteshrnandgaonkar

Differential Revision: D9991095

fbshipit-source-id: 685775e373ae22abbb06b979fea8461c35de74b5
2018-09-23 04:13:55 -07:00
Pascal Hartig
c7f6893cb4 Rename network plugin
Summary: Sonar -> Flipper. Class names only for now.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9991029

fbshipit-source-id: b96dbab7acc89586c1ee67b64bef1c9490b560b5
2018-09-22 16:43:26 -07:00
Pascal Hartig
52fb0fc1b8 Rename LithoFlipperDescriptors
Summary:
As titled.
The controller you requested could not be found.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9990862

fbshipit-source-id: 459420adf400fd4504035fc36b14c5595f431f6a
2018-09-22 09:38:43 -07:00
Pascal Hartig
bd27a624cd Rename LeakCanarySonarPlugin to LeakCanaryFlipperPlugin
Summary: As before.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9990841

fbshipit-source-id: 4517d6949c3eb408b86b2b520d369134b006cf4f
2018-09-22 09:38:43 -07:00