| 70 | pub use sys::android_c_interface_ExceptionCode as ExceptionCode; |
| 71 | |
| 72 | fn parse_exception_code(code: i32) -> ExceptionCode { |
| 73 | match code { |
| 74 | e if e == ExceptionCode::NONE as i32 => ExceptionCode::NONE, |
| 75 | e if e == ExceptionCode::SECURITY as i32 => ExceptionCode::SECURITY, |
| 76 | e if e == ExceptionCode::BAD_PARCELABLE as i32 => ExceptionCode::BAD_PARCELABLE, |
| 77 | e if e == ExceptionCode::ILLEGAL_ARGUMENT as i32 => ExceptionCode::ILLEGAL_ARGUMENT, |
| 78 | e if e == ExceptionCode::NULL_POINTER as i32 => ExceptionCode::NULL_POINTER, |
| 79 | e if e == ExceptionCode::ILLEGAL_STATE as i32 => ExceptionCode::ILLEGAL_STATE, |
| 80 | e if e == ExceptionCode::NETWORK_MAIN_THREAD as i32 => ExceptionCode::NETWORK_MAIN_THREAD, |
| 81 | e if e == ExceptionCode::UNSUPPORTED_OPERATION as i32 => { |
| 82 | ExceptionCode::UNSUPPORTED_OPERATION |
| 83 | } |
| 84 | e if e == ExceptionCode::SERVICE_SPECIFIC as i32 => ExceptionCode::SERVICE_SPECIFIC, |
| 85 | _ => ExceptionCode::TRANSACTION_FAILED, |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | // Safety: `Status` always contains a owning pointer to a valid `AStatus`. The |
| 90 | // lifetime of the contained pointer is the same as the `Status` object. |