diff --git a/Armadillo/src/main/java/com/scribd/armadillo/encryption/SecureStorage.kt b/Armadillo/src/main/java/com/scribd/armadillo/encryption/SecureStorage.kt index c919e75..140543d 100644 --- a/Armadillo/src/main/java/com/scribd/armadillo/encryption/SecureStorage.kt +++ b/Armadillo/src/main/java/com/scribd/armadillo/encryption/SecureStorage.kt @@ -89,12 +89,20 @@ internal class ArmadilloSecureStorage @Inject constructor( return download } - override fun getAllDrmDownloads(context: Context): Map = - legacyDrmStorage.all.keys.mapNotNull { key -> - legacyDrmStorage.getString(key, null)?.let { drmResult -> - key to drmResult.decodeToDrmDownload() + override fun getAllDrmDownloads(context: Context): Map { + val drmDownloads = secureDrmStorage.all.keys.mapNotNull { alias -> + secureDrmStorage.getString(alias, null)?.let { drmResult -> + alias to drmResult.decodeToDrmDownload() } }.toMap() + val legacyDownloads = legacyDrmStorage.all.keys.mapNotNull { alias -> + legacyDrmStorage.getString(alias, null)?.let { drmResult -> + alias to drmResult.decodeToDrmDownload() + } + }.toMap() + + return drmDownloads.plus(legacyDownloads) + } override fun removeDrmDownload(context: Context, audioUrl: String, drmType: DrmType) { val alias = getDrmDownloadAlias(audioUrl, drmType)