-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[remake] Restore old back handling for FlutterFragmentActivity #161545
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
[remake] Restore old back handling for FlutterFragmentActivity #161545
Conversation
|
Is this planned to fix #149753? |
|
When can we expect this to go live? |
|
I was originally planning on adding a test that modifies the manifest value, but I think this current test sufficiently covers the expected behavior (and adding a test that modified the manifest proved more challenging than expected). |
|
Predictive back is enabled by default in Android 15, so when can this pr be merged? |
...src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragmentActivity.java
Show resolved
Hide resolved
|
autosubmit label was removed for flutter/flutter/161545, because - The status or check suite Windows tool_tests_general has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
|
autosubmit label was removed for flutter/flutter/161545, because - The status or check suite Windows tool_tests_general has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
|
Hi @justinmc, when can we expect this to be merged to the stable branch? |
Manual roll requested by [email protected] flutter/flutter@043b719...1659206 2025-02-24 [email protected] Roll Skia from 3dfb3fee52e1 to 28017200173a (2 revisions) (flutter/flutter#163981) 2025-02-24 [email protected] Add integration test for Gradle-initiated android builds with flavors (flutter/flutter#163737) 2025-02-23 [email protected] Roll Skia from 72f949950adb to 3dfb3fee52e1 (1 revision) (flutter/flutter#163959) 2025-02-23 [email protected] Roll Skia from 4bee660601de to 72f949950adb (1 revision) (flutter/flutter#163948) 2025-02-22 [email protected] Roll Skia from cca9328df6ca to 4bee660601de (1 revision) (flutter/flutter#163927) 2025-02-22 [email protected] Roll Dart SDK from bad289580d9b to aea6fff33f06 (3 revisions) (flutter/flutter#163912) 2025-02-22 [email protected] Roll Skia from 1d884bab8593 to cca9328df6ca (12 revisions) (flutter/flutter#163910) 2025-02-22 [email protected] [fuchsia] include more tests in the fuchsia builders (flutter/flutter#163800) 2025-02-21 [email protected] [Engine] Add RoundSuperellipse to drawing OP (flutter/flutter#160883) 2025-02-21 [email protected] [remake] Restore old back handling for FlutterFragmentActivity (flutter/flutter#161545) 2025-02-21 [email protected] Revert "Marks Mac_benchmark basic_material_app_macos__compile to be flaky" (flutter/flutter#163878) 2025-02-21 [email protected] Revert "Marks Mac_benchmark flutter_view_macos__start_up to be flaky" (flutter/flutter#163880) 2025-02-21 [email protected] Roll Dart SDK from c5e582f15b6c to bad289580d9b (1 revision) (flutter/flutter#163885) 2025-02-21 [email protected] Revert "Marks Windows_mokey native_assets_android to be flaky" (flutter/flutter#163881) 2025-02-21 [email protected] Mark platform_views_hcpp_scroll_perf__timeline_summary out of bringup (flutter/flutter#163883) 2025-02-21 [email protected] Roll Skia from 6da10829d017 to 1d884bab8593 (42 revisions) (flutter/flutter#163789) 2025-02-21 [email protected] Enable `linux_android_emulator_tests` on presubmit. (flutter/flutter#163879) 2025-02-21 [email protected] Update gradle memory properties in example and test projects (flutter/flutter#163798) 2025-02-21 [email protected] Secure paste milestone 2 (flutter/flutter#159013) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
) Manual roll requested by [email protected] flutter/flutter@043b719...1659206 2025-02-24 [email protected] Roll Skia from 3dfb3fee52e1 to 28017200173a (2 revisions) (flutter/flutter#163981) 2025-02-24 [email protected] Add integration test for Gradle-initiated android builds with flavors (flutter/flutter#163737) 2025-02-23 [email protected] Roll Skia from 72f949950adb to 3dfb3fee52e1 (1 revision) (flutter/flutter#163959) 2025-02-23 [email protected] Roll Skia from 4bee660601de to 72f949950adb (1 revision) (flutter/flutter#163948) 2025-02-22 [email protected] Roll Skia from cca9328df6ca to 4bee660601de (1 revision) (flutter/flutter#163927) 2025-02-22 [email protected] Roll Dart SDK from bad289580d9b to aea6fff33f06 (3 revisions) (flutter/flutter#163912) 2025-02-22 [email protected] Roll Skia from 1d884bab8593 to cca9328df6ca (12 revisions) (flutter/flutter#163910) 2025-02-22 [email protected] [fuchsia] include more tests in the fuchsia builders (flutter/flutter#163800) 2025-02-21 [email protected] [Engine] Add RoundSuperellipse to drawing OP (flutter/flutter#160883) 2025-02-21 [email protected] [remake] Restore old back handling for FlutterFragmentActivity (flutter/flutter#161545) 2025-02-21 [email protected] Revert "Marks Mac_benchmark basic_material_app_macos__compile to be flaky" (flutter/flutter#163878) 2025-02-21 [email protected] Revert "Marks Mac_benchmark flutter_view_macos__start_up to be flaky" (flutter/flutter#163880) 2025-02-21 [email protected] Roll Dart SDK from c5e582f15b6c to bad289580d9b (1 revision) (flutter/flutter#163885) 2025-02-21 [email protected] Revert "Marks Windows_mokey native_assets_android to be flaky" (flutter/flutter#163881) 2025-02-21 [email protected] Mark platform_views_hcpp_scroll_perf__timeline_summary out of bringup (flutter/flutter#163883) 2025-02-21 [email protected] Roll Skia from 6da10829d017 to 1d884bab8593 (42 revisions) (flutter/flutter#163789) 2025-02-21 [email protected] Enable `linux_android_emulator_tests` on presubmit. (flutter/flutter#163879) 2025-02-21 [email protected] Update gradle memory properties in example and test projects (flutter/flutter#163798) 2025-02-21 [email protected] Secure paste milestone 2 (flutter/flutter#159013) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
) Manual roll requested by [email protected] flutter/flutter@043b719...1659206 2025-02-24 [email protected] Roll Skia from 3dfb3fee52e1 to 28017200173a (2 revisions) (flutter/flutter#163981) 2025-02-24 [email protected] Add integration test for Gradle-initiated android builds with flavors (flutter/flutter#163737) 2025-02-23 [email protected] Roll Skia from 72f949950adb to 3dfb3fee52e1 (1 revision) (flutter/flutter#163959) 2025-02-23 [email protected] Roll Skia from 4bee660601de to 72f949950adb (1 revision) (flutter/flutter#163948) 2025-02-22 [email protected] Roll Skia from cca9328df6ca to 4bee660601de (1 revision) (flutter/flutter#163927) 2025-02-22 [email protected] Roll Dart SDK from bad289580d9b to aea6fff33f06 (3 revisions) (flutter/flutter#163912) 2025-02-22 [email protected] Roll Skia from 1d884bab8593 to cca9328df6ca (12 revisions) (flutter/flutter#163910) 2025-02-22 [email protected] [fuchsia] include more tests in the fuchsia builders (flutter/flutter#163800) 2025-02-21 [email protected] [Engine] Add RoundSuperellipse to drawing OP (flutter/flutter#160883) 2025-02-21 [email protected] [remake] Restore old back handling for FlutterFragmentActivity (flutter/flutter#161545) 2025-02-21 [email protected] Revert "Marks Mac_benchmark basic_material_app_macos__compile to be flaky" (flutter/flutter#163878) 2025-02-21 [email protected] Revert "Marks Mac_benchmark flutter_view_macos__start_up to be flaky" (flutter/flutter#163880) 2025-02-21 [email protected] Roll Dart SDK from c5e582f15b6c to bad289580d9b (1 revision) (flutter/flutter#163885) 2025-02-21 [email protected] Revert "Marks Windows_mokey native_assets_android to be flaky" (flutter/flutter#163881) 2025-02-21 [email protected] Mark platform_views_hcpp_scroll_perf__timeline_summary out of bringup (flutter/flutter#163883) 2025-02-21 [email protected] Roll Skia from 6da10829d017 to 1d884bab8593 (42 revisions) (flutter/flutter#163789) 2025-02-21 [email protected] Enable `linux_android_emulator_tests` on presubmit. (flutter/flutter#163879) 2025-02-21 [email protected] Update gradle memory properties in example and test projects (flutter/flutter#163798) 2025-02-21 [email protected] Secure paste milestone 2 (flutter/flutter#159013) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Remake of flutter/engine#56565. Quoting from an old comment, slightly edited:
flutter/engine#52302 seems to have unintentionally had the effect of not allowing people to "opt out" of predictive back. This is actually aligned with what the android docs say should happen:
https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture
But this wasn't actually true for flutter apps before flutter/engine#52302, because we were not calling
super, andFlutterFragmentActivityextends aFragmentActivitywhich in turn extends aComponentActivity, which uses the oldonBackPressedto invoke the new back handling:So while the docs imply that removing the
onBackPressedinFlutterFragmentActivityshouldn't have had an effect, that wasn't true because in our case we were consuming the back event and ignoring the warningWhat all this means is that apps that aren't opting in to predictive back had their back handling migrated to the new code path automatically. FlutterFragmentActivity was uniquely is forced into the new back handling codepath by flutter/engine#52302, which this PR fixes.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.