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

Limit the size of VirtualDisplay we create in android #8704

Merged

Conversation

iskakaushik
Copy link
Contributor

- This can cause phones to restart as documented in flutter/flutter#28978
@iskakaushik iskakaushik merged commit 7471dde into flutter:master Apr 25, 2019
@iskakaushik iskakaushik deleted the bugfix/limit-virtual-display-size branch April 25, 2019 20:44
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 25, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Apr 25, 2019
flutter/engine@3a29e6a...7471dde

git log 3a29e6a..7471dde --no-merges --oneline
7471dde Limit the size of VirtualDisplay we create in android (flutter/engine#8704)
8edfaea Roll src/third_party/skia 10d172169f2d..8413ff13fefa (10 commits) (flutter/engine#8741)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff (liyuqian@google.com), and stop
the roller if necessary.
private void validateVirtualDisplayDimensions(int width, int height) {
DisplayMetrics metrics = mContext.getResources().getDisplayMetrics();
if (height > metrics.heightPixels || width > metrics.widthPixels) {
StringBuilder errorBuilder = new StringBuilder();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think it's more common in out codebase to just use + for string concatenation (I believe it is compiled to a StringBuilder anyway).
This should also save the Local import, which initially made me wonder.

@@ -406,6 +416,18 @@ private static PointerCoords parsePointerCoords(Object rawCoords, float density)
return coords;
}

private void validateVirtualDisplayDimensions(int width, int height) {
DisplayMetrics metrics = mContext.getResources().getDisplayMetrics();
if (height > metrics.heightPixels || width > metrics.widthPixels) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm missing context here, but wondering why do we have to be that strict? do we never want to allow VDs bigger than the main display? (if that is the case would be useful to add a comment explaining why we want to be that strict)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants