Commit 7baf3ff
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
- aaudio
- android
- accessibilityservice
- accounts
- adpf
- apphibernation
- appwidget
- app
- admin
- ambientcontext
- appfunctions
- assist
- backup
- blob
- contentsuggestions
- contextualsearch
- job
- ondeviceintelligence
- people
- pinner
- prediction
- search
- servertransaction
- slice
- smartspace
- supervision
- timedetector
- timezonedetector
- time
- trust
- usage
- wallpapereffectsgeneration
- wallpaper
- wearable
- binderdebug/test
- bluetooth
- le
- companion
- virtualcamera
- virtualnative
- virtual
- audio
- camera
- sensor
- content
- integrity
- om
- pm
- dependencyinstaller
- dex
- permission
- verify/domain
- res
- rollback
- credentials
- database
- debug
- flags
- frameworks
- automotive
- display
- powerpolicy
- internal_
- telemetry
- cameraservice
- device
- service
- devicestate
- location/altitude
- sensorservice
- stats
- vibrator
- graphics
- bufferstreams
- drawable
- fonts
- gui
- hardware
- audio
- core
- sounddose
- ISoundDose
- effect
- sounddose
- authsecret
- automotive
- audiocontrol
- can
- evs
- ivn
- occupant_awareness
- remoteaccess
- vehicle
- biometrics
- common
- events
- face
- virtualhal
- fingerprint
- virtualhal
- bluetooth
- audio
- finder
- lmp_event
- offload/leaudio
- ranging
- socket
- boot
- broadcastradio
- camera2
- extension
- camera
- device
- provider
- cas
- confirmationui
- contexthub
- devicestate
- display
- drm
- dumpstate
- face
- fastboot
- fingerprint
- gatekeeper
- gnss
- gnss_assistance
- measurement_corrections
- visibility_control
- graphics
- allocator
- composer3
- hdmi
- health
- storage
- identity
- input
- processor
- iris
- ir
- lights
- light
- location
- macsec
- media
- bufferpool2
- c2
- memtrack
- net/nlinterceptor
- neuralnetworks
- nfc
- oemlock
- power
- stats
- radio
- config
- data
- ims
- media
- messaging
- modem
- network
- sap
- sim
- voice
- rebootescrow
- secure_element
- security
- authgraph
- keymint
- secretkeeper
- secureclock
- see
- authmgr
- hdcp
- hwcrypto
- storage
- sensors
- soundtrigger3
- soundtrigger
- tests/extension/vibrator
- tetheroffload
- thermal
- threadnetwork
- tv
- hdmi
- cec
- connection
- earc
- input
- mediaquality
- tuner
- usb
- gadget
- uwb
- vibrator
- virtualization/capabilities
- weaver
- wifi
- hostapd
- supplicant
- location
- provider
- media
- audiopolicy
- audio
- eraser
- metrics
- midi
- musicrecognition
- projection
- quality
- session
- soundtrigger_middleware
- soundtrigger
- tv
- ad
- extension
- analog
- cam
- clienttoken
- event
- oad
- pvr
- rating
- scanbsu
- scan
- screenmode
- servicedb
- signal
- teletext
- time
- tune
- interactive
- tunerresourcemanager
- tuner
- net
- vcn
- wifi
- nl80211
- nfc/cardemulation
- os
- IInstalld
- connectivity
- image
- incremental
- instrumentation
- logcat
- storage
- vibrator
- permission
- printservice
- recommendation
- print
- security
- advancedprotection
- attestationverification
- authenticationpolicy
- intrusiondetection
- keymaster
- keystore
- recovery
- rkp
- service
- ambientcontext
- appprediction
- assist/classification
- attention
- autofill
- augmented
- carrier
- chooser
- contentcapture
- contentsuggestions
- controls
- actions
- templates
- credentials
- displayhash
- dreams
- euicc
- games
- media
- notification
- oemlock
- ondeviceintelligence
- persistentdata
- quickaccesswallet
- quicksettings
- remotelockscreenvalidation
- resolver
- resumeonreboot
- rotationresolver
- search
- settings
- preferences
- suggestions
- smartspace
- storage
- textclassifier
- timezone
- translation
- trust
- voice
- vr
- wallpapereffectsgeneration
- wallpaper
- watchdog
- wearable
- se/omapi
- speech
- tts
- system
- keystore2
- net/netd
- suspend
- internal_
- vold
- telecom
- telephony
- cdma
- data
- emergency
- euicc
- gba
- ims
- aidl
- feature
- stub
- mbms
- vendor
- satellite
- stub
- tests
- binder
- enforcepermission
- text
- tracing
- util
- view
- accessibility
- autofill
- contentcapture
- displayhash
- inputmethod
- textclassifier
- textservice
- translation
- webkit
- widget
- inline
- window
- com
- android
- frameworks
- coretests/aidl
- perftests/am/util
- ims
- internal_
- uce
- options
- presence
- uceservice
- internal_
- appwidget
- app
- procstats
- backup
- compat
- graphics/fonts
- infra
- inputmethod
- net
- os
- policy
- protolog
- IProtoLogConfigurationService
- statusbar
- telecom
- telephony
- euicc
- textservice
- view
- inline
- widget
- media/permission
- net
- onemedia
- playback
- printspooler/renderer
- server/inputflinger
- IInputFilter
- IInputFlingerRust
- IInputThread
- settingslib/bluetooth/devicesettings
- smspush/unitTests
- systemui
- assist
- communal/widgets
- IGlanceableHubWidgetManagerService
- IConfigureWidgetCallback
- notetask
- screenshot
- appclips
- proxy
- unfold/progress
- wallet/controller
- test
- binder
- viewembed
- wm/shell
- back
- bubbles
- common/pip
- desktopmode
- draganddrop
- onehanded
- recents
- splitscreen
- startingsurface
- google/android/lint/integration_tests
- examples/package_query
- fuzztest
- google/sdv/packagemanagerproxy
- libgui_test_server
- tools/pkg/codegen
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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