From d4794122ab779010f1d69bcbebb61ab2f7a2dae2 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 (#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/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java index 4f0844e73..9c3da20e9 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +++ b/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); } } -- GitLab