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
Limit the size of VirtualDisplay we create in android #8704
Merged
iskakaushik
merged 1 commit into
flutter:master
from
iskakaushik:bugfix/limit-virtual-display-size
Apr 25, 2019
Merged
Limit the size of VirtualDisplay we create in android #8704
iskakaushik
merged 1 commit into
flutter:master
from
iskakaushik:bugfix/limit-virtual-display-size
Apr 25, 2019
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
Contributor
iskakaushik
commented
Apr 23, 2019
- This can cause phones to restart as documented in WebView crashes if too big flutter#28978
- This can cause phones to restart as documented in flutter/flutter#28978
collinjackson
approved these changes
Apr 23, 2019
chinmaygarde
approved these changes
Apr 24, 2019
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.
amirh
reviewed
Apr 26, 2019
private void validateVirtualDisplayDimensions(int width, int height) { | ||
DisplayMetrics metrics = mContext.getResources().getDisplayMetrics(); | ||
if (height > metrics.heightPixels || width > metrics.widthPixels) { | ||
StringBuilder errorBuilder = new StringBuilder(); |
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.
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) { |
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'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)
iskakaushik
pushed a commit
to iskakaushik/engine
that referenced
this pull request
Apr 29, 2019
Address nits in: flutter#8704
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.