Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@pepsin
Copy link
Contributor

@pepsin pepsin commented Dec 18, 2020

Description

On some old iOS device, such as iPhone 6 or iPhone 6 Plus which runs on iOS 12.0+, when user choose a flutter view and that flutter view is going to present, and immediately user take a phone call or other stuff makes app goes to background, due to the currently wrongly LifeCycle, which is AppLifecycleState.resumed, Flutter Engine will continue to call on Metal Renderer to render new frames, that violates iOS's no background render policy and cause a crash.

With this PR, after view appeared, we recheck the Application state, if it's in background, we set the LifeCycle status right.

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.

  • [x ] I read the contributor guide and followed the process outlined there for submitting PRs.
  • [x ] I signed the CLA.
  • [x ] I read and followed the C++, Objective-C, Java style guides for the engine.
  • [x ] I read the tree hygiene wiki page, which explains my responsibilities.
  • [x ] I updated/added relevant documentation.
  • [x ] All existing and new tests are passing.
  • [x ] I am willing to follow-up on review comments in a timely manner.

Reviewer Checklist

Breaking Change

Did any tests fail when you ran them? Please read handling breaking changes.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Dec 18, 2020

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@pepsin
Copy link
Contributor Author

pepsin commented Dec 18, 2020

@googlebot I fixed it.

@google-cla
Copy link

google-cla bot commented Dec 18, 2020

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

[[_engine.get() lifecycleChannel] sendMessage:@"AppLifecycleState.resumed"];

[super viewDidAppear:animated];
if (UIApplication.sharedApplication.applicationState == UIApplicationStateBackground) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this case, shoudn't we just not sent the AppLifecycleState.resumed message?

Copy link
Contributor Author

@pepsin pepsin Jan 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's much better,will update the code.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Jan 8, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no and removed cla: yes labels Jan 8, 2021
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

1 similar comment
@google-cla
Copy link

google-cla bot commented Jan 8, 2021

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Jan 8, 2021
@chinmaygarde chinmaygarde added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jan 21, 2021
@fluttergithubbot fluttergithubbot merged commit 9223073 into flutter:master Jan 21, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 22, 2021
zanderso pushed a commit to flutter/flutter that referenced this pull request Jan 23, 2021
* 5b2defd Roll Fuchsia Mac SDK from MrtHftV0U... to 7nZajqutF... (flutter/engine#23827)

* c8ffb20 Roll Skia from 87a055b02027 to e0d023562bd9 (1 revision) (flutter/engine#23829)

* 296902b implemented GetMainContext() for opengl (flutter/engine#23634)

* 5cf3eae Roll Skia from e0d023562bd9 to 982127b7d57d (4 revisions) (flutter/engine#23831)

* fd9a079 [iOS] Fixes DisplayLinkManager leaks (flutter/engine#22194)

* b241537 Roll Fuchsia Linux Toolchain from git_revision:2c0536b76b35fa592ac7b4a0e4bb176eaf55af75 to IJxh_9dNS... (flutter/engine#23832)

* 5c2003f Roll Skia from 982127b7d57d to 6de1e52d0b12 (1 revision) (flutter/engine#23834)

* 5b9cd44 Automatically download Noto fonts as backup fonts in CanvasKit mode (flutter/engine#23728)

* 70a6824 Roll Dart SDK from 5e24a66b1bb8 to 704928da5702 (2 revisions) (flutter/engine#23838)

* b0c46d8 Roll Skia from 6de1e52d0b12 to 8a37fb2c605b (5 revisions) (flutter/engine#23836)

* d4132ea Use references when iterating over SkParagraph text boxes (flutter/engine#23837)

* 87960d8 Fix typo in embedder unit tests (flutter/engine#23783)

* 7f66714 iOS deeplink sends "path + query" instead of just path (flutter/engine#23562)

* 1474d08 Roll Skia from 8a37fb2c605b to 37d16f135265 (4 revisions) (flutter/engine#23839)

* 3da13fc Make android more lenient when it comes to out-of-order key event responses (flutter/engine#23604)

* 9223073 Fix background crash when FlutterView going appear while app goes background (flutter/engine#23175)

* 7c19824 Pass the filename directly to JNI for loading deferred component. (flutter/engine#23824)

* 5dc2469 Reland path vol tracker (flutter/engine#23840)

* e7e76f1 Roll Skia from 37d16f135265 to e89d8ea20b62 (2 revisions) (flutter/engine#23841)

* 07f4861 Roll Dart SDK from 704928da5702 to 1db2d4d95562 (1 revision) (flutter/engine#23846)

* 993ab78 Roll Skia from e89d8ea20b62 to c09761f57605 (1 revision) (flutter/engine#23843)

* a4836a6 Call Dart plugin registrant if available (flutter/engine#23813)

* 475a234 Roll Fuchsia Linux SDK from UGavhI1zv... to mODEe2CNk... (flutter/engine#23848)

* b51da31 Roll Skia from c09761f57605 to 450f8565c7f3 (5 revisions) (flutter/engine#23851)

* cb7106d Roll Skia from 450f8565c7f3 to 372791761157 (1 revision) (flutter/engine#23855)

* 69980e5 Roll Fuchsia Mac SDK from 7nZajqutF... to tuJCioUf3... (flutter/engine#23857)

* 20ff574 Roll Skia from 372791761157 to ce75036b3eaf (4 revisions) (flutter/engine#23858)

* 0118b54 Implements accessibility bridge in common library (flutter/engine#23491)

* ffc77f0 Search multiple paths when loading deferred component .so files. (flutter/engine#23849)

* 71d264d Revert "implemented GetMainContext() for opengl (#23634)" (flutter/engine#23859)

* fb48735 Roll Skia from ce75036b3eaf to cc6961b9ac5e (3 revisions) (flutter/engine#23860)

* fdddf87 Roll Dart SDK from 1db2d4d95562 to 82b4c77fb17f (2 revisions) (flutter/engine#23861)
hjfreyer pushed a commit to hjfreyer/engine that referenced this pull request Mar 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes platform-ios waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants