This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[Android] Lifecycle defaults to focused instead of unfocused #41875
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Internal: b/281537611 |
loic-sharma
approved these changes
May 11, 2023
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.
Code changes look good! Is there a test verifying we'll default to focused even if we don't receive that first onWindowFocusChanged(true)
?
The changes in the unit test should do that. It processes the resumed notification first, before any focus events are received. |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 11, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 11, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 11, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 11, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 11, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 11, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 11, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
May 12, 2023
…126622) flutter/engine@f38f46f...748ef96 2023-05-11 skia-flutter-autoroll@skia.org Roll Skia from aed81125e6bc to ccec5093ca38 (10 revisions) (flutter/engine#41963) 2023-05-11 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 2tQjI0g3aDmjHAtMw... to MjcKzcsqMDkuRKopu... (flutter/engine#41960) 2023-05-11 smartercallum@gmail.com iPhone floating cursor selection (flutter/engine#36643) 2023-05-11 vashworth@google.com Update README.md (flutter/engine#41953) 2023-05-11 skia-flutter-autoroll@skia.org Roll Clang from 5344d8e10bb7 to 6d667d4b261e (flutter/engine#41949) 2023-05-11 kjlubick@users.noreply.github.com Use moved SkImage procs (flutter/engine#41947) 2023-05-11 msgh@selfisekai.rocks allow supplying custom gn args in gn wrapper (flutter/engine#41794) 2023-05-11 68549184+Mayb3Nots@users.noreply.github.com fix: platform_dispatcher documentation typo (flutter/engine#41739) 2023-05-11 lhkbob@gmail.com Remove GN staging flag for save layer bounds (flutter/engine#41940) 2023-05-11 flar@google.com switch MockTexture off of MockCanvas calls (flutter/engine#41906) 2023-05-11 gspencergoog@users.noreply.github.com [Android] Lifecycle defaults to focused instead of unfocused (flutter/engine#41875) 2023-05-11 skia-flutter-autoroll@skia.org Roll Skia from ccf73af6ca91 to aed81125e6bc (9 revisions) (flutter/engine#41946) 2023-05-11 godofredoc@google.com Clobber caches in licenses test. (flutter/engine#41942) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from 2tQjI0g3aDmj to MjcKzcsqMDku 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 aaclarke@google.com,rmistry@google.com,zra@google.com 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
CaseyHillers
pushed a commit
to CaseyHillers/flutter
that referenced
this pull request
May 24, 2023
…lutter#126622) flutter/engine@f38f46f...748ef96 2023-05-11 skia-flutter-autoroll@skia.org Roll Skia from aed81125e6bc to ccec5093ca38 (10 revisions) (flutter/engine#41963) 2023-05-11 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 2tQjI0g3aDmjHAtMw... to MjcKzcsqMDkuRKopu... (flutter/engine#41960) 2023-05-11 smartercallum@gmail.com iPhone floating cursor selection (flutter/engine#36643) 2023-05-11 vashworth@google.com Update README.md (flutter/engine#41953) 2023-05-11 skia-flutter-autoroll@skia.org Roll Clang from 5344d8e10bb7 to 6d667d4b261e (flutter/engine#41949) 2023-05-11 kjlubick@users.noreply.github.com Use moved SkImage procs (flutter/engine#41947) 2023-05-11 msgh@selfisekai.rocks allow supplying custom gn args in gn wrapper (flutter/engine#41794) 2023-05-11 68549184+Mayb3Nots@users.noreply.github.com fix: platform_dispatcher documentation typo (flutter/engine#41739) 2023-05-11 lhkbob@gmail.com Remove GN staging flag for save layer bounds (flutter/engine#41940) 2023-05-11 flar@google.com switch MockTexture off of MockCanvas calls (flutter/engine#41906) 2023-05-11 gspencergoog@users.noreply.github.com [Android] Lifecycle defaults to focused instead of unfocused (flutter/engine#41875) 2023-05-11 skia-flutter-autoroll@skia.org Roll Skia from ccf73af6ca91 to aed81125e6bc (9 revisions) (flutter/engine#41946) 2023-05-11 godofredoc@google.com Clobber caches in licenses test. (flutter/engine#41942) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from 2tQjI0g3aDmj to MjcKzcsqMDku 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 aaclarke@google.com,rmistry@google.com,zra@google.com 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In #41702, the default state of the focus bit is "false", assuming that Android will send an
onWindowFocusChanged(true)
when the window is first focused, but there appear to be some cases where that doesn't happen.This change puts the initial state back to what it used to be: in the absence of focus change events, entering the "onResume" Android state will report the
resumed
state in Flutter. Before this PR, and after #41702, if no focus events were received, it would default toinactive
.Tests