-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android embedding refactor pr3 add remaining systemchannels #7738
Android embedding refactor pr3 add remaining systemchannels #7738
Conversation
shell/platform/android/io/flutter/embedding/engine/systemchannels/AccessibilityChannel.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformChannel.java
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The locale passing part LGTM, deferring additional review of other parts to others as I am not particularly familiar with the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
shell/platform/android/io/flutter/embedding/engine/systemchannels/AccessibilityChannel.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a partial review for up to shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java
. I'll try to review the rest soon. In the future it would be really helpful if PRs like this were split into smaller chunks. 2000 net code lines changed is challenging to try and go through in one review.
shell/platform/android/io/flutter/embedding/engine/systemchannels/AccessibilityChannel.java
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/AccessibilityChannel.java
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformChannel.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformChannel.java
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformChannel.java
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformChannel.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java
Outdated
Show resolved
Hide resolved
shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java
Show resolved
Hide resolved
* A text editing configuration. | ||
*/ | ||
public static class Configuration { | ||
public static Configuration fromJson(@NonNull JSONObject json) throws JSONException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe document what the JSONObject should be formatted to look like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm of two minds about this. On the one hand I agree with you that it would be really nice for devs to look at the javadoc and see the format. On the other hand I'm wondering how many days it will take for that comment to fall out of sync with the code.....what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the inherent problem with Javadoc and code comments, unfortunately. Right now this is basically taking an untyped Object object
and then risking exploding at runtime if it doesn't happen to be the right things. It makes sense to me that the right structure should be documented somewhere. If not here than it makes sense to link to an example file or something similar where you can see the keys.
shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java
Outdated
Show resolved
Hide resolved
I'm going to force push a rebase to handle the conflicts. |
ad3351a
to
03ca20c
Compare
03ca20c
to
b7fcd5b
Compare
@mklim please take another look when you get a chance. I responded to each of your comments. Only a couple were left open ended. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The classes I've looked at in detail LGTM in terms of Java style. Unfortunately I haven't reviewed the entire PR though.
Gonna merge this in with the understanding that @mklim is welcome to add more comments later if he gets time to review this any further, but I believe the reviews and modifications up to this point cover the important stuff. |
This appears to have broken the build. |
…lutter#7738)" From build log: ``` ../../flutter/shell/platform/android/io/flutter/view/FlutterView.java:95: error: cannot find symbol private final LocalizationChannel localizationChannel; ^ symbol: class LocalizationChannel location: class FlutterView ../../flutter/shell/platform/android/io/flutter/view/FlutterView.java:172: error: cannot find symbol localizationChannel = new LocalizationChannel(dartExecutor); ^ symbol: class LocalizationChannel location: class FlutterView 2 errors ``` This reverts commit 256db4b.
…7738)" (#7849) From build log: ``` ../../flutter/shell/platform/android/io/flutter/view/FlutterView.java:95: error: cannot find symbol private final LocalizationChannel localizationChannel; ^ symbol: class LocalizationChannel location: class FlutterView ../../flutter/shell/platform/android/io/flutter/view/FlutterView.java:172: error: cannot find symbol localizationChannel = new LocalizationChannel(dartExecutor); ^ symbol: class LocalizationChannel location: class FlutterView 2 errors ``` This reverts commit 256db4b.
flutter/engine@033f207...163a2fd git log 033f207..163a2fd --no-merges --oneline 163a2fd Revert "Android embedding refactor pr3 add remaining systemchannels (#7738)" (flutter/engine#7849) 0d6ff16 Shut down and restart the Dart VM as needed. (flutter/engine#7832) 256db4b Android embedding refactor pr3 add remaining systemchannels (flutter/engine#7738) 02d7ca3 Don't call static method from instance variable (flutter/engine#7841) 10cee61 Delete GL textures when they are released from the texture registry. (flutter/engine#7836) 69e4606 Fix NullPointerException in SurfaceTextureRegistryEntry (flutter/engine#7837) 9a965bc Fix NullPointerException in ResourceCleaner (flutter/engine#7838) 2acd794 Add fml::FileExists implementation for Windows (flutter/engine#7845) fa38a98 Update buildroot to 7f64ff4928e to unblock Mac builds. (flutter/engine#7846) 1ba3295 Add support for calling into other plugins from a background context on iOS (flutter/engine#7843) df2fc97 Roll src/third_party/skia 154acd7a1374..be9aff25bddc (13 commits) (flutter/engine#7842) 0ca1d1f Remove the Dart JIT snapshot data from AOT builds of the embedder library (flutter/engine#7806) c51ea41 Roll src/third_party/skia 7a74c7cb6da0..154acd7a1374 (1 commits) (flutter/engine#7840) ecbaea1 Ensure to pass dill file after VM options for gen_snapshot (flutter/engine#7839) 5d3f714 Roll src/third_party/skia b00f7b34751b..7a74c7cb6da0 (1 commits) (flutter/engine#7835) 7337399 Roll src/third_party/skia 9a88bee122f1..b00f7b34751b (24 commits) (flutter/engine#7831) 6f318ef Move up ndk version that is being downloaded(old one no longer available) (flutter/engine#7830) a8aa1ee Track flow id (flutter/engine#7826) b1ce6b7 Roll src/third_party/skia a0dcd29f536b..9a88bee122f1 (4 commits) (flutter/engine#7825) dbc1663 Roll src/third_party/skia 6152470dc69e..a0dcd29f536b (2 commits) (flutter/engine#7824) 9426776 Roll src/third_party/skia 4037f7f5d8b4..6152470dc69e (1 commits) (flutter/engine#7823) e2394ad Add flow events connecting pointer events to frames (flutter/engine#7807) 0a5a7c5 Roll src/third_party/skia 09c01e9df260..4037f7f5d8b4 (3 commits) (flutter/engine#7821) b867f48 Roll src/third_party/skia 186669c4128b..09c01e9df260 (5 commits) (flutter/engine#7820) af39e22 Fix tests that were committed after cirrus ran (flutter/engine#7819) 1f2cbf7 Roll src/third_party/dart 0a7dcf17eb..c92d5ca288 (64 commits) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff (liyuqian@google.com), and stop the roller if necessary.
This PR introduces implementations for an AccessibilityChannel, TextInputChannel, and PlatformChannel.
This PR should not alter any existing behavior, it just moves channel communication logic into Java APIs where it was previously written in the middle of other logic. Where possible, I introduced enums and data structures to codify message content that is received by Android from Flutter.