Skip to content

Commit 7baf3ff

Browse files
xaionaro@dx.centerxaionaro@dx.center
authored andcommitted
fix: resolve compilation errors in generated AIDL stubs
Fix five categories of bugs in the stub code generator: 1. Missing imports: always import context and parcel packages since the stub's OnTransaction method references them even for method-less interfaces. 2. Out parameter handling: pass zero-valued variables for AIDL `out` parameters to the implementation call instead of omitting them, which caused "not enough arguments" errors. 3. Duplicate switch cases: track used transaction codes and skip methods that resolve to an already-emitted code. 4. Builtin shadowing: add Go built-in function names (len, cap, make, etc.) to the reserved identifier set so AIDL parameters named after them get suffixed with underscore. 5. Import alias collision: rename the stub's parcel parameter from `data` to `_data` to avoid conflicts with import aliases like `data` for android.hardware.radio.data. Additionally: - Handle nullable non-cast stub params by taking address of read value to match the pointer-typed interface parameter. - Detect Go type name collisions from nested AIDL types (e.g., VolumeShaper.Configuration vs VolumeShaperConfiguration) and skip the empty forward-declared definition. - Update package_query example to match new IsPackageAvailable signature (userId is now auto-filled from CallerIdentity).
1 parent 502625b commit 7baf3ff

2,561 files changed

Lines changed: 43706 additions & 74744 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

aaudio/iaaudioclient.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aaudio/iaaudioservice.go

Lines changed: 32 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/accessibilityservice/accessibilitygestureevent.go

Lines changed: 8 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)