Skip to content

Conversation

@gmackall
Copy link
Member

@gmackall gmackall commented Jan 13, 2025

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

Note: OnBackPressedCallback is always called regardless of the value of android:enableOnBackInvokedCallback. In other words, disabling the system animation doesn't affect your app's back handling logic if it uses OnBackPressedCallback.

But this wasn't actually true for flutter apps before flutter/engine#52302, because we were not calling super, and FlutterFragmentActivity extends a FragmentActivity which in turn extends a ComponentActivity, which uses the old onBackPressed to invoke the new back handling:

   override fun onBackPressed() {
        onBackPressedDispatcher.onBackPressed()
    }

So while the docs imply that removing the onBackPressed in FlutterFragmentActivity shouldn't have had an effect, that wasn't true because in our case we were consuming the back event and ignoring the warning

  @Override
  @SuppressWarnings("MissingSuperCall")
  public void onBackPressed() {
    flutterFragment.onBackPressed();
  }

What 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.

@github-actions github-actions bot added platform-android Android applications specifically engine flutter/engine related. See also e: labels. labels Jan 13, 2025
@justinmc
Copy link
Contributor

Is this planned to fix #149753?

@kevinhuijsman13
Copy link

When can we expect this to go live?

@gmackall gmackall marked this pull request as ready for review February 11, 2025 22:11
@gmackall
Copy link
Member Author

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).

@gmackall gmackall requested review from a team and justinmc February 11, 2025 22:59
@jmagman jmagman changed the title [wip][remake] Restore old back handling for FlutterFragmentActivity [remake] Restore old back handling for FlutterFragmentActivity Feb 12, 2025
@ZhuJHua
Copy link

ZhuJHua commented Feb 17, 2025

Predictive back is enabled by default in Android 15, so when can this pr be merged?

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 20, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 20, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Feb 20, 2025

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.

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 20, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 20, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Feb 20, 2025

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.

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 25, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 25, 2025
@kevinhuijsman13
Copy link

Hi @justinmc, when can we expect this to be merged to the stable branch?

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 26, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 27, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 27, 2025
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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 2025
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
)

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
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels. platform-android Android applications specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants