Commit Graph

35 Commits

Author SHA1 Message Date
Billy Ng
3804ccf898 Revert D36052198: Partially remove dependency on folly async
Differential Revision:
D36052198 (ade685c621)

Original commit changeset: 170d64a324a1

Original Phabricator Diff: D36052198 (ade685c621)

fbshipit-source-id: 69d2b18e70a6267667432d6ed9dc1c5bc545b417
2022-05-12 18:47:41 -07:00
Lorenzo Blasa
ade685c621 Partially remove dependency on folly async
Summary:
This change isolates the usage of folly async from Flipper. Is now self-contained in Flipper Folly schedulers.

Users of Flipper can decide not to use the types defined in that header and implement their own.

NOTE: changes are minimal, we are just replacing direct calls to folly event base with a scheduler which simply relays this on to folly.

Reviewed By: fabiomassimo

Differential Revision: D36052198

fbshipit-source-id: 170d64a324a1f1f100224e2622a59cbac3c8b642
2022-05-12 17:56:17 -07:00
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
Lorenzo Blasa
6a4a867f74 Enable WebSockets for Android
Summary: This change effectively prioritises WebSocket over RSocket connections for Android.

Reviewed By: passy

Differential Revision: D32490095

fbshipit-source-id: 836438970f0668521ca6e7fab6c106e77f951652
2021-12-02 02:28:50 -08:00
Lorenzo Blasa
60de2bc147 Addresses a few issues raised during tests
Summary:
This change addresses a warning and provides a safer way of resolving the connection promise.

Also, fixes an issue whereas the websocket connection was not being reestablished as the listener is not notified when we manually disconnect.

Reviewed By: passy

Differential Revision: D32591859

fbshipit-source-id: 78ce4eac5414a924217867f2f47b04829da3b705
2021-11-29 03:50:08 -08:00
Lorenzo Blasa
a935ab8a6c Android Web Socket (#2978)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2978

Flipper Android WebSocket provider and socket implementation

Reviewed By: ldelgadoj

Differential Revision: D31683510

fbshipit-source-id: d553a7fdee9451da742e9ea3e6e5b6a2c9417579
2021-11-08 09:22:48 -08:00
Andres Suarez
731e39445f Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25861849

fbshipit-source-id: 840dc1061e557717c7f9ffcccbc09c24b96b78e0
2021-01-10 10:07:30 -08:00
Andres Suarez
c315691b2d Apply clang-format
Differential Revision: D19843069

fbshipit-source-id: af3f3998e2259ca5070b43ffb19933cf9304319d
2020-02-11 19:29:23 -08:00
Pascal Hartig
9e96f0c7c2 Remove closed task references
Summary: No longer relevant.

Reviewed By: jknoxville

Differential Revision: D17951216

fbshipit-source-id: 2ef2a97c594af7cf9c134555779765872cfa0eb4
2019-10-16 08:08:23 -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
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
Pritesh Nandgaonkar
5169d318de Fix the callstack sent from error reporting runnable
Summary:
The crash logged from `ErrorReporterRunnable` wasn't detailed. For example look at the following video.
Also for some reason the `FlipperConnection` interface doesn't have an argument for crash name. Thus I changed the js side of the plugin to accept `crash.name` to be undefined.

{F155526537}

Reviewed By: passy

Differential Revision: D14852561

fbshipit-source-id: 6daf9847535b4508fa312b4f940b014911aae2e5
2019-04-15 05:51:37 -07:00
John Knox
e594176401 Handle any exception pointers at top level
Summary: If a plugin thows an exception pointer instead of by value, we should capture it and stop the app from crashing.

Reviewed By: passy

Differential Revision: D14243644

fbshipit-source-id: a2e5dde2b36c430355552e3305634baa5913b703
2019-02-28 05:39:52 -08:00
John Knox
4a3de26a88 Add requestResponse handler for incoming calls
Summary:
Flipper exposes a call() api to plugins which lets them call their sdk component, and it returns a promise with the response.
Currently this is done by sending a fireAndForget request, noting the id of the request, and then receiving fireAndForget requests and matching up the ids to give the result back to the right plugin promise.

Instead, it will be simpler to use rsocket requestResponse, instead of fireAndForget, which is for this exact use case. This diff adds a requestResponse handler to the SDK, so that it can deal with such requests and respond accordingly, while preserving the current functionality if it receives a fireAndForget.

So this part is backwards compatible and should be safe to land in isolation.

A later diff will change the desktop app to use requestResponse, which may not be backwards compatible, so that will have to be deployed more carefully.

Reviewed By: passy

Differential Revision: D13974049

fbshipit-source-id: b371d94a86b1f186375161ed8f2242a462ce418f
2019-02-11 14:06:55 -08:00
John Knox
324a7ae873 Enable flipper android to use different ports based on prop
Summary:
Part 1 of enabling flipper to run on custom ports: android SDK.
Still to go: iOS SDK and desktop

This should allow you to run mobile apps that use flipper on different ports than the default (8089,8088).

`adb shell`
`su`
`setprop flipper.ports 1111,2222`

From what I can tell, this only works on rooted devices.

Reviewed By: passy

Differential Revision: D13753238

fbshipit-source-id: c5f370c9d8c7382e8c17fb81d4010c642ef7c114
2019-01-24 03:12:13 -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
ddbb3c7f89 Make android sdk crashless
Summary: This diff wraps all the important places where the java code is called in a try-catch block in order to avoid flipper bringing down an app.

Reviewed By: jknoxville

Differential Revision: D12839504

fbshipit-source-id: 4711bccbe6d50094d76ed7ecd1eb652cefc2a090
2018-11-19 04:29:34 -08:00
Pritesh Nandgaonkar
14e38c087f Add runInBackground Interface method
Summary:
Add support for plugins to opt in to background for android.
This diff does the following
- Adds a method `runInBackground` in java interface of `FlipperPlugin`
- Make the network plugin opt in to run in background

Reviewed By: danielbuechele

Differential Revision: D10360033

fbshipit-source-id: b31c7550d00b760b7033c150232e3925b6272d24
2018-10-15 05:47:25 -07:00
John Knox
3838decf1d Rename SONAR_OSS compiler flag
Summary: Part of sonar to flipper rename

Reviewed By: passy

Differential Revision: D9920332

fbshipit-source-id: 99b5cf33c07ca5d9cd59af21490fea18272e67d9
2018-09-24 07:00:44 -07:00
John Knox
c1295b1bc9 Rename SonarState* to FlipperState*
Summary: Part of sonar to flipper rename

Reviewed By: passy

Differential Revision: D9919821

fbshipit-source-id: a44a2a04d5463750f884f8bf1328e02d56593e82
2018-09-24 06:03:51 -07:00
John Knox
1d2793f701 Rename SonarWebSocket
Summary:
Part of Sonar -> Flipper rename.
It's about time this is renamed from *Websocket as well, since it doesn't use websockets anymore.

Reviewed By: passy

Differential Revision: D9919695

fbshipit-source-id: 78a63bfb7d5de19c093b7fb775d1426b4fc58f77
2018-09-24 06:03:51 -07:00
John Knox
5350d3ce7a Rename C++ SonarPlugin class
Summary: Part of sonar -> flipper rename

Reviewed By: passy

Differential Revision: D9917615

fbshipit-source-id: e59f43bf003d30ae6be4d95bc4a21c92ab39f732
2018-09-24 06:03:50 -07:00
Pascal Hartig
9a841d369b Rename android package classes to Flipper
Summary: Rename SonarClientImpl, SonarConnectionImpl, SonarResponderImpl, SonarThread.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9966853

fbshipit-source-id: e9f0faa32aff6efa2287aa94f6da6b6b395b7a1f
2018-09-22 05:13:24 -07:00
John Knox
9889df3f3c Rename SonarConnection to FlipperConnection
Summary: Part of Sonar -> Flipper rename

Reviewed By: passy

Differential Revision: D9907353

fbshipit-source-id: 01f7bb84da1c27fd68d608151f437a18b6eaaa4e
2018-09-20 17:06:54 -07:00
John Knox
3c656de7fa Rename SonarClient to FlipperClient
Summary: Part of the Sonar -> Flipper rename

Reviewed By: passy

Differential Revision: D9871902

fbshipit-source-id: 4b64953cb1a64235d47caaf0fabfb560bb85f7a2
2018-09-20 17:06:53 -07:00
John Knox
df8763e697 Move xplat/sonar/xplat/Sonar* to Flipper*
Summary:
Part of the Sonar -> Flipper rename
Intentionally left externally visible buck target as Sonar for now to minimize diff size.

Reviewed By: passy

Differential Revision: D9871684

fbshipit-source-id: 6926eb62c578a05cd895745c75ed7da3cfe965b5
2018-09-20 15:39:57 -07:00
Pascal Hartig
0a20d95195 Rename java core classes
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
2018-09-20 10:33:43 -07:00
Pascal Hartig
88ca69a13f Rename Java packages from sonar to flipper
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
2018-09-19 09:12:06 -07:00
John Knox
9d9fa17134 Rename all The c++ JNI classes
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/272

Reviewed By: passy

Differential Revision: D9861432

Pulled By: jknoxville

fbshipit-source-id: 523b8fc28541b922bbcc0939514f4ddd0a3fc1b0
2018-09-18 07:27:28 -07:00
John Knox
a480be90a2 Rename facebook::sonar namespace
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/271

Reviewed By: passy

Differential Revision: D9861393

Pulled By: jknoxville

fbshipit-source-id: d65f751c35028748915023f33f273d6ec45863c8
2018-09-18 07:27:28 -07:00
John Knox
660da3f80e Add getStateSummary method for diagnostics
Summary:
Adds a more structured representation of state updates than a multiline string.
Also changes the string form to omit [started] records.

Reviewed By: danielbuechele

Differential Revision: D9315503

fbshipit-source-id: 55b8f9572091fd42fe852c8d26a8f2a53f76c82a
2018-08-15 05:11:54 -07:00
John Knox
91e94815b4 Add state tracking plumbing
Summary:
The plan is to get SonarState to take update events and aggregate them into an object, that can be displayed in the UI so you can see what sonar is currently trying to do, and what if anything is failing.
This is pretty rubbish right now, as it just uses a single string to represent state, this is just the initial version I'll iterate on.
I also need to pass the SonarState into the SonarWebSocketImpl, since that's where a lot of the heavy lifting is done, but as long as something is logging state updates here, it proves the concept.
SonarStateUpdateListener is the interface that will be implemented by android and iOS implementations. These implementations will notify an activity or screen that the state has changed and they should reflect that.

Reviewed By: danielbuechele

Differential Revision: D9150551

fbshipit-source-id: 8dd585ca503d32e684ff843d66a59a50a420b4c0
2018-08-07 09:59:26 -07:00
Daniel Abramowitz
410e6d14c8 Revert D8932114: [sonar] Add state tracking plumbing
Differential Revision:
D8932114

Original commit changeset: fb03babfe92b

fbshipit-source-id: a6a372a4115d69b5419a8c9924b333e7c163497b
2018-08-03 08:27:42 -07:00
John Knox
fb447e4f84 Add state tracking plumbing
Summary:
The plan is to get SonarState to take update events and aggregate them into an object, that can be displayed in the UI so you can see what sonar is currently trying to do, and what if anything is failing.
This is pretty rubbish right now, as it just uses a single string to represent state, this is just the initial version I'll iterate on.
I also need to pass the SonarState into the SonarWebSocketImpl, since that's where a lot of the heavy lifting is done, but as long as something is logging state updates here, it proves the concept.
SonarStateUpdateListener is the interface that will be implemented by android and iOS implementations. These implementations will notify an activity or screen that the state has changed and they should reflect that.

Reviewed By: passy

Differential Revision: D8932114

fbshipit-source-id: fb03babfe92be53771eb4d8f10de7ecdc7f1a6d8
2018-08-03 07:42:16 -07:00
Pascal Hartig
c3e8a2d22a Fix cpp build paths
Summary:
Those hadn't been updated as part of the move and cause runtime
failures.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8931211

fbshipit-source-id: bc874eeea39134d6da9e16f6771bf0d3d3c02473
2018-07-20 08:20:50 -07:00