Stay organized with collections
Save and categorize content based on your preferences.
CredentialProtectedWhileLockedViolation
class CredentialProtectedWhileLockedViolation : Violation
Subclass of Violation
that is used when a process accesses filesystem paths stored in credential protected storage areas while the user is locked.
When a user is locked, credential protected storage is unavailable, and files stored in these locations appear to not exist, which can result in subtle app bugs if they assume default behaviors or empty states. Instead, apps should store data needed while a user is locked under device protected storage areas.
Summary
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# CredentialProtectedWhileLockedViolation\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCredentialProtectedWhileLockedViolation\n=======================================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/os/strictmode/CredentialProtectedWhileLockedViolation \"View this page in Java\") \n\n```\nclass CredentialProtectedWhileLockedViolation : Violation\n```\n\n|---|---|---|--------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) |||\n| | ↳ | [android.os.strictmode.Violation](/reference/kotlin/android/os/strictmode/Violation) ||\n| | | ↳ | [android.os.strictmode.CredentialProtectedWhileLockedViolation](#) |\n\nSubclass of `Violation` that is used when a process accesses filesystem paths stored in credential protected storage areas while the user is locked.\n\nWhen a user is locked, credential protected storage is unavailable, and files stored in these locations appear to not exist, which can result in subtle app bugs if they assume default behaviors or empty states. Instead, apps should store data needed while a user is locked under device protected storage areas.\n\nSummary\n-------\n\n| Inherited functions ||\n|---|---|\n| From class [Violation](/reference/kotlin/android/os/strictmode/Violation) |----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) | [fillInStackTrace](/reference/kotlin/android/os/strictmode/Violation#fillInStackTrace())`()` \u003cbr /\u003e | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [hashCode](/reference/kotlin/android/os/strictmode/Violation#hashCode())`()` \u003cbr /\u003e | | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) | [initCause](/reference/kotlin/android/os/strictmode/Violation#initCause(kotlin.Throwable))`(`cause:` `[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?`)` \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [setStackTrace](/reference/kotlin/android/os/strictmode/Violation#setStackTrace(kotlin.Array))`(`stackTrace:` `[Array](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)\u003c[StackTraceElement](../../../java/lang/StackTraceElement.html#)!\u003e`)` \u003cbr /\u003e | ||"]]