Skip reading config file that does not exist

By default there is no such file. This avoids printing
exception log on every boot. Especially it prints out
thousands of callstack when running unit tests.

Bug: 159102753
Test: LetterboxConfigurationPersisterTest
Change-Id: I64a62c4aa66ac045aa4b1ddf1ad2e51d7bf4ca5b
This commit is contained in:
Riddle Hsu
2023-02-18 22:06:25 +08:00
parent 7137d9165d
commit 15942b75e9

View File

@@ -216,6 +216,10 @@ class LetterboxConfigurationPersister {
} }
private void readCurrentConfiguration() { private void readCurrentConfiguration() {
if (!mConfigurationFile.exists()) {
useDefaultValue();
return;
}
FileInputStream fis = null; FileInputStream fis = null;
try { try {
fis = mConfigurationFile.openRead(); fis = mConfigurationFile.openRead();