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

Commit ad869cc9 authored by Christopher Tate's avatar Christopher Tate
Browse files

Thread-safe pipe teardown during restore operations

Bug 29135140

Change-Id: Id474f180815318618ec28ff953dc0cab892f781e
parent dbd5480a
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -5700,6 +5700,10 @@ public class BackupManagerService {
        }

        void tearDownPipes() {
            // Teardown might arise from the inline restore processing or from the asynchronous
            // timeout mechanism, and these might race.  Make sure we don't try to close and
            // null out the pipes twice.
            synchronized (this) {
                if (mPipes != null) {
                    try {
                        mPipes[0].close();
@@ -5712,6 +5716,7 @@ public class BackupManagerService {
                    mPipes = null;
                }
            }
        }

        void tearDownAgent(ApplicationInfo app) {
            if (mAgent != null) {