Call setGenerationId inside generateAndLoadKey to simplify the code just a little
Change-Id: Ie4cc656def75449f0129db09496f4717e2473d70 Test: adb shell am instrument -w -e package com.android.server.locksettings.recoverablekeystore com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
This commit is contained in:
@@ -146,7 +146,6 @@ public class PlatformKeyManager {
|
||||
public void regenerate() throws NoSuchAlgorithmException, KeyStoreException {
|
||||
int nextId = getGenerationId() + 1;
|
||||
generateAndLoadKey(nextId);
|
||||
setGenerationId(nextId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,7 +218,6 @@ public class PlatformKeyManager {
|
||||
}
|
||||
|
||||
generateAndLoadKey(generationId);
|
||||
mDatabase.setPlatformKeyGenerationId(mUserId, generationId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,6 +299,8 @@ public class PlatformKeyManager {
|
||||
.setBoundToSpecificSecureUserId(mUserId)
|
||||
.build());
|
||||
|
||||
setGenerationId(generationId);
|
||||
|
||||
try {
|
||||
secretKey.destroy();
|
||||
} catch (DestroyFailedException e) {
|
||||
|
||||
Reference in New Issue
Block a user