Skip to content

Commit 218e047

Browse files
xaionaro@dx.centerxaionaro@dx.center
authored andcommitted
feat: codegen typed_object fields as nullable struct fields
JavaWireFormat typed_object fields that correspond to a known parcelable are now generated as *ParcelableType struct fields with proper nullable marshal/unmarshal. Previously these fields were opaque (no struct field, marshal wrote int32(0) null marker). Now: - spec2go looks up typed_object field names in a parcelable index built from all loaded specs. If a matching parcelable is found, the AIDL qualified name is stored in JavaWireField.GoType. - The codegen generates *Type struct fields from GoType metadata (not from FieldDecl, to avoid perturbing the import graph's DFS back-edge selection for cycle breaking). - Marshal writes int32(1) + MarshalParcel for non-nil, int32(0) for nil. Unmarshal reads the flag and allocates/unmarshals if non-zero. - Cross-package imports are handled by the TypeRefResolver. A BFS-based WouldCreateCycle check redirects to types sub-packages when importing the target would create a cycle (even for edges not in the import graph). - ImportGraph gains WouldCreateCycle and SameSCC methods for cycle detection of edges not captured in the static import graph. Example: LocationRequest.WorkSource is now *types.WorkSource with proper nullable serialization instead of a hardcoded null marker.
1 parent 0a95cf2 commit 218e047

129 files changed

Lines changed: 3908 additions & 1046 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.

android/accessibilityservice/accessibilityserviceinfo.go

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

android/accessibilityservice/types/accessibilityserviceinfo.go

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

android/accounts/types/account.go

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

android/app/admin/enforcingadmin.go

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

android/app/automaticzenrule.go

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

android/app/granteduripermission.go

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

0 commit comments

Comments
 (0)