Repository navigation
Commit a7c6575
iOS: Re-enable rendering on willEnterForeground (flutter#191350)
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
This PR changes the moment the rendering is re-enabled after the app was
in the background.
Currently, the rendering is enabled only after the app enters the
"active" state. This means that if something covers the app right after
it returns from the background, e.g. a biometric prompt, the app visible
under the prompt doesn't render new frames. This results in the app
showing the frozen last frame from before going into background until
the biometric prompt is dismissed.
This PR changes the logic so that rendering is re-enabled when the app
enters foreground, even if it's foreground inactive, so that the app
content is updated normally.
NOTE: It used to work this way until this PR
flutter-team-archive/engine#7450, this was
changed to match the rendering disabling logic that was moved to the
`willResignActive` callback. The disabling was moved back to
the`didEnterBackground` callback in this PR
flutter-team-archive/engine#25196, so I believe
the re-enabling can be safely moved back to `willEnterForeground`.
flutter#191349
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
---------
Co-authored-by: Chris Bracken <[email protected]>
Co-authored-by: Victoria Ashworth <[email protected]>1 parent adc38eb commit a7c6575
3 files changed
Lines changed: 213 additions & 45 deletions
File tree
- engine/src/flutter/shell/platform/darwin/ios/framework/Source
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
669 | 684 | | |
670 | 685 | | |
671 | 686 | | |
672 | 687 | | |
673 | 688 | | |
674 | | - | |
675 | | - | |
676 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
677 | 695 | | |
678 | 696 | | |
679 | 697 | | |
| |||
729 | 747 | | |
730 | 748 | | |
731 | 749 | | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
732 | 762 | | |
733 | 763 | | |
734 | 764 | | |
| |||
815 | 845 | | |
816 | 846 | | |
817 | 847 | | |
818 | | - | |
819 | | - | |
820 | | - | |
| 848 | + | |
821 | 849 | | |
822 | 850 | | |
823 | 851 | | |
| |||
1021 | 1049 | | |
1022 | 1050 | | |
1023 | 1051 | | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | 1052 | | |
1028 | 1053 | | |
1029 | 1054 | | |
| |||
1048 | 1073 | | |
1049 | 1074 | | |
1050 | 1075 | | |
| 1076 | + | |
1051 | 1077 | | |
1052 | 1078 | | |
1053 | 1079 | | |
| |||
1319 | 1345 | | |
1320 | 1346 | | |
1321 | 1347 | | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
1325 | 1351 | | |
1326 | 1352 | | |
1327 | | - | |
1328 | | - | |
| 1353 | + | |
| 1354 | + | |
1329 | 1355 | | |
1330 | 1356 | | |
1331 | 1357 | | |
| |||
0 commit comments