Unify some duplicate StrictMode-enabling code.

Change-Id: Ifb92f35d9e245dbdb5e201597d8be702bce9e8b8
This commit is contained in:
Brad Fitzpatrick
2010-09-13 21:29:05 -07:00
parent 13f6270eb1
commit 50d66f9fcd
3 changed files with 23 additions and 17 deletions

View File

@@ -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();