RemoteException: Mark rethrow* APIs public
Bug: 144435970
Test: Compiles
Change-Id: I361f5d27529c938fff42fdbabb63f7b87527a270
diff --git a/api/current.txt b/api/current.txt
index 0ddc42a..8a235b1 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -35360,6 +35360,8 @@
public class RemoteException extends android.util.AndroidException {
ctor public RemoteException();
ctor public RemoteException(String);
+ method @NonNull public RuntimeException rethrowAsRuntimeException();
+ method @NonNull public RuntimeException rethrowFromSystemServer();
}
public class ResultReceiver implements android.os.Parcelable {
diff --git a/core/java/android/os/RemoteException.java b/core/java/android/os/RemoteException.java
index 2e673a8..10ef279 100644
--- a/core/java/android/os/RemoteException.java
+++ b/core/java/android/os/RemoteException.java
@@ -16,7 +16,7 @@
package android.os;
-import android.annotation.UnsupportedAppUsage;
+import android.annotation.NonNull;
import android.util.AndroidException;
/**
@@ -37,7 +37,15 @@
super(message, cause, enableSuppression, writableStackTrace);
}
- /** {@hide} */
+ /**
+ * Rethrow this as an unchecked runtime exception.
+ * <p>
+ * 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.
+ */
+ @NonNull
public RuntimeException rethrowAsRuntimeException() {
throw new RuntimeException(this);
}
@@ -52,10 +60,8 @@
* 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.
- *
- * @hide
*/
- @UnsupportedAppUsage
+ @NonNull
public RuntimeException rethrowFromSystemServer() {
if (this instanceof DeadObjectException) {
throw new RuntimeException(new DeadSystemException());