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

Commit 86271b57 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

Change-Id: I4518f7a6317d3c01e37a47b19dee653ccff71502
parents c71e7386 810c312a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -769,7 +769,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;
    }