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

Commit 78ec67a2 authored by Michal Karpinski's avatar Michal Karpinski
Browse files

[RefactoredBMS] Eliminate a race condition that could lead to

calling PBT#finalizeBackup() twice

This CL replicates ag/2510127 in RefactoredBMS.

Test: runtest -p com.android.server.backup frameworks-services
Bug: 37973765
Change-Id: Ic8571c08dd92386d0e4f79d7866aeb0f19f38106
parent f95cf5d9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -227,9 +227,8 @@ public class PerformBackupTask implements BackupRestoreTask {
                    if (!mFinished) {
                        finalizeBackup();
                    } else {
                        Slog.e(TAG, "Duplicate finish");
                        Slog.e(TAG, "Duplicate finish of K/V pass");
                    }
                    mFinished = true;
                    break;
            }
        }
@@ -609,6 +608,7 @@ public class PerformBackupTask implements BackupRestoreTask {
                    break;
            }
        }
        mFinished = true;
        Slog.i(TAG, "K/V backup pass finished.");
        // Only once we're entirely finished do we release the wakelock for k/v backup.
        backupManagerService.getWakelock().release();