Skip to content

AIDL CSharpCodeGenerator: oneway methods generate synchronous Proxy code #11507

@jonathanpeppers

Description

@jonathanpeppers

Summary

Xamarin.Android.Tools.Aidl.CSharpCodeGenerator does not honor AIDL method-level oneway semantics on the client (Proxy) side. For a method declared as:

oneway void fireAndForget(int value);

the generated Proxy still:

  1. Allocates a reply Parcel (var __reply = Parcel.Obtain ();),
  2. Passes it to Transact (...),
  3. Calls __reply.ReadException () after the transact returns.

True AIDL oneway semantics require:

  • No reply parcel (pass null),
  • The FlagOneway transact flag,
  • No ReadException call (oneway calls cannot return exceptions to the caller).

The current behavior turns oneway into an effectively synchronous call and can block the caller until the remote side returns, defeating the purpose of oneway.

Where

src/Xamarin.Android.Tools.Aidl/CSharpCodeGenerator.cs — Proxy method emission for methods with IsOneway == true.

Repro / evidence

See the golden output snapshotted in tests/Xamarin.Android.Tools.Aidl-Tests/TestData/OnewayMethods.txt (added in #11460), which captures the current Proxy output for a oneway method.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions