-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[battery] Support the v2 Android embedder #2152
Conversation
.../example/android/app/src/main/java/io/flutter/plugins/batteryexample/EmbedderV2Activity.java
Outdated
Show resolved
Hide resolved
| this.registrar = registrar; | ||
| @Override | ||
| public void onAttachedToEngine(FlutterPluginBinding binding) { | ||
| applicationContext = binding.getApplicationContext(); |
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 think this is redundant with this.applicationContext = applicationContext; in the other onAttachedToEngine
72475d8 to
541b33b
Compare
|
I believe this is now ready to land (including bumping the Flutter SDK constraint, adding CI-ready e2e tests, and making sure it builds on stable and master). |
collinjackson
left a comment
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.
a few minor comments, lgtm otherwise
...attery/example/android/app/src/main/java/io/flutter/plugins/batteryexample/MainActivity.java
Show resolved
Hide resolved
| void main() { | ||
| E2EWidgetsFlutterBinding.ensureInitialized(); | ||
|
|
||
| testWidgets('Builds and runs', (WidgetTester tester) async { |
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 a nit and we're not doing it consistently in first-party unit tests but since this is supposed to be a canonical example of an integration tested plugin, I'm wondering if you think we should wrap the test in a group('$Battery', () { ... });
And the description of the test could be 'level' since that's the method you're invoking.
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 don't think group('Battery') adds much as all tests in this file belong to that group...
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.
(renamed the test to 'Can get battery level')
|
If you encounter |
To run the e2e Android tests the same way they would be run on CI:
Related Issues
flutter/flutter#41833
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?