CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 04:45:57 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/dotnet/android.git
etag: W/"203a3a19065110b15bfef7fb2a926e3b"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=e4rcgQZfl2f%2Bh9ziZ826zXyPSqvbKMMlTDe7nmB2HKAOTRUwFFsQ6oJJAUmeBO0oC2YD6ARMrOj5fnj7qO%2FW3F3XiNMrwLmbFUvAnsFVLFOo7%2BgMXtwEcWP%2FKNILGaeU5CFj4cC8jgazrvsyaz%2FFvfoG3bJEEYMght5QrUwqbV2fbxr7fAO%2FqgLfqLB8MS4YqjfkDPAtDf7mvitnTTUyRJD56VcJJDZNOauxzYa31qkpJZIRco%2B1L03gOew0eQCw%2BBOOlcwRPZlPaWjBvKdehg%3D%3D--Z9DBPSyhzUBabwPn--CylSZWfy4a7YUX%2FJLDYsnw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1167558689.1753591556; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 04:45:56 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 04:45:56 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: B738:3C6DB4:15151B:1FB090:6885AF04
[Xamarin..Android.Tools.Aidl] inout+inout array Parameters (#5726) · dotnet/android@9cfa5f3 · GitHub
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Tools.Aidl/CSharpCodeGenerator.cs
Copy file name to clipboardExpand all lines: tests/Xamarin.Android.Tools.Aidl-Tests/TestData/FaceService.txt
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 555
Commit 9cfa5f3
authored
[Xamarin..Android.Tools.Aidl] inout+inout array Parameters (#5726)
Fixes: #4717
Fixes: #5079
Context: https://cs.android.com/android/platform/superproject/+/af1f0005723416a36e025fded7eccb2fd8c777de:system/tools/aidl/generate_java_binder.cpp;l=358
Context: https://cs.android.com/android/platform/superproject/+/af1f0005723416a36e025fded7eccb2fd8c777de:system/tools/aidl/generate_java_binder.cpp;l=486
Context: https://cs.android.com/android/platform/superproject/+/af1f0005723416a36e025fded7eccb2fd8c777de:system/tools/aidl/generate_java_binder.cpp;l=646
`Xamarin.Android.Tools.Aidl.CSharpCodeGenerator` did not properly
support `inout` or `out` parameter marshaling of array types.
For `inout` arrays:
// AIDL
interface Test {
void inoutArray (inout byte [] args);
}
the emitted `OnTransact()` method needs to write the "output" value
to the `reply` parameter, *not* the `data` parameter:
// generated C#
public interface ITest : Android.OS.IInterface {
void InoutArray (byte[] args)
}
abstract partial class ITestStub : Binder, ITest {
protected override bool OnTransact (int code, Parcel data, Parcel reply, int flags)
{
switch (code) {
case TransactionInoutArray: {
data.EnforceInterface (descriptor);
byte [] arg0 = default (byte []);
arg0 = data.CreateStringArray ();
this.InoutArray (arg0);
reply.WriteNoException ();
data.WriteByteArray (arg0); // SHOULD USE `reply`, not `data`!
return true;
}
}
}
}
Similar-yet-more-so, with `out` array parameters:
// AIDL
interface Test {
void outArray (out byte [] args);
}
the `OnTransact()` method *also* needs to support `args` being `null`:
// generated C#
public interface ITest : global::Android.OS.IInterface {
void OutArray (byte[] args)
}
abstract partial class ITestStub : Binder, ITest {
protected override bool OnTransact (int code, Parcel data, Parcel reply, int flags)
{
switch (code) {
case TransactionOutArray: {
data.EnforceInterface (descriptor);
byte [] arg0 = default (byte []);
int arg0_length = data.ReadInt(); // NEEDED
if (arg0_length < 0) { // NEEDED
arg0 = null; // NEEDED
} // NEEDED
else { // NEEDED
arg0 = new byte [arg0_length]; // NEEDED
} // NEEDED
this.OutArray (arg0);
reply.WriteNoException ();
reply.WriteByteArray (arg0); // PREVIOUSLY used data, not reply!
return true;
}
}
}
}
*Plus* the `Proxy` implementation needs to support `null`:
partial class ITestStub {
public class Proxy : Java.Lang.Object, ITest {
public void OutArray (byte[] args)
{
var __data = Parcel.Obtain ();
var __reply = Parcel.Obtain ();
try {
__data.WriteInterfaceToken (descriptor);
if (args == null) { // NEEDED
__data.WriteInt (-1); // NEEDED
} else { // NEEDED
__data.WriteInt(args.Length); // NEEDED
} // NEEDED
remote.Transact (ITestStub.TransactionOutArray, __data, __reply, 0);
…
}
}
}
This is comparable to the Java code the Android Studio produces.1 parent cc3d123 commit 9cfa5f3Copy full SHA for 9cfa5f3
File tree
Expand file treeCollapse file tree
7 files changed
+295
-758
lines changedFilter options
- src/Xamarin.Android.Tools.Aidl
- tests/Xamarin.Android.Tools.Aidl-Tests/TestData
Expand file treeCollapse file tree
7 files changed
+295
-758
lines changedsrc/Xamarin.Android.Tools.Aidl/CSharpCodeGenerator.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Tools.Aidl/CSharpCodeGenerator.cs+30-5Lines changed: 30 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
277 | 277 |
| |
278 | 278 |
| |
279 | 279 |
| |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
280 | 294 |
| |
281 | 295 |
| |
282 | 296 |
| |
| |||
289 | 303 |
| |
290 | 304 |
| |
291 | 305 |
| |
292 |
| - | |
293 |
| - | |
| 306 | + | |
| 307 | + | |
294 | 308 |
| |
295 | 309 |
| |
296 | 310 |
| |
| |||
331 | 345 |
| |
332 | 346 |
| |
333 | 347 |
| |
334 |
| - | |
| 348 | + | |
335 | 349 |
| |
336 | 350 |
| |
337 | 351 |
| |
338 |
| - | |
| 352 | + | |
339 | 353 |
| |
340 | 354 |
| |
| 355 | + | |
| 356 | + | |
| 357 | + | |
341 | 358 |
| |
342 | 359 |
| |
343 | 360 |
| |
| |||
613 | 630 |
| |
614 | 631 |
| |
615 | 632 |
| |
616 |
| - | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
617 | 642 |
| |
618 | 643 |
| |
619 | 644 |
| |
|
tests/Xamarin.Android.Tools.Aidl-Tests/TestData/FaceService.txt
Copy file name to clipboardExpand all lines: tests/Xamarin.Android.Tools.Aidl-Tests/TestData/FaceService.txt+6-15Lines changed: 6 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
113 | 113 |
| |
114 | 114 |
| |
115 | 115 |
| |
116 |
| - | |
117 | 116 |
| |
118 | 117 |
| |
119 | 118 |
| |
| |||
132 | 131 |
| |
133 | 132 |
| |
134 | 133 |
| |
135 |
| - | |
136 | 134 |
| |
137 | 135 |
| |
138 | 136 |
| |
| |||
151 | 149 |
| |
152 | 150 |
| |
153 | 151 |
| |
154 |
| - | |
155 | 152 |
| |
156 | 153 |
| |
157 | 154 |
| |
| |||
172 | 169 |
| |
173 | 170 |
| |
174 | 171 |
| |
175 |
| - | |
176 |
| - | |
177 | 172 |
| |
178 | 173 |
| |
179 | 174 |
| |
| |||
190 | 185 |
| |
191 | 186 |
| |
192 | 187 |
| |
193 |
| - | |
194 | 188 |
| |
195 | 189 |
| |
196 | 190 |
| |
| |||
229 | 223 |
| |
230 | 224 |
| |
231 | 225 |
| |
232 |
| - | |
233 |
| - | |
234 |
| - | |
235 | 226 |
| |
236 | 227 |
| |
237 | 228 |
| |
| |||
321 | 312 |
| |
322 | 313 |
| |
323 | 314 |
| |
324 |
| - | |
| 315 | + | |
325 | 316 |
| |
326 | 317 |
| |
327 | 318 |
| |
| |||
343 | 334 |
| |
344 | 335 |
| |
345 | 336 |
| |
346 |
| - | |
| 337 | + | |
347 | 338 |
| |
348 | 339 |
| |
349 | 340 |
| |
| |||
366 | 357 |
| |
367 | 358 |
| |
368 | 359 |
| |
369 |
| - | |
| 360 | + | |
370 | 361 |
| |
371 | 362 |
| |
372 | 363 |
| |
| |||
388 | 379 |
| |
389 | 380 |
| |
390 | 381 |
| |
391 |
| - | |
| 382 | + | |
392 | 383 |
| |
393 | 384 |
| |
394 | 385 |
| |
| |||
412 | 403 |
| |
413 | 404 |
| |
414 | 405 |
| |
415 |
| - | |
| 406 | + | |
416 | 407 |
| |
417 | 408 |
| |
418 | 409 |
| |
| |||
472 | 463 |
| |
473 | 464 |
| |
474 | 465 |
| |
475 |
| - | |
| 466 | + | |
476 | 467 |
| |
477 | 468 |
| |
478 | 469 |
| |
|
You can’t perform that action at this time.
0 commit comments