Merge "Prevent system server dump stuck by pipe buffer full."
This commit is contained in:
@@ -1061,14 +1061,29 @@ public final class ActivityThread {
|
||||
WindowManagerGlobal.getInstance().dumpGfxInfo(fd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dumpDbInfo(FileDescriptor fd, String[] args) {
|
||||
private void dumpDatabaseInfo(FileDescriptor fd, String[] args) {
|
||||
PrintWriter pw = new FastPrintWriter(new FileOutputStream(fd));
|
||||
PrintWriterPrinter printer = new PrintWriterPrinter(pw);
|
||||
SQLiteDebug.dump(printer, args);
|
||||
pw.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dumpDbInfo(final FileDescriptor fd, final String[] args) {
|
||||
if (mSystemThread) {
|
||||
// Ensure this invocation is asynchronous to prevent
|
||||
// writer waiting due to buffer cannot be consumed.
|
||||
AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
dumpDatabaseInfo(fd, args);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
dumpDatabaseInfo(fd, args);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unstableProviderDied(IBinder provider) {
|
||||
sendMessage(H.UNSTABLE_PROVIDER_DIED, provider);
|
||||
|
||||
Reference in New Issue
Block a user