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

Commit eed9ac11 authored by Alice Ryhl's avatar Alice Ryhl
Browse files

Fix unimplemented codepath in conversion to async binder interface

Bug: 291764260
Test: atest aidl_integration_test
Change-Id: I348ab109fd541c51ec51c9edec10100949dcaac7
parent 39a9427c
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())
            }