Preventing the hierarchy viewer from getting stuck, once when trying to load the window data for SurfaceView and the Wallpaper, and in the case the captured node has disappeared.

Change-Id: Iaff6bd501a2bb3faa7a394fff740479f6a95e899
This commit is contained in:
Konstantin Lopyrev
2010-08-24 22:00:12 -07:00
parent b8814dce28
commit 43b9b48f79
2 changed files with 32 additions and 15 deletions

View File

@@ -4808,6 +4808,8 @@ public class WindowManagerService extends IWindowManager.Stub
Parcel data = null;
Parcel reply = null;
BufferedWriter out = null;
// Any uncaught exception will crash the system process
try {
// Find the hashcode of the window
@@ -4845,6 +4847,12 @@ public class WindowManagerService extends IWindowManager.Stub
reply.readException();
if (!client.isOutputShutdown()) {
out = new BufferedWriter(new OutputStreamWriter(client.getOutputStream()));
out.write("DONE\n");
out.flush();
}
} catch (Exception e) {
Slog.w(TAG, "Could not send command " + command + " with parameters " + parameters, e);
success = false;
@@ -4855,6 +4863,13 @@ public class WindowManagerService extends IWindowManager.Stub
if (reply != null) {
reply.recycle();
}
if (out != null) {
try {
out.close();
} catch (IOException e) {
}
}
}
return success;