UnconditionallyKeep


@Retention(value = AnnotationRetention.BINARY)
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.FIELD, AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR])
public annotation UnconditionallyKeep


Indicates code which is accessed by references from outside of the application code directly, such as via JNI, reflection, or instantiation from platform framework code.

NOTE: This keep rule is unconditional, meaning that the annotated class, method, or field will always be preserved in the final application even if, for example, the surrounding code is never used.

If reflection or JNI access occurs inside the application, instead prefer the @UsesReflection*** annotations, as they will keep conditionally, rather than unconditionally as this annotation does.

Summary

Public constructors

UnconditionallyKeep(boolean shouldPreserveName)

Public methods

final boolean

Should the name be preserved.

Public constructors

UnconditionallyKeep

Added in 1.0.0-alpha01
public UnconditionallyKeep(boolean shouldPreserveName)

Public methods

getShouldPreserveName

public final boolean getShouldPreserveName()

Should the name be preserved.

Generally this is true if the reference is external, but this can be disabled if the name isn't important.