Skip to content

Commit 3055ffa

Browse files
xaionaro@dx.centerxaionaro@dx.center
authored andcommitted
fix: add persistable_bundle handling in codegen to restore full generation
The parcelable_gen.go codegen was missing persistable_bundle in four switch cases: computeReachableWireFields, two unmarshal skip paths, and the repeated-element marshal path. This caused the generator to silently truncate reachable fields for any parcelable containing a PersistableBundle, dropping ~900 Go files from the output (5169 instead of 6079).
1 parent 0a928c9 commit 3055ffa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tools/pkg/codegen/parcelable_gen.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ func writeJavaWireMarshalParcel(
10491049
f.P("\t\tp.WriteInt64(_item.%s)", elemGoName)
10501050
case "typed_object":
10511051
f.P("\t\tp.WriteInt32(0) // null %s", elem.Name)
1052-
case "bundle":
1052+
case "bundle", "persistable_bundle":
10531053
f.P("\t\tp.WriteInt32(-1) // null %s", elem.Name)
10541054
default:
10551055
f.P("\t\tp.WriteInt32(-1) // null %s", elem.Name)
@@ -1151,7 +1151,7 @@ func computeReachableWireFields(
11511151
// Handled opaque-skip cases (no unconditional return).
11521152
switch wf.WriteMethod {
11531153
case "component_name", "string_array", "int_array", "long_array",
1154-
"bundle", "write_list", "binder", "typed_array", "array_set",
1154+
"bundle", "persistable_bundle", "write_list", "binder", "typed_array", "array_set",
11551155
"char_sequence", "string_list":
11561156
continue
11571157
case "typed_object":
@@ -1369,7 +1369,7 @@ fieldLoop:
13691369
f.P("\t\t\t\t\treturn nil // non-null %s: cannot skip", elem.Name)
13701370
f.P("\t\t\t\t}")
13711371
f.P("\t\t\t}")
1372-
case "bundle":
1372+
case "bundle", "persistable_bundle":
13731373
f.P("\t\t\t{")
13741374
f.P("\t\t\t\t_bLen, _bErr := p.ReadInt32()")
13751375
f.P("\t\t\t\tif _bErr != nil {")
@@ -1484,7 +1484,7 @@ fieldLoop:
14841484
f.P("\tif _csErr := parcel.SkipCharSequence(p); _csErr != nil {")
14851485
f.P("\t\treturn _csErr")
14861486
f.P("\t}")
1487-
case "bundle":
1487+
case "bundle", "persistable_bundle":
14881488
f.P("\t{")
14891489
f.P("\t\t_opaqueLen, _opaqueErr := p.ReadInt32()")
14901490
f.P("\t\tif _opaqueErr != nil {")

0 commit comments

Comments
 (0)