Expose ServiceSpecificException as @SystemApi.

This class is useful as a system API because:

- It is one of the few exceptions that is natively Parcelable.
- It is directly supported by native code without using JNI,
  using Status::fromServiceSpecificError.
- Unlike other natively parcelable exceptions, it contains both
  an error message and an error code.

Test: m
Bug: 112869080
Change-Id: Ica3e88c2b6877e429a61b053d75f69b9f19fc74a
This commit is contained in:
Lorenzo Colitti
2019-01-22 17:11:01 +09:00
parent 20f1e0ca1d
commit a27da72cd1
3 changed files with 9 additions and 2 deletions

View File

@@ -15,6 +15,8 @@
*/
package android.os;
import android.annotation.SystemApi;
/**
* An exception specific to a service.
*
@@ -28,6 +30,7 @@ package android.os;
*
* @hide
*/
@SystemApi
public class ServiceSpecificException extends RuntimeException {
public final int errorCode;