-
Notifications
You must be signed in to change notification settings - Fork 6k
[iOS] Don't call App lifecycle resumed when device is locked #44947
[iOS] Don't call App lifecycle resumed when device is locked #44947
Conversation
chinmaygarde
left a comment
There was a problem hiding this 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.
…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]; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…#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
Fixed flutter/flutter#130055.
We can cancel the
resumedlife cycle notification if we receivedinactivenotification in the same runloop.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.