Skip to content

Commit 736450e

Browse files
ebiggersSKULSHADY
authored andcommitted
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 Merged-In: I19a72e3bd74038e7447a2d47529022a68a13b1e9 (cherry picked from commit 4aa768b46baff4ddbb9aa3342676300ee4c31008) Signed-off-by: Anushek Prasal <anushekprasal@gmail.com>
1 parent 1eb06ec commit 736450e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import java.io.BufferedReader;
6262
import java.io.File;
6363
import java.io.FileInputStream;
64+
import java.io.FileNotFoundException;
6465
import java.io.FileOutputStream;
6566
import java.io.FileReader;
6667
import java.io.IOException;
@@ -802,6 +803,9 @@ private void readAppIdleTimes(int userId, ArrayMap<String, AppUsageHistory> user
802803
}
803804
}
804805
}
806+
} catch (FileNotFoundException e) {
807+
// Expected on first boot
808+
Slog.d(TAG, "App idle file for user " + userId + " does not exist");
805809
} catch (IOException | XmlPullParserException e) {
806810
Slog.e(TAG, "Unable to read app idle file for user " + userId, e);
807811
} finally {

0 commit comments

Comments
 (0)