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

Commit 7b9570b3 authored by Alice Ryhl's avatar Alice Ryhl Committed by Automerger Merge Worker
Browse files

Merge "Fix unimplemented codepath in conversion to async binder interface"...

Merge "Fix unimplemented codepath in conversion to async binder interface" into main am: c1c1e6e8 am: ae58d475

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



Change-Id: Iec31585d783d819da902c8900b1891b9d83f3559
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bced0983 ae58d475
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -103,7 +103,12 @@ impl BinderAsyncPool for Tokio {
            //
            // This shouldn't cause issues with blocking the thread as only one task will run in a
            // call to `block_on`, so there aren't other tasks to block.
            let result = spawn_me();
            //
            // If the `block_in_place` call fails, then you are driving a current-thread runtime on
            // the binder threadpool. Instead, it is recommended to use `TokioRuntime<Handle>` when
            // the runtime is a current-thread runtime, as the current-thread runtime can be driven
            // only by `Runtime::block_on` calls and not by `Handle::block_on`.
            let result = tokio::task::block_in_place(spawn_me);
            Box::pin(after_spawn(result))
        } else {
            let handle = tokio::task::spawn_blocking(spawn_me);
+1 −11
Original line number Diff line number Diff line
@@ -1023,18 +1023,8 @@ macro_rules! declare_binder_interface {
                }

                if ibinder.associate_class(<$native as $crate::binder_impl::Remotable>::get_class()) {
                    let service: std::result::Result<$crate::binder_impl::Binder<$native>, $crate::StatusCode> =
                        std::convert::TryFrom::try_from(ibinder.clone());
                    if let Ok(service) = service {
                        // We were able to associate with our expected class and
                        // the service is local.
                        todo!()
                        //return Ok($crate::Strong::new(Box::new(service)));
                    } else {
                        // Service is remote
                    return Ok($crate::Strong::new(Box::new(<$proxy as $crate::binder_impl::Proxy>::from_binder(ibinder)?)));
                }
                }

                Err($crate::StatusCode::BAD_TYPE.into())
            }