Destroy secdiscardable file in destroyProtectorCommon()
The secdiscardable file is common to all protector types, so it should
be destroyed in destroyProtectorCommon(). No change in behavior.
Change-Id: I6a5ad14c0fe37b80a009ea19db38f93af84958ed
diff --git a/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java b/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
index 2d0143a..7ace03d 100644
--- a/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
+++ b/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
@@ -1308,7 +1308,6 @@
SyntheticPasswordBlob blob = SyntheticPasswordBlob.fromBytes(loadState(SP_BLOB_NAME,
protectorId, userId));
destroyProtectorCommon(protectorId, userId);
- destroyState(SECDISCARDABLE_NAME, protectorId, userId);
if (blob.mProtectorType == PROTECTOR_TYPE_WEAK_TOKEN_BASED) {
notifyWeakEscrowTokenRemovedListeners(protectorId, userId);
}
@@ -1332,7 +1331,6 @@
*/
public void destroyLskfBasedProtector(long protectorId, int userId) {
destroyProtectorCommon(protectorId, userId);
- destroyState(SECDISCARDABLE_NAME, protectorId, userId);
destroyState(PASSWORD_DATA_NAME, protectorId, userId);
destroyState(PASSWORD_METRICS_NAME, protectorId, userId);
}
@@ -1340,6 +1338,7 @@
private void destroyProtectorCommon(long protectorId, int userId) {
destroyState(SP_BLOB_NAME, protectorId, userId);
destroySPBlobKey(getKeyName(protectorId));
+ destroyState(SECDISCARDABLE_NAME, protectorId, userId);
if (hasState(WEAVER_SLOT_NAME, protectorId, userId)) {
destroyWeaverSlot(protectorId, userId);
}