Commit Graph

246 Commits

Author SHA1 Message Date
Dustin Bluck
825ecb8e23 SharedPreferencesPlugin -- Look for all shared pref files
Summary: Searches for all shared pref files instead of only the package name by default

Reviewed By: xiphirx

Differential Revision: D14763787

fbshipit-source-id: a3b7dfe8db078ac4f55e236b1516ed2de668f8d2
2019-04-03 18:16:05 -07:00
John Knox
ddd06971f1 NativePlugins: Implement sidebar sections in java
Summary:
Changes sidebar from just a bucket of json, to be a list of SidebarSections.
Currently implemented sections are Json, and Toolbar.

Reviewed By: passy

Differential Revision: D14620095

fbshipit-source-id: 6ba57f6f1ad954373c0bbb79570d779787e5d4db
2019-03-28 06:45:39 -07:00
John Knox
ff6988ddaf Java side of NativePlugins
Summary:
Adds abstract classes NativePlugin and TableNativePlugin.

Extend NativePlugin to implement a new NativePlugin type/template.

TableNativePlugin is an example of that. Extend TableNativePlugin to add a particular instance of a table plugin. See the stacked diff for an example of that (newsfeed inspector).

I think I'm going to change the NativePlugin implementation so it uses composition instead of inheriting from FlipperPlugin, so that the concrete subclasses don't get access to the FlipperPlugin primitive methods like onConnect etc. But I don't mind shipping this as is and changing it separately.

Reviewed By: passy

Differential Revision: D14505912

fbshipit-source-id: 0534147112aaf4c5a41d2d3e08de855767b2a010
2019-03-28 06:45:38 -07:00
Pascal Hartig
0b72c6082f Set up text filter to allow for correct emoji display
Reviewed By: jknoxville

Differential Revision: D14640808

fbshipit-source-id: 9ecdb15f32143f5615d5763b9da79c581698acc5
2019-03-28 03:12:50 -07:00
Pascal Hartig
d08a123ae4 Fix test
Summary: Add an ability to inspect errors reported through `ErrorReportingRunnable`.

Reviewed By: jknoxville

Differential Revision: D14640270

fbshipit-source-id: a5a79d647e20d5d46c85aac2a814c77abbc624b7
2019-03-27 10:12:04 -07:00
Vlad Albulescu
4d0b1d2fc3 remove unused constructor arg from MainThreadFlipperReceiver
Summary: Argument became unused in a previous diff.

Reviewed By: jknoxville

Differential Revision: D14642264

fbshipit-source-id: 99bc78a9cff8322e8bed337f201a4748039a0332
2019-03-27 09:50:54 -07:00
Vlad Albulescu
de46240272 explicitly report errors in MainThreadFlipperReceiver
Summary: Use responder rather than allowing exception to propagate.

Reviewed By: jknoxville

Differential Revision: D14538883

fbshipit-source-id: 2774a2adfcee356e1853fa3bf3c01aa113181262
2019-03-27 08:05:14 -07:00
Pascal Hartig
b2d1506f15 Fix SDK app crash
Summary:
I'm not sure why this was made an AssertionError in the first place
as this cannot be caught by a catch branch that only takes Exception-subclasses.

Given that this is expected behaviour in some cases, using an Error here
is rather dangerous.

This does not fix the underlying issue of the attached task, but fixes
the undesired crashing behaviour of the app.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14598611

fbshipit-source-id: b024b35f07e16755d9a4ab2f4a1f75b10d1353fb
2019-03-27 07:49:01 -07:00
Pascal Hartig
12700b8643 Remove test copy
Summary: Umm, not sure why this is still around. Looks like an `hg mv` gone wrong.

Reviewed By: jknoxville

Differential Revision: D14639300

fbshipit-source-id: 511116808c4e8ae684fc21454853a482a2c36122
2019-03-27 07:49:01 -07:00
Alex Dickson
99b0bf516e Make FlipperUtils parameters final
Summary: This diff makes the params final.

Reviewed By: jknoxville

Differential Revision: D14641443

fbshipit-source-id: 5c003bd09144a8d8dd848c04599388ace4baef4d
2019-03-27 07:44:16 -07:00
Mihaela Ogrezeanu
2d357a2ced Show state data in flipper Sections inspector
Summary:
as title; refactored getStateData for components so we can reuse
Depends on D14386744

Reviewed By: passy

Differential Revision: D14386910

fbshipit-source-id: 088605b920fd5b489d007e5daa69f4cd53fc3072
2019-03-20 09:13:21 -07:00
Mihaela Ogrezeanu
5195bfc0e4 Show Section props in flipper
Summary:
as title.
Refactored the getPropsData from DebugComponentDescriptor and extracted it to separate class so we can use it for SectionComponentDescriptor as well.
Will follow up with adding state info

Reviewed By: passy

Differential Revision: D14386744

fbshipit-source-id: c6b9887aa9d0c8d2333e7e64fa0954e56b505e51
2019-03-20 09:13:21 -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
Mihaela Ogrezeanu
50a1fa64d8 Use SoftReference in ObjectTracker
Summary:
if we use WeakReferences, DebugSection nodes are released very fast and highlighting doesn't work because the node is removed from the ObjectTracker.
passy do you know who else I can add as reviewer?

Reviewed By: passy

Differential Revision: D14385872

fbshipit-source-id: ecc63190a84a7186296ed9c4c82ff6ab2aca8ad2
2019-03-13 08:29:57 -07:00
Pritesh Nandgaonkar
1c8fffa20b Enable import all the nodes for android
Summary: Enables Import and Export for all the nodes for android. Also search and Accessibility feature works

Reviewed By: danielbuechele

Differential Revision: D14406016

fbshipit-source-id: 8976db66d1ca91e98c52983a31ea584764bde0f6
2019-03-12 07:08:24 -07:00
Pasquale Anatriello
a0ddb92cd2 Remove Reference API
Summary: Reference has been deprecated for a while. This diff completely removes it in favor of using ComparableDrawable everywhere.

Reviewed By: astreet

Differential Revision: D14241428

fbshipit-source-id: a986f34fda3a05c85d3d57b1e806c5e48c3f485e
2019-03-08 11:19:49 -08:00
Mihaela Ogrezeanu
410b6a6043 Update Section hierarchy when child views change
Summary:
we only include in the inspector hierarchy the sections which are visible on screen. If as a result of a UI change the hierarchy of visible sections changes (for example when scrolling to a section that wasn't previously visible) this forces the section hierarchy to be recreated.
passy not sure if there's an easier way of making the children of a node invalidate, let me know if you have any suggestions
Depends on D14300298

Reviewed By: passy

Differential Revision: D14301404

fbshipit-source-id: 551e1910d0a80238027e32417aab8d42ed1c00b3
2019-03-06 07:51:52 -08:00
Mihaela Ogrezeanu
de43fd29c6 Enable searching for sections in flipper
Summary:
as title, enables section name matching in the flipper search bar
Depends on D14300283

Reviewed By: passy

Differential Revision: D14300298

fbshipit-source-id: 33caefccf04b833c8606a083a13f3bffea6c419d
2019-03-06 07:51:52 -08:00
Mihaela Ogrezeanu
a665a12aec DebugSectionDescriptor non-null data and attributes
Summary:
these are not nullable. returning a non-null value
Depends on D14300226

Reviewed By: passy

Differential Revision: D14300283

fbshipit-source-id: bbc37161d2e01d94998cb287377742d8c5952bd1
2019-03-06 07:51:52 -08: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
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
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
aac9c40183 Open-source Fresco Android plugin
Summary: Let there be MIT!

Reviewed By: oprisnik

Differential Revision: D14150942

fbshipit-source-id: b907934e319d5ac7bd114a918fe79ca363724229
2019-02-21 03:30:02 -08:00
Pascal Hartig
e69306b34d Objecthelper
Summary:
Split off objecthelper into a (future) public and an fb-only version. This also open-sources the very first bit which is pretty useless on its own, but will already compile as its neatly stand-alone.

Note that this blocks releases until we have a stable version of Fresco to depend on.

Reviewed By: oprisnik

Differential Revision: D14149645

fbshipit-source-id: 0020d7ceccf89999695414ce389106ca6325ab7e
2019-02-21 03:30:02 -08:00
Pascal Hartig
d8d01b4a6f Remove global state for perf logger
Summary: Instead of installing some global mutable thing, pass it down. This also eliminates the rather gnarly side-effect of instantiating some visitor and suddenly logging information in an entirely different place.

Reviewed By: oprisnik

Differential Revision: D14131253

fbshipit-source-id: 760c6a3f85056e334ac1149c76ca4126fbfa7da4
2019-02-20 02:52:11 -08:00
Pascal Hartig
cf0003a87e Update perflogger package name
Summary:
Buck doesn't really care so the previous diff works out fine on
its own, but Android Studio is less forgiving.

Reviewed By: oprisnik

Differential Revision: D14131182

fbshipit-source-id: 0ad26e7c5f1e0776bdf07dda2f04bdf16183a5e8
2019-02-20 02:52:11 -08:00
Pascal Hartig
7f77dd1c1a Move logging interface out of QPL plugin
Summary:
This is generic enough, even though I strongly dislike the
installing mechanism, but that can be changed later.

Reviewed By: oprisnik

Differential Revision: D14131183

fbshipit-source-id: b75c1e1563ac9371cbc7d28b239c316a0aa1a9dd
2019-02-20 02:52:11 -08:00
Pascal Hartig
b594fb7c76 Fix download caching
Summary:
Not sure why, but if we stick this in the build folder,
the artifacts get downloaded every single time despite `onlyIfNewer`.

Reviewed By: jknoxville

Differential Revision: D14132383

fbshipit-source-id: 464e4a6e474877c16a06a6e83ccd1a2e355cbea2
2019-02-19 09:06:19 -08:00
Pascal Hartig
4e295f3247 Add DebugMemoryManager interface
Summary:
Bit ugly, but allows us to use this interface in open-source
and internally. There's no buck target as we only need this
for Gradle.

Reviewed By: oprisnik

Differential Revision: D14132467

fbshipit-source-id: 998df6ce31f1fb7d00ea99d6d28759f7e2c800c3
2019-02-19 08:36:07 -08:00
John Knox
8eb790b8b5 Fix Litho container props in layout inspector
Summary: The layout inspector isn't showing props for litho views. This fixes that.

Reviewed By: passy

Differential Revision: D14052057

fbshipit-source-id: fa6fe14785bc1588db6624c1319aedf88d843763
2019-02-14 09:30:41 -08:00
Edward Pastuszenski
dfbd12cd63 Expose FlipperArray construction from JSON
Summary: Enables `FlipperArray`s to be constructed from `JSONObject`s or JSON `String`s, as `FlipperObject`s can be.

Reviewed By: jknoxville

Differential Revision: D13996135

fbshipit-source-id: d8a445d907799cd51dcdb3ba832dfe6fddb7171e
2019-02-12 13:20:49 -08:00
Mihaela Ogrezeanu
73b816de16 Click to focus in hierarchy
Summary:
as title; this shouldn't change how focus worked before on views, but accounts for the new Section nodes
Depends on D13900789

Reviewed By: astreet

Differential Revision: D13900846

fbshipit-source-id: 093016c17b5c1351108dbd9c884bf99a1b4d49cb
2019-02-12 06:30:46 -08:00
Mihaela Ogrezeanu
8855687963 Highlight section
Summary:
as title, highlight a section when hovering over it
Depends on D13900729

Reviewed By: astreet

Differential Revision: D13900789

fbshipit-source-id: 552554f5ecf9a9dd3edf4724581b7dee6a8a855d
2019-02-12 06:30:46 -08:00
Mihaela Ogrezeanu
ec98c857c2 Enable section descriptors in Flipper from configDepends on D13803338/
Summary: as title

Reviewed By: passy

Differential Revision: D13803412

fbshipit-source-id: a9d511ca7d5466eb9b1f82f93b6c48879f0aa02e
2019-02-12 06:30:46 -08:00
Mihaela Ogrezeanu
e86a5166ad Add descriptors to view a Section as a child of LithoRecyclerView
Summary:
This doesn't add new behaviour. It adds NodeDescriptor implementations for rendering Section nodes inside Litho flipper inspector.
We'll consider LithoRecyclerView as the point where we can detect a section hierarchy, and it will (for now) have as a child a DebugSection which is the root of the SectionHierarchy.
Depends on D13802978

Reviewed By: astreet

Differential Revision: D13803272

fbshipit-source-id: a5367d97315349770201a29f5d5bd05baec0405e
2019-02-12 06:30:46 -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
Pascal Hartig
3478968d3f Add sectionsDebug dependency
Summary: Required to build new Sections plugin.

Reviewed By: mihaelao

Differential Revision: D13986716

fbshipit-source-id: 7ce07192c3e5258eb1eff9528d95ce40145e9b5c
2019-02-07 09:39:20 -08:00
Mihaela Ogrezeanu
3d03f44f1b Map highlight overlay drawable to view
Summary:
For the Sections plugin I need to be able to highlight multiple views at the same time (without highlighting their parent view). This enables us to do that. Let me know if you have any concerns
Depends on D13803412

Reviewed By: astreet

Differential Revision: D13900729

fbshipit-source-id: cdea9c21ceb11563793410b2bb8f7f2c3a44cefb
2019-02-04 06:11:58 -08:00
Brett Lavalla
fc1d32a3f9 Add accessibility role and role description to flipper
Summary:
This adds the concept of a custom role description to Flipper's accessibility inspector.  This functionality was added in support library version 24.1, and supported in Litho as of D8066609.

This will show both the AccessibilityNodeInfo's raw roleDescription under the AccessibilityNodeInfo section, as well as the derived role description under the main Accessibility section (see highlighted elements in screenshot below).

The difference between the raw role description and the derived role description is that the derived description will show any default description a role is given, such as "Button" for button roles.  This makes it clear that the role-description property will override those default strings.

Unfortunately making these mutable requires the AccessibilityRoleUtil class be restructured a bit to support EnumMapping for its roles, which isn't very straightforward due to these default descriptions being stored in the AccessibilityRole enum, so that will have to wait for a future diff.

Screenshot:

{F149099209}

Reviewed By: danielbuechele

Differential Revision: D13759563

fbshipit-source-id: 6eeb22a35f529663725630936af9967ea1f19c0c
2019-01-28 14:04:19 -08:00
John Knox
18b27f24ad Fix oss build
Summary:
A new test uses a non-public dependency causing the travis CI to fail.
Use the standard roboelectric one instead.

Reviewed By: passy

Differential Revision: D13801098

fbshipit-source-id: 9fcda26fceaed22d18bd743f10bf39eaae0da7a6
2019-01-24 05:19:47 -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
0daa5de428 Set parameters to non-null by default
Summary:
This helps Kotlin nullity inference and *should* already be enforced
by Infer/Eradicate. More details here: https://medium.com/square-corner-blog/non-null-is-the-default-58ffc0bb9111

Reviewed By: jknoxville

Differential Revision: D13732788

fbshipit-source-id: c0c60f0f8e9dc8bffe3780c7a1a700d682a6d2b8
2019-01-21 06:06:22 -08:00
Pritesh Nandgaonkar
c6efea991d Remove CrashReporter handlers
Summary: This diff removes the custom global exception handler which was being used to send crash notifications. Removing it in the favour of next diff, where we detect crash by looking at Logcat

Reviewed By: passy

Differential Revision: D13590049

fbshipit-source-id: 2914d51b2c5f33c1cade4926dbbf72c041047c71
2019-01-09 10:42:55 -08:00
Daniel Abramowitz
bb7c8a152a Generic layout inspector section
Summary: `PropWithNamedFlipperObject` is an interface that can be implemented by a Litho component prop to display a new section in the Flipper layout inspector.

Reviewed By: danielbuechele

Differential Revision: D13419918

fbshipit-source-id: be2ade160d6381944b1b68a7645b5b23f1d142a1
2018-12-19 09:43:31 -08:00
Pritesh Nandgaonkar
e3fb1e1d84 Disable crash reporter plugin for iOS and update callstack from array to string
Summary:
This diff does the following

- Comments out the code in iOS which sends the message to the desktop side
- Also comments out the part where signal handler is initialised, as we no longer need it. I will remove the iOS implementation completely in next few diffs
- Updated the JS side to expect call stack as a string instead of an array
- Updated the android side to send callstack as a string

I have commented out the code for crash reporter plugin of iOS as for iOS I will be adding a watchman  to a directory where crash logs are dumped. The diff related to this is in the stack

Reviewed By: passy

Differential Revision: D13424824

fbshipit-source-id: b1105da912292bf73cff948206c031de9b059abd
2018-12-18 13:42:40 -08:00
John Knox
e23da69db9 Use localhost instead of hardcoded IP address
Summary:
We can only do this when adb reverse is available, i.e. on Android 5+.
This also relies on a recent change to flipper desktop, to always run adb reverse on emulators.

Reviewed By: danielbuechele

Differential Revision: D10302579

fbshipit-source-id: cff07f0311d413fdd49424a42c641dfb3d225f7c
2018-12-18 07:31:43 -08:00