RemoteException  |  API reference  |  Android Developers (original) (raw)


open class RemoteException : AndroidException

kotlin.Any
kotlin.Throwable
java.lang.Exception
android.util.AndroidException

Parent exception for all Binder remote-invocation errors Note: not all exceptions from binder services will be subclasses of this. For instance, RuntimeException and several subclasses of it may be thrown as well as OutOfMemoryException. One common subclass is [DeadObjectException](/reference/kotlin/android/os/DeadObjectException).

Summary

Public constructors
RemoteException()
RemoteException(message: String!)
Public methods
open RuntimeException rethrowAsRuntimeException() Rethrow this as an unchecked runtime exception.
open RuntimeException rethrowFromSystemServer() Rethrow this exception when we know it came from the system server.

Public constructors

RemoteException

RemoteException()

RemoteException

RemoteException(message: String!)

Public methods

rethrowAsRuntimeException

open fun rethrowAsRuntimeException(): RuntimeException

Rethrow this as an unchecked runtime exception.

Apps making calls into other processes may end up persisting internal state or making security decisions based on the perceived success or failure of a call, or any default values returned. For this reason, we want to strongly throw when there was trouble with the transaction.

Return
RuntimeException This value cannot be null.
Exceptions
java.lang.RuntimeException

rethrowFromSystemServer

open fun rethrowFromSystemServer(): RuntimeException

Rethrow this exception when we know it came from the system server. This gives us an opportunity to throw a nice clean DeadSystemRuntimeException signal to avoid spamming logs with misleading stack traces.

Apps making calls into the system server may end up persisting internal state or making security decisions based on the perceived success or failure of a call, or any default values returned. For this reason, we want to strongly throw when there was trouble with the transaction.

Return
RuntimeException This value cannot be null.
Exceptions
java.lang.RuntimeException

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.