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

Commit 4559764e authored by Christopher Tate's avatar Christopher Tate
Browse files

Fix deadlock in BackupManagerService

Lock ordering bug.  The fix is to avoid having to hold both locks
simultaneously in one prong of the deadlock.  (Further strengthening:
the code path for potentially acquiring both simultaneously now
begins at a common method, ensuring that lock ordering is always
consistent.)

Change-Id: If9433aff8326fec2ba0e97e96ad2d835b01e2cda
parent 78a9f6a8
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -760,6 +760,7 @@ class BackupManagerService extends IBackupManager.Stub {
                    sf.delete();
                }
            }
        }

        // Enqueue a new backup of every participant
        int N = mBackupParticipants.size();
@@ -771,7 +772,6 @@ class BackupManagerService extends IBackupManager.Stub {
            }
        }
    }
    }

    // Add a transport to our set of available backends.  If 'transport' is null, this
    // is an unregistration, and the transport's entry is removed from our bookkeeping.