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

Commit 250c59b3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix an issue when empty the usap pool." am: faf1b1cf am: 9078248b...

Merge "Fix an issue when empty the usap pool." am: faf1b1cf am: 9078248b am: 80f41edf am: 81dd7537

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1893002

Change-Id: Ib59b0793f1bbcbb1a39ae15417598161550c95ff
parents 5857a0d8 81dd7537
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -724,9 +724,6 @@ public final class Zygote {
        DataOutputStream usapOutputStream = null;
        ZygoteArguments args = null;

        // Block SIGTERM so we won't be killed if the Zygote flushes the USAP pool.
        blockSigTerm();

        LocalSocket sessionSocket = null;
        if (argBuffer == null) {
            // Read arguments from usapPoolSocket instead.
@@ -742,6 +739,10 @@ public final class Zygote {
                ZygoteCommandBuffer tmpArgBuffer = null;
                try {
                    sessionSocket = usapPoolSocket.accept();
                    // Block SIGTERM so we won't be killed if the Zygote flushes the USAP pool.
                    // This is safe from a race condition because the pool is only flushed after
                    // the SystemServer changes its internal state to stop using the USAP pool.
                    blockSigTerm();

                    usapOutputStream =
                            new DataOutputStream(sessionSocket.getOutputStream());
@@ -759,9 +760,10 @@ public final class Zygote {
                unblockSigTerm();
                IoUtils.closeQuietly(sessionSocket);
                IoUtils.closeQuietly(tmpArgBuffer);
                blockSigTerm();
            }
        } else {
            // Block SIGTERM so we won't be killed if the Zygote flushes the USAP pool.
            blockSigTerm();
            try {
                args = ZygoteArguments.getInstance(argBuffer);
            } catch (Exception ex) {