From db4b619a2fbd2746425916806391d9b20bd8bfca Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Tue, 24 Oct 2017 11:08:50 -0600 Subject: [PATCH] Pass both partition GUID and filesystem UUID. FDE keys are indexed using the partition GUID, while FBE keys will be indexed using the filesystem UUID, so pass both of those identifiers along when forgetting a volume. Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest Bug: 25861755 Change-Id: I88e13b6b39c5675403a3199e69f978720f26814a --- .../com/android/server/StorageManagerService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index cd256109e1bde..bfbce408cb280 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -641,8 +641,8 @@ class StorageManagerService extends IStorageManager.Stub implements Watchdog.Mon break; } case H_PARTITION_FORGET: { - final String partGuid = (String) msg.obj; - forgetPartition(partGuid); + final VolumeRecord rec = (VolumeRecord) msg.obj; + forgetPartition(rec.partGuid, rec.fsUuid); break; } case H_RESET: { @@ -1694,7 +1694,7 @@ class StorageManagerService extends IStorageManager.Stub implements Watchdog.Mon synchronized (mLock) { final VolumeRecord rec = mRecords.remove(fsUuid); if (rec != null && !TextUtils.isEmpty(rec.partGuid)) { - mHandler.obtainMessage(H_PARTITION_FORGET, rec.partGuid).sendToTarget(); + mHandler.obtainMessage(H_PARTITION_FORGET, rec).sendToTarget(); } mCallbacks.notifyVolumeForgotten(fsUuid); @@ -1718,7 +1718,7 @@ class StorageManagerService extends IStorageManager.Stub implements Watchdog.Mon final String fsUuid = mRecords.keyAt(i); final VolumeRecord rec = mRecords.valueAt(i); if (!TextUtils.isEmpty(rec.partGuid)) { - mHandler.obtainMessage(H_PARTITION_FORGET, rec.partGuid).sendToTarget(); + mHandler.obtainMessage(H_PARTITION_FORGET, rec).sendToTarget(); } mCallbacks.notifyVolumeForgotten(fsUuid); } @@ -1733,9 +1733,9 @@ class StorageManagerService extends IStorageManager.Stub implements Watchdog.Mon } } - private void forgetPartition(String partGuid) { + private void forgetPartition(String partGuid, String fsUuid) { try { - mVold.forgetPartition(partGuid); + mVold.forgetPartition(partGuid, fsUuid); } catch (Exception e) { Slog.wtf(TAG, e); }