Commit Graph

726 Commits

Author SHA1 Message Date
Michel Weststrate
2f7a84115c Fix image rendering
Summary:
Images in the network plugin are rarely displayed in the network plugin, as it tries to use the public url to preview it. However, that won't if the endpoint is behind authentication, idempotent, etc. This diff changes the behavior to instead send the network body to flipper and use that to preview.

Changelog: [Network] Fixed image preview

Reviewed By: jknoxville, passy

Differential Revision: D23370743

fbshipit-source-id: 0070e9e38c10a5761b9f7190467e26f01a7b2471
2020-09-02 05:13:06 -07:00
Paco Estevez Garcia
ff3584e2e0 Add support for tagged messages on the Layout Inspector
Summary:
Related diff [CK]: D23243009

This diff adds support for a protocol for layout messages where the type is recursively encoded as:

```
{
 kind: "type",
 data: ???
}
```

The meat of the diff is on FlipperEditor.java, SetDataOperations.java and InspectorFlipperPlugin.java. The others are there just for a change on an interface.

We check if the message adheres to the new encoding, otherwise we fall back to the old behavior. If it's the new encoding, the message is traversed recursively flattening the types to EditorValue using the type hints provided.

Reviewed By: muraziz

Differential Revision: D23243009

fbshipit-source-id: 0f313455885930f3beaaadb66f3bf394f109ea23
2020-08-28 08:56:21 -07:00
Paco Estevez Garcia
19b5b65081 Add picker types for Yoga Layout values
Summary: This diff converts several flexbox properties to picker values

Reviewed By: colriot

Differential Revision: D23396217

fbshipit-source-id: 581a609a5e6da85c40d4a20c81f020e1832f2f4c
2020-08-28 07:45:41 -07:00
Paco Estevez Garcia
ee809fe112 Add support for the Picker widget in Android
Summary: Adds support in Flipper for the picker widget. The way it reaches Flipper is a bit nasty, using `toString` to produce a JSON value.

Reviewed By: passy

Differential Revision: D23294091

fbshipit-source-id: e3398e6fb474e46bdaac1960aeaf57e201946413
2020-08-28 07:45:41 -07:00
Pascal Hartig
97adea5423 fbjni 0.0.4 (#1428)
Summary:
Just released a new version.

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

Test Plan:
`./gradlew :android:installDebug`

However, I'm tethering right now and this is taking ages so I haven't
been able to complete this.

Reviewed By: mweststrate

Differential Revision: D23295098

Pulled By: passy

fbshipit-source-id: aa53fa1c47f0b02d2c8b9f12d66b1c600a37075b
2020-08-27 03:45:40 -07:00
Michel Weststrate
7f9d4c35a0 Allow for larger ascii responses
Summary: See linked task, data larger than 5KB would always be reported as blob. Increased this limit to 100KB, since if the user is looking at this data, it is proactively requested so it is fine if it is larger

Reviewed By: jknoxville

Differential Revision: D23317197

fbshipit-source-id: f563a980fa9567ac7e2f950b83c1888a7b295d77
2020-08-25 08:49:24 -07:00
Paco Estevez Garcia
b109fc4d3e FQN Cleanup
Summary: Fixing a silly missing import

Reviewed By: muraziz

Differential Revision: D23265033

fbshipit-source-id: 0e78d19314df853d2c512535650d3294bf3099e0
2020-08-25 04:28:51 -07:00
Dominik Wielgórski
939ed27aad Detect if given Component is LithoComponent
Summary: Useful for next diffs: enables to detect whether we have LithoComponent or CKComponent

Reviewed By: adityasharat

Differential Revision: D23128972

fbshipit-source-id: b9aef358c1426df4f05213c42e43402e8cae984f
2020-08-17 10:20:53 -07:00
John Knox
9efcbdceaf Send large responses in chunks
Summary:
It's common for responses to be completely missing in the network inspector. This is because they are larger than can be serialized in one go on some devices, so we drop all messages larger than 1MB.

This changes the android client to send large responses in individually serialized batches. This way we avoid running out of memory and can still send arbitrarily large payloads.

Changelog: Android network inspector can now handle responses large than 1MB.

Reviewed By: passy

Differential Revision: D22999905

fbshipit-source-id: ff4eb8fa72a7e42ea90d12ffe0f20c6d1e58b7e5
2020-08-10 08:47:32 -07:00
James Harmon
6989fa608d Add HTTP Status Code to mock response for Route (#1441)
Summary:
Mock requests can currently only return an HTTP Status Code of 200.  This is not sufficient to take full advantage of the mocking feature.  It would be more useful to specify a status code for the response.  Then not only can the original request be tested, but failure of the call could be tested as well.

This is described in Issue https://github.com/facebook/flipper/issues/1423 [https://github.com/facebook/flipper/issues/1423]

Changelog: Allow user to change response code for a mock request

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

Test Plan:
Here is a video demonstrating the change
[Uploading response-status-code.mp4.zip…]

Here is a screenshot showing where the new HTTP status code is entered for the mock request:
![image](https://user-images.githubusercontent.com/337874/89370139-a1c1c500-d6a5-11ea-9a55-e5e99ba37af5.png)

This screenshot shows a mock response with an alternate return code:
![image](https://user-images.githubusercontent.com/337874/89370265-ecdbd800-d6a5-11ea-82e7-10afbd5dd939.png)

Reviewed By: jknoxville

Differential Revision: D22977811

Pulled By: passy

fbshipit-source-id: c1662dd02abeb4546c80a416ed87f8e0dadbf96a
2020-08-07 09:30:10 -07:00
Dominik Wielgórski
3a628019f7 Detect classes which are Litho Sections
Summary:
Populate class name for Litho Sections.
See D22922106 (86cafb9e80) for reference

Reviewed By: adityasharat

Differential Revision: D22949896

fbshipit-source-id: d804971708cf8c8466dd74eda3e750957dc95fc9
2020-08-06 13:11:27 -07:00
Dominik Wielgórski
86cafb9e80 Detect classes which are Litho Components
Summary: Populate class name for Litho Components.

Reviewed By: adityasharat

Differential Revision: D22922106

fbshipit-source-id: e18b748e0e0bd6f511558124a28b4b58d217ded7
2020-08-05 01:49:13 -07:00
Dominik Wielgórski
4c4097f0f8 Implemented menu to select ide
Summary:
Added IDE menu functionalities.
Changed minor UX detail - for classes that cannot be opened user will always see 'Can't open' prompt.

Design: https://www.figma.com/file/M0l6qhQqzllIcefVE4tQvG/Error-Reporter-IDE-Selector?node-id=82%3A0

Reviewed By: arpitratan, adityasharat

Differential Revision: D22790328

fbshipit-source-id: 8dfbcf7408c53947909bcf3fa700dee7ae47e14a
2020-07-30 04:30:06 -07:00
Mathias Fleig Mortensen
e466bc4aed Make disk cache inspection toggleable
Summary: Adds a toggle switch to show/hide disk cache images defaulting to inactive. The image data is only sent on the adb connection when the toggle is activated.

Reviewed By: defHLT

Differential Revision: D20002059

fbshipit-source-id: 05c9e515ffe09441e5cfb6f66eb14559ac4a322c
2020-07-27 09:44:52 -07:00
Paco Estevez Garcia
10f9a48540 Wire Editor to Flipper
Summary:
This diff implements the integration between a Litho Editor and Flipper. It does so by converting the Editor format to FlipperObject, and then converting it back from FlipperDynamic.

This conversion works for both `State` and `Prop`. We already provide default implementations for primitive + wrapped types and String, so the functionality should match the existing one.

Reviewed By: passy, Katalune

Differential Revision: D22455220

fbshipit-source-id: f7f633765f3d997ce6de09d2c1277019e72c0802
2020-07-27 05:09:16 -07:00
Dominik Wielgórski
1784eb78d9 Added buttons +notifications for opening in IDE functionality
Summary: Created buttons which enable opening in IDE for classes which are valid.

Reviewed By: adityasharat

Differential Revision: D22724496

fbshipit-source-id: 3532213ab7730aae5e61877ccfecd0558b329d57
2020-07-27 05:07:02 -07:00
Dominik Wielgórski
6561bc8f16 Added connection between InAppErrorReporter and Flipper Desktop App via Layout Plugin
Summary:
Created functionality which allows user to open clicked file from inAppErrorReporter.
Created "iface" interface for openInIDE API and created default implementation which indicates that openInIDE is not supported.
Created "impl" implementation specifically for fb4a.

Reviewed By: arpitratan

Differential Revision: D22642497

fbshipit-source-id: 7b3011c128a479e556b869fcc8c4147e153caf71
2020-07-23 13:47:09 -07:00
Dominik Wielgórski
cf6df492ee Created openInIDE API inside Layout Plugin
Summary: Created a communication between Layout Plugin and Flipper Desktop. The API allows users to open given file in a selected IDE. The openInIDE function returns true if the connection with Flipper is established, otherwise returns false.

Reviewed By: adityasharat

Differential Revision: D22625829

fbshipit-source-id: feaf186c107d62b1a75dfc6bbe2c1d66ffd7fd78
2020-07-21 09:27:53 -07:00
Pascal Hartig
51e7ce3566 Fragment sample test (#1328)
Summary:
Wanted to have a way to test fragment support in open source for https://github.com/facebook/flipper/issues/1209.

Stacked on https://github.com/facebook/flipper/issues/1327.
Pull Request resolved: https://github.com/facebook/flipper/pull/1328

Test Plan: ![Screenshot 2020-07-02 12 10 17](https://user-images.githubusercontent.com/9906/86352544-dc2ae300-bc5d-11ea-91f8-f6b06437f7bc.png)

Reviewed By: jknoxville

Differential Revision: D22356283

Pulled By: passy

fbshipit-source-id: 2ad84df0aae85634c8245e71f18b803ce8dd6ca0
2020-07-03 04:02:31 -07:00
Richard Zadorozny
91cccbe436 Sonar tag for skipping empty view groups in layout target mode
Summary:
I think it's somewhat common to have large containers that can hold future views, especially fragments. The problem is the presence of these containers can block the layout inspector's "target" mode.

I found out from cekkaewnumchai that Flipper does in fact return multiple results from the pick, but I think it could still be helpful to have this new tag since it is more convenient than having to do the secondary drill down each time.

Reviewed By: jknoxville

Differential Revision: D22284972

fbshipit-source-id: 1a2826ec746e4f31690db33ed72815ae168bffab
2020-07-02 08:39:35 -07:00
Paco Estevez Garcia
d871ce0a04 Extract TouchOverlayView to new class
Summary:
Before this diff, `TouchOverlayView` would be an inner non-static class,so it'd be difficult to track memory ownership for it.

It also made `InspectorFlipperPlugin` longer and harder to read.

Reviewed By: cekkaewnumchai

Differential Revision: D22285744

fbshipit-source-id: 6fdd8c33a07be6ab900ebb28a8c3ebf3761fb598
2020-07-01 11:05:46 -07:00
Paco Estevez Garcia
c1d9527406 Fix potential nullable accesss
Summary:
While ramping up to Flipper I found this potential NPE caused by ordering issues.

There are only 3 uses downstream that don't use a constant that's part of the default initializer.
```
λ festevezga-mbp xplat → buck build sonar/android/src/main/java/com/facebook/flipper/plugins/inspector/... 2>&1 | rg ' = descriptorForClass' | awk '{$1=$1};1' | sort | uniq -c
   5 NodeDescriptor descriptor = descriptorForClass(Object.class);
   3 NodeDescriptor descriptor = descriptorForClass(View.class);
   1 NodeDescriptor descriptor = descriptorForClass(node.getClass());
   2 final NodeDescriptor descriptor = descriptorForClass(Dialog.class);
  12 final NodeDescriptor descriptor = descriptorForClass(Fragment.class);
   5 final NodeDescriptor descriptor = descriptorForClass(Object.class);
  26 final NodeDescriptor descriptor = descriptorForClass(View.class);
   2 final NodeDescriptor descriptor = descriptorForClass(Window.class);
   1 final NodeDescriptor descriptor = descriptorForClass(node.getClass());
   1 final NodeDescriptor descriptor = descriptorForClass(topChild.getClass());
   2 final NodeDescriptor objectDescriptor = descriptorForClass(Object.class);
```

Reviewed By: muraziz

Differential Revision: D22284669

fbshipit-source-id: b41c8d78c70c5b5acdc08aa6f0e7afa681f4242d
2020-07-01 11:05:46 -07:00
pyricau@users.noreply.github.com
cfd8662c12 Fix ApplicationWrapper activity weakRef leak (#1301)
Summary:
Fix for https://github.com/facebook/flipper/issues/1300

The weak refs were not being cleared in two cases:

- On config changes, isFinishing() would be false in onPause()
- When calling finish() from Activity.onCreate(), onPause() isn't guaranteed to be called.

## Changelog
Pull Request resolved: https://github.com/facebook/flipper/pull/1301

Reviewed By: mweststrate

Differential Revision: D22286182

Pulled By: passy

fbshipit-source-id: 948d1d9b2145b6526c0030cf537330409ff7f8c4
2020-06-30 09:46:00 -07:00
Aziz Murtazaev
b7c34d336a Add ability to modify rotation value of components in Flipper layout inspector plugin
Reviewed By: colriot

Differential Revision: D21526381

fbshipit-source-id: ed692cb9c1bf7d38bef156d2e808b55c76ed3e05
2020-06-02 02:35:41 -07:00
Chaiwat Ekkaewnumchai
d7172df082 (client) Add Another Activity to Sample App to Test The Functionality
Summary: - add another activity where there are two component overlapping each other

Reviewed By: mweststrate

Differential Revision: D21040425

fbshipit-source-id: 5514b59140bbf6b726e6777191e1808be5ac5b6f
2020-05-07 03:40:59 -07:00
Chaiwat Ekkaewnumchai
f06dc46c06 (client) Change Litho Descriptor
Summary: Similar to previous diff but for Litho component

Reviewed By: mweststrate

Differential Revision: D21040426

fbshipit-source-id: 32e997269bbda472917c8ff6f176d05cf502b9dc
2020-05-07 03:40:59 -07:00
Chaiwat Ekkaewnumchai
c3bc168216 (client) Change Inspector Descriptor
Summary: Previously, descriptor stopped iteration (searching) as soon as it finds hit element. This diff changes so that it will always do complete search

Reviewed By: mweststrate

Differential Revision: D21040424

fbshipit-source-id: 9123c6382dcdfefd6df17a95d283f5123906df11
2020-05-07 03:40:58 -07:00
Chaiwat Ekkaewnumchai
d593409ec4 (client) Return Tree instead of Path
Summary:
- Add return parameter to `createTouch` method: stack of node. This reference will be used to retrieve the final tree structure to be sent back to desktop app.
- `Touch` now keeps every step in component tree (I have concerned for app performance here)
- Edit test to reflect changes

Note:
- `path` will also be returned to keep backward compatibility with older server (desktop) side

Reviewed By: adityasharat

Differential Revision: D21040429

fbshipit-source-id: 6c2b9792378bf08b19fbbda1d2381df8c357170c
2020-05-07 03:40:58 -07:00
Chaiwat Ekkaewnumchai
f275ee00c5 Add Keys for FlipperObject
Summary: This adds ability to iterate over FlipperObject before sending it to be processed on Flipper desktop

Reviewed By: mweststrate

Differential Revision: D21214901

fbshipit-source-id: a6186a42004f1afb70889a395b1df037447f9881
2020-05-07 03:40:58 -07:00
Dan Yang
56b4d43eb0 Database Plugin - Increase blob max length and attempt to render UTF-8
Summary: 512 is a pretty small blob length. Increasing it to 5120 and changing it to attempt to stringify UTF-8 if not ascii.

Reviewed By: jknoxville

Differential Revision: D21253132

fbshipit-source-id: 1cc9226b86a9b9ddfd73e29c8b0c04ac54b5b4b2
2020-04-29 16:11:22 -07:00
Chaiwat Ekkaewnumchai
168d06011f Try to Retrieve Body from Request
Summary:
Previously, requests were passed to process first in an interceptor, and it is responsibility of an interceptor to process requests for responses. In FlipperOkhttpInterceptor, we did read data from request body before processing it. This caused a bug when the network process itself wants to also read that data, but the stream has been closed because the interceptor has just read. The fix is to report request body after we have triggered network call so that we can just drop request body if we cannot read.

This diff tries to bring back the same functionality while not cause the bug to occur by cloning the content to be read by Flipper and using the same one for the request.

Reviewed By: jknoxville

Differential Revision: D21279679

fbshipit-source-id: 47f8b29a1896705d8d2d601661cd485db572d251
2020-04-29 10:47:16 -07:00
Scott Kyle
c7a6908093 Add API to retrieve Java Object from Flipper objects
Summary: There's no existing API on the Flipper objects to get an arbitrary Java object, which we need in an inspector plugin we're building (`getDynamic` requires you to know what you want in the end).

Reviewed By: jknoxville

Differential Revision: D21223329

fbshipit-source-id: 29e9f8788be404cec44c6ddeb6b56b939b97b766
2020-04-29 08:27:21 -07:00
Joshua Selbo
e6b7c9a346 Migrate Sonar Android tests (#1045)
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/1045

Reviewed By: passy

Differential Revision: D21181354

fbshipit-source-id: ddc329f8bafd5890b7428642d32f7f62e1d499ad
2020-04-23 15:19:32 -07:00
Pritesh Nandgaonkar
17ccdeaf6f Change the export logic for the Inspector
Summary:
This enables the feature which showed the theme information in the layout plugin. It was disabled due to the OOM which occurred while exporting flipper trace. The OOM happened when we tried to serialise the whole layout hierarchy and the amount of info added per node by the theme info was quite heavy. Thus removing it solved the OOM problem at that point, but its not the correct solution.

The problem is that each node has too much information and sending it at one stretch is very heavy and causes OOM. So instead of sending it at one stretch, I have broken it into multiple calls at each level of the tree. This no longer causes OOM and we will be able to show theme information too.

Also for iOS we don't have AXNodes call or AXRoot feature implemented, so anyway I had to put a check to not make those calls, so instead I have kept the feature of fetching all nodes on the iOS instead, as there has been no problem on the iOS side with regards to the OOM. But I am indifferent, the same logic will work for iOS too, it might increase the time to export.

issue discussed [here](https://fb.workplace.com/groups/flippersupport/permalink/854729375007722/)

Reviewed By: jknoxville

Differential Revision: D21136057

fbshipit-source-id: becd237a6d53c50af082597f2e8ed790c25cb966
2020-04-23 04:31:17 -07:00
Chaiwat Ekkaewnumchai
f3edfb36db Fix Stream Closed IOException
Summary:
Original Issue: https://github.com/facebook/flipper/issues/993

The exception occurs when OkHttp and we try to read request body twice, while it can be only read once.

Hence, we will read request body after it is processed by OkHttp.

Tradeoff for this is requests on Flipper will not appear immediately after fired, but they will appear together with their responses.

There are ways we can get rid of the tradeoff. For example, as demonstrated in D21167308, OkHttp ^3.14.0 contains method `isOneShot`, which can be used to check if we can read request body more than once. Another example is to change server side to accept nullable variable so that we can send request body and others separately.

Reviewed By: passy

Differential Revision: D21175341

fbshipit-source-id: 053789a2c2f28cd8149ea1bb36fd0cfe1c668df7
2020-04-22 09:28:11 -07:00
Michal Zielinski
2d1870cf7d Add support for deleting a shared preference (#1018)
Summary:
This change makes it possible to remove preferences. I also added a `Delete` context menu option to `DataInspector` because I needed it to implement this feature. passy confirmed that it makes sense to add this because delete is a common action.

Fixes https://github.com/facebook/flipper/issues/451
Pull Request resolved: https://github.com/facebook/flipper/pull/1018

Reviewed By: jknoxville

Differential Revision: D21086308

Pulled By: passy

fbshipit-source-id: 551ff0908d5e6c93f58d6012b42e1ee3531de997
2020-04-17 09:01:04 -07:00
Pascal Hartig
66ca9ad8ee Add ndk specifier to glog
Summary:
Forgot to add it here previously, so it will diverge
from others if there's a global NDK env var set.

Reviewed By: nikoant

Differential Revision: D21061431

fbshipit-source-id: 0a90211a63497bac467b2b9598c7c058145857cc
2020-04-16 06:01:14 -07:00
Pascal Hartig
99a4884fad Bump Gradle plugin to 3.6.1 (#958)
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
2020-04-06 06:43:43 -07:00
Pascal Hartig
4be1b4d491 Add support for AndroidX fragments (#957)
Summary:
Fix https://github.com/facebook/flipper/issues/931

This is not how I would *like* to fix this, but it should do the job.
When the switch over to AndroidX was made, the overall abstraction
started to leak and we really need to remodel this in its entirety.
There's also the question of whether we want to support both support
fragments and AndroidX fragments or not. Right now it's kinda-sorta
supported but only under some circumstances, which is not great.

I also added some more defensive try/catches as there's some unsafe casting
involved and future changes may break this causing the entire layout to disappear.

Change Log: Fix support for AndroidX fragments in Layout Inspector.

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

Test Plan:
Changed the sample app to include some AndroidX fragments and they
now show up (again) in the view hierarchy:

![Screenshot 2020-04-01 13 40 53](https://user-images.githubusercontent.com/9906/78138910-915fbc00-741f-11ea-8386-4eeca9b7f932.png)

Tested internally that FB4A fragments show up again, too:

{F233098198}

Reviewed By: mweststrate

Differential Revision: D20792503

Pulled By: passy

fbshipit-source-id: 7030b897ab547d1e8803b7f0d7aaa34263cfaed2
2020-04-03 09:21:03 -07:00
Mathias Fleig Mortensen
57c573d973 Add disk cache support for Images plugin
Summary:
Tracks images in disk cache. It seems performant even with 500+ images in disk cache. Sidebar displays the local path for an image when that image is selected. Shows total size of images in disk cache. 'Clear Cache' clears the disk cache.

For now we unpack the async cache request in the plugin, should implement a `getSync()` method on `bufferedDiskCache` in the future. For some reason Flipper doesn't work with a blocking call (https://fburl.com/smj0s4li).

Reviewed By: defHLT

Differential Revision: D20001062

fbshipit-source-id: 1e7a7900e9f42d05e3bf30472e57cd643caa5aca
2020-03-27 06:32:46 -07:00
John Knox
84e9756b83 Catch Error, not just Exceptions in ErrorReportingRunnable
Summary: We can OOM in flipper, and we'd like to catch those and prevent them from crashing the app. They are Errors, not Exceptions.

Reviewed By: mweststrate

Differential Revision: D20648824

fbshipit-source-id: 60002a3c950518e56189776f05df8f2c92a851f0
2020-03-25 17:39:21 -07:00
John Knox
a30d5f3e60 Don't throw when reporting network request
Summary: Flipper should never crash the mobile app. This is a plugin entry point, so it's understandable that it can, but we should avoid it whenever possible.

Reviewed By: passy

Differential Revision: D20648373

fbshipit-source-id: f32b428cccdd0c78eb15e9e95a64ecf3f4e10429
2020-03-25 17:39:20 -07:00
Chaiwat Ekkaewnumchai
79141f5fd2 (Client) Clean up Android FlipperOkHttpInterceptor
Summary:
This is the change made by Pascal at D19813495. to clean up the file

Shouldn't really change how it works but makes it
safer and brings it in line with our coding standards.

Reviewed By: passy

Differential Revision: D20474258

fbshipit-source-id: 67d77316a5b7efd7258072b4f35a2d9c50de408e
2020-03-23 22:03:10 -07:00
Qichuan (Sean) ZHANG
d27e45d7bb (Client) Network Response Mocking Logic for Android Clients (Original PR) (#488)
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}

![60549983-187ce800-9d59-11e9-8f7a-4b1b6402653d](https://user-images.githubusercontent.com/410850/61124971-0c242800-a4db-11e9-8e11-8a0a45bbb621.gif)

- 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
2020-03-23 22:03:10 -07:00
Chaiwat Ekkaewnumchai
4ea1497387 (Client) Add isMock to ResponseInfo Object
Summary:
per title

Note:
- This is a part of this PR: https://github.com/facebook/flipper/pull/488

Reviewed By: jknoxville

Differential Revision: D20474257

fbshipit-source-id: d2ac79d03ac67453bd67ecc46ace973be1590c04
2020-03-23 22:03:09 -07:00
Chaiwat Ekkaewnumchai
4eccacbac8 (Client) Add Connection Listener to BufferingFlipperPlugin
Summary:
- Add a new listener to be called when the plugin is initialized

Note:
- This is a part of this PR: https://github.com/facebook/flipper/pull/488

Reviewed By: jknoxville

Differential Revision: D20474259

fbshipit-source-id: ef1673ffa7fbc087761a753fbae813346bd481c3
2020-03-23 22:03:09 -07:00
Pritesh Nandgaonkar
cfb82ad8c8 Fix the broken export of layout plugin in android(not easily reproducible)
Summary:
There was a bug reported recently where the fetching all the nodes failed and the error is pasted [here](https://our.intern.facebook.com/intern/paste/P127476330/). From the paste we can see this `android.content.res.Resources$NotFoundException: Unable to find resource ID #0x0`.

Reported bug is [here](https://fb.workplace.com/groups/flippersupport/permalink/830359447444715/)

I was able to repro this luckily

{F231474948}

Reviewed By: xiphirx

Differential Revision: D20441839

fbshipit-source-id: 9e9bfd15422c0f6c6f7a71aa22e9b1c8d640ec4a
2020-03-18 21:11:13 -07:00
Hilal Alsibai
68bc277c6c Add theme data for components in the layout inspector
Summary: Adds the theme information relating to a Litho component in the layout inspector

Reviewed By: sjkirby

Differential Revision: D20133889

fbshipit-source-id: 93acb745f47c1ff9ce37be35a05b4a6269193a47
2020-02-27 12:36:30 -08:00
Sim Sun
4a2349c42d refactor(asan): remove asan checker
Summary: Remove asan checker, we can use `BuildConfig.IS_ASAN_BUILD` to check whether it's a asan build to instead of invoking a JNI api.

Differential Revision: D20088093

fbshipit-source-id: f26d367430a983fbe7b630919a4131fdf2e2d510
2020-02-25 21:48:28 -08:00
Hilal Alsibai
33bbeadfe9 Add theme information for Application, Activity and View descriptors
Summary: This will query for and display all of the associated theme information for each of the descriptors.

Reviewed By: passy

Differential Revision: D20008056

fbshipit-source-id: 720d224144b0822528ca8e23cdbec9fe9dd25e6b
2020-02-24 11:33:01 -08:00