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

Conversation

@gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented May 9, 2023

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 to inactive.

Tests

  • Updated tests to match.

@chingjun
Copy link
Contributor

Internal: b/281537611

Copy link
Member

@loic-sharma loic-sharma left a 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)?

@gspencergoog
Copy link
Contributor Author

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.

@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label May 11, 2023
@auto-submit auto-submit bot merged commit eb88d37 into flutter:main 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 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 [email protected] Roll Skia from aed81125e6bc to ccec5093ca38 (10 revisions) (flutter/engine#41963)
2023-05-11 [email protected] Roll Fuchsia Mac SDK from 2tQjI0g3aDmjHAtMw... to MjcKzcsqMDkuRKopu... (flutter/engine#41960)
2023-05-11 [email protected] iPhone floating cursor selection (flutter/engine#36643)
2023-05-11 [email protected] Update README.md (flutter/engine#41953)
2023-05-11 [email protected] Roll Clang from 5344d8e10bb7 to 6d667d4b261e (flutter/engine#41949)
2023-05-11 [email protected] Use moved SkImage procs (flutter/engine#41947)
2023-05-11 [email protected] allow supplying custom gn args in gn wrapper (flutter/engine#41794)
2023-05-11 [email protected] fix: platform_dispatcher documentation typo (flutter/engine#41739)
2023-05-11 [email protected] Remove GN staging flag for save layer bounds (flutter/engine#41940)
2023-05-11 [email protected] switch MockTexture off of MockCanvas calls (flutter/engine#41906)
2023-05-11 [email protected] [Android] Lifecycle defaults to focused instead of unfocused (flutter/engine#41875)
2023-05-11 [email protected] Roll Skia from ccf73af6ca91 to aed81125e6bc (9 revisions) (flutter/engine#41946)
2023-05-11 [email protected] 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 [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
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request May 24, 2023
…lutter#126622)

flutter/engine@f38f46f...748ef96

2023-05-11 [email protected] Roll Skia from aed81125e6bc to ccec5093ca38 (10 revisions) (flutter/engine#41963)
2023-05-11 [email protected] Roll Fuchsia Mac SDK from 2tQjI0g3aDmjHAtMw... to MjcKzcsqMDkuRKopu... (flutter/engine#41960)
2023-05-11 [email protected] iPhone floating cursor selection (flutter/engine#36643)
2023-05-11 [email protected] Update README.md (flutter/engine#41953)
2023-05-11 [email protected] Roll Clang from 5344d8e10bb7 to 6d667d4b261e (flutter/engine#41949)
2023-05-11 [email protected] Use moved SkImage procs (flutter/engine#41947)
2023-05-11 [email protected] allow supplying custom gn args in gn wrapper (flutter/engine#41794)
2023-05-11 [email protected] fix: platform_dispatcher documentation typo (flutter/engine#41739)
2023-05-11 [email protected] Remove GN staging flag for save layer bounds (flutter/engine#41940)
2023-05-11 [email protected] switch MockTexture off of MockCanvas calls (flutter/engine#41906)
2023-05-11 [email protected] [Android] Lifecycle defaults to focused instead of unfocused (flutter/engine#41875)
2023-05-11 [email protected] Roll Skia from ccf73af6ca91 to aed81125e6bc (9 revisions) (flutter/engine#41946)
2023-05-11 [email protected] 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 [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
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-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants