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:
- Allocates a reply
Parcel (var __reply = Parcel.Obtain ();),
- Passes it to
Transact (...),
- 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
Summary
Xamarin.Android.Tools.Aidl.CSharpCodeGeneratordoes not honor AIDL method-levelonewaysemantics on the client (Proxy) side. For a method declared as:the generated
Proxystill:Parcel(var __reply = Parcel.Obtain ();),Transact (...),__reply.ReadException ()after the transact returns.True AIDL
onewaysemantics require:null),FlagOnewaytransact flag,ReadExceptioncall (oneway calls cannot return exceptions to the caller).The current behavior turns
onewayinto an effectively synchronous call and can block the caller until the remote side returns, defeating the purpose ofoneway.Where
src/Xamarin.Android.Tools.Aidl/CSharpCodeGenerator.cs— Proxy method emission for methods withIsOneway == 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 aonewaymethod.Notes
reply.WriteNoException ()foronewaymethods.