From 0ffcfa0f5c444e2ebc919bfcd44a090c8511f02a Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 22 Jun 2023 00:51:14 +0200 Subject: [PATCH] Accept failure in rotation or fold registration Do not make scrcpy fail if rotation or display fold listeners could not be registered. --- .../java/com/genymobile/scrcpy/wrappers/WindowManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java b/server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java index dde26e82..ce748855 100644 --- a/server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java +++ b/server/src/main/java/com/genymobile/scrcpy/wrappers/WindowManager.java @@ -107,7 +107,7 @@ public final class WindowManager { cls.getMethod("watchRotation", IRotationWatcher.class).invoke(manager, rotationWatcher); } } catch (Exception e) { - throw new AssertionError(e); + Ln.e("Could not register rotation watcher", e); } } @@ -117,7 +117,7 @@ public final class WindowManager { Class cls = manager.getClass(); cls.getMethod("registerDisplayFoldListener", IDisplayFoldListener.class).invoke(manager, foldListener); } catch (Exception e) { - throw new AssertionError(e); + Ln.e("Could not register display fold listener", e); } } }