Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76fed313 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Changes to UNEXPECTED_NULL handling in libbinder_rs." am: 00633648...

Merge "Changes to UNEXPECTED_NULL handling in libbinder_rs." am: 00633648 am: d27e8676 am: 3533a60c am: 58775b6e

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1406248

Change-Id: I5192da14d19d218b61c42314cfcd50b9a22a21d6
parents 138d751a 58775b6e
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -532,7 +532,17 @@ macro_rules! declare_binder_interface {
            }

            fn on_transact(&self, code: $crate::TransactionCode, data: &$crate::Parcel, reply: &mut $crate::Parcel) -> $crate::Result<()> {
                $on_transact(&*self.0, code, data, reply)
                match $on_transact(&*self.0, code, data, reply) {
                    // The C++ backend converts UNEXPECTED_NULL into an exception
                    Err($crate::StatusCode::UNEXPECTED_NULL) => {
                        let status = $crate::Status::new_exception(
                            $crate::ExceptionCode::NULL_POINTER,
                            None,
                        );
                        reply.write(&status)
                    },
                    result => result
                }
            }

            fn get_class() -> $crate::InterfaceClass {
+4 −1
Original line number Diff line number Diff line
@@ -352,7 +352,10 @@ impl SerializeArray for Option<&SpIBinder> {}

impl Deserialize for SpIBinder {
    fn deserialize(parcel: &Parcel) -> Result<SpIBinder> {
        parcel.read_binder().transpose().unwrap()
        parcel
            .read_binder()
            .transpose()
            .unwrap_or(Err(StatusCode::UNEXPECTED_NULL))
    }
}