Skip to content

Commit

Permalink
Fix logspam from AppIdleHistory on first boot
Browse files Browse the repository at this point in the history
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
Merged-In: I19a72e3bd74038e7447a2d47529022a68a13b1e9
(cherry picked from commit 4aa768b46baff4ddbb9aa3342676300ee4c31008)
Signed-off-by: Anushek Prasal <[email protected]>
  • Loading branch information
ebiggers authored and SKULSHADY committed Oct 15, 2023
1 parent 1eb06ec commit 736450e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
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;
Expand Down Expand Up @@ -802,6 +803,9 @@ private void readAppIdleTimes(int userId, ArrayMap<String, AppUsageHistory> user
}
}
}
} 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 {
Expand Down

0 comments on commit 736450e

Please sign in to comment.