Added in API level 28

Violation


abstract class Violation : Throwable
CleartextNetworkViolation

ContentUriWithoutPermissionViolation

CredentialProtectedWhileLockedViolation

Subclass of Violation that is used when a process accesses filesystem paths stored in credential protected storage areas while the user is locked.

CustomViolation

DiskReadViolation

DiskWriteViolation

ExplicitGcViolation

See #android.os.StrictMode.ThreadPolicy.Builder#detectExplicitGc().

FileUriExposedViolation

ImplicitDirectBootViolation

Subclass of Violation that is used when a process implicitly relies on automatic Direct Boot filtering.

IncorrectContextUseViolation

Incorrect usage of Context, such as obtaining a UI service from non-UI Context instance.

InstanceCountViolation

IntentReceiverLeakedViolation

LeakedClosableViolation

NetworkViolation

NonSdkApiUsedViolation

Subclass of Violation that is used when a process accesses a non SDK API.

ResourceMismatchViolation

ServiceConnectionLeakedViolation

SqliteObjectLeakedViolation

UnbufferedIoViolation

See #Builder.detectUnbufferedIo()

UnsafeIntentLaunchViolation

Violation raised when your app launches an Intent which originated from outside your app.

UntaggedSocketViolation

WebViewMethodCalledOnWrongThreadViolation

Root class for all StrictMode violations.

Summary

Public methods
open Throwable

open Int

open Throwable

open Unit

Public methods

fillInStackTrace

Added in API level 28
open fun fillInStackTrace(): Throwable
Return
Throwable a reference to this Throwable instance.

hashCode

Added in API level 28
open fun hashCode(): Int
Return
Int a hash code value for this object.

initCause

Added in API level 28
open fun initCause(cause: Throwable?): Throwable
Parameters
cause Throwable?: the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Return
Throwable a reference to this Throwable instance.
Exceptions
java.lang.IllegalArgumentException if cause is this throwable. (A throwable cannot be its own cause.)
java.lang.IllegalStateException if this throwable was created with Throwable(java.lang.Throwable) or Throwable(java.lang.String,java.lang.Throwable), or this method has already been called on this throwable.

setStackTrace

Added in API level 28
open fun setStackTrace(stackTrace: Array<StackTraceElement!>): Unit
Parameters
stackTrace Array<StackTraceElement!>: the stack trace elements to be associated with this Throwable. The specified array is copied by this call; changes in the specified array after the method invocation returns will have no affect on this Throwable's stack trace.
Exceptions
java.lang.NullPointerException if stackTrace is null or if any of the elements of stackTrace are null