Commit Graph

68 Commits

Author SHA1 Message Date
Sara Valderrama
33e6538477 Highlight the current talkback-focused element in the accessibility tree
Summary: Highlights the element corresponding to the view talkback is focused on in green in the ax tree (and updates live as talkback moves).

Reviewed By: blavalla

Differential Revision: D9021542

fbshipit-source-id: c3bf6f5625aacb0cd054032b33a50541b88b2eaf
2018-07-31 04:14:49 -07:00
Sara Valderrama
ffe53d1345 Small sidebar update
Summary: Added some props to sidebar for ax mode.

Differential Revision: D8983386

fbshipit-source-id: eaf414dc8ae5386744c66f1d43b6b9068b9593c1
2018-07-26 15:48:00 -07:00
Pascal Hartig
8482e80c27 Move javatests/
Summary: That one was a doozy.

Reviewed By: jknoxville

Differential Revision: D8974692

fbshipit-source-id: bbdca0d5c598a2d1ebcc03f1456a7b17be5ffcf2
2018-07-26 02:05:02 -07:00
Sara Valderrama
41f4478a74 Basic mutual highlighting for Litho components
Summary: Shows basic relationship between the AX and nonAX tree litho nodes. When a litho component is selected from the nonAX tree, it's corresponding hostView or lithoView (root of the component tree) is highlighted in the AX tree giving priority to the hostView if it exists. If a hostView is selected in the AX tree, it's corresponding component is selected in the non-AX tree. If a lithoView is selected from the AX tree, it's corresponding lithoView is highlighted in the non-AX tree. This means that each hostView has a one-to-one highlighting between the two trees but lithoViews will have many nodes in the main tree that map to one node in the AX tree (which is accurate to litho components rendering but we may need to change in the future if it is not clear).

Reviewed By: jknoxville

Differential Revision: D8972205

fbshipit-source-id: d136f5b594d0ac1b66a82b35dc7b085186829fc4
2018-07-25 10:19:37 -07:00
Sara Valderrama
c57e6e4396 Expand trees together - including fragments, not including litho components
Summary: When expanding one tree, the other tree also expands. This expanding jumps over fragments (which are not in the accessibility tree) so that the trees can stay in sync even when there are extra wrappers in the main tree. Need to figure out functionality for litho components (these simply don't expand together right now since the relationship between the trees at these nodes are less obvious).

Differential Revision: D8943229

fbshipit-source-id: 289c3511a6495508b45a62da13ae4c50209e6118
2018-07-25 10:19:37 -07:00
Pascal Hartig
16093222c0 Move Litho plugin to xplat//
Summary: Last one of the plugins.

Reviewed By: jknoxville

Differential Revision: D8966725

fbshipit-source-id: 1564042c45815d324f7dc0ef6d9d024307787b49
2018-07-25 06:33:29 -07:00
Thomson Thomas
65239838f2 Fix the crash from okhttp interceptor (#168)
Summary:
Add a null check before creating a new response
Fixes #166
Pull Request resolved: https://github.com/facebook/Sonar/pull/168

Reviewed By: jknoxville

Differential Revision: D8915871

Pulled By: passy

fbshipit-source-id: aa93273f6fe90a8160133331e0844f67ff7e620a
2018-07-24 08:33:14 -07:00
Pascal Hartig
5b38cbdf76 Move OSS plugins
Summary:
This is a big one. Moves all oss plugins to a new place and leaves
stub targets in place. No logic changes. Everything apart from
BUCK files should be unchanged.

Reviewed By: jknoxville

Differential Revision: D8951045

fbshipit-source-id: 8054fb4028181d5cc4a240b1908dab6471cf0a27
2018-07-24 07:22:27 -07:00
Pascal Hartig
fb2b9cfc9f Update android lib build paths
Summary: Move manifest to correct place, update build.gradle accordingly.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8931222

fbshipit-source-id: e2cf4b507de4ea984b5a2dce1bb9edee0c4e2558
2018-07-20 08:20:50 -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
Pascal Hartig
07b083e570 Move sample source and resources to gradle dirs
Summary: Follow standard Gradle paths.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8890133

fbshipit-source-id: 062331b6b3d5f118f07cb5ca14cdec871f75867b
2018-07-19 09:50:04 -07:00
Pascal Hartig
f6b143135c Remove third-party from dependencies
Summary:
:third-party doesn't actually export anything. So we don't need to
explicitly depend on it as it messes with the POM generation otherwise.

Reviewed By: jknoxville

Differential Revision: D8913636

fbshipit-source-id: d0da6ed4c47e8d6b7986ec9f12960c9323ad1640
2018-07-19 08:48:13 -07:00
Austin Vandergon
5b0e742fe6 Call module init helpers on debug builds
Reviewed By: SeyelentEco

Differential Revision: D8879847

fbshipit-source-id: 812ff0098fc8e3c85ab0a33df5e4ade919209583
2018-07-18 17:24:35 -07:00
Sara Valderrama
0244f15dab Use views not components for Litho nodes in AX tree + more sidebar props
Summary: Switches the tree to use the view hierarchy for Litho nodes rather than Litho component hierarchy since Accessibility services interact with the views rendered. Includes a few more properties in the accessibility sidebar and updates to the segmented sidebar based on derived/non-derived properties for all views. Also adds functions to the AccessibilityUtil to be able to work on the accessibility sidebar while still leaving the non-accessibility sidebar unchanged. Eventually the accessibility panel will be removed from 'normal' mode and the original functions will no longer be necessary.

Reviewed By: blavalla

Differential Revision: D8881739

fbshipit-source-id: 9ce37e8f18025538cba2c86c0895ee38d13d024b
2018-07-18 17:03:32 -07:00
Pascal Hartig
818c5e9dc5 Move android package to xplat
Summary: That's the android package and all references to it.

Reviewed By: jknoxville

Differential Revision: D8875423

fbshipit-source-id: 478bb380012bc1327199d51527a7fe376824fce2
2018-07-18 08:04:23 -07:00
Pascal Hartig
ee86ea0338 Move testing to xplat
Summary: More moving.

Reviewed By: jknoxville

Differential Revision: D8859751

fbshipit-source-id: 23dac3808715000d672f843d5eff34e81ccf637a
2018-07-17 07:49:33 -07:00
Pascal Hartig
bd719e6c9e Move sonar core to xplat
Reviewed By: jknoxville

Differential Revision: D8859681

fbshipit-source-id: 6613d6b62d4433aa3dde60b34affd48752c53366
2018-07-17 07:49:33 -07:00
Pascal Hartig
c0d1510d58 Move android build files to xplat
Summary:
This should work with our existing shipit config. Moves the build
files to xplat and sets up a standard gradle directory structure
that we will continue to move more files into.

Reviewed By: jknoxville

Differential Revision: D8859483

fbshipit-source-id: 5df5882a3bcaee36280af68aeaa740290288e0d3
2018-07-17 03:34:54 -07:00
Sara Valderrama
5ceb3e4ffe Include non-drawable litho components in AX tree + small sidebar edit
Summary:
Fixed issue with DebugComponentDescriptors being left out of accessibility tree so the AX tree now includes all Litho view nodes (not Litho accessibility nodes yet). Litho drawables have no accessibility properties so these are not included. Also changed default for getAXChildAt to do whatever the original view tree does for that node and added a getAXChildCount function to better customize the accessibility tree.

Segmented the ax sidebar into properties directly form the view and properties derived from the AccessibilityNodeInfo.

Differential Revision: D8861129

fbshipit-source-id: 987683ef45188aa9cb587cc0e5ffba8fbf40136d
2018-07-16 17:04:15 -07:00
Pascal Hartig
cd6a5f9ff8 Reorganize native dep download and extraction (#154)
Summary:
This moves the native setup to a separate gradle file and unpacks everything outside the build folder. That way we don't throw everything away on every incremental build.

This is an intermediate step to get to a more declarative setup like Fresco has it and get rid of the individual hacks we have for every download.
Pull Request resolved: https://github.com/facebook/Sonar/pull/154

Reviewed By: jknoxville

Differential Revision: D8833812

Pulled By: passy

fbshipit-source-id: 2424c9d6e22e6092c04af344e06939b4a6aba041
2018-07-16 10:26:10 -07:00
Sara Valderrama
1c5ecce667 NodeInfo tree working (besides litho nodes)
Summary: The second tree has access to all AX NodeInfo properties (they are not in the sidebar yet). Infrastructure set up to customize displayed information bassed on what is most useful. Descriptors for views updated to include AX functionality and non-view descriptors AX functions defaulted to null/empty. Non-view nodes (like Fragments, Window, Appication) no longer included in AX tree. Corresponding nodes will be highlighted (although not expanded) on click in either tree.

Differential Revision: D8795800

fbshipit-source-id: cf2333f69bfecca3ff84aae62681c684dfa14bf3
2018-07-12 09:33:21 -07:00
Pascal Hartig
fcd1b1e773 Clean up dependencies (#153)
Summary:
Remove unused dependencies and centralise the remaining ones in the
global project config.
Pull Request resolved: https://github.com/facebook/Sonar/pull/153

Reviewed By: priteshrnandgaonkar

Differential Revision: D8820462

Pulled By: passy

fbshipit-source-id: 1c845898930eb62942379fddec6da39dbdc426d0
2018-07-12 09:05:55 -07:00
Pascal Hartig
c871496f8c Update build deps (#151)
Summary:
Update some build dependencies (gradle, android plugin) and make some
minor cleanups in the gradle files along the way.
Pull Request resolved: https://github.com/facebook/Sonar/pull/151

Reviewed By: priteshrnandgaonkar

Differential Revision: D8818841

Pulled By: passy

fbshipit-source-id: 78b6592dbf967553aadead57a60023a0b5ae79b6
2018-07-12 06:47:41 -07:00
Pascal Hartig
c7de8b8d37 Link against OpenSSL statically (#149)
Summary:
Compile against a static version of OpenSSL for better compatibility
with apps that already use OpenSSL in some fashion.
Pull Request resolved: https://github.com/facebook/Sonar/pull/149

Reviewed By: priteshrnandgaonkar

Differential Revision: D8804169

Pulled By: passy

fbshipit-source-id: 4de66a77806a3b3f01b2cf5f253916f2cf6f48e8
2018-07-11 08:42:02 -07:00
Daniel Büchele
c239fcac01 persist network plugin state
Summary:
This saved the state of the network plugin even when switching between plugins using persistedState.
A bug in the Android implementation didn't clear the events that were already sent to the desktop.

Reviewed By: jknoxville

Differential Revision: D8752098

fbshipit-source-id: 152ec5da83958ad8124686f780d39983cbce563f
2018-07-10 02:33:51 -07:00
John Knox
26d58557ee Android: Use separate thread for network connection
Summary:
We currently give sonar one event base from java / obj-c code to use for scheduling tasks.
This causes a problem, because we schedule reconnect tasks on the event base, and then these tasks interact with rsocket which schedules it's own tasks.
The problem is that we're passing rsocket the same event base. So the reconnect code executes and blocks waiting for rsocket to connect.
But rsocket can never connect because it never executes because that thread is blocked, so we get deadlock.

Fixing it by giving both processes their own event base / thread.

Reviewed By: danielbuechele

Differential Revision: D8748354

fbshipit-source-id: aa00766059f66fadfecb1970492bbb7107bbbfe4
2018-07-09 07:49:08 -07:00
John Knox
cebc409da6 Change SonarInitConfig to take two EventBases
Summary:
We currently give sonar one event base from java / obj-c code to use for scheduling tasks.
This causes a problem, because we schedule reconnect tasks on the event base, and then these tasks interact with rsocket which schedules it's own tasks.
The problem is that we're passing rsocket the same event base. So the reconnect code executes and blocks waiting for rsocket to connect.
But rsocket can never connect because it never executes because that thread is blocked, so we get deadlock.

This is the first step which just changes the interface to pass two event bases.
The consumers will be changed to pass in different threads next.

Reviewed By: danielbuechele

Differential Revision: D8748350

fbshipit-source-id: 481d6f23644f28fd0f1c786252605287019c999c
2018-07-09 07:49:07 -07:00
Conor O'Donnell
d45bc14cce Keep strong reference to OnSharedPreferenceChangeListener (#131)
Summary:
A strong reference to the listener should be kept when calling `registerOnSharedPreferenceChangeListener`, otherwise the listener can get garbage-collected and stop working.

Mentioned in the Android SDK docs [here](https://developer.android.com/reference/android/content/SharedPreferences.html#registerOnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener)):

> Caution: The preference manager does not currently store a strong reference to the listener. You must store a strong reference to the listener, or it will be susceptible to garbage collection. We recommend you keep a reference to the listener in the instance data of an object that will exist as long as you need the listener.
Closes https://github.com/facebook/Sonar/pull/131

Differential Revision: D8751484

Pulled By: xiphirx

fbshipit-source-id: e46715d637c89491770c266fc22c27db41beb042
2018-07-06 13:03:44 -07:00
Edoardo Tognoni
53753801b0 Open source the Sandbox plugin
Summary: This diff is mainly moving diffs around to open source the Sandbox plugin. I created the MD file writing some docs. The rest is just making our own FB implementation work

Reviewed By: danielbuechele

Differential Revision: D8731839

fbshipit-source-id: 27ac67223c6de9d1be406ab8c06b71b82d5407bc
2018-07-05 09:19:37 -07:00
Pascal Hartig
020a771125 Clean up Folly CMakeLists (#127)
Summary:
Remove left over from local testing.
Closes https://github.com/facebook/Sonar/pull/127

Reviewed By: danielbuechele

Differential Revision: D8723789

Pulled By: passy

fbshipit-source-id: f08203a441c35860dd5257a0ec147d1bf9c3da60
2018-07-04 11:33:36 -07:00
Pascal Hartig
3dcf7722bb Add support for x86_64 builds (#128)
Summary:
Add the required compiler flag for Folly when building x86_64.

I'll prepare a new release for this shortly.

Depends on #126
Closes https://github.com/facebook/Sonar/pull/128

Reviewed By: danielbuechele

Differential Revision: D8731955

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 9511811b0b51205989a5200ad9d0d8689ca684cb
2018-07-04 10:17:52 -07:00
Hilal Alsibai
e6fa377d75 Add extension support to InspectorSonarPlugin
Summary:
This mirrors the extension support added to the desktop plugin and allows people to dynamically
add extension commands

Reviewed By: danielbuechele

Differential Revision: D8691167

fbshipit-source-id: 60136b960f8bbdfa42b2077d1f5f7b391fc44443
2018-07-03 16:33:42 -07:00
Pascal Hartig
69711642c9 Build against vanilla OpenSSL 1.1.0h (#125)
Summary:
This uses OpenSSL 1.1.0h to build and link against. The `.so`s are
precompiled and hand-patched from [this
repository](https://github.com/passy/android-database-sqlcipher). The
patching was necessary to fix the `SONAME` and corresponding `NEEDED`
flags to *not* contain a `.1.1` version suffix as Gradle will refuse to
bundle those.

We basically only use the headers for the remaining part.

The precompiled version contains ABI support for `arm64-v8a`, `armeabi`,
`armeabi-v7a`, `x86` and most importantly `x86_64`. HOWEVER, `x86_64` is
still excluded for now because folly fails to compile due to a missing
compiler flag:

```
error: needs target feature pclmul
```

This should be easily fixable by ensuring that `-mpclmul` is added to
the CFLAGS if we're compiling for an `x86_64` target in the
`CMakeLists.txt` for Folly.

Closes #113.
Closes https://github.com/facebook/Sonar/pull/125

Reviewed By: priteshrnandgaonkar

Differential Revision: D8723636

Pulled By: passy

fbshipit-source-id: 41c61047d2793ebaef5793a3c937c4d628471d6a
2018-07-03 13:18:53 -07:00
Hilal Alsibai
c6eb0d6b1a Integrate shared preferences plugin in sample Android app
Summary: Adds the shared preferences plugin to the sample Android app

Reviewed By: sjkirby

Differential Revision: D8661572

fbshipit-source-id: 490a19938b9dd1c87f9200027d3395d719013d21
2018-07-02 11:05:14 -07:00
Hilal Alsibai
ceb16db812 Make the shared preferences plugin more flexible
Summary:
You don't necessarily need / have your shared preferences defined in a file that is your package
name. This adds the ability to pass in the name + mode you need to read the correct shared
preferences file.

Reviewed By: sjkirby

Differential Revision: D8661573

fbshipit-source-id: 49e57b0371228eca7fc4f06e8ba65ff8cc059b11
2018-07-02 11:05:14 -07:00
Pascal Hartig
0515ddb76e Setup fbjni sub-project for maven (#119)
Summary:
Set up our fbjni sub-project to be published to Maven Central.
This removes a bunch of abiFilters that we no longer make use of, too.
Closes https://github.com/facebook/Sonar/pull/119

Reviewed By: priteshrnandgaonkar

Differential Revision: D8694537

Pulled By: passy

fbshipit-source-id: de246fbda99c02856fbc7806b78df2114cb82acb
2018-07-02 01:19:35 -07:00
Pascal Hartig
167792e7d8 Remove NDK build from fbjni sub-project (#116)
Summary:
We're already building this as dependency via CMake of sonar itself and
bundle the resulting `.so` files in there.

This project only contains the java files so we can ship them as
separate JAR.

Importantly, this avoids having to use `pickFirst` as we bundle multiple
incompatible `.so` files in both AARs.
Closes https://github.com/facebook/Sonar/pull/116

Reviewed By: priteshrnandgaonkar

Differential Revision: D8691119

Pulled By: passy

fbshipit-source-id: 82303d6c2b5d7e12dcd8f49300090ce8e4570e47
2018-06-29 06:47:31 -07:00
Pascal Hartig
46df0b25a0 Set up Maven packaging and Bintray upload (#104)
Summary:
This make use of the the setup we have at Litho, which should make
it easier to keep them in sync.

It creates proper source jars, AARs (without bundling in unwanted
transitive deps) and POMs.
Closes https://github.com/facebook/Sonar/pull/104

Reviewed By: priteshrnandgaonkar

Differential Revision: D8638912

Pulled By: passy

fbshipit-source-id: ff4921c0683e9b6f859085b542ceae840a7e8291
2018-06-26 08:18:23 -07:00
Pritesh Nandgaonkar
110ff1c353 Package prebuilt libraries in android target (#105)
Summary:
package prebuilt libraries in `:android` rather than in sample app
Closes https://github.com/facebook/Sonar/pull/105

Reviewed By: passy

Differential Revision: D8639064

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 4da20b046e2e55f0f605f91bf8809a4efd6848d9
2018-06-26 07:32:46 -07:00
Pritesh Nandgaonkar
64a61a37d4 Fix Broken sample app (#103)
Summary:
With this fix the entire android setup builds with gradle . To try out the sample app, run `./gradlew :sample:installDebug`
Closes https://github.com/facebook/Sonar/pull/103

Reviewed By: danielbuechele

Differential Revision: D8618622

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 62a038f95c37cbadf48636a58ca222c8162e256e
2018-06-25 11:33:44 -07:00
Pritesh Nandgaonkar
452dfd7ecc Remove armeabi arch from gradle
Summary: Currently while building thru gradle got the error that armeabi is not supported.The supported ABI's by ndk are x86, x86_64, armeabi-v71, arm64

Reviewed By: danielbuechele

Differential Revision: D8611628

fbshipit-source-id: 80d9449c35a69aab020412b523f5c21fe6661de8
2018-06-25 06:02:32 -07:00
Pritesh Nandgaonkar
edfdd64950 [WIP] gradle builds but app freezes, updated fbjni so file is the possible culprit 2018-06-21 16:27:18 +01:00
Pritesh Nandgaonkar
a49d31a12d Remove comments 2018-06-19 18:31:18 +01:00
Pritesh Nandgaonkar
3a6d7928be Case sensitive path 2018-06-19 18:28:36 +01:00
Pritesh Nandgaonkar
88a6cff373 Fix merge conflicts 2018-06-19 15:31:33 +01:00
Pritesh Nandgaonkar
7405cd268a Merge branch 'master' of https://github.com/facebook/Sonar into Fix-Android 2018-06-19 14:13:59 +01:00
Pritesh Nandgaonkar
ffa6e744c2 update 2018-06-19 14:08:12 +01:00
Pritesh Nandgaonkar
88ecb9b494 app builds but not with sonarfb 2018-06-18 18:45:37 +01:00
Pascal Hartig
16a3e2fa27 Rename isInternalComponent to canResolve
Summary:
I'm sure there's a better way to describe what this does in the Javadoc, but I
can't really come up with one.

Also inlined one method which made another call which is now redundant.

I'd also really like to make this call entirely unnecessary by moving the logic
to `resolve()` so that overriding it automatically implies `canResolve` but the
edge cases for commonProps and treeProps make this rather unpleasant.

Reviewed By: IanChilds

Differential Revision: D8476911

fbshipit-source-id: 33c6a20da03e50cd1c1d4994e64ef8b43b2c68bc
2018-06-18 07:32:26 -07:00
Pascal Hartig
e820beba83 Centralize sample dependencies (#77)
Summary:
The support libraries where out of sync between the projects, causing
the sample build to fail with

```
> Android dependency 'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution
```

This makes sure that the sample submodule uses the top-level
dependencies and same versions.
Closes https://github.com/facebook/Sonar/pull/77

Reviewed By: emilsjolander

Differential Revision: D8447186

Pulled By: passy

fbshipit-source-id: e391501edd97fdbe6456b32cd7305d8be26e20db
2018-06-15 09:40:22 -07:00