Loading core/java/android/app/ActivityThread.java +2 −9 Original line number Diff line number Diff line Loading @@ -3107,18 +3107,11 @@ public final class ActivityThread { /** * For system applications on userdebug/eng builds, log stack * traces of disk and network access to dropbox for analysis. * * Similar logic exists in SystemServer.java. */ if ((data.appInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0 && !"user".equals(Build.TYPE)) { StrictMode.setThreadPolicy( StrictMode.DISALLOW_DISK_WRITE | StrictMode.DISALLOW_DISK_READ | StrictMode.DISALLOW_NETWORK | StrictMode.PENALTY_DROPBOX); ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0) { StrictMode.conditionallyEnableDebugLogging(); } /** Loading core/java/android/os/StrictMode.java +19 −0 Original line number Diff line number Diff line Loading @@ -200,6 +200,25 @@ public final class StrictMode { return oldPolicy; } /** * Enable DropBox logging for debug phone builds. * * @hide */ public static boolean conditionallyEnableDebugLogging() { // For debug builds, log event loop stalls to dropbox for analysis. // Similar logic also appears in ActivityThread.java for system apps. if ("user".equals(Build.TYPE)) { return false; } StrictMode.setThreadPolicy( StrictMode.DISALLOW_DISK_WRITE | StrictMode.DISALLOW_DISK_READ | StrictMode.DISALLOW_NETWORK | StrictMode.PENALTY_DROPBOX); return true; } /** * Parses the BlockGuard policy mask out from the Exception's * getMessage() String value. Kinda gross, but least Loading services/java/com/android/server/SystemServer.java +2 −8 Original line number Diff line number Diff line Loading @@ -518,14 +518,8 @@ class ServerThread extends Thread { }); // For debug builds, log event loop stalls to dropbox for analysis. // Similar logic also appears in ActivityThread.java for system apps. if (!"user".equals(Build.TYPE)) { Slog.i(TAG, "Enabling StrictMode for system server."); StrictMode.setThreadPolicy( StrictMode.DISALLOW_DISK_WRITE | StrictMode.DISALLOW_DISK_READ | StrictMode.DISALLOW_NETWORK | StrictMode.PENALTY_DROPBOX); if (StrictMode.conditionallyEnableDebugLogging()) { Slog.i(TAG, "Enabled StrictMode for system server main thread."); } Looper.loop(); Loading Loading
core/java/android/app/ActivityThread.java +2 −9 Original line number Diff line number Diff line Loading @@ -3107,18 +3107,11 @@ public final class ActivityThread { /** * For system applications on userdebug/eng builds, log stack * traces of disk and network access to dropbox for analysis. * * Similar logic exists in SystemServer.java. */ if ((data.appInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0 && !"user".equals(Build.TYPE)) { StrictMode.setThreadPolicy( StrictMode.DISALLOW_DISK_WRITE | StrictMode.DISALLOW_DISK_READ | StrictMode.DISALLOW_NETWORK | StrictMode.PENALTY_DROPBOX); ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0) { StrictMode.conditionallyEnableDebugLogging(); } /** Loading
core/java/android/os/StrictMode.java +19 −0 Original line number Diff line number Diff line Loading @@ -200,6 +200,25 @@ public final class StrictMode { return oldPolicy; } /** * Enable DropBox logging for debug phone builds. * * @hide */ public static boolean conditionallyEnableDebugLogging() { // For debug builds, log event loop stalls to dropbox for analysis. // Similar logic also appears in ActivityThread.java for system apps. if ("user".equals(Build.TYPE)) { return false; } StrictMode.setThreadPolicy( StrictMode.DISALLOW_DISK_WRITE | StrictMode.DISALLOW_DISK_READ | StrictMode.DISALLOW_NETWORK | StrictMode.PENALTY_DROPBOX); return true; } /** * Parses the BlockGuard policy mask out from the Exception's * getMessage() String value. Kinda gross, but least Loading
services/java/com/android/server/SystemServer.java +2 −8 Original line number Diff line number Diff line Loading @@ -518,14 +518,8 @@ class ServerThread extends Thread { }); // For debug builds, log event loop stalls to dropbox for analysis. // Similar logic also appears in ActivityThread.java for system apps. if (!"user".equals(Build.TYPE)) { Slog.i(TAG, "Enabling StrictMode for system server."); StrictMode.setThreadPolicy( StrictMode.DISALLOW_DISK_WRITE | StrictMode.DISALLOW_DISK_READ | StrictMode.DISALLOW_NETWORK | StrictMode.PENALTY_DROPBOX); if (StrictMode.conditionallyEnableDebugLogging()) { Slog.i(TAG, "Enabled StrictMode for system server main thread."); } Looper.loop(); Loading