From 859a261615fe05d3cd500bf143e8d57be3d7bda6 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 7 Jul 2023 23:29:00 +0000 Subject: Fix logspam due to missing /vendor/etc/public.libraries.txt On Cuttlefish, a warning "Failed to read public libraries file" followed by a stack trace is logged at boot time due to /vendor/etc/public.libraries.txt not existing. However, this file only exists when the silicon vendor chooses to provide additional libraries accessible to apps, according to https://source.android.com/docs/core/permissions/namespaces_libraries#adding-additional-native-libraries Therefore, catch the FileNotFoundException and just log a debug message. Bug: 290402890 Test: booted Cuttlefish and verified the warning is gone Change-Id: I8c21ccb5603fe1f3d523ce762ccc2f7191d74938 Merged-In: I8c21ccb5603fe1f3d523ce762ccc2f7191d74938 --- core/java/com/android/server/SystemConfig.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/java/com/android/server/SystemConfig.java b/core/java/com/android/server/SystemConfig.java index 088c0016c0da..21da321e2b08 100644 --- a/core/java/com/android/server/SystemConfig.java +++ b/core/java/com/android/server/SystemConfig.java @@ -1848,6 +1848,9 @@ public class SystemConfig { soname, soname, new String[0], true); mSharedLibraries.put(entry.name, entry); } + } catch (FileNotFoundException e) { + // Expected for /vendor/etc/public.libraries.txt on some devices + Slog.d(TAG, listFile + " does not exist"); } catch (IOException e) { Slog.w(TAG, "Failed to read public libraries file " + listFile, e); } -- cgit v1.2.3-59-g8ed1b