So I\'ve written a Service and an Activity for the Android OS.
My service is running in it\'s own process, so all the communication between my Activities and the Ser
RemoteException is thrown if the process hosting the remote object is no longer available, which usually means the process crashed.
However, the previous comment, and also the official Android documentation is wrong about DeadObjectException being the only exception ever thrown back to the client. Some types of RuntimeExceptions thrown in your AIDL service implementation will be passed back to the client and rethrown there. If you take a look at the Binder.execTransact() method, you will see that it catches RuntimeException and passes a select few back to the client.
The RuntimeExceptions that receive this special treatment are listed below. You can also check Parcel.writeException to verify. That method is used by the Binder class to marshal the exception into a Parcel and transfer it back to the client, where it will be rethrown as part of Parcel.readException.
I stumbled on this behavior by accident, I was seeing unexpected exceptions on the client side, and my service was not crashing when it should on an IllegalStateException. Full writeup: https://blog.classycode.com/dealing-with-exceptions-in-aidl-9ba904c6d63