Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 261d5092 authored by Konstantin Lopyrev's avatar Konstantin Lopyrev Committed by Android Git Automerger
Browse files

am 5a54e980: am 6947cc59: Merge "Preventing the hierarchy viewer from getting...

am 5a54e980: am 6947cc59: Merge "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." into gingerbread

Merge commit '5a54e980'

* commit '5a54e980':
  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.
parents ebe083ef 5a54e980
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -1139,7 +1139,13 @@ public class ViewDebug {
        final View captureView = findView(root, parameter);
        Bitmap b = performViewCapture(captureView, false);

        if (b != null) {
        if (b == null) {
            Log.w("View", "Failed to create capture bitmap!");
            // Send an empty one so that it doesn't get stuck waiting for
            // something.
            b = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
        }

        BufferedOutputStream out = null;
        try {
            out = new BufferedOutputStream(clientStream, 32 * 1024);
@@ -1151,10 +1157,6 @@ public class ViewDebug {
            }
            b.recycle();
        }
        } else {
            Log.w("View", "Failed to create capture bitmap!");
            clientStream.close();
        }
    }

    private static Bitmap performViewCapture(final View captureView, final boolean skpiChildren) {
+15 −0
Original line number Diff line number Diff line
@@ -4798,6 +4798,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
@@ -4835,6 +4837,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;
@@ -4845,6 +4853,13 @@ public class WindowManagerService extends IWindowManager.Stub
            if (reply != null) {
                reply.recycle();
            }
            if (out != null) {
                try {
                    out.close();
                } catch (IOException e) {

                }
            }
        }

        return success;