Fix logspam from AppIdleHistory on first boot

Before /data/system/users/0/app_idle_stats.xml has been created, it is
expected that it doesn't exist.  Log a simple debug message instead of
an error message with stacktrace.

Bug: 290410617
Test: booted Cuttlefish and checked logcat
Change-Id: I19a72e3bd74038e7447a2d47529022a68a13b1e9
This commit is contained in:
Eric Biggers
2023-07-07 23:49:07 +00:00
parent c96354dd42
commit 4aa768b46b

View File

@@ -61,6 +61,7 @@ import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
@@ -802,6 +803,9 @@ public class AppIdleHistory {
}
}
}
} catch (FileNotFoundException e) {
// Expected on first boot
Slog.d(TAG, "App idle file for user " + userId + " does not exist");
} catch (IOException | XmlPullParserException e) {
Slog.e(TAG, "Unable to read app idle file for user " + userId, e);
} finally {