-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not pause rendering when android activity loses focus #4848
Changes from all commits
15c6251
f0d8f0e
7369547
452778c
a663b1b
b30ef98
1c719bc
7adbd70
84c1211
e3019db
b224383
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -267,7 +267,7 @@ public void addActivityLifecycleListener(ActivityLifecycleListener listener) { | |
} | ||
|
||
public void onPause() { | ||
mFlutterLifecycleChannel.send("AppLifecycleState.paused"); | ||
mFlutterLifecycleChannel.send("AppLifecycleState.inactive"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be worth testing, I might be wrong, but I think on most Android manufacturer OSes, the lock screen might put us in this state too. We should be sure about battery usage for common cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll take a look at battery use. I'm fairly certain that Choreographer won't give use frames, so hopefully it looks okay. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did some research - we might be able to tell using the PowerManager API There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked a few devices (pixel 1, nexus 5, galaxy s5) - all will call onStop when exiting to the lock screen. I think this should be okay as is |
||
} | ||
|
||
public void onPostResume() { | ||
|
@@ -278,7 +278,7 @@ public void onPostResume() { | |
} | ||
|
||
public void onStop() { | ||
mFlutterLifecycleChannel.send("AppLifecycleState.suspending"); | ||
mFlutterLifecycleChannel.send("AppLifecycleState.paused"); | ||
} | ||
|
||
public void onMemoryPressure() { | ||
|
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.
Does this still happen if you apply the pending engine refactoring by @chinmaygarde ? (https://github.com/chinmaygarde/flutter_engine/tree/shell)
The Dart application may fail if it sends a message to the host and the host drops the message with no response.
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.
So looking into this more - I can reproduce the issue on master, somewhat flaky though. Might only be a debug issue