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

Conversation

@zhongwuzw
Copy link
Member

@zhongwuzw zhongwuzw commented Aug 22, 2023

Fixed flutter/flutter#130055.
We can cancel the resumed life cycle notification if we received inactive notification in the same runloop.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@zhongwuzw zhongwuzw requested a review from gspencergoog August 22, 2023 09:15
Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

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

lgtm but perhaps @stuartmorgan can also find a reviewer.

@zhongwuzw zhongwuzw added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 29, 2023
@auto-submit auto-submit bot merged commit c2ec683 into flutter:main Aug 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 29, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 29, 2023
…133535)

flutter/engine@3d1faae...c2ec683

2023-08-29 [email protected] [iOS] Don't call App lifecycle resumed when device is locked (flutter/engine#44947)
2023-08-29 [email protected] Roll Dart SDK from 60a3bb84fa6d to f6c11801db41 (1 revision) (flutter/engine#45207)
2023-08-29 [email protected] Roll Skia from b27fecd52899 to f576668bfe99 (1 revision) (flutter/engine#45206)
2023-08-29 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 3.5.3 to 3.6.0 (flutter/engine#45205)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
[self goToApplicationLifecycle:@"AppLifecycleState.resumed"];
[self performSelector:@selector(goToApplicationLifecycle:)
withObject:@"AppLifecycleState.resumed"
afterDelay:0.0f];
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems dangerous; what prevents us from mis-ordering lifecycle events because just one of them is delayed?

Copy link
Member Author

Choose a reason for hiding this comment

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

This seems dangerous; what prevents us from mis-ordering lifecycle events because just one of them is delayed?

When the device like iPhone14 pro is locked, the system mistakenly sends an "active" event, so we may need to cancel it if we receive an inactive notification in the same runloop.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand what the goal of the PR is; that's not what I asked. I'm asking why we should have confidence that this will not mis-order the event relative to other lifestyle events in the cases where it's not cancelled.

Copy link
Member Author

Choose a reason for hiding this comment

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

active/resumed is the final event of application lifecycle events when app changed from inactive to active.

gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
…#44947)

Fixed flutter/flutter#130055.
We can cancel the `resumed` life cycle notification if we received `inactive` notification in the same runloop.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

didChangeAppLifecycleState is called with AppLifecycleState.resumed while screen is locked

3 participants