From 300503b8d8c4ce571b31199b1e9c867c3420744d Mon Sep 17 00:00:00 2001 From: "hafizi@dev" <36718405+hafizidev@users.noreply.github.com> Date: Sun, 19 Jan 2020 23:59:21 +0800 Subject: [PATCH] java.io.FileNotFoundException logged but harmless 'java.io.FileNotFoundException' logged but harmless, properly handling this issue #994 --- server/src/main/java/com/genymobile/scrcpy/Workarounds.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/main/java/com/genymobile/scrcpy/Workarounds.java b/server/src/main/java/com/genymobile/scrcpy/Workarounds.java index b1b8190326..4026d01c3d 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Workarounds.java +++ b/server/src/main/java/com/genymobile/scrcpy/Workarounds.java @@ -71,6 +71,9 @@ public static void fillAppInfo() { Field mInitialApplicationField = activityThreadClass.getDeclaredField("mInitialApplication"); mInitialApplicationField.setAccessible(true); mInitialApplicationField.set(activityThread, app); + } catch (java.io.FileNotFoundException exception) { + // this is a workaround, so do not show error when file is not exist + // when file not exist, it means this workaround is not needed } catch (Throwable throwable) { // this is a workaround, so failing is not an error Ln.w("Could not fill app info: " + throwable.getMessage());