Enable strictmode logging in system_server & add a lock.

We weren't logging strictmode violation in the system_server process
in non-user builds (only system apps), even though the rest of the
strictmode logging supports it.

Also add a missing lock in ActivityManagerService.

Change-Id: If2af96a7e4fdde604a647b836097f0029ef1334b
This commit is contained in:
Brad Fitzpatrick
2010-09-10 09:19:50 -07:00
parent 219eb7ec84
commit 1e02d36b0f
3 changed files with 26 additions and 7 deletions

View File

@@ -517,6 +517,17 @@ 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);
}
Looper.loop();
Slog.d(TAG, "System ServerThread is exiting!");
}