From 780b9e091825d703dd3f591fb2ee6bbb09fd4cf2 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Thu, 30 May 2019 08:07:41 +0530 Subject: [PATCH] Change the virtual display size restriction to warning (flutter/engine#9110) * Change the virtual display size restriction to warning - Fixes: https://github.com/flutter/flutter/issues/33290 - This is so we don't block usecases where users show the platform view partially. - https://github.com/flutter/flutter/issues/31990 should address this issue more broadly. * Fix error message --- .../flutter/plugin/platform/PlatformViewsController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java index 4f0844e735f..9c3da20e905 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java @@ -422,11 +422,12 @@ public class PlatformViewsController implements MethodChannel.MethodCallHandler, private void validateVirtualDisplayDimensions(int width, int height) { DisplayMetrics metrics = context.getResources().getDisplayMetrics(); if (height > metrics.heightPixels || width > metrics.widthPixels) { - String error = "Creating a virtual display of size: " - + "[" + width + ", " + height + "]" - + " is not supported. It is larger than the device screen size: " + String message = "Creating a virtual display of size: " + + "[" + width + ", " + height + "] may result in problems" + + "(https://github.com/flutter/flutter/issues/2897)." + + "It is larger than the device screen size: " + "[" + metrics.widthPixels + ", " + metrics.heightPixels + "]."; - throw new IllegalArgumentException(error); + Log.w(TAG, message); } }