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

Commit 30d7eb9f authored by Michal Karpinski's avatar Michal Karpinski Committed by android-build-merger
Browse files

Merge "Reintroduce the contract for random token to be non-negative" into oc-dr1-dev am: 810c312a

am: c2e30cd5

Change-Id: If613847830b9fc820838e685ba2e57dadaae0765
parents cbc1fb63 c2e30cd5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -776,7 +776,9 @@ public class BackupManagerService implements BackupManagerServiceInterface {
    // side unpredictability.
    @Override
    public int generateRandomIntegerToken() {
        int token = mTokenGenerator.nextInt() & ~0xFF;
        int token = mTokenGenerator.nextInt();
        if (token < 0) token = -token;
        token &= ~0xFF;
        token |= (mNextToken.incrementAndGet() & 0xFF);
        return token;
    }