Skip to content

Commit

Permalink
Remove deprecated symbols (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
qnga authored Nov 11, 2024
1 parent d177e72 commit bbf59e9
Show file tree
Hide file tree
Showing 100 changed files with 28 additions and 5,980 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

40 changes: 0 additions & 40 deletions readium/lcp/src/main/java/org/readium/r2/lcp/LcpAuthenticating.kt
Original file line number Diff line number Diff line change
Expand Up @@ -96,43 +96,3 @@ public interface LcpAuthenticating {
get() = document.user
}
}

@Deprecated(
"Renamed to `LcpAuthenticating`",
replaceWith = ReplaceWith("LcpAuthenticating"),
level = DeprecationLevel.ERROR
)
public typealias LCPAuthenticating = LcpAuthenticating

@Deprecated("Not used anymore", level = DeprecationLevel.ERROR)
public interface LCPAuthenticationDelegate

@Deprecated(
"Renamed to `LcpAuthenticating.AuthenticationReason`",
replaceWith = ReplaceWith("LcpAuthenticating.AuthenticationReason"),
level = DeprecationLevel.ERROR
)
public typealias LCPAuthenticationReason = LcpAuthenticating.AuthenticationReason

@Deprecated(
"Renamed to `LcpAuthenticating.AuthenticatedLicense`",
replaceWith = ReplaceWith("LcpAuthenticating.AuthenticatedLicense"),
level = DeprecationLevel.ERROR
)
public typealias LCPAuthenticatedLicense = LcpAuthenticating.AuthenticatedLicense

@Deprecated(
"Renamed to `PassphraseNotFound`",
replaceWith = ReplaceWith("PassphraseNotFound"),
level = DeprecationLevel.ERROR
)
public val LcpAuthenticating.AuthenticationReason.Companion.passphraseNotFound: LcpAuthenticating.AuthenticationReason
get() = LcpAuthenticating.AuthenticationReason.PassphraseNotFound

@Deprecated(
"Renamed to `InvalidPassphrase`",
replaceWith = ReplaceWith("InvalidPassphrase"),
level = DeprecationLevel.ERROR
)
public val LcpAuthenticating.AuthenticationReason.Companion.invalidPassphrase: LcpAuthenticating.AuthenticationReason
get() = LcpAuthenticating.AuthenticationReason.InvalidPassphrase
14 changes: 0 additions & 14 deletions readium/lcp/src/main/java/org/readium/r2/lcp/LcpError.kt
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,3 @@ public sealed class LcpError(
}

internal class LcpException(val error: LcpError) : Exception(error.message, ErrorException(error))

@Deprecated(
"Renamed to `LcpException`",
replaceWith = ReplaceWith("LcpException"),
level = DeprecationLevel.ERROR
)
public typealias LCPError = LcpError

@Deprecated(
"Use `getUserMessage()` instead",
replaceWith = ReplaceWith("getUserMessage(context)"),
level = DeprecationLevel.ERROR
)
public val LcpError.errorDescription: String get() = message
77 changes: 4 additions & 73 deletions readium/lcp/src/main/java/org/readium/r2/lcp/LcpLicense.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@

package org.readium.r2.lcp

import java.net.URL
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import org.joda.time.DateTime
import org.readium.r2.lcp.license.model.LicenseDocument
import org.readium.r2.lcp.license.model.StatusDocument
import org.readium.r2.shared.publication.services.ContentProtectionService
import org.readium.r2.shared.util.Closeable
import org.readium.r2.shared.util.Instant
import org.readium.r2.shared.util.Try
import org.readium.r2.shared.util.Url
import org.readium.r2.shared.util.toDebugDescription
import timber.log.Timber

/**
* Opened license, used to decipher a protected publication and manage its license.
Expand Down Expand Up @@ -67,7 +59,10 @@ public interface LcpLicense : ContentProtectionService.UserRights, Closeable {
* @param prefersWebPage Indicates whether the loan should be renewed through a web page if
* available, instead of programmatically.
*/
public suspend fun renewLoan(listener: RenewListener, prefersWebPage: Boolean = false): Try<Instant?, LcpError>
public suspend fun renewLoan(
listener: RenewListener,
prefersWebPage: Boolean = false
): Try<Instant?, LcpError>

/**
* Can the user return the loaned publication?
Expand Down Expand Up @@ -108,68 +103,4 @@ public interface LcpLicense : ContentProtectionService.UserRights, Closeable {
*/
public suspend fun openWebPage(url: Url)
}

@Deprecated(
"Use `license.encryption.profile` instead",
ReplaceWith("license.encryption.profile"),
level = DeprecationLevel.ERROR
)
public val encryptionProfile: String? get() =
license.encryption.profile

@Deprecated(
"Use `decrypt()` with coroutines instead",
ReplaceWith("decrypt(data)"),
level = DeprecationLevel.ERROR
)
public fun decipher(data: ByteArray): ByteArray? =
runBlocking { decrypt(data) }
.onFailure { Timber.e(it.toDebugDescription()) }
.getOrNull()

@Deprecated(
"Use `renewLoan` with `RenewListener` instead",
ReplaceWith("renewLoan(LcpLicense.RenewListener)"),
level = DeprecationLevel.ERROR
)
public suspend fun renewLoan(end: DateTime?, urlPresenter: suspend (URL) -> Unit): Try<Unit, LcpError> = Try.success(
Unit
)

@Deprecated(
"Use `renewLoan` with `RenewListener` instead",
ReplaceWith("renewLoan(LcpLicense.RenewListener)"),
level = DeprecationLevel.ERROR
)
public fun renewLoan(
end: DateTime?,
present: (URL, dismissed: () -> Unit) -> Unit,
completion: (LcpError?) -> Unit
) {}

@Deprecated(
"Use `returnPublication()` with coroutines instead",
ReplaceWith("returnPublication"),
level = DeprecationLevel.ERROR
)
@DelicateCoroutinesApi
public fun returnPublication(completion: (LcpError?) -> Unit) {
GlobalScope.launch {
completion(returnPublication().failureOrNull())
}
}
}

@Deprecated(
"Renamed to `LcpService`",
replaceWith = ReplaceWith("LcpService"),
level = DeprecationLevel.ERROR
)
public typealias LCPService = LcpService

@Deprecated(
"Renamed to `LcpLicense`",
replaceWith = ReplaceWith("LcpLicense"),
level = DeprecationLevel.ERROR
)
public typealias LCPLicense = LcpLicense
Loading

0 comments on commit bbf59e9

Please sign in to comment.